]> git.cameronkatri.com Git - mandoc.git/blob - private.h
Split roff engine into roff.c.
[mandoc.git] / private.h
1 /* $Id: private.h,v 1.4 2008/11/24 14:24:55 kristaps Exp $ */
2 /*
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
4 *
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
8 * copies.
9 *
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.
18 */
19 #ifndef PRIVATE_H
20 #define PRIVATE_H
21
22 struct md_rbuf {
23 int fd;
24 char *name;
25 char *buf;
26 size_t bufsz;
27 size_t line;
28 };
29
30 struct md_mbuf {
31 int fd;
32 char *name;
33 char *buf;
34 size_t bufsz;
35 size_t pos;
36 };
37
38 __BEGIN_DECLS
39
40 typedef void (*(*md_init)(const struct md_args *,
41 struct md_mbuf *, const struct md_rbuf *));
42 typedef int (*md_line)(void *, char *, size_t);
43 typedef int (*md_exit)(void *, int);
44
45 void *md_init_html4_strict(const struct md_args *,
46 struct md_mbuf *, const struct md_rbuf *);
47 int md_line_html4_strict(void *, char *, size_t);
48 int md_exit_html4_strict(void *, int);
49
50 void *md_init_dummy(const struct md_args *,
51 struct md_mbuf *, const struct md_rbuf *);
52 int md_line_dummy(void *, char *, size_t);
53 int md_exit_dummy(void *, int);
54
55 int md_buf_puts(struct md_mbuf *, const char *, size_t);
56 int md_buf_putchar(struct md_mbuf *, char);
57 int md_buf_putstring(struct md_mbuf *, const char *);
58
59 struct rofftree;
60
61 struct rofftree *roff_alloc(const struct md_args *,
62 struct md_mbuf *, const struct md_rbuf *);
63 int roff_engine(struct rofftree *, char *, size_t);
64 int roff_free(struct rofftree *, int);
65
66 __END_DECLS
67
68 #endif /*!PRIVATE_H*/