summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-26 15:36:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-26 15:36:37 +0000
commit8ee307fc9980fbb248f1ed3b9c0da115e8c79440 (patch)
tree66dccb2268cc430f3125d54205263d9fb915a5b6
parenta7a9c3b662c1cf6ee6766d865a9dcc58376ea2c9 (diff)
downloadmandoc-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.h1
-rw-r--r--libmdoc.h1
-rw-r--r--main.c4
-rw-r--r--man.38
-rw-r--r--man.c4
-rw-r--r--man.h4
-rw-r--r--man_html.c1
-rw-r--r--man_term.c1
-rw-r--r--mdoc.38
-rw-r--r--mdoc.c4
-rw-r--r--mdoc.h4
-rw-r--r--mdoc_html.c1
-rw-r--r--mdoc_term.c1
-rw-r--r--regs.h4
-rw-r--r--term.c2
-rw-r--r--tree.c1
16 files changed, 35 insertions, 14 deletions
diff --git a/libman.h b/libman.h
index ef0d128f..20154706 100644
--- a/libman.h
+++ b/libman.h
@@ -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 4fee2230..f05130d2 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -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 a29c3633..802d2787 100644
--- a/main.c
+++ b/main.c
@@ -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 49e84590..4a1ac6a4 100644
--- a/man.3
+++ b/man.3
@@ -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 9f99c0ca..ad1a7df4 100644
--- a/man.c
+++ b/man.c
@@ -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 160d0723..5d274731 100644
--- a/man.h
+++ b/man.h
@@ -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 ce2effe1..47b66063 100644
--- a/man_html.c
+++ b/man_html.c
@@ -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 0f09ec01..f9e7aec3 100644
--- a/man_term.c
+++ b/man_term.c
@@ -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 ea7bedb4..cc93d711 100644
--- a/mdoc.3
+++ b/mdoc.3
@@ -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 25729ebe..6dc68b28 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -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 7fc5b3e4..36df7270 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -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"
diff --git a/regs.h b/regs.h
index 9f176d6d..ca388597 100644
--- a/regs.h
+++ b/regs.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 */
diff --git a/term.c b/term.c
index 854c6050..fef878d7 100644
--- a/term.c
+++ b/term.c
@@ -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 29019a0b..1156a0d7 100644
--- a/tree.c
+++ b/tree.c
@@ -24,6 +24,7 @@
#include <time.h>
#include "mandoc.h"
+#include "regs.h"
#include "mdoc.h"
#include "man.h"
#include "main.h"