X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/569291aa948d0c424a458fd6b732f178f8d52c30..a07f0a16ba6e6322f4f665e7d97e7dba650e8192:/mandoc.h diff --git a/mandoc.h b/mandoc.h index cf20bfbc..5f01644c 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.68 2011/03/23 09:47:13 kristaps Exp $ */ +/* $Id: mandoc.h,v 1.76 2011/05/17 11:50:20 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * @@ -288,10 +288,26 @@ enum mparset { MPARSE_MAN /* assume -man */ }; +enum mandoc_esc { + ESCAPE_ERROR = 0, /* bail! unparsable escape */ + ESCAPE_IGNORE, /* escape to be ignored */ + ESCAPE_SPECIAL, /* a regular special character */ + ESCAPE_PREDEF, /* a predefined special character */ + ESCAPE_FONT, /* a generic font mode */ + ESCAPE_FONTBOLD, /* bold font mode */ + ESCAPE_FONTITALIC, /* italic font mode */ + ESCAPE_FONTROMAN, /* roman font mode */ + ESCAPE_FONTPREV, /* previous font mode */ + ESCAPE_NUMBERED, /* a numbered glyph */ + ESCAPE_UNICODE, /* a unicode codepoint */ + ESCAPE_NOSPACE /* suppress space if the last on a line */ +}; + typedef void (*mandocmsg)(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); struct mparse; +struct mchars; struct mdoc; struct man; @@ -303,11 +319,25 @@ struct mparse *mparse_alloc(enum mparset, enum mandoclevel, mandocmsg, void *); enum mandoclevel mparse_readfd(struct mparse *, int, const char *); void mparse_result(struct mparse *, struct mdoc **, struct man **); +const char *mparse_strerror(enum mandocerr); +const char *mparse_strlevel(enum mandoclevel); void *mandoc_calloc(size_t, size_t); void *mandoc_malloc(size_t); void *mandoc_realloc(void *, size_t); +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); +const char *mchars_res2str(struct mchars *, const char *, size_t, size_t *); +int mchars_res2cp(struct mchars *, const char *, size_t); +void mchars_free(struct mchars *); + + __END_DECLS #endif /*!MANDOC_H*/