1 /* $Id: private.h,v 1.24 2008/12/03 14:39: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.
23 int fd
; /* Open descriptor. */
24 char *name
; /* Name of file. */
25 char *buf
; /* Buffer. */
26 size_t bufsz
; /* Size of buffer. */
27 size_t line
; /* Current line number. */
31 int fd
; /* Open descriptor. */
32 char *name
; /* Name of file. */
33 char *buf
; /* Buffer. */
34 size_t bufsz
; /* Size of buffer. */
35 size_t pos
; /* Position in buffer. */
147 #define ROFF_Nosplit 1
148 #define ROFF_Ragged 2
149 #define ROFF_Unfilled 3
150 #define ROFF_Literal 4
152 #define ROFF_Offset 6
153 #define ROFF_Bullet 7
155 #define ROFF_Hyphen 9
161 #define ROFF_Ohang 15
162 #define ROFF_Inset 16
163 #define ROFF_Column 17
164 #define ROFF_Width 18
165 #define ROFF_Compact 19
167 #define ROFF_p1003_1_88 21
168 #define ROFF_p1003_1_90 22
169 #define ROFF_p1003_1_96 23
170 #define ROFF_p1003_1_2001 24
171 #define ROFF_p1003_1_2004 25
172 #define ROFF_p1003_1 26
173 #define ROFF_p1003_1b 27
174 #define ROFF_p1003_1b_93 28
175 #define ROFF_p1003_1c_95 29
176 #define ROFF_p1003_1g_2000 30
177 #define ROFF_p1003_2_92 31
178 #define ROFF_p1387_2_95 32
179 #define ROFF_p1003_2 33
180 #define ROFF_p1387_2 34
181 #define ROFF_isoC_90 35
182 #define ROFF_isoC_amd1 36
183 #define ROFF_isoC_tcor1 37
184 #define ROFF_isoC_tcor2 38
185 #define ROFF_isoC_99 39
186 #define ROFF_ansiC 40
187 #define ROFF_ansiC_89 41
188 #define ROFF_ansiC_99 42
189 #define ROFF_ieee754 43
190 #define ROFF_iso8802_3 44
193 #define ROFF_xpg4_2 47
194 #define ROFF_xpg4_3 48
199 #define ROFF_xns5_2d2_0 53
200 #define ROFF_xcurses4_2 54
201 #define ROFF_susv2 55
202 #define ROFF_susv3 56
203 #define ROFF_svid4 57
204 #define ROFF_Filled 58
205 #define ROFF_Words 59
206 #define ROFF_ARGMAX 60
208 extern const char *const *toknames
;
209 extern const char *const *tokargnames
;
211 enum roffmsg
{ ROFF_WARN
, ROFF_ERROR
};
214 void (*roffmsg
)(void *, enum roffmsg
,
215 const char *, const char *, char *);
216 int (*roffhead
)(void *);
217 int (*rofftail
)(void *);
218 int (*roffin
)(void *, int, int *, char **);
219 int (*roffdata
)(void *, int, char *);
220 int (*roffout
)(void *, int);
221 int (*roffblkin
)(void *, int, int *, char **);
222 int (*roffblkout
)(void *, int);
223 int (*roffspecial
)(void *, int, int *, char **, char **);
230 typedef void (*(*md_init
)(const struct md_args
*,
231 struct md_mbuf
*, const struct md_rbuf
*));
232 typedef int (*md_line
)(void *, char *);
233 typedef int (*md_exit
)(void *, int);
235 void *md_init_html(const struct md_args
*,
236 struct md_mbuf
*, const struct md_rbuf
*);
237 int md_line_html(void *, char *);
238 int md_exit_html(void *, int);
240 void *md_init_xml(const struct md_args
*,
241 struct md_mbuf
*, const struct md_rbuf
*);
242 int md_line_xml(void *, char *);
243 int md_exit_xml(void *, int);
245 int md_buf_puts(struct md_mbuf
*, const char *, size_t);
246 int md_buf_putchar(struct md_mbuf
*, char);
247 int md_buf_putstring(struct md_mbuf
*, const char *);
249 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
250 int roff_engine(struct rofftree
*, char *);
251 int roff_free(struct rofftree
*, int);
255 #endif /*!PRIVATE_H*/