]>
git.cameronkatri.com Git - mandoc.git/blob - libroff.h
1 /* $Id: libroff.h,v 1.15 2011/01/02 10:10:57 kristaps Exp $ */
3 * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
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.
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.
23 TBL_PART_OPTS
, /* in options (first line) */
24 TBL_PART_LAYOUT
, /* describing layout */
25 TBL_PART_DATA
/* creating data rows */
29 mandocmsg msg
; /* status messages */
30 void *data
; /* privdata for messages */
31 int pos
; /* invocation column */
32 int line
; /* invocation line */
35 struct tbl_row
*first_row
;
36 struct tbl_row
*last_row
;
37 struct tbl_span
*first_span
;
38 struct tbl_span
*last_span
;
39 struct tbl_head
*first_head
;
40 struct tbl_head
*last_head
;
41 struct tbl_node
*next
;
44 #define TBL_MSG(tblp, type, line, col) \
45 (*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
47 struct tbl_node
*tbl_alloc(int, int, void *, mandocmsg
);
48 void tbl_restart(int, int, struct tbl_node
*);
49 void tbl_free(struct tbl_node
*);
50 void tbl_reset(struct tbl_node
*);
51 enum rofferr
tbl_read(struct tbl_node
*, int, const char *, int);
52 int tbl_option(struct tbl_node
*, int, const char *);
53 int tbl_layout(struct tbl_node
*, int, const char *);
54 int tbl_data(struct tbl_node
*, int, const char *);
55 const struct tbl_span
*tbl_span(const struct tbl_node
*);
56 void tbl_end(struct tbl_node
*);