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

Annotation of mandoc/private.h, Revision 1.5

1.5     ! kristaps    1: /* $Id: private.h,v 1.4 2008/11/24 14:24:55 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 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:
1.5     ! kristaps   38: #define        ROFF___          0
        !            39: #define        ROFF_Dd          1
        !            40: #define        ROFF_Dt          2
        !            41: #define        ROFF_Os          3
        !            42: #define        ROFF_Sh          4
        !            43: #define        ROFF_An          5
        !            44: #define        ROFF_Li          6
        !            45: #define        ROFF_MAX         7
        !            46:
        !            47: #define        ROFF_Split       0
        !            48: #define        ROFF_Nosplit     1
        !            49: #define        ROFF_ARGMAX      2
        !            50:
        !            51: /* FIXME: have a md_roff with all necessary parameters. */
        !            52:
        !            53: typedef        int     (*roffin)(int, int *, char **);
        !            54: typedef        int     (*roffout)(int);
        !            55: typedef        int     (*roffblkin)(int);
        !            56: typedef        int     (*roffblkout)(int);
        !            57:
1.1       kristaps   58: __BEGIN_DECLS
                     59:
1.4       kristaps   60: typedef        void  (*(*md_init)(const struct md_args *,
                     61:                        struct md_mbuf *, const struct md_rbuf *));
                     62: typedef        int     (*md_line)(void *, char *, size_t);
                     63: typedef        int     (*md_exit)(void *, int);
                     64:
                     65: void            *md_init_html4_strict(const struct md_args *,
                     66:                        struct md_mbuf *, const struct md_rbuf *);
                     67: int              md_line_html4_strict(void *, char *, size_t);
                     68: int              md_exit_html4_strict(void *, int);
                     69:
                     70: void            *md_init_dummy(const struct md_args *,
                     71:                        struct md_mbuf *, const struct md_rbuf *);
                     72: int              md_line_dummy(void *, char *, size_t);
                     73: int              md_exit_dummy(void *, int);
1.1       kristaps   74:
                     75: int              md_buf_puts(struct md_mbuf *, const char *, size_t);
                     76: int              md_buf_putchar(struct md_mbuf *, char);
                     77: int              md_buf_putstring(struct md_mbuf *, const char *);
                     78:
1.4       kristaps   79: struct rofftree;
                     80:
                     81: struct rofftree *roff_alloc(const struct md_args *,
1.5     ! kristaps   82:                        struct md_mbuf *, const struct md_rbuf *,
        !            83:                        const roffin *, const roffout *,
        !            84:                        const roffblkin *, const roffblkout *);
1.4       kristaps   85: int              roff_engine(struct rofftree *, char *, size_t);
                     86: int              roff_free(struct rofftree *, int);
                     87:
1.1       kristaps   88: __END_DECLS
                     89:
                     90: #endif /*!PRIVATE_H*/

CVSweb