]> git.cameronkatri.com Git - mandoc.git/blob - libmdocml.h
Putting md_run and friends into libmdocml (needs work to be useful).
[mandoc.git] / libmdocml.h
1 /* $Id: libmdocml.h,v 1.2 2008/11/22 18:34:06 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 LIBMDOCML_H
20 #define LIBMDOCML_H
21
22 #include <sys/types.h>
23
24 struct md_rbuf {
25 int fd;
26 const char *name;
27 char *buf;
28 size_t bufsz;
29 size_t line;
30 };
31
32 struct md_mbuf {
33 int fd;
34 const char *name;
35 char *buf;
36 size_t bufsz;
37 size_t pos;
38 };
39
40 enum md_type {
41 MD_DUMMY
42 };
43
44 __BEGIN_DECLS
45
46 int md_run(enum md_type, struct md_mbuf *, struct md_rbuf *);
47
48 __END_DECLS
49
50 #endif /*!LIBMDOCML_H*/