=================================================================== RCS file: /cvs/mandoc/Attic/libmdocml.h,v retrieving revision 1.1 retrieving revision 1.11 diff -u -p -r1.1 -r1.11 --- mandoc/Attic/libmdocml.h 2008/11/22 14:53:29 1.1 +++ mandoc/Attic/libmdocml.h 2008/12/03 14:39:59 1.11 @@ -1,4 +1,4 @@ -/* $Id: libmdocml.h,v 1.1 2008/11/22 14:53:29 kristaps Exp $ */ +/* $Id: libmdocml.h,v 1.11 2008/12/03 14:39:59 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -19,7 +19,49 @@ #ifndef LIBMDOCML_H #define LIBMDOCML_H +#include + +struct md_params_xml { + int dummy; +}; + +struct md_params_html { + int dummy; +}; + +union md_params { + struct md_params_xml xml; + struct md_params_html html; +}; + +enum md_type { + MD_XML, /* XML. */ + MD_HTML /* HTML4.01-strict. */ +}; + +struct md_args { + union md_params params;/* Parameters for parser. */ + enum md_type type; /* Type of parser. */ + + int warnings; +#define MD_WARN_ALL (1 << 0) + int verbosity; +}; + +struct md_buf { + int fd; /* Open file descriptor. */ + char *name; /* Name of file/socket/whatever. */ + char *buf; /* Buffer for storing data. */ + size_t bufsz; /* Size of buf. */ +}; + __BEGIN_DECLS + +/* Run the parser over prepared input and output buffers. Returns -1 on + * failure and 0 on success. + */ +int md_run(const struct md_args *, + const struct md_buf *, const struct md_buf *); __END_DECLS