Annotation of mandoc/libroff.h, Revision 1.18
1.18 ! kristaps 1: /* $Id: libroff.h,v 1.17 2011/01/25 12:24:27 schwarze Exp $ */
1.1 kristaps 2: /*
1.17 schwarze 3: * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
1.1 kristaps 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_part {
23: TBL_PART_OPTS, /* in options (first line) */
24: TBL_PART_LAYOUT, /* describing layout */
1.16 kristaps 25: TBL_PART_DATA, /* creating data rows */
26: TBL_PART_CDATA /* continue previous row */
1.2 kristaps 27: };
28:
1.15 kristaps 29: struct tbl_node {
1.5 kristaps 30: mandocmsg msg; /* status messages */
31: void *data; /* privdata for messages */
1.12 kristaps 32: int pos; /* invocation column */
33: int line; /* invocation line */
1.15 kristaps 34: enum tbl_part part;
35: struct tbl opts;
1.8 kristaps 36: struct tbl_row *first_row;
37: struct tbl_row *last_row;
38: struct tbl_span *first_span;
1.17 schwarze 39: struct tbl_span *current_span;
1.8 kristaps 40: struct tbl_span *last_span;
1.14 kristaps 41: struct tbl_head *first_head;
42: struct tbl_head *last_head;
1.15 kristaps 43: struct tbl_node *next;
1.2 kristaps 44: };
1.1 kristaps 45:
1.18 ! kristaps 46: struct eqn_node {
! 47: int pos; /* invocation column */
! 48: int line; /* invocation line */
! 49: struct eqn eqn;
! 50: struct eqn_node *next;
! 51: };
! 52:
1.3 kristaps 53: #define TBL_MSG(tblp, type, line, col) \
54: (*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
55:
1.15 kristaps 56: struct tbl_node *tbl_alloc(int, int, void *, mandocmsg);
57: void tbl_restart(int, int, struct tbl_node *);
58: void tbl_free(struct tbl_node *);
59: void tbl_reset(struct tbl_node *);
60: enum rofferr tbl_read(struct tbl_node *, int, const char *, int);
61: int tbl_option(struct tbl_node *, int, const char *);
62: int tbl_layout(struct tbl_node *, int, const char *);
63: int tbl_data(struct tbl_node *, int, const char *);
1.16 kristaps 64: int tbl_cdata(struct tbl_node *, int, const char *);
1.17 schwarze 65: const struct tbl_span *tbl_span(struct tbl_node *);
1.15 kristaps 66: void tbl_end(struct tbl_node *);
1.18 ! kristaps 67: struct eqn_node *eqn_alloc(int, int);
! 68: void eqn_end(struct eqn_node *);
! 69: void eqn_free(struct eqn_node *);
! 70: enum rofferr eqn_read(struct eqn_node **, int, const char *, int);
1.1 kristaps 71:
72: __END_DECLS
73:
74: #endif /*LIBROFF_H*/
CVSweb