diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | libman.h | 2 | ||||
-rw-r--r-- | man.c | 2 | ||||
-rw-r--r-- | man_action.c | 99 | ||||
-rw-r--r-- | man_macro.c | 8 |
5 files changed, 3 insertions, 114 deletions
@@ -55,12 +55,12 @@ MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \ arch.c vol.c msec.c st.c MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \ - man_action.ln man_argv.ln + man_argv.ln MANOBJS = man_macro.o man.o man_hash.o man_validate.o \ - man_action.o man_argv.o + man_argv.o MANSRCS = man_macro.c man.c man_hash.c man_validate.c \ - man_action.c man_argv.c + man_argv.c MAINLNS = main.ln mdoc_term.ln chars.ln term.ln tree.ln \ compat.ln man_term.ln html.ln mdoc_html.ln \ @@ -84,8 +84,6 @@ int man_vmsg(struct man *, enum mandocerr, int, int, const char *, ...); int man_valid_post(struct man *); int man_valid_pre(struct man *, struct man_node *); -int man_action_post(struct man *); -int man_action_pre(struct man *, struct man_node *); int man_unscope(struct man *, const struct man_node *, enum mandocerr); @@ -216,8 +216,6 @@ man_node_append(struct man *man, struct man_node *p) case (MAN_TEXT): if ( ! man_valid_post(man)) return(0); - if ( ! man_action_post(man)) - return(0); break; default: break; diff --git a/man_action.c b/man_action.c deleted file mode 100644 index 2868bf89..00000000 --- a/man_action.c +++ /dev/null @@ -1,99 +0,0 @@ -/* $Id$ */ -/* - * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#include "mandoc.h" -#include "libman.h" -#include "libmandoc.h" - -struct actions { - int (*post)(struct man *); -}; - -const struct actions man_actions[MAN_MAX] = { - { NULL }, /* br */ - { NULL }, /* TH */ - { NULL }, /* SH */ - { NULL }, /* SS */ - { NULL }, /* TP */ - { NULL }, /* LP */ - { NULL }, /* PP */ - { NULL }, /* P */ - { NULL }, /* IP */ - { NULL }, /* HP */ - { NULL }, /* SM */ - { NULL }, /* SB */ - { NULL }, /* BI */ - { NULL }, /* IB */ - { NULL }, /* BR */ - { NULL }, /* RB */ - { NULL }, /* R */ - { NULL }, /* B */ - { NULL }, /* I */ - { NULL }, /* IR */ - { NULL }, /* RI */ - { NULL }, /* na */ - { NULL }, /* i */ - { NULL }, /* sp */ - { NULL }, /* nf */ - { NULL }, /* fi */ - { NULL }, /* r */ - { NULL }, /* RE */ - { NULL }, /* RS */ - { NULL }, /* DT */ - { NULL }, /* UC */ - { NULL }, /* PD */ - { NULL }, /* Sp */ - { NULL }, /* Vb */ - { NULL }, /* Ve */ - { NULL }, /* AT */ - { NULL }, /* in */ -}; - - -int -man_action_post(struct man *m) -{ - - if (MAN_ACTED & m->last->flags) - return(1); - m->last->flags |= MAN_ACTED; - - switch (m->last->type) { - case (MAN_TEXT): - /* FALLTHROUGH */ - case (MAN_ROOT): - return(1); - default: - break; - } - - if (NULL == man_actions[m->last->tok].post) - return(1); - return((*man_actions[m->last->tok].post)(m)); -} - - - - diff --git a/man_macro.c b/man_macro.c index cec6ca43..2b8bbad4 100644 --- a/man_macro.c +++ b/man_macro.c @@ -123,8 +123,6 @@ man_unscope(struct man *m, const struct man_node *n, return(0); if ( ! man_valid_post(m)) return(0); - if ( ! man_action_post(m)) - return(0); m->last = m->last->parent; assert(m->last); } @@ -133,8 +131,6 @@ man_unscope(struct man *m, const struct man_node *n, return(0); if ( ! man_valid_post(m)) return(0); - if ( ! man_action_post(m)) - return(0); m->next = MAN_ROOT == m->last->type ? MAN_NEXT_CHILD : MAN_NEXT_SIBLING; @@ -458,8 +454,6 @@ in_line_eoln(MACRO_PROT_ARGS) break; if ( ! man_valid_post(m)) return(0); - if ( ! man_action_post(m)) - return(0); } assert(m->last); @@ -470,8 +464,6 @@ in_line_eoln(MACRO_PROT_ARGS) if (m->last->type != MAN_ROOT && ! man_valid_post(m)) return(0); - if (m->last->type != MAN_ROOT && ! man_action_post(m)) - return(0); m->next = MAN_ROOT == m->last->type ? MAN_NEXT_CHILD : MAN_NEXT_SIBLING; |