Annotation of mandoc/libroff.h, Revision 1.2
1.2 ! kristaps 1: /* $Id: libroff.h,v 1.1 2010/12/28 10:51:03 kristaps Exp $ */
1.1 kristaps 2: /*
3: * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
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 above
7: * copyright notice and this permission notice appear in all copies.
8: *
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.
16: */
17: #ifndef LIBROFF_H
18: #define LIBROFF_H
19:
20: __BEGIN_DECLS
21:
1.2 ! kristaps 22: enum tbl_tok {
! 23: TBL_TOK_OPENPAREN = 0,
! 24: TBL_TOK_CLOSEPAREN,
! 25: TBL_TOK_COMMA,
! 26: TBL_TOK_SEMICOLON,
! 27: TBL_TOK_PERIOD,
! 28: TBL_TOK_SPACE,
! 29: TBL_TOK_TAB,
! 30: TBL_TOK_NIL,
! 31: TBL_TOK__MAX
! 32: };
! 33:
! 34: enum tbl_part {
! 35: TBL_PART_OPTS, /* in options (first line) */
! 36: TBL_PART_LAYOUT, /* describing layout */
! 37: TBL_PART_DATA /* creating data rows */
! 38: };
! 39:
! 40: struct tbl {
! 41: enum tbl_part part;
! 42: char buf[BUFSIZ];
! 43: char tab; /* cell-separator */
! 44: char decimal; /* decimal point */
! 45: int linesize;
! 46: char delims[2];
! 47: int opts;
! 48: #define TBL_OPT_CENTRE (1 << 0)
! 49: #define TBL_OPT_EXPAND (1 << 1)
! 50: #define TBL_OPT_BOX (1 << 2)
! 51: #define TBL_OPT_DBOX (1 << 3)
! 52: #define TBL_OPT_ALLBOX (1 << 4)
! 53: #define TBL_OPT_NOKEEP (1 << 5)
! 54: #define TBL_OPT_NOSPACE (1 << 6)
! 55: };
1.1 kristaps 56:
57: struct tbl *tbl_alloc(void);
58: void tbl_free(struct tbl *);
59: void tbl_reset(struct tbl *);
60: enum rofferr tbl_read(struct tbl *, int, const char *, int);
1.2 ! kristaps 61: enum tbl_tok tbl_next(struct tbl *, const char *, int *);
1.1 kristaps 62:
63: __END_DECLS
64:
65: #endif /*LIBROFF_H*/
CVSweb