]>
git.cameronkatri.com Git - mandoc.git/blob - mdoc.h
1 /* $Id: mdoc.h,v 1.20 2009/01/12 12:52:21 kristaps Exp $ */
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
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
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.
22 #define MDOC_LINEARG_MAX 12
133 #define MDOC_Nosplit 1
134 #define MDOC_Ragged 2
135 #define MDOC_Unfilled 3
136 #define MDOC_Literal 4
138 #define MDOC_Offset 6
139 #define MDOC_Bullet 7
141 #define MDOC_Hyphen 9
147 #define MDOC_Ohang 15
148 #define MDOC_Inset 16
149 #define MDOC_Column 17
150 #define MDOC_Width 18
151 #define MDOC_Compact 19
153 #define MDOC_p1003_1_88 21
154 #define MDOC_p1003_1_90 22
155 #define MDOC_p1003_1_96 23
156 #define MDOC_p1003_1_2001 24
157 #define MDOC_p1003_1_2004 25
158 #define MDOC_p1003_1 26
159 #define MDOC_p1003_1b 27
160 #define MDOC_p1003_1b_93 28
161 #define MDOC_p1003_1c_95 29
162 #define MDOC_p1003_1g_2000 30
163 #define MDOC_p1003_2_92 31
164 #define MDOC_p1387_2_95 32
165 #define MDOC_p1003_2 33
166 #define MDOC_p1387_2 34
167 #define MDOC_isoC_90 35
168 #define MDOC_isoC_amd1 36
169 #define MDOC_isoC_tcor1 37
170 #define MDOC_isoC_tcor2 38
171 #define MDOC_isoC_99 39
172 #define MDOC_ansiC 40
173 #define MDOC_ansiC_89 41
174 #define MDOC_ansiC_99 42
175 #define MDOC_ieee754 43
176 #define MDOC_iso8802_3 44
179 #define MDOC_xpg4_2 47
180 #define MDOC_xpg4_3 48
185 #define MDOC_xns5_2d2_0 53
186 #define MDOC_xcurses4_2 54
187 #define MDOC_susv2 55
188 #define MDOC_susv3 56
189 #define MDOC_svid4 57
190 #define MDOC_Filled 58
191 #define MDOC_Words 59
192 #define MDOC_Emphasis 60
193 #define MDOC_Symbolic 61
194 #define MDOC_ARG_MAX 62
197 ERR_SYNTAX_QUOTE
, /* NOTUSED */
215 ERR_SEC_PROLOGUE_REP
,
224 ERR_SYNTAX_PARENTBAD
,
225 ERR_SYNTAX_CHILDHEAD
,
226 ERR_SYNTAX_CHILDBODY
,
227 ERR_SYNTAX_EMPTYBODY
,
228 ERR_SYNTAX_EMPTYHEAD
,
253 WARN_SYNTAX_EMPTYHEAD
,
254 WARN_SYNTAX_EMPTYBODY
,
374 #define META_TITLE_SZ (64)
375 char title
[META_TITLE_SZ
];
376 #define META_OS_SZ (64)
386 struct mdoc_arg
*argv
;
387 struct mdoc_node
*head
;
388 struct mdoc_node
*body
;
389 struct mdoc_node
*tail
;
396 struct mdoc_arg
*argv
;
400 struct mdoc_text text
;
401 struct mdoc_elem elem
;
402 struct mdoc_block block
;
406 struct mdoc_node
*parent
;
407 struct mdoc_node
*child
;
408 struct mdoc_node
*next
;
409 struct mdoc_node
*prev
;
414 union mdoc_data data
;
418 int (*mdoc_err
)(void *, int, int, enum mdoc_err
);
419 int (*mdoc_warn
)(void *, int, int, enum mdoc_warn
);
420 void (*mdoc_msg
)(void *, int, int, const char *);
423 extern const char *const *mdoc_macronames
;
424 extern const char *const *mdoc_argnames
;
430 void mdoc_free(struct mdoc
*);
431 struct mdoc
*mdoc_alloc(void *data
, const struct mdoc_cb
*);
432 int mdoc_parseln(struct mdoc
*, int, char *buf
);
433 const struct mdoc_node
434 *mdoc_result(struct mdoc
*);
435 int mdoc_endparse(struct mdoc
*);