]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
1 /* $Id: private.h,v 1.30 2008/12/04 23:10:51 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 int fd
; /* Open descriptor. */
26 char *name
; /* Name of file. */
27 char *buf
; /* Buffer. */
28 size_t bufsz
; /* Size of buffer. */
29 size_t line
; /* Current line number. */
33 int fd
; /* Open descriptor. */
34 char *name
; /* Name of file. */
35 char *buf
; /* Buffer. */
36 size_t bufsz
; /* Size of buffer. */
37 size_t pos
; /* Position in buffer. */
40 #define ROFFTok_Sp_A 0
41 #define ROFFTok_Sp_B 1
42 #define ROFFTok_Sp_F 2
43 #define ROFFTok_Sp_N 3
44 #define ROFFTok_Sp_R 4
45 #define ROFFTok_Sp_T 5
46 #define ROFFTok_Sp_V 6
47 #define ROFFTok_Space 7
48 #define ROFFTok_Null 8
49 #define ROFFTok_Hyphen 9
54 #define ROFFTok_Rquote 14
55 #define ROFFTok_Lquote 15
56 #define ROFFTok_Uparrow 16
57 #define ROFFTok_Acute 17
58 #define ROFFTok_Grave 18
63 #define ROFFTok_Plusmin 23
64 #define ROFFTok_Infty 24
65 #define ROFFTok_Bar 25
66 #define ROFFTok_Nan 26
67 #define ROFFTok_Quote 27
68 #define ROFFTok_Sp_0 28
69 #define ROFFTok_Slash 29
70 #define ROFFTok_MAX 30
181 #define ROFF_Nosplit 1
182 #define ROFF_Ragged 2
183 #define ROFF_Unfilled 3
184 #define ROFF_Literal 4
186 #define ROFF_Offset 6
187 #define ROFF_Bullet 7
189 #define ROFF_Hyphen 9
195 #define ROFF_Ohang 15
196 #define ROFF_Inset 16
197 #define ROFF_Column 17
198 #define ROFF_Width 18
199 #define ROFF_Compact 19
201 #define ROFF_p1003_1_88 21
202 #define ROFF_p1003_1_90 22
203 #define ROFF_p1003_1_96 23
204 #define ROFF_p1003_1_2001 24
205 #define ROFF_p1003_1_2004 25
206 #define ROFF_p1003_1 26
207 #define ROFF_p1003_1b 27
208 #define ROFF_p1003_1b_93 28
209 #define ROFF_p1003_1c_95 29
210 #define ROFF_p1003_1g_2000 30
211 #define ROFF_p1003_2_92 31
212 #define ROFF_p1387_2_95 32
213 #define ROFF_p1003_2 33
214 #define ROFF_p1387_2 34
215 #define ROFF_isoC_90 35
216 #define ROFF_isoC_amd1 36
217 #define ROFF_isoC_tcor1 37
218 #define ROFF_isoC_tcor2 38
219 #define ROFF_isoC_99 39
220 #define ROFF_ansiC 40
221 #define ROFF_ansiC_89 41
222 #define ROFF_ansiC_99 42
223 #define ROFF_ieee754 43
224 #define ROFF_iso8802_3 44
227 #define ROFF_xpg4_2 47
228 #define ROFF_xpg4_3 48
233 #define ROFF_xns5_2d2_0 53
234 #define ROFF_xcurses4_2 54
235 #define ROFF_susv2 55
236 #define ROFF_susv3 56
237 #define ROFF_svid4 57
238 #define ROFF_Filled 58
239 #define ROFF_Words 59
240 #define ROFF_ARGMAX 60
242 #define ROFF_MAXLINEARG 32
244 extern const char *const *toknames
;
245 extern const char *const *tokargnames
;
247 enum roffmsg
{ ROFF_WARN
, ROFF_ERROR
};
250 void (*roffmsg
)(void *, enum roffmsg
,
251 const char *, const char *, char *);
252 int (*roffhead
)(void *, const struct tm
*, const char *,
253 const char *, const char *, const char *);
254 int (*rofftail
)(void *);
255 int (*roffdata
)(void *, int, const char *, char *);
256 int (*roffin
)(void *, int, int *, char **);
257 int (*roffout
)(void *, int);
258 int (*roffblkin
)(void *, int, int *, char **);
259 int (*roffblkout
)(void *, int);
260 int (*roffblkheadin
)(void *, int, int *, char **);
261 int (*roffblkheadout
)(void *, int);
262 int (*roffblkbodyin
)(void *, int, int *, char **);
263 int (*roffblkbodyout
)(void *, int);
264 int (*roffspecial
)(void *, int, const char *, char **);
271 typedef void (*(*md_init
)(const struct md_args
*,
272 struct md_mbuf
*, const struct md_rbuf
*));
273 typedef int (*md_line
)(void *, char *);
274 typedef int (*md_exit
)(void *, int);
276 void *md_init_html(const struct md_args
*,
277 struct md_mbuf
*, const struct md_rbuf
*);
278 int md_line_html(void *, char *);
279 int md_exit_html(void *, int);
281 void *md_init_xml(const struct md_args
*,
282 struct md_mbuf
*, const struct md_rbuf
*);
283 int md_line_xml(void *, char *);
284 int md_exit_xml(void *, int);
286 int md_buf_puts(struct md_mbuf
*, const char *, size_t);
287 int md_buf_putchar(struct md_mbuf
*, char);
288 int md_buf_putstring(struct md_mbuf
*, const char *);
290 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
291 int roff_engine(struct rofftree
*, char *);
292 int roff_free(struct rofftree
*, int);
294 int rofftok_scan(const char *, int *);
298 #endif /*!PRIVATE_H*/