summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 14:09:33 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-08-19 14:09:33 +0000
commitc4212c1395b905108924b52e7aaf8e812f329ade (patch)
tree2d5300f482f42d52f29e69b375c2caf3df177247 /mdoc.c
parente57c06cc3631ebb1c40bd2234537697ba2742305 (diff)
downloadmandoc-c4212c1395b905108924b52e7aaf8e812f329ade.tar.gz
mandoc-c4212c1395b905108924b52e7aaf8e812f329ade.tar.zst
mandoc-c4212c1395b905108924b52e7aaf8e812f329ade.zip
In-line documentation of mdoc_macro file.
Moved _NEXT_ macros into _alloc_ routines (where they belong).
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/mdoc.c b/mdoc.c
index ed219096..080233bc 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.101 2009/08/19 11:58:32 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.102 2009/08/19 14:09:33 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -459,7 +459,10 @@ mdoc_tail_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_TAIL);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -474,7 +477,10 @@ mdoc_head_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_HEAD);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -486,7 +492,10 @@ mdoc_body_alloc(struct mdoc *m, int line, int pos, int tok)
p = node_alloc(m, line, pos, tok, MDOC_BODY);
if (NULL == p)
return(0);
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -502,7 +511,10 @@ mdoc_block_alloc(struct mdoc *m, int line, int pos,
p->args = args;
if (p->args)
(args->refcnt)++;
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}
@@ -518,7 +530,10 @@ mdoc_elem_alloc(struct mdoc *m, int line, int pos,
p->args = args;
if (p->args)
(args->refcnt)++;
- return(node_append(m, p));
+ if ( ! node_append(m, p))
+ return(0);
+ m->next = MDOC_NEXT_CHILD;
+ return(1);
}