]> git.cameronkatri.com Git - mandoc.git/blob - man_hash.c
First addition of -man macro support.
[mandoc.git] / man_hash.c
1 /* $Id: man_hash.c,v 1.1 2009/03/23 14:22:11 kristaps Exp $ */
2 /*
3 * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19 #include <assert.h>
20 #include <ctype.h>
21 #include <err.h>
22 #include <stdlib.h>
23 #include <stdio.h>
24 #include <string.h>
25
26 #include "libman.h"
27
28 /* ARGUSED */
29 void
30 man_hash_free(void *htab)
31 {
32
33 /* Do nothing. */
34 }
35
36
37 /* ARGUSED */
38 void *
39 man_hash_alloc(void)
40 {
41
42 /* Do nothing. */
43 return(NULL);
44 }
45
46
47 int
48 man_hash_find(const void *arg, const char *tmp)
49 {
50 int i;
51
52 for (i = 0; i < MAN_MAX; i++)
53 if (0 == strcasecmp(tmp, man_macronames[i]))
54 return(i);
55
56 return(MAN_MAX);
57 }
58