=================================================================== RCS file: /cvs/mandoc/mdoc.h,v retrieving revision 1.38 retrieving revision 1.45 diff -u -p -r1.38 -r1.45 --- mandoc/mdoc.h 2009/03/08 11:41:22 1.38 +++ mandoc/mdoc.h 2009/03/09 14:19:59 1.45 @@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.38 2009/03/08 11:41:22 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.45 2009/03/09 14:19:59 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -19,6 +19,8 @@ #ifndef MDOC_H #define MDOC_H +#include + /* * This library implements a validating scanner/parser for ``mdoc'' roff * macro documents, a.k.a. BSD manual page documents. The mdoc.c file @@ -29,6 +31,8 @@ /* What follows is a list of ALL possible macros. */ +/* TODO: Brq et al. */ + #define MDOC___ 0 #define MDOC_Dd 1 #define MDOC_Dt 2 @@ -136,7 +140,11 @@ #define MDOC_Fr 104 #define MDOC_Ud 105 #define MDOC_Lb 106 -#define MDOC_MAX 107 +#define MDOC_Ap 107 +#define MDOC_Lp 108 +#define MDOC_Lk 109 +#define MDOC_Mt 110 +#define MDOC_MAX 111 /* What follows is a list of ALL possible macro arguments. */ @@ -249,6 +257,8 @@ struct mdoc_node { #define MDOC_ACTED (1 << 1) enum mdoc_type type; enum mdoc_sec sec; + + /* FIXME: union/struct this with #defines. */ struct mdoc_arg *args; /* BLOCK/ELEM */ struct mdoc_node *head; /* BLOCK */ struct mdoc_node *body; /* BLOCK */ @@ -256,7 +266,9 @@ struct mdoc_node { char *string; /* TEXT */ }; -#define MDOC_IGN_SCOPE (1 << 0) +#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. */ /* Call-backs for parse messages. */ struct mdoc_cb { @@ -280,7 +292,7 @@ struct mdoc; void mdoc_free(struct mdoc *); /* Allocate a new parser instance. */ -struct mdoc *mdoc_alloc(void *data, const struct mdoc_cb *); +struct mdoc *mdoc_alloc(void *, int, const struct mdoc_cb *); /* Set parse options. */ void mdoc_setflags(struct mdoc *, int);