]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
1 /* $Id: private.h,v 1.35 2008/12/09 17:09:12 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.
25 #include "libmdocml.h"
28 int fd
; /* Open descriptor. */
29 char *name
; /* Name of file. */
30 char *buf
; /* Buffer. */
31 size_t bufsz
; /* Size of buffer. */
32 size_t line
; /* Current line number. */
33 #define MD_LINE (BUFSIZ)
34 char linebuf
[MD_LINE
];
38 int fd
; /* Open descriptor. */
39 char *name
; /* Name of file. */
40 char *buf
; /* Buffer. */
41 size_t bufsz
; /* Size of buffer. */
42 size_t pos
; /* Position in buffer. */
45 #define ROFFTok_Sp_A 0
46 #define ROFFTok_Sp_B 1
47 #define ROFFTok_Sp_F 2
48 #define ROFFTok_Sp_N 3
49 #define ROFFTok_Sp_R 4
50 #define ROFFTok_Sp_T 5
51 #define ROFFTok_Sp_V 6
52 #define ROFFTok_Space 7
53 #define ROFFTok_Null 8
54 #define ROFFTok_Hyphen 9
59 #define ROFFTok_Rquote 14
60 #define ROFFTok_Lquote 15
61 #define ROFFTok_Uparrow 16
62 #define ROFFTok_Acute 17
63 #define ROFFTok_Grave 18
68 #define ROFFTok_Plusmin 23
69 #define ROFFTok_Infty 24
70 #define ROFFTok_Bar 25
71 #define ROFFTok_Nan 26
72 #define ROFFTok_Quote 27
73 #define ROFFTok_Sp_0 28
74 #define ROFFTok_Slash 29
75 #define ROFFTok_MAX 30
186 #define ROFF_Nosplit 1
187 #define ROFF_Ragged 2
188 #define ROFF_Unfilled 3
189 #define ROFF_Literal 4
191 #define ROFF_Offset 6
192 #define ROFF_Bullet 7
194 #define ROFF_Hyphen 9
200 #define ROFF_Ohang 15
201 #define ROFF_Inset 16
202 #define ROFF_Column 17
203 #define ROFF_Width 18
204 #define ROFF_Compact 19
206 #define ROFF_p1003_1_88 21
207 #define ROFF_p1003_1_90 22
208 #define ROFF_p1003_1_96 23
209 #define ROFF_p1003_1_2001 24
210 #define ROFF_p1003_1_2004 25
211 #define ROFF_p1003_1 26
212 #define ROFF_p1003_1b 27
213 #define ROFF_p1003_1b_93 28
214 #define ROFF_p1003_1c_95 29
215 #define ROFF_p1003_1g_2000 30
216 #define ROFF_p1003_2_92 31
217 #define ROFF_p1387_2_95 32
218 #define ROFF_p1003_2 33
219 #define ROFF_p1387_2 34
220 #define ROFF_isoC_90 35
221 #define ROFF_isoC_amd1 36
222 #define ROFF_isoC_tcor1 37
223 #define ROFF_isoC_tcor2 38
224 #define ROFF_isoC_99 39
225 #define ROFF_ansiC 40
226 #define ROFF_ansiC_89 41
227 #define ROFF_ansiC_99 42
228 #define ROFF_ieee754 43
229 #define ROFF_iso8802_3 44
232 #define ROFF_xpg4_2 47
233 #define ROFF_xpg4_3 48
238 #define ROFF_xns5_2d2_0 53
239 #define ROFF_xcurses4_2 54
240 #define ROFF_susv2 55
241 #define ROFF_susv3 56
242 #define ROFF_svid4 57
243 #define ROFF_Filled 58
244 #define ROFF_Words 59
245 #define ROFF_ARGMAX 60
247 #define ROFF_MAXLINEARG 32
249 extern const char *const *toknames
;
250 extern const char *const *tokargnames
;
286 #define ROFFSec_NMASK (0x07)
288 #define ROFFSec_NAME (1 << 0)
289 #define ROFFSec_SYNOP (1 << 1)
290 #define ROFFSec_DESC (1 << 2)
291 #define ROFFSec_RETVAL (1 << 3)
292 #define ROFFSec_ENV (1 << 4)
293 #define ROFFSec_FILES (1 << 5)
294 #define ROFFSec_EX (1 << 6)
295 #define ROFFSec_DIAG (1 << 7)
296 #define ROFFSec_ERRS (1 << 8)
297 #define ROFFSec_SEEALSO (1 << 9)
298 #define ROFFSec_STAND (1 << 10)
299 #define ROFFSec_HIST (1 << 11)
300 #define ROFFSec_AUTH (1 << 12)
301 #define ROFFSec_CAVEATS (1 << 13)
302 #define ROFFSec_BUGS (1 << 14)
303 #define ROFFSec_OTHER (1 << 15)
306 int (*roffmsg
)(void *, enum roffmsg
,
307 const char *, const char *, const char *);
308 int (*roffhead
)(void *, const struct tm
*, const char *,
309 const char *, enum roffmsec
, const char *);
310 int (*rofftail
)(void *);
311 int (*roffdata
)(void *, int, const char *, const char *);
312 int (*roffin
)(void *, int, int *, const char **);
313 int (*roffout
)(void *, int);
314 int (*roffblkin
)(void *, int, int *, const char **);
315 int (*roffblkout
)(void *, int);
316 int (*roffblkheadin
)(void *, int, int *, const char **);
317 int (*roffblkheadout
)(void *, int);
318 int (*roffblkbodyin
)(void *, int, int *, const char **);
319 int (*roffblkbodyout
)(void *, int);
320 int (*roffspecial
)(void *, int, const char *,
321 const int *, const char **, const char **);
328 typedef void (*(*md_init
)(const struct md_args
*,
329 struct md_mbuf
*, const struct md_rbuf
*));
330 typedef int (*md_line
)(void *, char *);
331 typedef int (*md_exit
)(void *, int);
333 void *md_init_html(const struct md_args
*,
334 struct md_mbuf
*, const struct md_rbuf
*);
335 int md_line_html(void *, char *);
336 int md_exit_html(void *, int);
338 void *md_init_xml(const struct md_args
*,
339 struct md_mbuf
*, const struct md_rbuf
*);
340 int md_line_xml(void *, char *);
341 int md_exit_xml(void *, int);
343 int md_buf_puts(struct md_mbuf
*, const char *, size_t);
344 int md_buf_putchar(struct md_mbuf
*, char);
345 int md_buf_putstring(struct md_mbuf
*, const char *);
347 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
348 int roff_engine(struct rofftree
*, char *);
349 int roff_free(struct rofftree
*, int);
351 int rofftok_scan(const char *, int *);
353 char *roff_literal(int, const int *,
354 const char **, const char **);
355 char *roff_fmtstring(int);
356 char *roff_msecname(enum roffmsec
);
357 enum roffmsec
roff_msec(const char *);
358 int roff_sec(const char **);
359 enum roffatt
roff_att(const char *);
363 #endif /*!PRIVATE_H*/