version 1.13, 2009/01/03 18:38:39 |
version 1.18, 2009/01/09 14:45:44 |
|
|
#ifndef MDOC_H |
#ifndef MDOC_H |
#define MDOC_H |
#define MDOC_H |
|
|
#define MDOC_LINEARG_MAX 8 |
#define MDOC_LINEARG_MAX 12 |
|
|
#define MDOC___ 0 |
#define MDOC___ 0 |
#define MDOC_Dd 1 |
#define MDOC_Dd 1 |
|
|
ERR_ARGS_EQ1, |
ERR_ARGS_EQ1, |
ERR_ARGS_GE1, |
ERR_ARGS_GE1, |
ERR_ARGS_LE2, |
ERR_ARGS_LE2, |
|
ERR_ARGS_LE8, |
ERR_ARGS_MANY, |
ERR_ARGS_MANY, |
ERR_SYNTAX_CHILDHEAD, |
ERR_SYNTAX_CHILDHEAD, |
ERR_SYNTAX_CHILDBODY, |
ERR_SYNTAX_CHILDBODY, |
ERR_SYNTAX_EMPTYBODY, |
ERR_SYNTAX_EMPTYBODY, |
ERR_SYNTAX_EMPTYHEAD |
ERR_SYNTAX_EMPTYHEAD, |
|
ERR_SYNTAX_NOTEXT |
}; |
}; |
|
|
enum mdoc_att { |
enum mdoc_att { |
Line 250 enum mdoc_warn { |
|
Line 252 enum mdoc_warn { |
|
WARN_IGN_BEFORE_BLK, |
WARN_IGN_BEFORE_BLK, |
WARN_IGN_OBSOLETE, |
WARN_IGN_OBSOLETE, |
WARN_SEC_OO, |
WARN_SEC_OO, |
|
WARN_SEC_REP, |
WARN_ARGS_GE1, |
WARN_ARGS_GE1, |
WARN_ARGS_EQ0, |
WARN_ARGS_EQ0, |
WARN_COMPAT_TROFF |
WARN_COMPAT_TROFF |
Line 265 enum mdoc_type { |
|
Line 268 enum mdoc_type { |
|
MDOC_TEXT, |
MDOC_TEXT, |
MDOC_ELEM, |
MDOC_ELEM, |
MDOC_HEAD, |
MDOC_HEAD, |
|
MDOC_TAIL, |
MDOC_BODY, |
MDOC_BODY, |
MDOC_BLOCK |
MDOC_BLOCK, |
|
MDOC_ROOT |
}; |
}; |
|
|
enum mdoc_msec { |
enum mdoc_msec { |
Line 376 struct mdoc_block { |
|
Line 381 struct mdoc_block { |
|
}; |
}; |
|
|
struct mdoc_head { |
struct mdoc_head { |
size_t sz; |
|
char **args; |
|
int tok; |
int tok; |
}; |
}; |
|
|
|
struct mdoc_tail { |
|
int tok; |
|
}; |
|
|
struct mdoc_body { |
struct mdoc_body { |
int tok; |
int tok; |
}; |
}; |
Line 398 union mdoc_data { |
|
Line 405 union mdoc_data { |
|
struct mdoc_elem elem; |
struct mdoc_elem elem; |
struct mdoc_body body; |
struct mdoc_body body; |
struct mdoc_head head; |
struct mdoc_head head; |
|
struct mdoc_tail tail; |
struct mdoc_block block; |
struct mdoc_block block; |
}; |
}; |
|
|
Line 406 struct mdoc_node { |
|
Line 414 struct mdoc_node { |
|
struct mdoc_node *child; |
struct mdoc_node *child; |
struct mdoc_node *next; |
struct mdoc_node *next; |
struct mdoc_node *prev; |
struct mdoc_node *prev; |
|
int line; |
|
int pos; |
enum mdoc_type type; |
enum mdoc_type type; |
union mdoc_data data; |
union mdoc_data data; |
}; |
}; |
Line 413 struct mdoc_node { |
|
Line 423 struct mdoc_node { |
|
struct mdoc_cb { |
struct mdoc_cb { |
int (*mdoc_err)(void *, int, int, enum mdoc_err); |
int (*mdoc_err)(void *, int, int, enum mdoc_err); |
int (*mdoc_warn)(void *, int, int, enum mdoc_warn); |
int (*mdoc_warn)(void *, int, int, enum mdoc_warn); |
void (*mdoc_msg)(void *, int, const char *); |
void (*mdoc_msg)(void *, int, int, const char *); |
}; |
}; |
|
|
extern const char *const *mdoc_macronames; |
extern const char *const *mdoc_macronames; |
|
|
|
|
void mdoc_free(struct mdoc *); |
void mdoc_free(struct mdoc *); |
struct mdoc *mdoc_alloc(void *data, const struct mdoc_cb *); |
struct mdoc *mdoc_alloc(void *data, const struct mdoc_cb *); |
int mdoc_parseln(struct mdoc *, char *buf); |
int mdoc_parseln(struct mdoc *, int, char *buf); |
const struct mdoc_node |
const struct mdoc_node |
*mdoc_result(struct mdoc *); |
*mdoc_result(struct mdoc *); |
|
int mdoc_endparse(struct mdoc *); |
|
|
__END_DECLS |
__END_DECLS |
|
|