=================================================================== RCS file: /cvs/mandoc/man_macro.c,v retrieving revision 1.31 retrieving revision 1.34 diff -u -p -r1.31 -r1.34 --- mandoc/man_macro.c 2010/03/22 05:59:32 1.31 +++ mandoc/man_macro.c 2010/03/24 03:46:02 1.34 @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.31 2010/03/22 05:59:32 kristaps Exp $ */ +/* $Id: man_macro.c,v 1.34 2010/03/24 03:46:02 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -25,18 +25,21 @@ #include "libman.h" -#define REW_REWIND (0) /* See rew_scope(). */ -#define REW_NOHALT (1) /* See rew_scope(). */ -#define REW_HALT (2) /* See rew_scope(). */ +enum rew { + REW_REWIND, + REW_NOHALT, + REW_HALT, +}; static int in_line_eoln(MACRO_PROT_ARGS); static int blk_imp(MACRO_PROT_ARGS); static int blk_close(MACRO_PROT_ARGS); -static int rew_scope(enum man_type, struct man *, int); -static int rew_dohalt(int, enum man_type, +static int rew_scope(enum man_type, + struct man *, enum mant); +static enum rew rew_dohalt(enum mant, enum man_type, const struct man_node *); -static int rew_block(int, enum man_type, +static enum rew rew_block(enum mant, enum man_type, const struct man_node *); const struct man_macro __man_macros[MAN_MAX] = { @@ -72,6 +75,9 @@ const struct man_macro __man_macros[MAN_MAX] = { { in_line_eoln, 0 }, /* DT */ { in_line_eoln, 0 }, /* UC */ { in_line_eoln, 0 }, /* PD */ + { in_line_eoln, MAN_NSCOPED }, /* Sp */ + { in_line_eoln, 0 }, /* Vb */ + { in_line_eoln, 0 }, /* Ve */ }; const struct man_macro * const man_macros = __man_macros; @@ -100,8 +106,8 @@ man_unscope(struct man *m, const struct man_node *n) } -static int -rew_block(int ntok, enum man_type type, const struct man_node *n) +static enum rew +rew_block(enum mant ntok, enum man_type type, const struct man_node *n) { if (MAN_BLOCK == type && ntok == n->parent->tok && @@ -116,10 +122,10 @@ rew_block(int ntok, enum man_type type, const struct m * section (all less sections), and scoped to subsections (all less * sections and subsections). */ -static int -rew_dohalt(int tok, enum man_type type, const struct man_node *n) +static enum rew +rew_dohalt(enum mant tok, enum man_type type, const struct man_node *n) { - int c; + enum rew c; if (MAN_ROOT == n->type) return(REW_HALT); @@ -172,10 +178,10 @@ rew_dohalt(int tok, enum man_type type, const struct m * scopes. When a scope is closed, it must be validated and actioned. */ static int -rew_scope(enum man_type type, struct man *m, int tok) +rew_scope(enum man_type type, struct man *m, enum mant tok) { struct man_node *n; - int c; + enum rew c; /* LINTED */ for (n = m->last; n; n = n->parent) { @@ -202,7 +208,7 @@ rew_scope(enum man_type type, struct man *m, int tok) int blk_close(MACRO_PROT_ARGS) { - int ntok; + enum mant ntok; const struct man_node *nn; switch (tok) { @@ -315,7 +321,6 @@ in_line_eoln(MACRO_PROT_ARGS) return(0); if (0 == w) break; - if ( ! man_word_alloc(m, line, la, p)) return(0); }