[BACK]Return to libmdocml.h CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/libmdocml.h, Revision 1.14

1.14    ! kristaps    1: /* $Id: libmdocml.h,v 1.13 2008/12/09 00:27:17 kristaps Exp $ */
1.1       kristaps    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:
1.2       kristaps   22: #include <sys/types.h>
                     23:
1.11      kristaps   24: struct         md_params_html {
1.12      kristaps   25:        char            *css;
                     26:        int              flags;
                     27: #define        HTML_CSS_EMBED  (1 << 0)
1.3       kristaps   28: };
                     29:
                     30: union  md_params {
1.11      kristaps   31:        struct md_params_html html;
1.2       kristaps   32: };
                     33:
                     34: enum   md_type {
1.10      kristaps   35:        MD_XML,                 /* XML. */
1.14    ! kristaps   36:        MD_HTML,                /* HTML4.01-strict. */
        !            37:        MD_NOOP                 /* Validates only. */
1.3       kristaps   38: };
                     39:
                     40: struct md_args {
                     41:        union md_params  params;/* Parameters for parser. */
                     42:        enum md_type     type;  /* Type of parser. */
1.8       kristaps   43:
                     44:        int              warnings;
                     45: #define        MD_WARN_ALL     (1 << 0)
1.13      kristaps   46: #define        MD_WARN_ERROR   (1 << 1)
1.8       kristaps   47:        int              verbosity;
1.3       kristaps   48: };
                     49:
                     50: struct md_buf {
                     51:        int              fd;    /* Open file descriptor. */
                     52:        char            *name;  /* Name of file/socket/whatever. */
                     53:        char            *buf;   /* Buffer for storing data. */
                     54:        size_t           bufsz; /* Size of buf. */
1.2       kristaps   55: };
                     56:
1.1       kristaps   57: __BEGIN_DECLS
                     58:
1.3       kristaps   59: /* Run the parser over prepared input and output buffers.  Returns -1 on
                     60:  * failure and 0 on success.
                     61:  */
                     62: int    md_run(const struct md_args *,
                     63:                const struct md_buf *, const struct md_buf *);
1.2       kristaps   64:
1.1       kristaps   65: __END_DECLS
                     66:
                     67: #endif /*!LIBMDOCML_H*/

CVSweb