=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.49 retrieving revision 1.59 diff -u -p -r1.49 -r1.59 --- mandoc/mdoc.h 2009/03/16 23:37:28 1.49 +++ mandoc/mdoc.h 2009/06/16 19:45:51 1.59 @@ -1,20 +1,18 @@ -/* $Id: mdoc.h,v 1.49 2009/03/16 23:37:28 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.59 2009/06/16 19:45:51 kristaps Exp $ */ /* - * Copyright (c) 2008 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef MDOC_H #define MDOC_H @@ -31,7 +29,7 @@ /* What follows is a list of ALL possible macros. */ -#define MDOC___ 0 +#define MDOC_Ap 0 #define MDOC_Dd 1 #define MDOC_Dt 2 #define MDOC_Os 3 @@ -138,17 +136,17 @@ #define MDOC_Fr 104 #define MDOC_Ud 105 #define MDOC_Lb 106 -#define MDOC_Ap 107 -#define MDOC_Lp 108 -#define MDOC_Lk 109 -#define MDOC_Mt 110 -#define MDOC_Brq 111 -#define MDOC_Bro 112 -#define MDOC_Brc 113 -#define MDOC__C 114 -#define MDOC_Es 115 -#define MDOC_En 116 -#define MDOC_Dx 117 +#define MDOC_Lp 107 +#define MDOC_Lk 108 +#define MDOC_Mt 109 +#define MDOC_Brq 110 +#define MDOC_Bro 111 +#define MDOC_Brc 112 +#define MDOC__C 113 +#define MDOC_Es 114 +#define MDOC_En 115 +#define MDOC_Dx 116 +#define MDOC__Q 117 #define MDOC_MAX 118 /* What follows is a list of ALL possible macro arguments. */ @@ -275,10 +273,10 @@ struct mdoc_node { #define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */ #define MDOC_IGN_ESCAPE (1 << 1) /* Ignore bad escape sequences. */ #define MDOC_IGN_MACRO (1 << 2) /* Ignore unknown macros. */ +#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */ /* Call-backs for parse messages. */ struct mdoc_cb { - void (*mdoc_msg)(void *, int, int, const char *); int (*mdoc_err)(void *, int, int, const char *); int (*mdoc_warn)(void *, int, int, enum mdoc_warn, const char *); @@ -300,8 +298,8 @@ void mdoc_free(struct mdoc *); /* Allocate a new parser instance. */ struct mdoc *mdoc_alloc(void *, int, const struct mdoc_cb *); -/* Set parse options. */ -void mdoc_setflags(struct mdoc *, int); +/* Gets system ready for another parse. */ +int mdoc_reset(struct mdoc *); /* Parse a single line in a stream (boolean retval). */ int mdoc_parseln(struct mdoc *, int, char *buf); @@ -320,8 +318,6 @@ int mdoc_endparse(struct mdoc *); const char *mdoc_a2att(const char *); const char *mdoc_a2lib(const char *); const char *mdoc_a2st(const char *); - -int mdoc_isdelim(const char *); __END_DECLS