diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-26 15:36:37 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-26 15:36:37 +0000 |
commit | 8ee307fc9980fbb248f1ed3b9c0da115e8c79440 (patch) | |
tree | 66dccb2268cc430f3125d54205263d9fb915a5b6 | |
parent | a7a9c3b662c1cf6ee6766d865a9dcc58376ea2c9 (diff) | |
download | mandoc-8ee307fc9980fbb248f1ed3b9c0da115e8c79440.tar.gz |
Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept a
const struct regset pointer. No functionality.
-rw-r--r-- | libman.h | 1 | ||||
-rw-r--r-- | libmdoc.h | 1 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | man.3 | 8 | ||||
-rw-r--r-- | man.c | 4 | ||||
-rw-r--r-- | man.h | 4 | ||||
-rw-r--r-- | man_html.c | 1 | ||||
-rw-r--r-- | man_term.c | 1 | ||||
-rw-r--r-- | mdoc.3 | 8 | ||||
-rw-r--r-- | mdoc.c | 4 | ||||
-rw-r--r-- | mdoc.h | 4 | ||||
-rw-r--r-- | mdoc_html.c | 1 | ||||
-rw-r--r-- | mdoc_term.c | 1 | ||||
-rw-r--r-- | regs.h | 4 | ||||
-rw-r--r-- | term.c | 2 | ||||
-rw-r--r-- | tree.c | 1 |
16 files changed, 35 insertions, 14 deletions
@@ -17,6 +17,7 @@ #ifndef LIBMAN_H #define LIBMAN_H +#include "regs.h" #include "man.h" enum man_next { @@ -17,6 +17,7 @@ #ifndef LIBMDOC_H #define LIBMDOC_H +#include "regs.h" #include "mdoc.h" enum mdoc_next { @@ -562,9 +562,9 @@ fdesc(struct curparse *curp) /* Lastly, push down into the parsers themselves. */ - if (man && ! man_parseln(man, lnn_start, ln.buf, of)) + if (man && ! man_parseln(man, ®s, lnn_start, ln.buf, of)) goto bailout; - if (mdoc && ! mdoc_parseln(mdoc, lnn_start, ln.buf, of)) + if (mdoc && ! mdoc_parseln(mdoc, ®s, lnn_start, ln.buf, of)) goto bailout; } @@ -29,6 +29,7 @@ .Nd man macro compiler library .Sh SYNOPSIS .In mandoc.h +.In regs.h .In man.h .Vt extern const char * const * man_macronames; .Ft "struct man *" @@ -42,7 +43,12 @@ .Ft "const struct man_node *" .Fn man_node "const struct man *man" .Ft int -.Fn man_parseln "struct man *man" "int line" "char *buf" +.Fo man_parseln +.Fa "struct man *man" +.Fa "const struct regset *regs" +.Fa "int line" +.Fa "char *buf" +.Fc .Ft void .Fn man_reset "struct man *man" .Sh DESCRIPTION @@ -28,6 +28,7 @@ #include <string.h> #include "mandoc.h" +#include "regs.h" #include "libman.h" #include "libmandoc.h" @@ -124,7 +125,8 @@ man_endparse(struct man *m) int -man_parseln(struct man *m, int ln, char *buf, int offs) +man_parseln(struct man *m, const struct regset *regs, + int ln, char *buf, int offs) { if (MAN_HALT & m->flags) @@ -108,7 +108,9 @@ struct man; void man_free(struct man *); struct man *man_alloc(void *, int, mandocmsg); void man_reset(struct man *); -int man_parseln(struct man *, int, char *, int); +int man_parseln(struct man *, + const struct regset *, + int, char *, int); int man_endparse(struct man *); const struct man_node *man_node(const struct man *); @@ -29,6 +29,7 @@ #include "mandoc.h" #include "out.h" #include "html.h" +#include "regs.h" #include "man.h" #include "main.h" @@ -28,6 +28,7 @@ #include "mandoc.h" #include "out.h" +#include "regs.h" #include "man.h" #include "term.h" #include "chars.h" @@ -29,6 +29,7 @@ .Nd mdoc macro compiler library .Sh SYNOPSIS .In mandoc.h +.In regs.h .In mdoc.h .Vt extern const char * const * mdoc_macronames; .Vt extern const char * const * mdoc_argnames; @@ -43,7 +44,12 @@ .Ft "const struct mdoc_node *" .Fn mdoc_node "const struct mdoc *mdoc" .Ft int -.Fn mdoc_parseln "struct mdoc *mdoc" "int line" "char *buf" +.Fo mdoc_parseln +.Fa "struct mdoc *mdoc" +.Fa "const struct regset *regs" +.Fa "int line" +.Fa "char *buf" +.Fc .Ft int .Fn mdoc_reset "struct mdoc *mdoc" .Sh DESCRIPTION @@ -29,6 +29,7 @@ #include <time.h> #include "mandoc.h" +#include "regs.h" #include "libmdoc.h" #include "libmandoc.h" @@ -229,7 +230,8 @@ mdoc_endparse(struct mdoc *m) * the macro (mdoc_pmacro()) or text parser (mdoc_ptext()). */ int -mdoc_parseln(struct mdoc *m, int ln, char *buf, int offs) +mdoc_parseln(struct mdoc *m, const struct regset *regs, + int ln, char *buf, int offs) { if (MDOC_HALT & m->flags) @@ -336,7 +336,9 @@ struct mdoc; void mdoc_free(struct mdoc *); struct mdoc *mdoc_alloc(void *, int, mandocmsg); void mdoc_reset(struct mdoc *); -int mdoc_parseln(struct mdoc *, int, char *, int); +int mdoc_parseln(struct mdoc *, + const struct regset *, + int, char *, int); const struct mdoc_node *mdoc_node(const struct mdoc *); const struct mdoc_meta *mdoc_meta(const struct mdoc *); int mdoc_endparse(struct mdoc *); diff --git a/mdoc_html.c b/mdoc_html.c index 9b0f920a..f3bc78e2 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -30,6 +30,7 @@ #include "mandoc.h" #include "out.h" #include "html.h" +#include "regs.h" #include "mdoc.h" #include "main.h" diff --git a/mdoc_term.c b/mdoc_term.c index 2ca83630..8943e8d2 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -30,6 +30,7 @@ #include "mandoc.h" #include "out.h" #include "term.h" +#include "regs.h" #include "mdoc.h" #include "chars.h" #include "main.h" @@ -24,10 +24,6 @@ enum regs { REG__MAX }; -/* - * Registers are passed into libmdoc and libman. They refer to some - * sort of external state. - */ struct regset { union { int i; /* integer value */ @@ -31,8 +31,6 @@ #include "chars.h" #include "out.h" #include "term.h" -#include "man.h" -#include "mdoc.h" #include "main.h" static void spec(struct termp *, const char *, size_t); @@ -24,6 +24,7 @@ #include <time.h> #include "mandoc.h" +#include "regs.h" #include "mdoc.h" #include "man.h" #include "main.h" |