summaryrefslogtreecommitdiffstats
path: root/libmdocml.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-11-24 14:24:55 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-11-24 14:24:55 +0000
commit3238820d08da942be84ccab704e810b0f6d8bcf4 (patch)
tree95aa8bf9dc7c3dfb08fb8b46d811fabd58008b44 /libmdocml.c
parenta73f55c2be0ca8e1deeeb05389879a52e46f05d2 (diff)
downloadmandoc-3238820d08da942be84ccab704e810b0f6d8bcf4.tar.gz
Split roff engine into roff.c.
Re-worked calling convention for md_*.
Diffstat (limited to 'libmdocml.c')
-rw-r--r--libmdocml.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libmdocml.c b/libmdocml.c
index 11936f91..6fc5d32e 100644
--- a/libmdocml.c
+++ b/libmdocml.c
@@ -136,13 +136,13 @@ md_run_leave(const struct md_args *args, struct md_mbuf *mbuf,
/* Run exiters. */
switch (args->type) {
case (MD_HTML4_STRICT):
- if ( ! md_exit_html4_strict(args, mbuf, rbuf, c, data))
- return(-1);
- break;
- case (MD_DUMMY):
+ if ( ! md_exit_html4_strict(data, -1 == c ? 0 : 1))
+ c = -1;
break;
default:
- abort();
+ if ( ! md_exit_dummy(data, -1 == c ? 0 : 1))
+ c = -1;
+ break;
}
/* Make final flush of buffer. */
@@ -200,7 +200,7 @@ again:
}
line[pos] = 0;
- if ( ! (*fp)(args, mbuf, rbuf, line, pos, p))
+ if ( ! (*fp)(p, line, pos))
return(md_run_leave(args, mbuf, rbuf, -1, p));
rbuf->line++;
pos = 0;
@@ -228,18 +228,17 @@ md_run(const struct md_args *args,
mbuf.pos = 0;
rbuf.line = 1;
- data = NULL;
/* Run initialisers. */
switch (args->type) {
case (MD_HTML4_STRICT):
- if ( ! md_init_html4_strict(args, &mbuf, &rbuf, &data))
- return(-1);
- break;
- case (MD_DUMMY):
+ data = md_init_html4_strict
+ (args, &mbuf, &rbuf);
break;
default:
- abort();
+ data = md_init_dummy
+ (args, &mbuf, &rbuf);
+ break;
}
/* Go into mainline. */