summaryrefslogtreecommitdiffstats
path: root/mlg.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-05 17:43:14 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-05 17:43:14 +0000
commit57ed1544ce7edde6d0812e0c870f03e6b1e7204f (patch)
treef0901e95a0cbbd7383ebde2739459cdba0e7c8da /mlg.c
parenta4880c4fea2cc33d9168cb96bc44c1b3670ef402 (diff)
downloadmandoc-57ed1544ce7edde6d0812e0c870f03e6b1e7204f.tar.gz
*** empty log message ***
Diffstat (limited to 'mlg.c')
-rw-r--r--mlg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mlg.c b/mlg.c
index 7fb7d74d..7ea1ecf3 100644
--- a/mlg.c
+++ b/mlg.c
@@ -58,6 +58,7 @@ struct md_mlg {
int flags;
#define ML_OVERRIDE_ONE (1 << 0)
#define ML_OVERRIDE_ALL (1 << 1)
+ void *data;
};
@@ -144,7 +145,7 @@ mlg_begintag(struct md_mlg *p, enum md_ns ns, int tok,
if ( ! ml_nputs(p->mbuf, "<", 1, &p->pos))
return(0);
- res = (*p->begintag)(p->mbuf, p->args, ns, tok,
+ res = (*p->begintag)(p->mbuf, p->data, p->args, ns, tok,
argc, (const char **)argv);
if (-1 == res)
return(0);
@@ -193,7 +194,7 @@ mlg_endtag(struct md_mlg *p, enum md_ns ns, int tok)
if ( ! ml_nputs(p->mbuf, "</", 2, &p->pos))
return(0);
- res = (*p->endtag)(p->mbuf, p->args, ns, tok);
+ res = (*p->endtag)(p->mbuf, p->data, p->args, ns, tok);
if (-1 == res)
return(0);
@@ -333,7 +334,7 @@ mlg_exit(struct md_mlg *p, int flush)
struct md_mlg *
-mlg_alloc(const struct md_args *args,
+mlg_alloc(const struct md_args *args, void *data,
const struct md_rbuf *rbuf,
struct md_mbuf *mbuf,
ml_begintag begintag, ml_endtag endtag,
@@ -366,6 +367,7 @@ mlg_alloc(const struct md_args *args,
p->endtag = endtag;
p->begin = begin;
p->end = end;
+ p->data = data;
if (NULL == (p->tree = roff_alloc(&cb, p))) {
free(p);