version 1.70, 2011/04/09 15:29:40 |
version 1.94, 2011/07/23 18:41:18 |
Line 104 enum mandocerr { |
|
Line 104 enum mandocerr { |
|
MANDOCERR_BADESCAPE, /* unknown escape sequence */ |
MANDOCERR_BADESCAPE, /* unknown escape sequence */ |
MANDOCERR_BADQUOTE, /* unterminated quoted string */ |
MANDOCERR_BADQUOTE, /* unterminated quoted string */ |
|
|
|
/* related to equations */ |
|
MANDOCERR_EQNQUOTE, /* unexpected literal in equation */ |
|
|
MANDOCERR_ERROR, /* ===== start of errors ===== */ |
MANDOCERR_ERROR, /* ===== start of errors ===== */ |
|
|
|
/* related to equations */ |
|
MANDOCERR_EQNNSCOPE, /* unexpected equation scope closure*/ |
|
MANDOCERR_EQNSCOPE, /* equation scope open on exit */ |
|
MANDOCERR_EQNBADSCOPE, /* overlapping equation scopes */ |
|
MANDOCERR_EQNEOF, /* unexpected end of equation */ |
|
MANDOCERR_EQNSYNT, /* equation syntax error */ |
|
|
/* related to tables */ |
/* related to tables */ |
MANDOCERR_TBL, /* bad table syntax */ |
MANDOCERR_TBL, /* bad table syntax */ |
MANDOCERR_TBLOPT, /* bad table option */ |
MANDOCERR_TBLOPT, /* bad table option */ |
Line 270 struct tbl_span { |
|
Line 280 struct tbl_span { |
|
struct tbl_span *next; |
struct tbl_span *next; |
}; |
}; |
|
|
|
enum eqn_boxt { |
|
EQN_ROOT, /* root of parse tree */ |
|
EQN_TEXT, /* text (number, variable, whatever) */ |
|
EQN_SUBEXPR, /* nested `eqn' subexpression */ |
|
EQN_LIST, /* subexpressions list */ |
|
EQN_MATRIX /* matrix subexpression */ |
|
}; |
|
|
|
enum eqn_markt { |
|
EQNMARK_NONE = 0, |
|
EQNMARK_DOT, |
|
EQNMARK_DOTDOT, |
|
EQNMARK_HAT, |
|
EQNMARK_TILDE, |
|
EQNMARK_VEC, |
|
EQNMARK_DYAD, |
|
EQNMARK_BAR, |
|
EQNMARK_UNDER, |
|
EQNMARK__MAX |
|
}; |
|
|
|
enum eqn_fontt { |
|
EQNFONT_NONE = 0, |
|
EQNFONT_ROMAN, |
|
EQNFONT_BOLD, |
|
EQNFONT_FAT, |
|
EQNFONT_ITALIC, |
|
EQNFONT__MAX |
|
}; |
|
|
|
enum eqn_post { |
|
EQNPOS_NONE = 0, |
|
EQNPOS_OVER, |
|
EQNPOS_SUP, |
|
EQNPOS_SUB, |
|
EQNPOS_TO, |
|
EQNPOS_FROM, |
|
EQNPOS__MAX |
|
}; |
|
|
|
enum eqn_pilet { |
|
EQNPILE_NONE = 0, |
|
EQNPILE_CPILE, |
|
EQNPILE_RPILE, |
|
EQNPILE_LPILE, |
|
EQNPILE_CCOL, |
|
EQNPILE_RCOL, |
|
EQNPILE_LCOL, |
|
EQNPILE__MAX |
|
}; |
|
|
|
/* |
|
* A "box" is a parsed mathematical expression as defined by the eqn.7 |
|
* grammar. |
|
*/ |
|
struct eqn_box { |
|
int size; /* font size of expression */ |
|
#define EQN_DEFSIZE INT_MIN |
|
enum eqn_boxt type; /* type of node */ |
|
struct eqn_box *first; /* first child node */ |
|
struct eqn_box *last; /* last child node */ |
|
struct eqn_box *next; /* node sibling */ |
|
struct eqn_box *parent; /* node sibling */ |
|
char *text; /* text (or NULL) */ |
|
char *left; |
|
char *right; |
|
enum eqn_post pos; /* position of next box */ |
|
enum eqn_markt mark; /* a mark about the box */ |
|
enum eqn_fontt font; /* font of box */ |
|
enum eqn_pilet pile; /* equation piling */ |
|
}; |
|
|
|
/* |
|
* An equation consists of a tree of expressions starting at a given |
|
* line and position. |
|
*/ |
struct eqn { |
struct eqn { |
size_t sz; |
char *name; /* identifier (or NULL) */ |
char *data; |
struct eqn_box *root; /* root mathematical expression */ |
int line; /* invocation line */ |
int ln; /* invocation line */ |
int pos; /* invocation position */ |
int pos; /* invocation position */ |
}; |
}; |
|
|
Line 292 enum mandoc_esc { |
|
Line 378 enum mandoc_esc { |
|
ESCAPE_ERROR = 0, /* bail! unparsable escape */ |
ESCAPE_ERROR = 0, /* bail! unparsable escape */ |
ESCAPE_IGNORE, /* escape to be ignored */ |
ESCAPE_IGNORE, /* escape to be ignored */ |
ESCAPE_SPECIAL, /* a regular special character */ |
ESCAPE_SPECIAL, /* a regular special character */ |
ESCAPE_PREDEF, /* a predefined special character */ |
|
ESCAPE_FONT, /* a generic font mode */ |
ESCAPE_FONT, /* a generic font mode */ |
ESCAPE_FONTBOLD, /* bold font mode */ |
ESCAPE_FONTBOLD, /* bold font mode */ |
ESCAPE_FONTITALIC, /* italic font mode */ |
ESCAPE_FONTITALIC, /* italic font mode */ |
ESCAPE_FONTROMAN, /* roman font mode */ |
ESCAPE_FONTROMAN, /* roman font mode */ |
ESCAPE_FONTPREV, /* previous font mode */ |
ESCAPE_FONTPREV, /* previous font mode */ |
ESCAPE_NUMBERED, /* a numbered glyph */ |
ESCAPE_NUMBERED, /* a numbered glyph */ |
|
ESCAPE_UNICODE, /* a unicode codepoint */ |
ESCAPE_NOSPACE /* suppress space if the last on a line */ |
ESCAPE_NOSPACE /* suppress space if the last on a line */ |
}; |
}; |
|
|
Line 306 typedef void (*mandocmsg)(enum mandocerr, enum mandocl |
|
Line 392 typedef void (*mandocmsg)(enum mandocerr, enum mandocl |
|
const char *, int, int, const char *); |
const char *, int, int, const char *); |
|
|
struct mparse; |
struct mparse; |
|
struct mchars; |
struct mdoc; |
struct mdoc; |
struct man; |
struct man; |
|
|
Line 323 const char *mparse_strlevel(enum mandoclevel); |
|
Line 410 const char *mparse_strlevel(enum mandoclevel); |
|
void *mandoc_calloc(size_t, size_t); |
void *mandoc_calloc(size_t, size_t); |
void *mandoc_malloc(size_t); |
void *mandoc_malloc(size_t); |
void *mandoc_realloc(void *, size_t); |
void *mandoc_realloc(void *, size_t); |
|
char *mandoc_strdup(const char *); |
|
char *mandoc_strndup(const char *, size_t); |
|
|
enum mandoc_esc mandoc_escape(const char **, const char **, int *); |
enum mandoc_esc mandoc_escape(const char **, const char **, int *); |
|
|
|
struct mchars *mchars_alloc(void); |
|
char mchars_num2char(const char *, size_t); |
|
int mchars_num2uc(const char *, size_t); |
|
const char *mchars_spec2str(struct mchars *, const char *, size_t, size_t *); |
|
int mchars_spec2cp(struct mchars *, const char *, size_t); |
|
void mchars_free(struct mchars *); |
|
|
|
|
__END_DECLS |
__END_DECLS |
|
|