summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-03-31 07:13:53 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-03-31 07:13:53 +0000
commitd8f04423aa0185697ac4ab7b182532f8f02b5de7 (patch)
treec8c61056a4f445fdc9afc57f108313b3581e6dca /mdoc.c
parentd6a01dde28af9c768a8898988b670a59be49563a (diff)
downloadmandoc-d8f04423aa0185697ac4ab7b182532f8f02b5de7.tar.gz
Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" values).
Initial check-in of Ingo Schwarze's patch for Xo/Xc handling (in blocks ifdef'd "UGLY"). Put Oc-close-Op parts into UGLY ifdef blocks.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/mdoc.c b/mdoc.c
index 0d3925ff..ba7066f1 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -143,7 +143,7 @@ const char * const *mdoc_argnames = __mdoc_argnames;
static void mdoc_free1(struct mdoc *);
static void mdoc_alloc1(struct mdoc *);
static struct mdoc_node *node_alloc(struct mdoc *, int, int,
- int, enum mdoc_type);
+ enum mdoct, enum mdoc_type);
static int node_append(struct mdoc *,
struct mdoc_node *);
static int parsetext(struct mdoc *, int, char *);
@@ -341,9 +341,11 @@ mdoc_err(struct mdoc *m, int line, int pos, int iserr, enum merr type)
int
-mdoc_macro(struct mdoc *m, int tok,
+mdoc_macro(struct mdoc *m, enum mdoct tok,
int ln, int pp, int *pos, char *buf)
{
+
+ assert(tok < MDOC_MAX);
/*
* If we're in the prologue, deny "body" macros. Similarly, if
* we're in the body, deny prologue calls.
@@ -424,8 +426,8 @@ node_append(struct mdoc *mdoc, struct mdoc_node *p)
static struct mdoc_node *
-node_alloc(struct mdoc *m, int line,
- int pos, int tok, enum mdoc_type type)
+node_alloc(struct mdoc *m, int line, int pos,
+ enum mdoct tok, enum mdoc_type type)
{
struct mdoc_node *p;
@@ -434,15 +436,13 @@ node_alloc(struct mdoc *m, int line,
p->line = line;
p->pos = pos;
p->tok = tok;
- if (MDOC_TEXT != (p->type = type))
- assert(p->tok >= 0);
return(p);
}
int
-mdoc_tail_alloc(struct mdoc *m, int line, int pos, int tok)
+mdoc_tail_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
{
struct mdoc_node *p;
@@ -455,7 +455,7 @@ mdoc_tail_alloc(struct mdoc *m, int line, int pos, int tok)
int
-mdoc_head_alloc(struct mdoc *m, int line, int pos, int tok)
+mdoc_head_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
{
struct mdoc_node *p;
@@ -471,7 +471,7 @@ mdoc_head_alloc(struct mdoc *m, int line, int pos, int tok)
int
-mdoc_body_alloc(struct mdoc *m, int line, int pos, int tok)
+mdoc_body_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
{
struct mdoc_node *p;
@@ -485,7 +485,7 @@ mdoc_body_alloc(struct mdoc *m, int line, int pos, int tok)
int
mdoc_block_alloc(struct mdoc *m, int line, int pos,
- int tok, struct mdoc_arg *args)
+ enum mdoct tok, struct mdoc_arg *args)
{
struct mdoc_node *p;
@@ -502,7 +502,7 @@ mdoc_block_alloc(struct mdoc *m, int line, int pos,
int
mdoc_elem_alloc(struct mdoc *m, int line, int pos,
- int tok, struct mdoc_arg *args)
+ enum mdoct tok, struct mdoc_arg *args)
{
struct mdoc_node *p;