summaryrefslogtreecommitdiffstats
path: root/mdoc_argv.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-03-31 07:13:53 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-03-31 07:13:53 +0000
commitd8f04423aa0185697ac4ab7b182532f8f02b5de7 (patch)
treec8c61056a4f445fdc9afc57f108313b3581e6dca /mdoc_argv.c
parentd6a01dde28af9c768a8898988b670a59be49563a (diff)
downloadmandoc-d8f04423aa0185697ac4ab7b182532f8f02b5de7.tar.gz
Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" values).
Initial check-in of Ingo Schwarze's patch for Xo/Xc handling (in blocks ifdef'd "UGLY"). Put Oc-close-Op parts into UGLY ifdef blocks.
Diffstat (limited to 'mdoc_argv.c')
-rw-r--r--mdoc_argv.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index 9ad6a00a..b61c8b9a 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -44,7 +44,7 @@
#define MULTI_STEP 5
-static int argv_a2arg(int, const char *);
+static int argv_a2arg(enum mdoct, const char *);
static int args(struct mdoc *, int, int *,
char *, int, char **);
static int argv(struct mdoc *, int,
@@ -218,7 +218,7 @@ static int mdoc_argflags[MDOC_MAX] = {
* one mandatory value, an optional single value, or no value.
*/
int
-mdoc_argv(struct mdoc *m, int line, int tok,
+mdoc_argv(struct mdoc *m, int line, enum mdoct tok,
struct mdoc_arg **v, int *pos, char *buf)
{
char *p, sv;
@@ -330,13 +330,14 @@ mdoc_zargs(struct mdoc *m, int line, int *pos,
int
-mdoc_args(struct mdoc *m, int line,
- int *pos, char *buf, int tok, char **v)
+mdoc_args(struct mdoc *m, int line, int *pos,
+ char *buf, enum mdoct tok, char **v)
{
int fl, c, i;
struct mdoc_node *n;
- fl = (0 == tok) ? 0 : mdoc_argflags[tok];
+ assert(tok && tok < MDOC_MAX);
+ fl = mdoc_argflags[tok];
if (MDOC_It != tok)
return(args(m, line, pos, buf, fl, v));
@@ -552,7 +553,7 @@ args(struct mdoc *m, int line, int *pos,
static int
-argv_a2arg(int tok, const char *p)
+argv_a2arg(enum mdoct tok, const char *p)
{
/*