diff options
-rw-r--r-- | libman.h | 3 | ||||
-rw-r--r-- | libmdoc.h | 3 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | man.3 | 12 | ||||
-rw-r--r-- | man.c | 6 | ||||
-rw-r--r-- | man.h | 6 | ||||
-rw-r--r-- | man_html.c | 3 | ||||
-rw-r--r-- | man_term.c | 3 | ||||
-rw-r--r-- | mdoc.3 | 12 | ||||
-rw-r--r-- | mdoc.c | 6 | ||||
-rw-r--r-- | mdoc.h | 6 | ||||
-rw-r--r-- | mdoc_html.c | 3 | ||||
-rw-r--r-- | mdoc_term.c | 3 | ||||
-rw-r--r-- | regs.h | 6 | ||||
-rw-r--r-- | term.c | 4 | ||||
-rw-r--r-- | tree.c | 3 |
16 files changed, 53 insertions, 32 deletions
@@ -1,4 +1,4 @@ -/* $Id: libman.h,v 1.36 2010/06/19 20:46:27 kristaps Exp $ */ +/* $Id: libman.h,v 1.37 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -17,6 +17,7 @@ #ifndef LIBMAN_H #define LIBMAN_H +#include "regs.h" #include "man.h" enum man_next { @@ -1,4 +1,4 @@ -/* $Id: libmdoc.h,v 1.53 2010/06/19 20:46:27 kristaps Exp $ */ +/* $Id: libmdoc.h,v 1.54 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -17,6 +17,7 @@ #ifndef LIBMDOC_H #define LIBMDOC_H +#include "regs.h" #include "mdoc.h" enum mdoc_next { @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.90 2010/06/26 15:22:19 kristaps Exp $ */ +/* $Id: main.c,v 1.91 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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; } @@ -1,4 +1,4 @@ -.\" $Id: man.3,v 1.18 2010/05/25 22:16:59 kristaps Exp $ +.\" $Id: man.3,v 1.19 2010/06/26 15:36:37 kristaps Exp $ .\" .\" Copyright (c) 2009-2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 25 2010 $ +.Dd $Mdocdate: June 26 2010 $ .Dt MAN 3 .Os .Sh NAME @@ -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 @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.76 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: man.c,v 1.77 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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) @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.37 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: man.h,v 1.38 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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 *); @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.37 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: man_html.c,v 1.38 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -29,6 +29,7 @@ #include "mandoc.h" #include "out.h" #include "html.h" +#include "regs.h" #include "man.h" #include "main.h" @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.77 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: man_term.c,v 1.78 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -28,6 +28,7 @@ #include "mandoc.h" #include "out.h" +#include "regs.h" #include "man.h" #include "term.h" #include "chars.h" @@ -1,4 +1,4 @@ -.\" $Id: mdoc.3,v 1.41 2010/05/30 22:56:02 kristaps Exp $ +.\" $Id: mdoc.3,v 1.42 2010/06/26 15:36:37 kristaps Exp $ .\" .\" Copyright (c) 2009-2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 30 2010 $ +.Dd $Mdocdate: June 26 2010 $ .Dt MDOC 3 .Os .Sh NAME @@ -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 @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.146 2010/06/12 11:58:22 kristaps Exp $ */ +/* $Id: mdoc.c,v 1.147 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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) @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.91 2010/06/26 15:22:19 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.92 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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 82ecccf0..f13fe42f 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.85 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.86 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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 b9e7823d..a3585e76 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.157 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.158 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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" @@ -1,4 +1,4 @@ -/* $Id: regs.h,v 1.1 2010/06/26 15:22:19 kristaps Exp $ */ +/* $Id: regs.h,v 1.2 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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 */ @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.149 2010/06/25 18:53:14 kristaps Exp $ */ +/* $Id: term.c,v 1.150 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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); @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.21 2010/06/19 20:46:28 kristaps Exp $ */ +/* $Id: tree.c,v 1.22 2010/06/26 15:36:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -24,6 +24,7 @@ #include <time.h> #include "mandoc.h" +#include "regs.h" #include "mdoc.h" #include "man.h" #include "main.h" |