summaryrefslogtreecommitdiffstats
path: root/libmandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-23 14:29:38 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-23 14:29:38 +0000
commita99c9a30e9f41eb3ce553ac0b2ac6ff963ebe49d (patch)
tree9de2c70188a81c04c2b08671dcf1d3eb421403da /libmandoc.h
parent50f5bf83cff66e2f7baa88e327d78c37143bed97 (diff)
downloadmandoc-a99c9a30e9f41eb3ce553ac0b2ac6ff963ebe49d.tar.gz
Implement the roff(7) .shift and .return requests,
for example used by groff_hdtbl(7) and groff_mom(7). Also correctly interpolate arguments during nested macro execution even after .shift and .return, implemented using a stack of argument arrays. Note that only read.c, but not roff.c can detect the end of a macro execution, and the existence of .shift implies that arguments cannot be interpolated up front, so unfortunately, this includes a partial revert of roff.c rev. 1.337, moving argument interpolation back into the function roff_res().
Diffstat (limited to 'libmandoc.h')
-rw-r--r--libmandoc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmandoc.h b/libmandoc.h
index f864d352..0fb70f86 100644
--- a/libmandoc.h
+++ b/libmandoc.h
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -21,6 +21,8 @@ enum rofferr {
ROFF_RERUN, /* re-run roff interpreter with offset */
ROFF_APPEND, /* re-run main parser, appending next line */
ROFF_REPARSE, /* re-run main parser on the result */
+ ROFF_USERCALL, /* dto., calling a user-defined macro */
+ ROFF_USERRET, /* abort parsing of user-defined macro */
ROFF_SO, /* include another file */
ROFF_IGN, /* ignore current line */
};
@@ -64,6 +66,7 @@ struct roff_man *roff_man_alloc(struct roff *, struct mparse *,
const char *, int);
void roff_man_reset(struct roff_man *);
enum rofferr roff_parseln(struct roff *, int, struct buf *, int *);
+void roff_userret(struct roff *);
void roff_endparse(struct roff *);
void roff_setreg(struct roff *, const char *, int, char sign);
int roff_getreg(struct roff *, const char *);