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

Annotation of mandoc/man.h, Revision 1.2

1.2     ! kristaps    1: /* $Id: man.h,v 1.1 2009/03/23 14:22:11 kristaps Exp $ */
1.1       kristaps    2: /*
                      3:  * Copyright (c) 2009 Kristaps Dzonsons <kristaps@openbsd.org>
                      4:  *
                      5:  * Permission to use, copy, modify, and distribute this software for any
                      6:  * purpose with or without fee is hereby granted, provided that the
                      7:  * above copyright notice and this permission notice appear in all
                      8:  * copies.
                      9:  *
                     10:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
                     11:  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
                     12:  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
                     13:  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
                     14:  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
                     15:  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
                     16:  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
                     17:  * PERFORMANCE OF THIS SOFTWARE.
                     18:  */
                     19: #ifndef MAN_H
                     20: #define MAN_H
                     21:
                     22: #include <time.h>
                     23:
                     24: #define        MAN___           0
                     25: #define        MAN_TH           1
                     26: #define        MAN_SH           2
                     27: #define        MAN_SS           3
                     28: #define        MAN_TP           4
                     29: #define        MAN_LP           5
                     30: #define        MAN_PP           6
                     31: #define        MAN_P            7
                     32: #define        MAN_IP           8
                     33: #define        MAN_HP           9
                     34: #define        MAN_SM           10
                     35: #define        MAN_SB           11
                     36: #define        MAN_BI           12
                     37: #define        MAN_IB           13
                     38: #define        MAN_BR           14
                     39: #define        MAN_RB           15
                     40: #define        MAN_R            16
                     41: #define        MAN_B            17
                     42: #define        MAN_I            18
1.2     ! kristaps   43: #define        MAN_IR           19
        !            44: #define        MAN_MAX          20
1.1       kristaps   45:
                     46: enum   man_type {
                     47:        MAN_TEXT,
                     48:        MAN_ELEM,
                     49:        MAN_ROOT
                     50: };
                     51:
                     52: struct man_meta {
                     53:        int              msec;
                     54:        char            *vol;
                     55:        time_t           date;
                     56:        char            *title;
                     57:        char            *os;
                     58: };
                     59:
                     60: struct man_node {
                     61:        struct man_node *parent;
                     62:        struct man_node *child;
                     63:        struct man_node *next;
                     64:        struct man_node *prev;
                     65:        int              line;
                     66:        int              pos;
                     67:        int              tok;
                     68:        int              flags;
                     69: #define        MAN_VALID       (1 << 0)
                     70: #define        MAN_ACTED       (1 << 1)
                     71:        enum man_type    type;
                     72:        char            *string;
                     73: };
                     74:
                     75: extern const char *const *man_macronames;
                     76:
                     77: __BEGIN_DECLS
                     78:
                     79: struct man;
                     80:
                     81: void             man_free(struct man *);
                     82: struct man      *man_alloc(void);
                     83: void             man_reset(struct man *);
                     84: int              man_parseln(struct man *, int, char *buf);
                     85: int              man_endparse(struct man *);
                     86:
                     87: const struct man_node *man_node(const struct man *);
                     88: const struct man_meta *man_meta(const struct man *);
                     89:
                     90: __END_DECLS
                     91:
                     92: #endif /*!MAN_H*/

CVSweb