1 /* $Id: libmdocml.h,v 1.10 2008/11/30 21:41:35 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 #include <sys/types.h>
24 struct md_params_xml
{
28 struct md_params_html4_strict
{
33 struct md_params_xml xml
;
34 struct md_params_html4_strict html4_strict
;
39 MD_HTML4_STRICT
/* HTML4.01-strict. */
43 union md_params params
;/* Parameters for parser. */
44 enum md_type type
; /* Type of parser. */
47 #define MD_WARN_ALL (1 << 0)
52 int fd
; /* Open file descriptor. */
53 char *name
; /* Name of file/socket/whatever. */
54 char *buf
; /* Buffer for storing data. */
55 size_t bufsz
; /* Size of buf. */
60 /* Run the parser over prepared input and output buffers. Returns -1 on
61 * failure and 0 on success.
63 int md_run(const struct md_args
*,
64 const struct md_buf
*, const struct md_buf
*);
68 #endif /*!LIBMDOCML_H*/