]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
1 /* $Id: private.h,v 1.22 2008/12/02 13:20:24 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 /* Input buffer (input read into buffer, then filled when empty). */
24 int fd
; /* Open descriptor. */
25 char *name
; /* Name of file. */
26 char *buf
; /* Buffer. */
27 size_t bufsz
; /* Size of buffer. */
28 size_t line
; /* Current line number. */
31 /* Output buffer (output buffered until full, then flushed). */
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. */
149 #define ROFF_Nosplit 1
150 #define ROFF_Ragged 2
151 #define ROFF_Unfilled 3
152 #define ROFF_Literal 4
154 #define ROFF_Offset 6
155 #define ROFF_Bullet 7
157 #define ROFF_Hyphen 9
163 #define ROFF_Ohang 15
164 #define ROFF_Inset 16
165 #define ROFF_Column 17
166 #define ROFF_Width 18
167 #define ROFF_Compact 19
169 #define ROFF_p1003_1_88 21
170 #define ROFF_p1003_1_90 22
171 #define ROFF_p1003_1_96 23
172 #define ROFF_p1003_1_2001 24
173 #define ROFF_p1003_1_2004 25
174 #define ROFF_p1003_1 26
175 #define ROFF_p1003_1b 27
176 #define ROFF_p1003_1b_93 28
177 #define ROFF_p1003_1c_95 29
178 #define ROFF_p1003_1g_2000 30
179 #define ROFF_p1003_2_92 31
180 #define ROFF_p1387_2_95 32
181 #define ROFF_p1003_2 33
182 #define ROFF_p1387_2 34
183 #define ROFF_isoC_90 35
184 #define ROFF_isoC_amd1 36
185 #define ROFF_isoC_tcor1 37
186 #define ROFF_isoC_tcor2 38
187 #define ROFF_isoC_99 39
188 #define ROFF_ansiC 40
189 #define ROFF_ansiC_89 41
190 #define ROFF_ansiC_99 42
191 #define ROFF_ieee754 43
192 #define ROFF_iso8802_3 44
195 #define ROFF_xpg4_2 47
196 #define ROFF_xpg4_3 48
201 #define ROFF_xns5_2d2_0 53
202 #define ROFF_xcurses4_2 54
203 #define ROFF_susv2 55
204 #define ROFF_susv3 56
205 #define ROFF_svid4 57
206 #define ROFF_Filled 58
207 #define ROFF_Words 59
208 #define ROFF_ARGMAX 60
210 extern const char *const *toknames
;
211 extern const char *const *tokargnames
;
213 enum roffmsg
{ ROFF_WARN
, ROFF_ERROR
};
216 void (*roffmsg
)(void *, enum roffmsg
,
217 const char *, const char *, char *);
218 int (*roffhead
)(void *);
219 int (*rofftail
)(void *);
220 int (*roffin
)(void *, int, int *, char **);
221 int (*roffdata
)(void *, int, char *);
222 int (*roffout
)(void *, int);
223 int (*roffblkin
)(void *, int, int *, char **);
224 int (*roffblkout
)(void *, int);
225 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_html4_strict(const struct md_args
*,
236 struct md_mbuf
*, const struct md_rbuf
*);
237 int md_line_html4_strict(void *, char *);
238 int md_exit_html4_strict(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 *);
251 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
252 int roff_engine(struct rofftree
*, char *);
253 int roff_free(struct rofftree
*, int);
257 #endif /*!PRIVATE_H*/