Home | History | Annotate | Line # | Download | only in dist
mandoc_parse.h revision 1.1.1.2
      1  1.1.1.2       wiz /*	Id: mandoc_parse.h,v 1.5 2019/11/09 14:39:49 schwarze Exp  */
      2      1.1  christos /*
      3      1.1  christos  * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps (at) bsd.lv>
      4      1.1  christos  * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze (at) openbsd.org>
      5      1.1  christos  *
      6      1.1  christos  * Permission to use, copy, modify, and distribute this software for any
      7      1.1  christos  * purpose with or without fee is hereby granted, provided that the above
      8      1.1  christos  * copyright notice and this permission notice appear in all copies.
      9      1.1  christos  *
     10      1.1  christos  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
     11      1.1  christos  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     12      1.1  christos  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
     13      1.1  christos  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     14      1.1  christos  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     15      1.1  christos  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     16      1.1  christos  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     17      1.1  christos  *
     18      1.1  christos  * Top level parser interface.  For use in the main program
     19      1.1  christos  * and in the main parser, but not in formatters.
     20      1.1  christos  */
     21      1.1  christos 
     22      1.1  christos /*
     23      1.1  christos  * Parse options.
     24      1.1  christos  */
     25      1.1  christos #define	MPARSE_MDOC	(1 << 0)  /* assume -mdoc */
     26      1.1  christos #define	MPARSE_MAN	(1 << 1)  /* assume -man */
     27      1.1  christos #define	MPARSE_SO	(1 << 2)  /* honour .so requests */
     28      1.1  christos #define	MPARSE_QUICK	(1 << 3)  /* abort the parse early */
     29      1.1  christos #define	MPARSE_UTF8	(1 << 4)  /* accept UTF-8 input */
     30      1.1  christos #define	MPARSE_LATIN1	(1 << 5)  /* accept ISO-LATIN-1 input */
     31      1.1  christos #define	MPARSE_VALIDATE	(1 << 6)  /* call validation functions */
     32  1.1.1.2       wiz #define	MPARSE_COMMENT	(1 << 7)  /* save comments in the tree */
     33      1.1  christos 
     34      1.1  christos 
     35      1.1  christos struct	roff_meta;
     36      1.1  christos struct	mparse;
     37      1.1  christos 
     38      1.1  christos struct mparse	 *mparse_alloc(int, enum mandoc_os, const char *);
     39      1.1  christos void		  mparse_copy(const struct mparse *);
     40      1.1  christos void		  mparse_free(struct mparse *);
     41      1.1  christos int		  mparse_open(struct mparse *, const char *);
     42      1.1  christos void		  mparse_readfd(struct mparse *, int, const char *);
     43      1.1  christos void		  mparse_reset(struct mparse *);
     44      1.1  christos struct roff_meta *mparse_result(struct mparse *);
     45