aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--libman.h3
-rw-r--r--libmdoc.h3
-rw-r--r--main.c6
-rw-r--r--man.312
-rw-r--r--man.c6
-rw-r--r--man.h6
-rw-r--r--man_html.c3
-rw-r--r--man_term.c3
-rw-r--r--mdoc.312
-rw-r--r--mdoc.c6
-rw-r--r--mdoc.h6
-rw-r--r--mdoc_html.c3
-rw-r--r--mdoc_term.c3
-rw-r--r--regs.h6
-rw-r--r--term.c4
-rw-r--r--tree.c3
16 files changed, 53 insertions, 32 deletions
diff --git a/libman.h b/libman.h
index 4a0df633..e7d537c2 100644
--- a/libman.h
+++ b/libman.h
@@ -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 {
diff --git a/libmdoc.h b/libmdoc.h
index e0935be0..e0d96a58 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -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 {
diff --git a/main.c b/main.c
index a8e83824..11b7a900 100644
--- a/main.c
+++ b/main.c
@@ -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, &regs, lnn_start, ln.buf, of))
goto bailout;
- if (mdoc && ! mdoc_parseln(mdoc, lnn_start, ln.buf, of))
+ if (mdoc && ! mdoc_parseln(mdoc, &regs, lnn_start, ln.buf, of))
goto bailout;
}
diff --git a/man.3 b/man.3
index 08291447..3191a11e 100644
--- a/man.3
+++ b/man.3
@@ -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
diff --git a/man.c b/man.c
index b810735b..02b5bd2f 100644
--- a/man.c
+++ b/man.c
@@ -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)
diff --git a/man.h b/man.h
index 46ec7f8e..ddeb0184 100644
--- a/man.h
+++ b/man.h
@@ -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 *);
diff --git a/man_html.c b/man_html.c
index 2406393a..ed6e6c7f 100644
--- a/man_html.c
+++ b/man_html.c
@@ -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"
diff --git a/man_term.c b/man_term.c
index 5b59968b..65a6e7b4 100644
--- a/man_term.c
+++ b/man_term.c
@@ -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"
diff --git a/mdoc.3 b/mdoc.3
index da963ca5..49acb46e 100644
--- a/mdoc.3
+++ b/mdoc.3
@@ -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
diff --git a/mdoc.c b/mdoc.c
index bdd03482..36ed1acb 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -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)
diff --git a/mdoc.h b/mdoc.h
index b743121b..dc4be587 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -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"
diff --git a/regs.h b/regs.h
index b42e1d15..ce56f615 100644
--- a/regs.h
+++ b/regs.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 */
diff --git a/term.c b/term.c
index bd557395..1585c1af 100644
--- a/term.c
+++ b/term.c
@@ -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);
diff --git a/tree.c b/tree.c
index 9125e6a5..61ce1b4f 100644
--- a/tree.c
+++ b/tree.c
@@ -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"