[BACK]Return to man_action.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/man_action.c, Revision 1.43

1.43    ! kristaps    1: /*     $Id: man_action.c,v 1.42 2010/10/11 15:45:36 kristaps Exp $ */
1.1       kristaps    2: /*
1.41      schwarze    3:  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
1.1       kristaps    4:  *
                      5:  * Permission to use, copy, modify, and distribute this software for any
1.10      kristaps    6:  * purpose with or without fee is hereby granted, provided that the above
                      7:  * copyright notice and this permission notice appear in all copies.
1.1       kristaps    8:  *
1.10      kristaps    9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       kristaps   16:  */
1.25      kristaps   17: #ifdef HAVE_CONFIG_H
                     18: #include "config.h"
                     19: #endif
1.1       kristaps   20:
                     21: #include <assert.h>
                     22: #include <stdlib.h>
                     23: #include <string.h>
1.42      kristaps   24: #include <time.h>
1.1       kristaps   25:
1.36      kristaps   26: #include "mandoc.h"
1.1       kristaps   27: #include "libman.h"
1.22      kristaps   28: #include "libmandoc.h"
1.1       kristaps   29:
                     30: struct actions {
                     31:        int     (*post)(struct man *);
                     32: };
                     33:
                     34: const  struct actions man_actions[MAN_MAX] = {
1.12      kristaps   35:        { NULL }, /* br */
1.43    ! kristaps   36:        { NULL }, /* TH */
1.1       kristaps   37:        { NULL }, /* SH */
                     38:        { NULL }, /* SS */
                     39:        { NULL }, /* TP */
                     40:        { NULL }, /* LP */
                     41:        { NULL }, /* PP */
                     42:        { NULL }, /* P */
                     43:        { NULL }, /* IP */
                     44:        { NULL }, /* HP */
                     45:        { NULL }, /* SM */
                     46:        { NULL }, /* SB */
                     47:        { NULL }, /* BI */
                     48:        { NULL }, /* IB */
                     49:        { NULL }, /* BR */
                     50:        { NULL }, /* RB */
                     51:        { NULL }, /* R */
                     52:        { NULL }, /* B */
                     53:        { NULL }, /* I */
                     54:        { NULL }, /* IR */
1.5       kristaps   55:        { NULL }, /* RI */
1.8       kristaps   56:        { NULL }, /* na */
1.9       kristaps   57:        { NULL }, /* i */
1.14      kristaps   58:        { NULL }, /* sp */
1.43    ! kristaps   59:        { NULL }, /* nf */
        !            60:        { NULL }, /* fi */
1.16      kristaps   61:        { NULL }, /* r */
                     62:        { NULL }, /* RE */
                     63:        { NULL }, /* RS */
1.17      kristaps   64:        { NULL }, /* DT */
1.43    ! kristaps   65:        { NULL }, /* UC */
1.20      kristaps   66:        { NULL }, /* PD */
1.27      kristaps   67:        { NULL }, /* Sp */
1.43    ! kristaps   68:        { NULL }, /* Vb */
        !            69:        { NULL }, /* Ve */
        !            70:        { NULL }, /* AT */
1.40      kristaps   71:        { NULL }, /* in */
1.1       kristaps   72: };
                     73:
                     74:
                     75: int
                     76: man_action_post(struct man *m)
                     77: {
                     78:
                     79:        if (MAN_ACTED & m->last->flags)
                     80:                return(1);
                     81:        m->last->flags |= MAN_ACTED;
                     82:
                     83:        switch (m->last->type) {
                     84:        case (MAN_TEXT):
1.18      kristaps   85:                /* FALLTHROUGH */
1.1       kristaps   86:        case (MAN_ROOT):
1.18      kristaps   87:                return(1);
                     88:        default:
1.1       kristaps   89:                break;
                     90:        }
1.18      kristaps   91:
                     92:        if (NULL == man_actions[m->last->tok].post)
                     93:                return(1);
                     94:        return((*man_actions[m->last->tok].post)(m));
                     95: }
                     96:
                     97:
1.35      joerg      98:
                     99:

CVSweb