From 4d1bc0c8c120742600a57c849edf1b2481c45e26 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 29 Apr 2011 22:18:12 +0000 Subject: Move "chars" interface out of out.h and into mandoc.h. This doesn't change any code but for renaming functions and types to be consistent with other mandoc.h stuff. The reason for moving into libmandoc is that the rendering of special characters is part of mandoc itself---not an external part. From mandoc(1)'s perspective, this changes nothing, but for other utilities, it's important to have these part of libmandoc. Note this isn't documented [yet] in mandoc.3 because there are some parts I'd like to change around beforehand. --- mandoc.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'mandoc.h') diff --git a/mandoc.h b/mandoc.h index ce9cf0c3..b42ce81e 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.70 2011/04/09 15:29:40 kristaps Exp $ */ +/* $Id: mandoc.h,v 1.71 2011/04/29 22:18:12 kristaps Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * @@ -302,10 +302,16 @@ enum mandoc_esc { ESCAPE_NOSPACE /* suppress space if the last on a line */ }; +enum mcharst { + MCHARS_ASCII, /* 7-bit ascii representation */ + MCHARS_HTML /* unicode values */ +}; + typedef void (*mandocmsg)(enum mandocerr, enum mandoclevel, const char *, int, int, const char *); struct mparse; +struct mchars; struct mdoc; struct man; @@ -326,6 +332,15 @@ void *mandoc_realloc(void *, size_t); enum mandoc_esc mandoc_escape(const char **, const char **, int *); +struct mchars *mchars_init(enum mcharst); +const char *mchars_num2char(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*/ -- cgit v1.2.3-56-ge451