+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+enum htmltag {
+ TAG_HTML,
+ TAG_HEAD,
+ TAG_BODY,
+ TAG_META,
+ TAG_TITLE,
+ TAG_DIV,
+ TAG_IDIV,
+ TAG_SECTION,
+ TAG_H1,
+ TAG_H2,
+ TAG_SPAN,
+ TAG_LINK,
+ TAG_BR,
+ TAG_A,
+ TAG_TABLE,
+ TAG_TR,
+ TAG_TD,
+ TAG_LI,
+ TAG_UL,
+ TAG_OL,
+ TAG_DL,
+ TAG_DT,
+ TAG_DD,
+ TAG_P,
+ TAG_PRE,
+ TAG_VAR,
+ TAG_CITE,
+ TAG_B,
+ TAG_I,
+ TAG_CODE,
+ TAG_SMALL,
+ TAG_STYLE,
+ TAG_MATH,
+ TAG_MROW,
+ TAG_MI,
+ TAG_MN,
+ TAG_MO,
+ TAG_MSUP,
+ TAG_MSUB,
+ TAG_MSUBSUP,
+ TAG_MFRAC,
+ TAG_MSQRT,
+ TAG_MFENCED,
+ TAG_MTABLE,
+ TAG_MTR,
+ TAG_MTD,
+ TAG_MUNDEROVER,
+ TAG_MUNDER,
+ TAG_MOVER,
+ TAG_MAX
+};
+
+enum htmlfont {
+ HTMLFONT_NONE = 0,
+ HTMLFONT_BOLD,
+ HTMLFONT_ITALIC,
+ HTMLFONT_BI,
+ HTMLFONT_CW,
+ HTMLFONT_MAX
+};
+
+struct tag {
+ struct tag *next;
+ int refcnt;
+ int closed;
+ enum htmltag tag;
+};
+
+struct html {
+ int flags;
+#define HTML_NOSPACE (1 << 0) /* suppress next space */
+#define HTML_IGNDELIM (1 << 1)
+#define HTML_KEEP (1 << 2)
+#define HTML_PREKEEP (1 << 3)
+#define HTML_NONOSPACE (1 << 4) /* never add spaces */
+#define HTML_SKIPCHAR (1 << 6) /* skip the next character */
+#define HTML_NOSPLIT (1 << 7) /* do not break line before .An */
+#define HTML_SPLIT (1 << 8) /* break line before .An */
+#define HTML_NONEWLINE (1 << 9) /* No line break in nofill mode. */
+#define HTML_BUFFER (1 << 10) /* Collect a word to see if it fits. */
+#define HTML_TOCDONE (1 << 11) /* The TOC was already written. */
+ size_t indent; /* current output indentation level */
+ int noindent; /* indent disabled by */
+ size_t col; /* current output byte position */
+ size_t bufcol; /* current buf byte position */
+ char buf[80]; /* output buffer */
+ struct tag *tag; /* last open tag */
+ struct rofftbl tbl; /* current table */
+ struct tag *tblt; /* current open table scope */
+ char *base_man1; /* bases for manpage href */
+ char *base_man2;
+ char *base_includes; /* base for include href */
+ char *style; /* style-sheet URI */
+ struct tag *metaf; /* current open font scope */
+ enum htmlfont metal; /* last used font */
+ enum htmlfont metac; /* current font mode */
+ int oflags; /* output options */
+#define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */
+#define HTML_TOC (1 << 1) /* emit a table of contents */
+};
+
+
+struct roff_node;
+struct tbl_span;
+struct eqn_box;
+
+void roff_html_pre(struct html *, const struct roff_node *);
+
+void print_gen_comment(struct html *, struct roff_node *);
+void print_gen_decls(struct html *);
+void print_gen_head(struct html *);
+void print_metaf(struct html *, enum mandoc_esc);
+struct tag *print_otag(struct html *, enum htmltag, const char *, ...);
+void print_tagq(struct html *, const struct tag *);
+void print_stagq(struct html *, const struct tag *);
+void print_text(struct html *, const char *);
+void print_tblclose(struct html *);
+void print_tbl(struct html *, const struct tbl_span *);
+void print_eqn(struct html *, const struct eqn_box *);
+void print_endline(struct html *);
+
+void html_close_paragraph(struct html *);
+enum roff_tok html_fillmode(struct html *, enum roff_tok);
+char *html_make_id(const struct roff_node *, int);
Property changes on: vendor/mandoc/1.14.5/html.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/lib.c
===================================================================
--- vendor/mandoc/1.14.5/lib.c (nonexistent)
+++ vendor/mandoc/1.14.5/lib.c (revision 345686)
@@ -0,0 +1,35 @@
+/* $Id: lib.c,v 1.15 2018/12/13 11:55:46 schwarze Exp $ */
+/*
+ * Copyright (c) 2009 Kristaps Dzonsons
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include "config.h"
+
+#include
+#include
+
+#include "roff.h"
+#include "libmdoc.h"
+
+#define LINE(x, y) \
+ if (0 == strcmp(p, x)) return(y);
+
+const char *
+mdoc_a2lib(const char *p)
+{
+
+#include "lib.in"
+
+ return NULL;
+}
Property changes on: vendor/mandoc/1.14.5/lib.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/lib.in
===================================================================
--- vendor/mandoc/1.14.5/lib.in (nonexistent)
+++ vendor/mandoc/1.14.5/lib.in (revision 345686)
@@ -0,0 +1,136 @@
+/* $Id: lib.in,v 1.21 2019/03/04 17:35:21 schwarze Exp $ */
+/*
+ * Copyright (c) 2009 Kristaps Dzonsons
+ * Copyright (c) 2009, 2012 Joerg Sonnenberger
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * These are all possible .Lb strings. When a new library is added, add
+ * its short-string to the left-hand side and formatted string to the
+ * right-hand side.
+ *
+ * Be sure to escape strings.
+ */
+
+LINE("lib80211", "802.11 Wireless Network Management Library (lib80211, \\-l80211)")
+LINE("libalias", "Packet Aliasing Library (libalias, \\-lalias)")
+LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)")
+LINE("libarm", "ARM Architecture Library (libarm, \\-larm)")
+LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)")
+LINE("libbe", "Boot Environment Library (libbe, \\-lbe)")
+LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)")
+LINE("libbsdxml", "eXpat XML parser library (libbsdxml, \\-lbsdxml)")
+LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)")
+LINE("libc", "Standard C\\~Library (libc, \\-lc)")
+LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)")
+LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)")
+LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)")
+LINE("libcasper", "Casper Library (libcasper, \\-lcasper)")
+LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)")
+LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)")
+LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)")
+LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)")
+LINE("libcurses", "Curses Library (libcurses, \\-lcurses)")
+LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)")
+LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)")
+LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)")
+LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)")
+LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)")
+LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)")
+LINE("libdl", "Dynamic Linker Services Filter (libdl, \\-ldl)")
+LINE("libdm", "Device Mapper Library (libdm, \\-ldm)")
+LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)")
+LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)")
+LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)")
+LINE("libelf", "ELF Access Library (libelf, \\-lelf)")
+LINE("libevent", "Event Notification Library (libevent, \\-levent)")
+LINE("libexecinfo", "Backtrace Information Library (libexecinfo, \\-lexecinfo)")
+LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)")
+LINE("libfsid", "Filesystem Identification Library (libfsid, \\-lfsid)")
+LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)")
+LINE("libform", "Curses Form Library (libform, \\-lform)")
+LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)")
+LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)")
+LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)")
+LINE("libi386", "i386 Architecture Library (libi386, \\-li386)")
+LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)")
+LINE("libipsec", "IPsec Policy Control Library (libipsec, \\-lipsec)")
+LINE("libiscsi", "iSCSI protocol library (libiscsi, \\-liscsi)")
+LINE("libisns", "Internet Storage Name Service Library (libisns, \\-lisns)")
+LINE("libjail", "Jail Library (libjail, \\-ljail)")
+LINE("libkcore", "Kernel Memory Core Access Library (libkcore, \\-lkcore)")
+LINE("libkiconv", "Kernel-side iconv Library (libkiconv, \\-lkiconv)")
+LINE("libkse", "N:M Threading Library (libkse, \\-lkse)")
+LINE("libkvm", "Kernel Data Access Library (libkvm, \\-lkvm)")
+LINE("libm", "Math Library (libm, \\-lm)")
+LINE("libm68k", "m68k Architecture Library (libm68k, \\-lm68k)")
+LINE("libmagic", "Magic Number Recognition Library (libmagic, \\-lmagic)")
+LINE("libmandoc", "Mandoc Macro Compiler Library (libmandoc, \\-lmandoc)")
+LINE("libmd", "Message Digest (MD4, MD5, etc.) Support Library (libmd, \\-lmd)")
+LINE("libmemstat", "Kernel Memory Allocator Statistics Library (libmemstat, \\-lmemstat)")
+LINE("libmenu", "Curses Menu Library (libmenu, \\-lmenu)")
+LINE("libmj", "Minimalist JSON library (libmj, \\-lmj)")
+LINE("libnetgraph", "Netgraph User Library (libnetgraph, \\-lnetgraph)")
+LINE("libnetpgp", "Netpgp Signing, Verification, Encryption and Decryption (libnetpgp, \\-lnetpgp)")
+LINE("libnetpgpverify", "Netpgp Verification (libnetpgpverify, \\-lnetpgpverify)")
+LINE("libnpf", "NPF Packet Filter Library (libnpf, \\-lnpf)")
+LINE("libnv", "Name/value pairs library (libnv, \\-lnv)")
+LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)")
+LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)")
+LINE("libpanel", "Z-order for curses windows (libpanel, \\-lpanel)")
+LINE("libpcap", "Packet capture Library (libpcap, \\-lpcap)")
+LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)")
+LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)")
+LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)")
+LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)")
+LINE("libposix1e", "POSIX.1e Security API Library (libposix1e, \\-lposix1e)")
+LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)")
+LINE("libproc", "Processor Monitoring and Analysis Library (libproc, \\-lproc)")
+LINE("libprocstat", "Process and Files Information Retrieval (libprocstat, \\-lprocstat)")
+LINE("libprop", "Property Container Object Library (libprop, \\-lprop)")
+LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)")
+LINE("libpthread_dbg", "POSIX Debug Threads Library (libpthread_dbg, \\-lpthread_dbg)")
+LINE("libpuffs", "puffs Convenience Library (libpuffs, \\-lpuffs)")
+LINE("libquota", "Disk Quota Access and Control Library (libquota, \\-lquota)")
+LINE("libradius", "RADIUS Client Library (libradius, \\-lradius)")
+LINE("librefuse", "File System in Userspace Convenience Library (librefuse, \\-lrefuse)")
+LINE("libresolv", "DNS Resolver Library (libresolv, \\-lresolv)")
+LINE("librpcsec_gss", "RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)")
+LINE("librpcsvc", "RPC Service Library (librpcsvc, \\-lrpcsvc)")
+LINE("librt", "POSIX Real\\-time Library (librt, \\-lrt)")
+LINE("librtld_db", "Debugging interface to the runtime linker Library (librtld_db, \\-lrtld_db)")
+LINE("librumpclient", "Clientside Stubs for rump Kernel Remote Protocols (librumpclient, \\-lrumpclient)")
+LINE("libsaslc", "Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)")
+LINE("libsbuf", "Safe String Composition Library (libsbuf, \\-lsbuf)")
+LINE("libsdp", "Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)")
+LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)")
+LINE("libstand", "Standalone Applications Library (libstand, \\-lstand)")
+LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)")
+LINE("libSystem", "System Library (libSystem, \\-lSystem)")
+LINE("libsysdecode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)")
+LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)")
+LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)")
+LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)")
+LINE("libterminfo", "Terminal Information Library (libterminfo, \\-lterminfo)")
+LINE("libthr", "1:1 Threading Library (libthr, \\-lthr)")
+LINE("libufs", "UFS File System Access Library (libufs, \\-lufs)")
+LINE("libugidfw", "File System Firewall Interface Library (libugidfw, \\-lugidfw)")
+LINE("libulog", "User Login Record Library (libulog, \\-lulog)")
+LINE("libusbhid", "USB Human Interface Devices Library (libusbhid, \\-lusbhid)")
+LINE("libutil", "System Utilities Library (libutil, \\-lutil)")
+LINE("libvgl", "Video Graphics Library (libvgl, \\-lvgl)")
+LINE("libx86_64", "x86_64 Architecture Library (libx86_64, \\-lx86_64)")
+LINE("libxo", "Text, XML, JSON, and HTML Output Emission Library (libxo, \\-lxo)")
+LINE("libz", "Compression Library (libz, \\-lz)")
Property changes on: vendor/mandoc/1.14.5/lib.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/libman.h
===================================================================
--- vendor/mandoc/1.14.5/libman.h (nonexistent)
+++ vendor/mandoc/1.14.5/libman.h (revision 345686)
@@ -0,0 +1,42 @@
+/* $Id: libman.h,v 1.86 2018/12/31 10:04:39 schwarze Exp $ */
+/*
+ * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons
+ * Copyright (c) 2014, 2015, 2018 Ingo Schwarze
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+struct roff_node;
+struct roff_man;
+
+#define MACRO_PROT_ARGS struct roff_man *man, \
+ enum roff_tok tok, \
+ int line, \
+ int ppos, \
+ int *pos, \
+ char *buf
+
+struct man_macro {
+ void (*fp)(MACRO_PROT_ARGS);
+ int flags;
+#define MAN_BSCOPED (1 << 0) /* Optional next-line block scope. */
+#define MAN_ESCOPED (1 << 1) /* Optional next-line element scope. */
+#define MAN_NSCOPED (1 << 2) /* Allowed in next-line element scope. */
+#define MAN_XSCOPE (1 << 3) /* Exit next-line block scope. */
+#define MAN_JOIN (1 << 4) /* Join arguments together. */
+};
+
+const struct man_macro *man_macro(enum roff_tok);
+
+void man_descope(struct roff_man *, int, int, char *);
+void man_unscope(struct roff_man *, const struct roff_node *);
Property changes on: vendor/mandoc/1.14.5/libman.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/libmandoc.h
===================================================================
--- vendor/mandoc/1.14.5/libmandoc.h (nonexistent)
+++ vendor/mandoc/1.14.5/libmandoc.h (revision 345686)
@@ -0,0 +1,81 @@
+/* $Id: libmandoc.h,v 1.77 2018/12/21 17:15:18 schwarze Exp $ */
+/*
+ * Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons
+ * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Return codes passed from the roff parser to the main parser.
+ */
+
+/* Main instruction: what to do with the returned line. */
+#define ROFF_IGN 0x000 /* Don't do anything with it. */
+#define ROFF_CONT 0x001 /* Give it to the high-level parser. */
+#define ROFF_RERUN 0x002 /* Re-run the roff parser with an offset. */
+#define ROFF_REPARSE 0x004 /* Recursively run the main parser on it. */
+#define ROFF_SO 0x008 /* Include the named file. */
+#define ROFF_MASK 0x00f /* Only one of these bits should be set. */
+
+/* Options for further parsing, to be OR'ed with the above. */
+#define ROFF_APPEND 0x010 /* Append the next line to this one. */
+#define ROFF_USERCALL 0x020 /* Start execution of a new macro. */
+#define ROFF_USERRET 0x040 /* Abort execution of the current macro. */
+#define ROFF_WHILE 0x100 /* Start a new .while loop. */
+#define ROFF_LOOPCONT 0x200 /* Iterate the current .while loop. */
+#define ROFF_LOOPEXIT 0x400 /* Exit the current .while loop. */
+#define ROFF_LOOPMASK 0xf00
+
+
+struct buf {
+ char *buf;
+ size_t sz;
+ struct buf *next;
+};
+
+
+struct roff;
+struct roff_man;
+
+char *mandoc_normdate(struct roff_man *, char *, int, int);
+int mandoc_eos(const char *, size_t);
+int mandoc_strntoi(const char *, size_t, int);
+const char *mandoc_a2msec(const char*);
+
+int mdoc_parseln(struct roff_man *, int, char *, int);
+void mdoc_endparse(struct roff_man *);
+
+int man_parseln(struct roff_man *, int, char *, int);
+void man_endparse(struct roff_man *);
+
+int preconv_cue(const struct buf *, size_t);
+int preconv_encode(const struct buf *, size_t *,
+ struct buf *, size_t *, int *);
+
+void roff_free(struct roff *);
+struct roff *roff_alloc(int);
+void roff_reset(struct roff *);
+void roff_man_free(struct roff_man *);
+struct roff_man *roff_man_alloc(struct roff *, const char *, int);
+void roff_man_reset(struct roff_man *);
+int roff_parseln(struct roff *, int, struct buf *, int *);
+void roff_userret(struct roff *);
+void roff_endparse(struct roff *);
+void roff_setreg(struct roff *, const char *, int, char sign);
+int roff_getreg(struct roff *, const char *);
+char *roff_strdup(const struct roff *, const char *);
+char *roff_getarg(struct roff *, char **, int, int *);
+int roff_getcontrol(const struct roff *,
+ const char *, int *);
+int roff_getformat(const struct roff *);
Property changes on: vendor/mandoc/1.14.5/libmandoc.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/libmdoc.h
===================================================================
--- vendor/mandoc/1.14.5/libmdoc.h (nonexistent)
+++ vendor/mandoc/1.14.5/libmdoc.h (revision 345686)
@@ -0,0 +1,87 @@
+/* $Id: libmdoc.h,v 1.117 2018/12/31 04:55:46 schwarze Exp $ */
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons
+ * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+struct roff_node;
+struct roff_man;
+struct mdoc_arg;
+
+#define MACRO_PROT_ARGS struct roff_man *mdoc, \
+ enum roff_tok tok, \
+ int line, \
+ int ppos, \
+ int *pos, \
+ char *buf
+
+struct mdoc_macro {
+ void (*fp)(MACRO_PROT_ARGS);
+ int flags;
+#define MDOC_CALLABLE (1 << 0)
+#define MDOC_PARSED (1 << 1)
+#define MDOC_EXPLICIT (1 << 2)
+#define MDOC_PROLOGUE (1 << 3)
+#define MDOC_IGNDELIM (1 << 4)
+#define MDOC_JOIN (1 << 5)
+};
+
+enum margserr {
+ ARGS_ERROR,
+ ARGS_EOLN, /* end-of-line */
+ ARGS_WORD, /* normal word */
+ ARGS_ALLOC, /* normal word from roff_getarg() */
+ ARGS_PUNCT, /* series of punctuation */
+ ARGS_PHRASE /* Bl -column phrase */
+};
+
+/*
+ * A punctuation delimiter is opening, closing, or "middle mark"
+ * punctuation. These govern spacing.
+ * Opening punctuation (e.g., the opening parenthesis) suppresses the
+ * following space; closing punctuation (e.g., the closing parenthesis)
+ * suppresses the leading space; middle punctuation (e.g., the vertical
+ * bar) can do either. The middle punctuation delimiter bends the rules
+ * depending on usage.
+ */
+enum mdelim {
+ DELIM_NONE = 0,
+ DELIM_OPEN,
+ DELIM_MIDDLE,
+ DELIM_CLOSE,
+ DELIM_MAX
+};
+
+const struct mdoc_macro *mdoc_macro(enum roff_tok);
+
+void mdoc_elem_alloc(struct roff_man *, int, int,
+ enum roff_tok, struct mdoc_arg *);
+struct roff_node *mdoc_block_alloc(struct roff_man *, int, int,
+ enum roff_tok, struct mdoc_arg *);
+void mdoc_tail_alloc(struct roff_man *, int, int,
+ enum roff_tok);
+struct roff_node *mdoc_endbody_alloc(struct roff_man *, int, int,
+ enum roff_tok, struct roff_node *);
+void mdoc_state(struct roff_man *, struct roff_node *);
+const char *mdoc_a2arch(const char *);
+const char *mdoc_a2att(const char *);
+const char *mdoc_a2lib(const char *);
+enum roff_sec mdoc_a2sec(const char *);
+const char *mdoc_a2st(const char *);
+void mdoc_argv(struct roff_man *, int, enum roff_tok,
+ struct mdoc_arg **, int *, char *);
+enum margserr mdoc_args(struct roff_man *, int,
+ int *, char *, enum roff_tok, char **);
+enum mdelim mdoc_isdelim(const char *);
Property changes on: vendor/mandoc/1.14.5/libmdoc.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: vendor/mandoc/1.14.5/main.c
===================================================================
--- vendor/mandoc/1.14.5/main.c (nonexistent)
+++ vendor/mandoc/1.14.5/main.c (revision 345686)
@@ -0,0 +1,1246 @@
+/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */
+/*
+ * Copyright (c) 2008-2012 Kristaps Dzonsons
+ * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze
+ * Copyright (c) 2010 Joerg Sonnenberger
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include "config.h"
+
+#include
+#include
+#include /* MACHINE */
+#include
+
+#include
+#include
+#if HAVE_ERR
+#include
+#endif
+#include
+#include
+#include
+#if HAVE_SANDBOX_INIT
+#include
+#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "mandoc_aux.h"
+#include "mandoc.h"
+#include "mandoc_xr.h"
+#include "roff.h"
+#include "mdoc.h"
+#include "man.h"
+#include "mandoc_parse.h"
+#include "tag.h"
+#include "main.h"
+#include "manconf.h"
+#include "mansearch.h"
+
+enum outmode {
+ OUTMODE_DEF = 0,
+ OUTMODE_FLN,
+ OUTMODE_LST,
+ OUTMODE_ALL,
+ OUTMODE_ONE
+};
+
+enum outt {
+ OUTT_ASCII = 0, /* -Tascii */
+ OUTT_LOCALE, /* -Tlocale */
+ OUTT_UTF8, /* -Tutf8 */
+ OUTT_TREE, /* -Ttree */
+ OUTT_MAN, /* -Tman */
+ OUTT_HTML, /* -Thtml */
+ OUTT_MARKDOWN, /* -Tmarkdown */
+ OUTT_LINT, /* -Tlint */
+ OUTT_PS, /* -Tps */
+ OUTT_PDF /* -Tpdf */
+};
+
+struct curparse {
+ struct mparse *mp;
+ struct manoutput *outopts; /* output options */
+ void *outdata; /* data for output */
+ char *os_s; /* operating system for display */
+ int wstop; /* stop after a file with a warning */
+ enum mandoc_os os_e; /* check base system conventions */
+ enum outt outtype; /* which output to use */
+};
+
+
+int mandocdb(int, char *[]);
+
+static void check_xr(void);
+static int fs_lookup(const struct manpaths *,
+ size_t ipath, const char *,
+ const char *, const char *,
+ struct manpage **, size_t *);
+static int fs_search(const struct mansearch *,
+ const struct manpaths *, int, char**,
+ struct manpage **, size_t *);
+static int koptions(int *, char *);
+static void moptions(int *, char *);
+static void outdata_alloc(struct curparse *);
+static void parse(struct curparse *, int, const char *);
+static void passthrough(const char *, int, int);
+static pid_t spawn_pager(struct tag_files *);
+static int toptions(struct curparse *, char *);
+static void usage(enum argmode) __attribute__((__noreturn__));
+static int woptions(struct curparse *, char *);
+
+static const int sec_prios[] = {1, 4, 5, 8, 6, 3, 7, 2, 9};
+static char help_arg[] = "help";
+static char *help_argv[] = {help_arg, NULL};
+
+
+int
+main(int argc, char *argv[])
+{
+ struct manconf conf;
+ struct mansearch search;
+ struct curparse curp;
+ struct winsize ws;
+ struct tag_files *tag_files;
+ struct manpage *res, *resp;
+ const char *progname, *sec, *thisarg;
+ char *conf_file, *defpaths, *auxpaths;
+ char *oarg, *tagarg;
+ unsigned char *uc;
+ size_t i, sz;
+ int prio, best_prio;
+ enum outmode outmode;
+ int fd, startdir;
+ int show_usage;
+ int options;
+ int use_pager;
+ int status, signum;
+ int c;
+ pid_t pager_pid, tc_pgid, man_pgid, pid;
+
+#if HAVE_PROGNAME
+ progname = getprogname();
+#else
+ if (argc < 1)
+ progname = mandoc_strdup("mandoc");
+ else if ((progname = strrchr(argv[0], '/')) == NULL)
+ progname = argv[0];
+ else
+ ++progname;
+ setprogname(progname);
+#endif
+
+ mandoc_msg_setoutfile(stderr);
+ if (strncmp(progname, "mandocdb", 8) == 0 ||
+ strcmp(progname, BINM_MAKEWHATIS) == 0)
+ return mandocdb(argc, argv);
+
+#if HAVE_PLEDGE
+ if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+#endif
+
+#if HAVE_SANDBOX_INIT
+ if (sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, NULL) == -1)
+ errx((int)MANDOCLEVEL_SYSERR, "sandbox_init");
+#endif
+
+ /* Search options. */
+
+ memset(&conf, 0, sizeof(conf));
+ conf_file = defpaths = NULL;
+ auxpaths = NULL;
+
+ memset(&search, 0, sizeof(struct mansearch));
+ search.outkey = "Nd";
+ oarg = NULL;
+
+ if (strcmp(progname, BINM_MAN) == 0)
+ search.argmode = ARG_NAME;
+ else if (strcmp(progname, BINM_APROPOS) == 0)
+ search.argmode = ARG_EXPR;
+ else if (strcmp(progname, BINM_WHATIS) == 0)
+ search.argmode = ARG_WORD;
+ else if (strncmp(progname, "help", 4) == 0)
+ search.argmode = ARG_NAME;
+ else
+ search.argmode = ARG_FILE;
+
+ /* Parser and formatter options. */
+
+ memset(&curp, 0, sizeof(struct curparse));
+ curp.outtype = OUTT_LOCALE;
+ curp.outopts = &conf.output;
+ options = MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1;
+
+ use_pager = 1;
+ tag_files = NULL;
+ show_usage = 0;
+ outmode = OUTMODE_DEF;
+
+ while ((c = getopt(argc, argv,
+ "aC:cfhI:iK:klM:m:O:S:s:T:VW:w")) != -1) {
+ if (c == 'i' && search.argmode == ARG_EXPR) {
+ optind--;
+ break;
+ }
+ switch (c) {
+ case 'a':
+ outmode = OUTMODE_ALL;
+ break;
+ case 'C':
+ conf_file = optarg;
+ break;
+ case 'c':
+ use_pager = 0;
+ break;
+ case 'f':
+ search.argmode = ARG_WORD;
+ break;
+ case 'h':
+ conf.output.synopsisonly = 1;
+ use_pager = 0;
+ outmode = OUTMODE_ALL;
+ break;
+ case 'I':
+ if (strncmp(optarg, "os=", 3)) {
+ warnx("-I %s: Bad argument", optarg);
+ return (int)MANDOCLEVEL_BADARG;
+ }
+ if (curp.os_s != NULL) {
+ warnx("-I %s: Duplicate argument", optarg);
+ return (int)MANDOCLEVEL_BADARG;
+ }
+ curp.os_s = mandoc_strdup(optarg + 3);
+ break;
+ case 'K':
+ if ( ! koptions(&options, optarg))
+ return (int)MANDOCLEVEL_BADARG;
+ break;
+ case 'k':
+ search.argmode = ARG_EXPR;
+ break;
+ case 'l':
+ search.argmode = ARG_FILE;
+ outmode = OUTMODE_ALL;
+ break;
+ case 'M':
+ defpaths = optarg;
+ break;
+ case 'm':
+ auxpaths = optarg;
+ break;
+ case 'O':
+ oarg = optarg;
+ break;
+ case 'S':
+ search.arch = optarg;
+ break;
+ case 's':
+ search.sec = optarg;
+ break;
+ case 'T':
+ if ( ! toptions(&curp, optarg))
+ return (int)MANDOCLEVEL_BADARG;
+ break;
+ case 'W':
+ if ( ! woptions(&curp, optarg))
+ return (int)MANDOCLEVEL_BADARG;
+ break;
+ case 'w':
+ outmode = OUTMODE_FLN;
+ break;
+ default:
+ show_usage = 1;
+ break;
+ }
+ }
+
+ if (show_usage)
+ usage(search.argmode);
+
+ /* Postprocess options. */
+
+ if (outmode == OUTMODE_DEF) {
+ switch (search.argmode) {
+ case ARG_FILE:
+ outmode = OUTMODE_ALL;
+ use_pager = 0;
+ break;
+ case ARG_NAME:
+ outmode = OUTMODE_ONE;
+ break;
+ default:
+ outmode = OUTMODE_LST;
+ break;
+ }
+ }
+
+ if (oarg != NULL) {
+ if (outmode == OUTMODE_LST)
+ search.outkey = oarg;
+ else {
+ while (oarg != NULL) {
+ thisarg = oarg;
+ if (manconf_output(&conf.output,
+ strsep(&oarg, ","), 0) == 0)
+ continue;
+ warnx("-O %s: Bad argument", thisarg);
+ return (int)MANDOCLEVEL_BADARG;
+ }
+ }
+ }
+
+ if (curp.outtype != OUTT_TREE || !curp.outopts->noval)
+ options |= MPARSE_VALIDATE;
+
+ if (outmode == OUTMODE_FLN ||
+ outmode == OUTMODE_LST ||
+ !isatty(STDOUT_FILENO))
+ use_pager = 0;
+
+ if (use_pager &&
+ (conf.output.width == 0 || conf.output.indent == 0) &&
+ ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 &&
+ ws.ws_col > 1) {
+ if (conf.output.width == 0 && ws.ws_col < 79)
+ conf.output.width = ws.ws_col - 1;
+ if (conf.output.indent == 0 && ws.ws_col < 66)
+ conf.output.indent = 3;
+ }
+
+#if HAVE_PLEDGE
+ if (!use_pager)
+ if (pledge("stdio rpath", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+#endif
+
+ /* Parse arguments. */
+
+ if (argc > 0) {
+ argc -= optind;
+ argv += optind;
+ }
+ resp = NULL;
+
+ /*
+ * Quirks for help(1)
+ * and for a man(1) section argument without -s.
+ */
+
+ if (search.argmode == ARG_NAME) {
+ if (*progname == 'h') {
+ if (argc == 0) {
+ argv = help_argv;
+ argc = 1;
+ }
+ } else if (argc > 1 &&
+ ((uc = (unsigned char *)argv[0]) != NULL) &&
+ ((isdigit(uc[0]) && (uc[1] == '\0' ||
+ (isalpha(uc[1]) && uc[2] == '\0'))) ||
+ (uc[0] == 'n' && uc[1] == '\0'))) {
+ search.sec = (char *)uc;
+ argv++;
+ argc--;
+ }
+ if (search.arch == NULL)
+ search.arch = getenv("MACHINE");
+#ifdef MACHINE
+ if (search.arch == NULL)
+ search.arch = MACHINE;
+#endif
+ }
+
+ /*
+ * Use the first argument for -O tag in addition to
+ * using it as a search term for man(1) or apropos(1).
+ */
+
+ if (conf.output.tag != NULL && *conf.output.tag == '\0') {
+ tagarg = argc > 0 && search.argmode == ARG_EXPR ?
+ strchr(*argv, '=') : NULL;
+ conf.output.tag = tagarg == NULL ? *argv : tagarg + 1;
+ }
+
+ /* man(1), whatis(1), apropos(1) */
+
+ if (search.argmode != ARG_FILE) {
+ if (search.argmode == ARG_NAME &&
+ outmode == OUTMODE_ONE)
+ search.firstmatch = 1;
+
+ /* Access the mandoc database. */
+
+ manconf_parse(&conf, conf_file, defpaths, auxpaths);
+ if ( ! mansearch(&search, &conf.manpath,
+ argc, argv, &res, &sz))
+ usage(search.argmode);
+
+ if (sz == 0 && search.argmode == ARG_NAME)
+ fs_search(&search, &conf.manpath,
+ argc, argv, &res, &sz);
+
+ if (search.argmode == ARG_NAME) {
+ for (c = 0; c < argc; c++) {
+ if (strchr(argv[c], '/') == NULL)
+ continue;
+ if (access(argv[c], R_OK) == -1) {
+ warn("%s", argv[c]);
+ continue;
+ }
+ res = mandoc_reallocarray(res,
+ sz + 1, sizeof(*res));
+ res[sz].file = mandoc_strdup(argv[c]);
+ res[sz].names = NULL;
+ res[sz].output = NULL;
+ res[sz].ipath = SIZE_MAX;
+ res[sz].sec = 10;
+ res[sz].form = FORM_SRC;
+ sz++;
+ }
+ }
+
+ if (sz == 0) {
+ if (search.argmode != ARG_NAME)
+ warnx("nothing appropriate");
+ mandoc_msg_setrc(MANDOCLEVEL_BADARG);
+ goto out;
+ }
+
+ /*
+ * For standard man(1) and -a output mode,
+ * prepare for copying filename pointers
+ * into the program parameter array.
+ */
+
+ if (outmode == OUTMODE_ONE) {
+ argc = 1;
+ best_prio = 20;
+ } else if (outmode == OUTMODE_ALL)
+ argc = (int)sz;
+
+ /* Iterate all matching manuals. */
+
+ resp = res;
+ for (i = 0; i < sz; i++) {
+ if (outmode == OUTMODE_FLN)
+ puts(res[i].file);
+ else if (outmode == OUTMODE_LST)
+ printf("%s - %s\n", res[i].names,
+ res[i].output == NULL ? "" :
+ res[i].output);
+ else if (outmode == OUTMODE_ONE) {
+ /* Search for the best section. */
+ sec = res[i].file;
+ sec += strcspn(sec, "123456789");
+ if (sec[0] == '\0')
+ continue;
+ prio = sec_prios[sec[0] - '1'];
+ if (sec[1] != '/')
+ prio += 10;
+ if (prio >= best_prio)
+ continue;
+ best_prio = prio;
+ resp = res + i;
+ }
+ }
+
+ /*
+ * For man(1), -a and -i output mode, fall through
+ * to the main mandoc(1) code iterating files
+ * and running the parsers on each of them.
+ */
+
+ if (outmode == OUTMODE_FLN || outmode == OUTMODE_LST)
+ goto out;
+ }
+
+ /* mandoc(1) */
+
+#if HAVE_PLEDGE
+ if (use_pager) {
+ if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+ } else {
+ if (pledge("stdio rpath", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+ }
+#endif
+
+ if (search.argmode == ARG_FILE)
+ moptions(&options, auxpaths);
+
+ mchars_alloc();
+ curp.mp = mparse_alloc(options, curp.os_e, curp.os_s);
+
+ if (argc < 1) {
+ if (use_pager) {
+ tag_files = tag_init();
+ tag_files->tagname = conf.output.tag;
+ }
+ thisarg = "