version 1.258, 2018/12/13 11:55:46 |
version 1.266, 2020/01/19 18:02:00 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2012-2018 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2012-2020 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
MANDOCERR_TH_NOTITLE, /* missing manual title, using "": [macro] */ |
MANDOCERR_TH_NOTITLE, /* missing manual title, using "": [macro] */ |
MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */ |
MANDOCERR_MSEC_MISSING, /* missing manual section, using "": macro */ |
MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */ |
MANDOCERR_MSEC_BAD, /* unknown manual section: Dt ... section */ |
MANDOCERR_DATE_MISSING, /* missing date, using today's date */ |
MANDOCERR_DATE_MISSING, /* missing date, using "": [macro] */ |
MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */ |
MANDOCERR_DATE_BAD, /* cannot parse date, using it verbatim: date */ |
MANDOCERR_DATE_FUTURE, /* date in the future, using it anyway: date */ |
MANDOCERR_DATE_FUTURE, /* date in the future, using it anyway: date */ |
MANDOCERR_OS_MISSING, /* missing Os macro, using "" */ |
MANDOCERR_OS_MISSING, /* missing Os macro, using "" */ |
Line 169 enum mandocerr { |
|
Line 169 enum mandocerr { |
|
MANDOCERR_FI_TAB, /* tab in filled text */ |
MANDOCERR_FI_TAB, /* tab in filled text */ |
MANDOCERR_EOS, /* new sentence, new line */ |
MANDOCERR_EOS, /* new sentence, new line */ |
MANDOCERR_ESC_BAD, /* invalid escape sequence: esc */ |
MANDOCERR_ESC_BAD, /* invalid escape sequence: esc */ |
|
MANDOCERR_ESC_UNDEF, /* undefined escape, printing literally: char */ |
MANDOCERR_STR_UNDEF, /* undefined string, using "": name */ |
MANDOCERR_STR_UNDEF, /* undefined string, using "": name */ |
|
|
/* related to tables */ |
/* related to tables */ |
Line 192 enum mandocerr { |
|
Line 193 enum mandocerr { |
|
MANDOCERR_TBLDATA_BLK, /* data block open at end of tbl: macro */ |
MANDOCERR_TBLDATA_BLK, /* data block open at end of tbl: macro */ |
|
|
/* related to document structure and macros */ |
/* related to document structure and macros */ |
MANDOCERR_FILE, /* cannot open file */ |
|
MANDOCERR_PROLOG_REP, /* duplicate prologue macro: macro */ |
MANDOCERR_PROLOG_REP, /* duplicate prologue macro: macro */ |
MANDOCERR_DT_LATE, /* skipping late title macro: Dt args */ |
MANDOCERR_DT_LATE, /* skipping late title macro: Dt args */ |
MANDOCERR_ROFFLOOP, /* input stack limit exceeded, infinite loop? */ |
MANDOCERR_ROFFLOOP, /* input stack limit exceeded, infinite loop? */ |
Line 223 enum mandocerr { |
|
Line 223 enum mandocerr { |
|
MANDOCERR_SHIFT, /* excessive shift: ..., but max is ... */ |
MANDOCERR_SHIFT, /* excessive shift: ..., but max is ... */ |
MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */ |
MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */ |
MANDOCERR_SO_FAIL, /* .so request failed */ |
MANDOCERR_SO_FAIL, /* .so request failed */ |
|
MANDOCERR_TG_SPC, /* skipping tag containing whitespace: tag */ |
MANDOCERR_ARG_SKIP, /* skipping all arguments: macro args */ |
MANDOCERR_ARG_SKIP, /* skipping all arguments: macro args */ |
MANDOCERR_ARG_EXCESS, /* skipping excess arguments: macro ... args */ |
MANDOCERR_ARG_EXCESS, /* skipping excess arguments: macro ... args */ |
MANDOCERR_DIVZERO, /* divide by zero */ |
MANDOCERR_DIVZERO, /* divide by zero */ |
Line 231 enum mandocerr { |
|
Line 232 enum mandocerr { |
|
|
|
MANDOCERR_TOOLARGE, /* input too large */ |
MANDOCERR_TOOLARGE, /* input too large */ |
MANDOCERR_CHAR_UNSUPP, /* unsupported control character: number */ |
MANDOCERR_CHAR_UNSUPP, /* unsupported control character: number */ |
|
MANDOCERR_ESC_UNSUPP, /* unsupported escape sequence: escape */ |
MANDOCERR_REQ_UNSUPP, /* unsupported roff request: request */ |
MANDOCERR_REQ_UNSUPP, /* unsupported roff request: request */ |
MANDOCERR_WHILE_NEST, /* nested .while loops */ |
MANDOCERR_WHILE_NEST, /* nested .while loops */ |
MANDOCERR_WHILE_OUTOF, /* end of scope with open .while loop */ |
MANDOCERR_WHILE_OUTOF, /* end of scope with open .while loop */ |
Line 240 enum mandocerr { |
|
Line 242 enum mandocerr { |
|
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */ |
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */ |
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */ |
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */ |
|
|
|
MANDOCERR_BADARG, /* ===== start of bad invocations ===== */ |
|
|
|
MANDOCERR_BADARG_BAD, /* bad argument */ |
|
MANDOCERR_BADARG_DUPE, /* duplicate argument */ |
|
MANDOCERR_BADVAL, /* does not take a value */ |
|
MANDOCERR_BADVAL_MISS, /* missing argument value */ |
|
MANDOCERR_BADVAL_BAD, /* bad argument value */ |
|
MANDOCERR_BADVAL_DUPE, /* duplicate argument value */ |
|
MANDOCERR_TAG, /* no such tag */ |
|
|
|
MANDOCERR_SYSERR, /* ===== start of system errors ===== */ |
|
|
|
MANDOCERR_DUP, |
|
MANDOCERR_EXEC, |
|
MANDOCERR_FDOPEN, |
|
MANDOCERR_FFLUSH, |
|
MANDOCERR_FORK, |
|
MANDOCERR_FSTAT, |
|
MANDOCERR_GETLINE, |
|
MANDOCERR_GLOB, |
|
MANDOCERR_GZCLOSE, |
|
MANDOCERR_GZDOPEN, |
|
MANDOCERR_MKSTEMP, |
|
MANDOCERR_OPEN, |
|
MANDOCERR_PLEDGE, |
|
MANDOCERR_READ, |
|
MANDOCERR_WAIT, |
|
MANDOCERR_WRITE, |
|
|
MANDOCERR_MAX |
MANDOCERR_MAX |
}; |
}; |
|
|
enum mandoc_esc { |
enum mandoc_esc { |
ESCAPE_ERROR = 0, /* bail! unparsable escape */ |
ESCAPE_ERROR = 0, /* bail! unparsable escape */ |
|
ESCAPE_UNSUPP, /* unsupported escape; ignore it */ |
ESCAPE_IGNORE, /* escape to be ignored */ |
ESCAPE_IGNORE, /* escape to be ignored */ |
|
ESCAPE_UNDEF, /* undefined escape; print literal character */ |
ESCAPE_SPECIAL, /* a regular special character */ |
ESCAPE_SPECIAL, /* a regular special character */ |
ESCAPE_FONT, /* a generic font mode */ |
ESCAPE_FONT, /* a generic font mode */ |
ESCAPE_FONTBOLD, /* bold font mode */ |
ESCAPE_FONTBOLD, /* bold font mode */ |
Line 265 enum mandoc_esc { |
|
Line 298 enum mandoc_esc { |
|
ESCAPE_OVERSTRIKE /* overstrike all chars in the argument */ |
ESCAPE_OVERSTRIKE /* overstrike all chars in the argument */ |
}; |
}; |
|
|
typedef void (*mandocmsg)(enum mandocerr, enum mandoclevel, |
|
const char *, int, int, const char *); |
|
|
|
|
enum mandoc_esc mandoc_font(const char *, int sz); |
enum mandoc_esc mandoc_escape(const char **, const char **, int *); |
enum mandoc_esc mandoc_escape(const char **, const char **, int *); |
|
void mandoc_msg_setoutfile(FILE *); |
|
const char *mandoc_msg_getinfilename(void); |
|
void mandoc_msg_setinfilename(const char *); |
|
enum mandocerr mandoc_msg_getmin(void); |
|
void mandoc_msg_setmin(enum mandocerr); |
|
enum mandoclevel mandoc_msg_getrc(void); |
|
void mandoc_msg_setrc(enum mandoclevel); |
|
void mandoc_msg(enum mandocerr, int, int, const char *, ...) |
|
__attribute__((__format__ (__printf__, 4, 5))); |
|
void mandoc_msg_summary(void); |
void mchars_alloc(void); |
void mchars_alloc(void); |
void mchars_free(void); |
void mchars_free(void); |
int mchars_num2char(const char *, size_t); |
int mchars_num2char(const char *, size_t); |