summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
commitf0efcfb7750a1c0ab3108c5a759de5c050166035 (patch)
tree42c4f3dfff406eb906a633e4b8588959e74dd9ae /mdoc.c
parentd7fbb7d096f24634fd2aa0c5146e6fbf55acb09e (diff)
downloadmandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.gz
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.zst
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.zip
Re-merged old port-building routines.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mdoc.c b/mdoc.c
index a1a2c48c..a8ca26c5 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.40 2009/01/20 13:05:28 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.41 2009/01/20 13:44:05 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -26,6 +26,12 @@
#include "private.h"
+/*
+ * Main caller in the libmdoc library. This begins the parsing routine,
+ * handles allocation of data, and so forth. Most of the "work" is done
+ * in macro.c, but this orchestrates who does what, when.
+ */
+
const char *const __mdoc_macronames[MDOC_MAX] = {
"\\\"", "Dd", "Dt", "Os",
"Sh", "Ss", "Pp", "D1",
@@ -83,6 +89,8 @@ const char *const __mdoc_argnames[MDOC_ARG_MAX] = {
"emphasis", "symbolic",
};
+/* Central table of library: who gets parsed how. */
+
const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
{ NULL, 0 }, /* \" */
{ macro_constant, MDOC_PROLOGUE }, /* Dd */
@@ -199,7 +207,6 @@ const char * const *mdoc_macronames = __mdoc_macronames;
const char * const *mdoc_argnames = __mdoc_argnames;
const struct mdoc_macro * const mdoc_macros = __mdoc_macros;
-
static struct mdoc_arg *argdup(size_t, const struct mdoc_arg *);
static void argfree(size_t, struct mdoc_arg *);
static void argcpy(struct mdoc_arg *,