aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 09:16:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 09:16:38 +0000
commit154c74a463b9f4d0c87a3161a60df5ce17c366c9 (patch)
tree71d24bb33de21624f0ddc202816da1a8e7025f9b /mandoc.h
parent92c367a844f2f26d325d4ee6ca032894e94f7a06 (diff)
downloadmandoc-154c74a463b9f4d0c87a3161a60df5ce17c366c9.tar.gz
mandoc-154c74a463b9f4d0c87a3161a60df5ce17c366c9.tar.zst
mandoc-154c74a463b9f4d0c87a3161a60df5ce17c366c9.zip
Move mdoc_isdelim() into mandoc.h as mandoc_isdelim(). This allows the
removal of manual delimiter checks in html.c and term.c. Finally, add the escaped period as a closing delimiter, removing a TODO to this effect.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/mandoc.h b/mandoc.h
index ad0345db..447dbd55 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.59 2011/03/17 08:49:34 kristaps Exp $ */
+/* $Id: mandoc.h,v 1.60 2011/03/17 09:16:38 kristaps Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -312,6 +312,22 @@ struct regset {
struct reg regs[REG__MAX];
};
+/*
+ * A punctuation delimiter, used only in mdoc(7) documents, is opening,
+ * closing, or "middle mark" punctuation. These govern spacing.
+ * Opening punctuation (e.g., the opening parenthesis) suppresses the
+ * following space; closing punctuation (e.g., the closing parenthesis)
+ * suppresses the leading space; middle punctuation (e.g., the vertical
+ * bar) can do either. The middle punctuation delimiter bends the rules
+ * depending on usage.
+ */
+enum mdelim {
+ DELIM_NONE = 0,
+ DELIM_OPEN,
+ DELIM_MIDDLE,
+ DELIM_CLOSE
+};
+
typedef int (*mandocmsg)(enum mandocerr, void *,
int, int, const char *);
@@ -320,6 +336,8 @@ __BEGIN_DECLS
void *mandoc_calloc(size_t, size_t);
void *mandoc_malloc(size_t);
void *mandoc_realloc(void *, size_t);
+#define DELIMSZ 6 /* hint: max possible size of a delimiter */
+enum mdelim mandoc_isdelim(const char *);
__END_DECLS