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

Annotation of mandoc/libroff.h, Revision 1.14

1.14    ! kristaps    1: /*     $Id: libroff.h,v 1.13 2011/01/01 16:10:40 kristaps Exp $ */
1.1       kristaps    2: /*
                      3:  * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
                      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 above
                      7:  * copyright notice and this permission notice appear in all copies.
                      8:  *
                      9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     16:  */
                     17: #ifndef LIBROFF_H
                     18: #define LIBROFF_H
                     19:
                     20: __BEGIN_DECLS
                     21:
1.2       kristaps   22: enum   tbl_part {
                     23:        TBL_PART_OPTS, /* in options (first line) */
                     24:        TBL_PART_LAYOUT, /* describing layout */
                     25:        TBL_PART_DATA  /* creating data rows */
                     26: };
                     27:
                     28: struct tbl {
1.5       kristaps   29:        mandocmsg         msg; /* status messages */
                     30:        void             *data; /* privdata for messages */
1.2       kristaps   31:        enum tbl_part     part;
                     32:        char              tab; /* cell-separator */
                     33:        char              decimal; /* decimal point */
1.12      kristaps   34:        int               pos; /* invocation column */
                     35:        int               line; /* invocation line */
1.2       kristaps   36:        int               linesize;
                     37:        char              delims[2];
                     38:        int               opts;
                     39: #define        TBL_OPT_CENTRE   (1 << 0)
                     40: #define        TBL_OPT_EXPAND   (1 << 1)
                     41: #define        TBL_OPT_BOX      (1 << 2)
                     42: #define        TBL_OPT_DBOX     (1 << 3)
                     43: #define        TBL_OPT_ALLBOX   (1 << 4)
                     44: #define        TBL_OPT_NOKEEP   (1 << 5)
                     45: #define        TBL_OPT_NOSPACE  (1 << 6)
1.8       kristaps   46:        struct tbl_row   *first_row;
                     47:        struct tbl_row   *last_row;
                     48:        struct tbl_span  *first_span;
                     49:        struct tbl_span  *last_span;
1.14    ! kristaps   50:        struct tbl_head  *first_head;
        !            51:        struct tbl_head  *last_head;
1.10      kristaps   52:        struct tbl       *next;
1.2       kristaps   53: };
1.1       kristaps   54:
1.3       kristaps   55: #define        TBL_MSG(tblp, type, line, col) \
                     56:        (*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL)
                     57:
1.12      kristaps   58: struct tbl     *tbl_alloc(int, int, void *, mandocmsg);
1.13      kristaps   59: void            tbl_restart(int, int, struct tbl *);
1.1       kristaps   60: void            tbl_free(struct tbl *);
                     61: void            tbl_reset(struct tbl *);
                     62: enum rofferr    tbl_read(struct tbl *, int, const char *, int);
1.3       kristaps   63: int             tbl_option(struct tbl *, int, const char *);
1.5       kristaps   64: int             tbl_layout(struct tbl *, int, const char *);
1.8       kristaps   65: int             tbl_data(struct tbl *, int, const char *);
1.11      kristaps   66: const struct tbl_span *tbl_span(const struct tbl *);
1.12      kristaps   67: void            tbl_end(struct tbl *);
1.1       kristaps   68:
                     69: __END_DECLS
                     70:
                     71: #endif /*LIBROFF_H*/

CVSweb