]>
git.cameronkatri.com Git - mandoc.git/blob - private.h
1 /* $Id: private.h,v 1.15 2008/11/28 15:25:49 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. */
145 #define ROFF_Nosplit 1
146 #define ROFF_Ragged 2
147 #define ROFF_Unfilled 3
148 #define ROFF_Literal 4
150 #define ROFF_Offset 6
151 #define ROFF_Bullet 7
153 #define ROFF_Hyphen 9
159 #define ROFF_Ohang 15
160 #define ROFF_Inset 16
161 #define ROFF_Column 17
162 #define ROFF_Width 18
163 #define ROFF_Compact 19
165 #define ROFF_p1003_1_88 21
166 #define ROFF_p1003_1_90 22
167 #define ROFF_p1003_1_96 23
168 #define ROFF_p1003_1_2001 24
169 #define ROFF_p1003_1_2004 25
170 #define ROFF_p1003_1 26
171 #define ROFF_p1003_1b 27
172 #define ROFF_p1003_1b_93 28
173 #define ROFF_p1003_1c_95 29
174 #define ROFF_p1003_1g_2000 30
175 #define ROFF_p1003_2_92 31
176 #define ROFF_p1387_2_95 32
177 #define ROFF_p1003_2 33
178 #define ROFF_p1387_2 34
179 #define ROFF_isoC_90 35
180 #define ROFF_isoC_amd1 36
181 #define ROFF_isoC_tcor1 37
182 #define ROFF_isoC_tcor2 38
183 #define ROFF_isoC_99 39
184 #define ROFF_ansiC 40
185 #define ROFF_ansiC_89 41
186 #define ROFF_ansiC_99 42
187 #define ROFF_ieee754 43
188 #define ROFF_iso8802_3 44
191 #define ROFF_xpg4_2 47
192 #define ROFF_xpg4_3 48
197 #define ROFF_xns5_2d2_0 53
198 #define ROFF_xcurses4_2 54
199 #define ROFF_susv2 55
200 #define ROFF_susv3 56
201 #define ROFF_svid4 57
202 #define ROFF_Filled 58
203 #define ROFF_Words 59
204 #define ROFF_ARGMAX 60
206 extern const char *const *toknames
;
207 extern const char *const *tokargnames
;
209 enum roffmsg
{ ROFF_WARN
, ROFF_ERROR
};
212 void (*roffmsg
)(void *, enum roffmsg
,
213 const char *, const char *, char *);
214 int (*roffhead
)(void *);
215 int (*rofftail
)(void *);
216 int (*roffin
)(void *, int, int *, char **);
217 int (*roffdata
)(void *, const char *);
218 int (*roffout
)(void *, int);
219 int (*roffblkin
)(void *, int);
220 int (*roffblkout
)(void *, int);
221 int (*roffspecial
)(void *, int);
226 typedef void (*(*md_init
)(const struct md_args
*,
227 struct md_mbuf
*, const struct md_rbuf
*));
228 typedef int (*md_line
)(void *, char *, size_t);
229 typedef int (*md_exit
)(void *, int);
231 void *md_init_html4_strict(const struct md_args
*,
232 struct md_mbuf
*, const struct md_rbuf
*);
233 int md_line_html4_strict(void *, char *, size_t);
234 int md_exit_html4_strict(void *, int);
236 void *md_init_valid(const struct md_args
*,
237 struct md_mbuf
*, const struct md_rbuf
*);
238 int md_line_valid(void *, char *, size_t);
239 int md_exit_valid(void *, int);
241 int md_buf_puts(struct md_mbuf
*, const char *, size_t);
242 int md_buf_putchar(struct md_mbuf
*, char);
243 int md_buf_putstring(struct md_mbuf
*, const char *);
247 struct rofftree
*roff_alloc(const struct roffcb
*, void *);
248 int roff_engine(struct rofftree
*, char *, size_t);
249 int roff_free(struct rofftree
*, int);
253 #endif /*!PRIVATE_H*/