]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
1 /* $Id: private.h,v 1.28 2008/12/04 16:34:59 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_MAX 28
179 #define ROFF_Nosplit 1
180 #define ROFF_Ragged 2
181 #define ROFF_Unfilled 3
182 #define ROFF_Literal 4
184 #define ROFF_Offset 6
185 #define ROFF_Bullet 7
187 #define ROFF_Hyphen 9
193 #define ROFF_Ohang 15
194 #define ROFF_Inset 16
195 #define ROFF_Column 17
196 #define ROFF_Width 18
197 #define ROFF_Compact 19
199 #define ROFF_p1003_1_88 21
200 #define ROFF_p1003_1_90 22
201 #define ROFF_p1003_1_96 23
202 #define ROFF_p1003_1_2001 24
203 #define ROFF_p1003_1_2004 25
204 #define ROFF_p1003_1 26
205 #define ROFF_p1003_1b 27
206 #define ROFF_p1003_1b_93 28
207 #define ROFF_p1003_1c_95 29
208 #define ROFF_p1003_1g_2000 30
209 #define ROFF_p1003_2_92 31
210 #define ROFF_p1387_2_95 32
211 #define ROFF_p1003_2 33
212 #define ROFF_p1387_2 34
213 #define ROFF_isoC_90 35
214 #define ROFF_isoC_amd1 36
215 #define ROFF_isoC_tcor1 37
216 #define ROFF_isoC_tcor2 38
217 #define ROFF_isoC_99 39
218 #define ROFF_ansiC 40
219 #define ROFF_ansiC_89 41
220 #define ROFF_ansiC_99 42
221 #define ROFF_ieee754 43
222 #define ROFF_iso8802_3 44
225 #define ROFF_xpg4_2 47
226 #define ROFF_xpg4_3 48
231 #define ROFF_xns5_2d2_0 53
232 #define ROFF_xcurses4_2 54
233 #define ROFF_susv2 55
234 #define ROFF_susv3 56
235 #define ROFF_svid4 57
236 #define ROFF_Filled 58
237 #define ROFF_Words 59
238 #define ROFF_ARGMAX 60
240 #define ROFF_MAXLINEARG 32
242 extern const char *const *toknames
;
243 extern const char *const *tokargnames
;
245 enum roffmsg
{ ROFF_WARN
, ROFF_ERROR
};
248 void (*roffmsg
)(void *, enum roffmsg
,
249 const char *, const char *, char *);
250 int (*roffhead
)(void *, const struct tm
*, const char *,
251 const char *, const char *, const char *);
252 int (*rofftail
)(void *);
253 int (*roffdata
)(void *, int, const char *, char *);
254 int (*rofftoken
)(void *, int, int);
255 int (*roffin
)(void *, int, int *, char **);
256 int (*roffout
)(void *, int);
257 int (*roffblkin
)(void *, int, int *, char **);
258 int (*roffblkout
)(void *, int);
259 int (*roffblkheadin
)(void *, int, int *, char **);
260 int (*roffblkheadout
)(void *, int);
261 int (*roffblkbodyin
)(void *, int, int *, char **);
262 int (*roffblkbodyout
)(void *, int);
263 int (*roffspecial
)(void *, int, int *, char **, char **);
270 typedef void (*(*md_init
)(const struct md_args
*,
271 struct md_mbuf
*, const struct md_rbuf
*));
272 typedef int (*md_line
)(void *, char *);
273 typedef int (*md_exit
)(void *, int);
275 void *md_init_html(const struct md_args
*,
276 struct md_mbuf
*, const struct md_rbuf
*);
277 int md_line_html(void *, char *);
278 int md_exit_html(void *, int);
280 void *md_init_xml(const struct md_args
*,
281 struct md_mbuf
*, const struct md_rbuf
*);
282 int md_line_xml(void *, char *);
283 int md_exit_xml(void *, int);
285 int md_buf_puts(struct md_mbuf
*, const char *, size_t);
286 int md_buf_putchar(struct md_mbuf
*, char);
287 int md_buf_putstring(struct md_mbuf
*, const char *);
289 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
290 int roff_engine(struct rofftree
*, char *);
291 int roff_free(struct rofftree
*, int);
293 int rofftok_scan(const char *);
297 #endif /*!PRIVATE_H*/