summaryrefslogtreecommitdiffstats
path: root/mandoc.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-29 22:18:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-29 22:18:12 +0000
commitca0ffe9dcbdc75b372adf897f81053ccd2df605e (patch)
tree9f55cfc1c41bcf64290b9c493f1d4f2403f3780b /mandoc.h
parentc8b861b7ce8fa5f991be88f5f1b2476c455fe717 (diff)
downloadmandoc-ca0ffe9dcbdc75b372adf897f81053ccd2df605e.tar.gz
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.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/mandoc.h b/mandoc.h
index a838c325..477f8809 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -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*/