=================================================================== RCS file: /cvs/mandoc/mandoc.h,v retrieving revision 1.58 retrieving revision 1.60 diff -u -p -r1.58 -r1.60 --- mandoc/mandoc.h 2011/03/07 01:35:51 1.58 +++ mandoc/mandoc.h 2011/03/17 09:16:38 1.60 @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.58 2011/03/07 01:35:51 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.60 2011/03/17 09:16:38 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * @@ -312,14 +312,32 @@ struct regset { struct reg regs[REG__MAX]; }; -__BEGIN_DECLS - /* - * Callback function for warnings, errors, and fatal errors as they - * occur in the compilers libroff, libmdoc, and libman. + * A punctuation delimiter, used only in mdoc(7) documents, is opening, + * closing, or "middle mark" punctuation. These govern spacing. + * Opening punctuation (e.g., the opening parenthesis) suppresses the + * following space; closing punctuation (e.g., the closing parenthesis) + * suppresses the leading space; middle punctuation (e.g., the vertical + * bar) can do either. The middle punctuation delimiter bends the rules + * depending on usage. */ -typedef int (*mandocmsg)(enum mandocerr, void *, - int, int, const char *); +enum mdelim { + DELIM_NONE = 0, + DELIM_OPEN, + DELIM_MIDDLE, + DELIM_CLOSE +}; + +typedef int (*mandocmsg)(enum mandocerr, void *, + int, int, const char *); + +__BEGIN_DECLS + +void *mandoc_calloc(size_t, size_t); +void *mandoc_malloc(size_t); +void *mandoc_realloc(void *, size_t); +#define DELIMSZ 6 /* hint: max possible size of a delimiter */ +enum mdelim mandoc_isdelim(const char *); __END_DECLS