summaryrefslogtreecommitdiffstats
path: root/mlg.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-08 12:46:28 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-08 12:46:28 +0000
commit590484168e25f0faf46db9b6df44c27b50ffeb50 (patch)
tree2710f24f8b76175801d4fb7b79499f2425c13e0d /mlg.c
parent1dc52a2bad8738c62ac5bc9689c09600eb7b1269 (diff)
downloadmandoc-590484168e25f0faf46db9b6df44c27b50ffeb50.tar.gz
Added warnings for using macros in the wrong sections.
Diffstat (limited to 'mlg.c')
-rw-r--r--mlg.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mlg.c b/mlg.c
index 6ca4522d..e930b7d0 100644
--- a/mlg.c
+++ b/mlg.c
@@ -64,7 +64,7 @@ static void mlg_roffmsg(void *arg,
const char *, const char *);
static int mlg_roffhead(void *, const struct tm *,
const char *, const char *,
- const char *, const char *);
+ enum roffmsec, const char *);
static int mlg_rofftail(void *);
static int mlg_roffin(void *, int,
int *, const char **);
@@ -362,10 +362,10 @@ mlg_exit(struct md_mlg *p, int flush)
int c;
c = roff_free(p->tree, flush);
- free(p);
-
(*p->cbs.ml_free)(p->data);
+ free(p);
+
return(c);
}
@@ -415,7 +415,7 @@ mlg_alloc(const struct md_args *args,
static int
mlg_roffhead(void *arg, const struct tm *tm, const char *os,
- const char *title, const char *sec, const char *vol)
+ const char *title, enum roffmsec sec, const char *vol)
{
struct md_mlg *p;
@@ -462,6 +462,8 @@ mlg_literal_special(struct md_mlg *p, int tok, const char *start,
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more))
return(0);
+ /* FIXME: must be ml-filtered. */
+
lit = ml_literal(tok, argc, argv, more);
assert(lit);
@@ -510,12 +512,13 @@ mlg_formatted_special(struct md_mlg *p, int tok,
{
char buf[256], *lit;
- /* FIXME: *more must be ml-filtered. */
-
if ( ! mlg_begintag(p, MD_NS_INLINE, tok, NULL, more))
return(0);
+ /* FIXME: must be ml-filtered. */
+
lit = ml_literal(tok, argc, argv, more);
+
assert(lit);
assert(*more);
(void)snprintf(buf, sizeof(buf), lit, *more++);