aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libmdoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-10-21 23:47:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-10-21 23:47:58 +0000
commit6f0fdff7bd838e5309174d1f70528d04e7474a18 (patch)
tree2a08b6583b1b1f3c153b9a539419c9a3d39d0301 /libmdoc.h
parentee091385eb708ecd7a3b7c555c2d4172dfdbfa59 (diff)
downloadmandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.tar.gz
mandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.tar.zst
mandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.zip
There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as arguments (like Nd Sh Em %T An). In the past, even the latter put each word of their arguments into its own MDOC_TEXT node; instead, concatenate arguments unless delimiters, keeps or spacing mode prevent that. Regarding mandoc(1), this is internal refactoring, no output change intended. Regarding mandocdb(8), this fixes yet another regression introduced when switching from DB to SQLite: The ability to search for strings crossing word boundaries was lost and is hereby restored. At the same time, database sizes and build times are both reduced by a bit more than 5% each.
Diffstat (limited to 'libmdoc.h')
-rw-r--r--libmdoc.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/libmdoc.h b/libmdoc.h
index 8a389a4a..3f14519d 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -1,6 +1,7 @@
-/* $Id: libmdoc.h,v 1.81 2012/11/17 00:26:33 schwarze Exp $ */
+/* $Id: libmdoc.h,v 1.82 2013/10/21 23:47:58 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -34,6 +35,8 @@ struct mdoc {
#define MDOC_PPHRASE (1 << 5) /* within a partial phrase */
#define MDOC_FREECOL (1 << 6) /* `It' invocation should close */
#define MDOC_SYNOPSIS (1 << 7) /* SYNOPSIS-style formatting */
+#define MDOC_KEEP (1 << 8) /* in a word keep */
+#define MDOC_SMOFF (1 << 9) /* spacing is off */
enum mdoc_next next; /* where to put the next node */
struct mdoc_node *last; /* the last node parsed */
struct mdoc_node *first; /* the first node parsed */
@@ -57,8 +60,8 @@ struct mdoc_macro {
#define MDOC_PARSED (1 << 1)
#define MDOC_EXPLICIT (1 << 2)
#define MDOC_PROLOGUE (1 << 3)
-#define MDOC_IGNDELIM (1 << 4)
- /* Reserved words in arguments treated as text. */
+#define MDOC_IGNDELIM (1 << 4)
+#define MDOC_JOIN (1 << 5)
};
enum margserr {
@@ -107,6 +110,7 @@ __BEGIN_DECLS
int mdoc_macro(MACRO_PROT_ARGS);
int mdoc_word_alloc(struct mdoc *,
int, int, const char *);
+void mdoc_word_append(struct mdoc *, const char *);
int mdoc_elem_alloc(struct mdoc *, int, int,
enum mdoct, struct mdoc_arg *);
int mdoc_block_alloc(struct mdoc *, int, int,