From eae8f4ff2cd357d92c5e6aa901cf82cc4d344470 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 23 Mar 2009 14:22:11 +0000 Subject: First addition of -man macro support. Abstraction of mdoc. --- man_hash.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 man_hash.c (limited to 'man_hash.c') diff --git a/man_hash.c b/man_hash.c new file mode 100644 index 00000000..918258e1 --- /dev/null +++ b/man_hash.c @@ -0,0 +1,58 @@ +/* $Id: man_hash.c,v 1.1 2009/03/23 14:22:11 kristaps Exp $ */ +/* + * Copyright (c) 2008, 2009 Kristaps Dzonsons + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ +#include +#include +#include +#include +#include +#include + +#include "libman.h" + +/* ARGUSED */ +void +man_hash_free(void *htab) +{ + + /* Do nothing. */ +} + + +/* ARGUSED */ +void * +man_hash_alloc(void) +{ + + /* Do nothing. */ + return(NULL); +} + + +int +man_hash_find(const void *arg, const char *tmp) +{ + int i; + + for (i = 0; i < MAN_MAX; i++) + if (0 == strcasecmp(tmp, man_macronames[i])) + return(i); + + return(MAN_MAX); +} + -- cgit v1.2.3-56-ge451