aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_hash.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-04-02 06:51:44 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-04-02 06:51:44 +0000
commitf8fe5d9a147b378ab9cd53f2287730070ded22c2 (patch)
treeac8804842dcd211cf3ee64177bff113640075a2c /mdoc_hash.c
parent4cd2606cca8b6f78a9d90bec6f4fa0c45c2dcd0f (diff)
downloadmandoc-f8fe5d9a147b378ab9cd53f2287730070ded22c2.tar.gz
mandoc-f8fe5d9a147b378ab9cd53f2287730070ded22c2.tar.zst
mandoc-f8fe5d9a147b378ab9cd53f2287730070ded22c2.zip
mdoc_tokhash -> hash
Initial man hashtab (BROKEN).
Diffstat (limited to 'mdoc_hash.c')
-rw-r--r--mdoc_hash.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mdoc_hash.c b/mdoc_hash.c
index 5127095c..cf8c2056 100644
--- a/mdoc_hash.c
+++ b/mdoc_hash.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_hash.c,v 1.1 2009/03/23 14:22:11 kristaps Exp $ */
+/* $Id: mdoc_hash.c,v 1.2 2009/04/02 06:51:44 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -18,7 +18,6 @@
*/
#include <assert.h>
#include <ctype.h>
-#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -32,7 +31,7 @@
*/
void
-mdoc_tokhash_free(void *htab)
+mdoc_hash_free(void *htab)
{
free(htab);
@@ -40,14 +39,14 @@ mdoc_tokhash_free(void *htab)
void *
-mdoc_tokhash_alloc(void)
+mdoc_hash_alloc(void)
{
int i, major, minor, ind;
const void **htab;
htab = calloc(27 * 26 * 3, sizeof(struct mdoc_macro *));
if (NULL == htab)
- err(1, "calloc");
+ return(NULL);
for (i = 1; i < MDOC_MAX; i++) {
major = mdoc_macronames[i][0];
@@ -95,7 +94,7 @@ mdoc_tokhash_alloc(void)
int
-mdoc_tokhash_find(const void *arg, const char *tmp)
+mdoc_hash_find(const void *arg, const char *tmp)
{
int major, minor, ind, slot;
const void **htab;