aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit4d1bc0c8c120742600a57c849edf1b2481c45e26 (patch)
treea34e167ede1a560af694e85311e4283146871c92 /mandoc.h
parent8686868cc9a1d5c5f474b8cdbd718b152b4d6188 (diff)
downloadmandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.tar.gz
mandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.tar.zst
mandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.zip
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.h17
1 files changed, 16 insertions, 1 deletions
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 <kristaps@bsd.lv>
*
@@ -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*/