=================================================================== RCS file: /cvs/mandoc/mandoc.h,v retrieving revision 1.112 retrieving revision 1.116 diff -u -p -r1.112 -r1.116 --- mandoc/mandoc.h 2013/12/30 18:30:32 1.112 +++ mandoc/mandoc.h 2014/03/19 21:51:20 1.116 @@ -1,7 +1,7 @@ -/* $Id: mandoc.h,v 1.112 2013/12/30 18:30:32 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.116 2014/03/19 21:51:20 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2012, 2013 Ingo Schwarze + * Copyright (c) 2012, 2013, 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,6 +20,7 @@ #define ASCII_NBRSP 31 /* non-breaking space */ #define ASCII_HYPH 30 /* breakable hyphen */ +#define ASCII_BREAK 29 /* breakable zero-width space */ /* * Status level. This refers to both internal status (i.e., whilst @@ -152,6 +153,7 @@ enum mandocerr { MANDOCERR_FATAL, /* ===== start of fatal errors ===== */ + MANDOCERR_TOOLARGE, /* input too large */ MANDOCERR_NOTMANUAL, /* manual isn't really a manual */ MANDOCERR_COLUMNS, /* column syntax is inconsistent */ MANDOCERR_BADDISP, /* NOT IMPLEMENTED: .Bd -file */ @@ -162,6 +164,13 @@ enum mandocerr { MANDOCERR_NODOCBODY, /* no document body */ MANDOCERR_NODOCPROLOG, /* no document prologue */ MANDOCERR_MEM, /* static buffer exhausted */ + + /* ===== system errors ===== */ + + MANDOCERR_SYSOPEN, /* cannot open file */ + MANDOCERR_SYSSTAT, /* cannot stat file */ + MANDOCERR_SYSREAD, /* cannot read file */ + MANDOCERR_MAX }; @@ -363,15 +372,12 @@ struct eqn { }; /* - * The type of parse sequence. This value is usually passed via the - * mandoc(1) command line of -man and -mdoc. It's almost exclusively - * -mandoc but the others have been retained for compatibility. + * Parse options. */ -enum mparset { - MPARSE_AUTO, /* magically determine the document type */ - MPARSE_MDOC, /* assume -mdoc */ - MPARSE_MAN /* assume -man */ -}; +#define MPARSE_MDOC 1 /* assume -mdoc */ +#define MPARSE_MAN 2 /* assume -man */ +#define MPARSE_SO 4 /* honour .so requests */ +#define MPARSE_QUICK 8 /* abort the parse early */ enum mandoc_esc { ESCAPE_ERROR = 0, /* bail! unparsable escape */ @@ -413,8 +419,7 @@ int mchars_spec2cp(const struct mchars *, const char *, size_t); const char *mchars_spec2str(const struct mchars *, const char *, size_t, size_t *); -struct mparse *mparse_alloc(enum mparset, enum mandoclevel, - mandocmsg, void *, char *); +struct mparse *mparse_alloc(int, enum mandoclevel, mandocmsg, char *); void mparse_free(struct mparse *); void mparse_keep(struct mparse *); enum mandoclevel mparse_readfd(struct mparse *, int, const char *);