aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-06-06 17:51:31 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-06-06 17:51:31 +0000
commit7f4a49958ba60f5c3043ee9fc9c6f2bd80186c8f (patch)
treef6e4d41ce7d773d3b3bcb9df4681e80f365d069e
parente57826a67fe010b43faaeb1f84e6c4def1a10e17 (diff)
downloadmandoc-7f4a49958ba60f5c3043ee9fc9c6f2bd80186c8f.tar.gz
mandoc-7f4a49958ba60f5c3043ee9fc9c6f2bd80186c8f.tar.zst
mandoc-7f4a49958ba60f5c3043ee9fc9c6f2bd80186c8f.zip
Drop wordaddbuf() which is identical to putkeys().
Also rename straddbuf() to stradds() to be more similar to putkeys(). Just cleanup, no functional change.
-rw-r--r--mandocdb.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 1829f4b9..6e0254ac 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.63 2013/06/06 15:15:07 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.64 2013/06/06 17:51:31 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -157,17 +157,15 @@ static int set_basedir(const char *);
static void putkey(const struct of *,
const char *, uint64_t);
static void putkeys(const struct of *,
- const char *, int, uint64_t);
+ const char *, size_t, uint64_t);
static void putmdockey(const struct of *,
const struct mdoc_node *, uint64_t);
static void say(const char *, const char *, ...);
static char *stradd(const char *);
-static char *straddbuf(const char *, size_t);
+static char *stradds(const char *, size_t);
static int treescan(void);
static size_t utf8(unsigned int, char [7]);
static void utf8key(struct mchars *, struct str *);
-static void wordaddbuf(const struct of *,
- const char *, size_t, uint64_t);
static char *progname;
static int use_all; /* use all found files */
@@ -1154,17 +1152,7 @@ putkey(const struct of *of, const char *value, uint64_t type)
{
assert(NULL != value);
- wordaddbuf(of, value, strlen(value), type);
-}
-
-/*
- * Like putkey() but for unterminated strings.
- */
-static void
-putkeys(const struct of *of, const char *value, int sz, uint64_t type)
-{
-
- wordaddbuf(of, value, sz, type);
+ putkeys(of, value, strlen(value), type);
}
/*
@@ -1537,13 +1525,13 @@ parse_mdoc_body(struct of *of, const struct mdoc_node *n)
}
/*
- * See straddbuf().
+ * See stradds().
*/
static char *
stradd(const char *cp)
{
- return(straddbuf(cp, strlen(cp)));
+ return(stradds(cp, strlen(cp)));
}
/*
@@ -1553,10 +1541,10 @@ stradd(const char *cp)
* In using it, we avoid having thousands of (e.g.) "cat1" string
* allocations for the "of" table.
* We also have a layer atop the string table for keeping track of words
- * in a parse sequence (see wordaddbuf()).
+ * in a parse sequence (see putkeys()).
*/
static char *
-straddbuf(const char *cp, size_t sz)
+stradds(const char *cp, size_t sz)
{
struct str *s;
unsigned int index;
@@ -1596,8 +1584,7 @@ hashget(const char *cp, size_t sz)
* of its entries without conflict.
*/
static void
-wordaddbuf(const struct of *of,
- const char *cp, size_t sz, uint64_t v)
+putkeys(const struct of *of, const char *cp, size_t sz, uint64_t v)
{
struct str *s;
unsigned int index;