Annotation of mandoc/man.h, Revision 1.1
1.1 ! kristaps 1: /* $Id: mdoc.h,v 1.52 2009/03/21 13:09:29 kristaps Exp $ */
! 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
! 43: #define MAN_MAX 19
! 44:
! 45: enum man_type {
! 46: MAN_TEXT,
! 47: MAN_ELEM,
! 48: MAN_HEAD,
! 49: MAN_BODY,
! 50: MAN_BLOCK,
! 51: MAN_ROOT
! 52: };
! 53:
! 54: struct man_meta {
! 55: int msec;
! 56: char *vol;
! 57: time_t date;
! 58: char *title;
! 59: char *os;
! 60: };
! 61:
! 62: struct man_node {
! 63: struct man_node *parent;
! 64: struct man_node *child;
! 65: struct man_node *next;
! 66: struct man_node *prev;
! 67: int line;
! 68: int pos;
! 69: int tok;
! 70: int flags;
! 71: #define MAN_VALID (1 << 0)
! 72: #define MAN_ACTED (1 << 1)
! 73: enum man_type type;
! 74:
! 75: struct man_node *head;
! 76: struct man_node *body;
! 77: char *string;
! 78: };
! 79:
! 80: extern const char *const *man_macronames;
! 81:
! 82: __BEGIN_DECLS
! 83:
! 84: struct man;
! 85:
! 86: void man_free(struct man *);
! 87: struct man *man_alloc(void);
! 88: void man_reset(struct man *);
! 89: int man_parseln(struct man *, int, char *buf);
! 90: int man_endparse(struct man *);
! 91:
! 92: const struct man_node *man_node(const struct man *);
! 93: const struct man_meta *man_meta(const struct man *);
! 94:
! 95: __END_DECLS
! 96:
! 97: #endif /*!MAN_H*/
CVSweb