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

Annotation of mandoc/eqn_parse.h, Revision 1.4

1.4     ! schwarze    1: /* $Id: eqn_parse.h,v 1.3 2018/12/14 06:33:14 schwarze Exp $ */
1.1       schwarze    2: /*
1.4     ! schwarze    3:  * Copyright (c) 2014, 2017, 2018, 2022 Ingo Schwarze <schwarze@openbsd.org>
1.1       schwarze    4:  * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
                      5:  *
                      6:  * Permission to use, copy, modify, and distribute this software for any
                      7:  * purpose with or without fee is hereby granted, provided that the above
                      8:  * copyright notice and this permission notice appear in all copies.
                      9:  *
                     10:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
                     11:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     12:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
                     13:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     14:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     15:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     16:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     17:  *
                     18:  * External interface of the eqn(7) parser.
                     19:  * For use in the roff(7) and eqn(7) parsers only.
                     20:  */
                     21:
                     22: struct roff_node;
                     23: struct eqn_box;
                     24: struct eqn_def;
                     25:
                     26: struct eqn_node {
                     27:        struct roff_node *node;    /* Syntax tree of this equation. */
                     28:        struct eqn_def   *defs;    /* Array of definitions. */
                     29:        char             *data;    /* Source code of this equation. */
                     30:        char             *start;   /* First byte of the current token. */
                     31:        char             *end;     /* First byte of the next token. */
                     32:        size_t            defsz;   /* Number of definitions. */
                     33:        size_t            sz;      /* Length of the source code. */
                     34:        size_t            toksz;   /* Length of the current token. */
1.4     ! schwarze   35:        int               sublen;  /* End of rightmost substitution, so far. */
        !            36:        int               subcnt;  /* Number of recursive substitutions. */
1.1       schwarze   37:        int               gsize;   /* Default point size. */
                     38:        int               delim;   /* In-line delimiters enabled. */
                     39:        char              odelim;  /* In-line opening delimiter. */
                     40:        char              cdelim;  /* In-line closing delimiter. */
                     41: };
                     42:
                     43:
1.3       schwarze   44: struct eqn_node        *eqn_alloc(void);
1.2       schwarze   45: struct eqn_box *eqn_box_new(void);
1.1       schwarze   46: void            eqn_box_free(struct eqn_box *);
                     47: void            eqn_free(struct eqn_node *);
                     48: void            eqn_parse(struct eqn_node *);
                     49: void            eqn_read(struct eqn_node *, const char *);
                     50: void            eqn_reset(struct eqn_node *);

CVSweb