diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-06 13:04:52 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-07-06 13:04:52 +0000 |
commit | 7a72fe65c7d5fe05324b8d227b387f2aa3cea747 (patch) | |
tree | a9b1a7faf197c0162351bbd69ec28a426e4cc67c /libmdoc.h | |
parent | 836a616d2c9decff2a835b27818ffa4749af5900 (diff) | |
download | mandoc-7a72fe65c7d5fe05324b8d227b387f2aa3cea747.tar.gz |
Consolidated all err/warnings into mdoc.c via libmdoc.h.
Diffstat (limited to 'libmdoc.h')
-rw-r--r-- | libmdoc.h | 81 |
1 files changed, 70 insertions, 11 deletions
@@ -41,6 +41,64 @@ struct mdoc { enum mdoc_sec lastsec; }; +enum merr { + ETAILWS, + ECOLEMPTY, + EARGVPARM, + EQUOTPARM, + EQUOTTERM, + EMALLOC, + EARGVAL, + ENOCALL, + EBODYPROL, + EPROLBODY, + ESPACE, + ETEXTPROL, + ENOBLANK, + ETOOLONG, + EESCAPE, + EPRINT, + ENODAT, + ENOPROLOGUE, + ELINE, + EATT, + ENAME, + ELISTTYPE, + EDISPTYPE, + EMULTIDISP, + ESECNAME, + EMULTILIST, + EARGREP, + EBOOL, + ECOLMIS, + ENESTDISP, + EMISSWIDTH, + EWRONGMSEC, + ESECOOO, + ESECREP, + EBADSTAND, + ENAMESECINC, + ENOMULTILINE, + EMULTILINE, + ENOLINE, + EPROLOOO, + EPROLREP, + EBADMSEC, + EFONT, + EBADDATE, + ENOWIDTH, + EBADSEC, + EUTSNAME, + ENUMFMT, + EOBS, + EMACPARM, + EIMPBRK, + EIGNE, + EOPEN, + EQUOT, + ENOCTX, + ENOPARMS +}; #define MACRO_PROT_ARGS struct mdoc *mdoc, int tok, int line, \ int ppos, int *pos, char *buf @@ -60,18 +118,19 @@ extern const struct mdoc_macro *const mdoc_macros; __BEGIN_DECLS -/* - * When GCC2 is deprecated, most of these can be reverted to #define - * as mdoc_vXXX using __VA_ARGS__. Until then, use real functions. - */ -int mdoc_vwarn(struct mdoc *, int, int, const char *, ...); +#define mdoc_perr(m, l, p, t) \ + mdoc_err((m), (l), (p), 1, (t)) +#define mdoc_pwarn(m, l, p, t) \ + mdoc_err((m), (l), (p), 0, (t)) +#define mdoc_nerr(m, n, t) \ + mdoc_err((m), (n)->line, (n)->pos, 0, (t)) +#define mdoc_nwarn(m, n, t) \ + mdoc_err((m), (n)->line, (n)->pos, 1, (t)) + +int mdoc_err(struct mdoc *, int, int, int, enum merr); int mdoc_verr(struct mdoc *, int, int, const char *, ...); -int mdoc_nerr(struct mdoc *, const struct mdoc_node *, - const char *, ...); -int mdoc_warn(struct mdoc *, const char *, ...); -int mdoc_err(struct mdoc *, const char *, ...); -int mdoc_pwarn(struct mdoc *, int, int, const char *, ...); -int mdoc_perr(struct mdoc *, int, int, const char *, ...); +int mdoc_vwarn(struct mdoc *, int, int, const char *, ...); + int mdoc_macro(MACRO_PROT_ARGS); int mdoc_word_alloc(struct mdoc *, int, int, const char *); |