version 1.1, 2009/03/23 14:22:11 |
version 1.2, 2009/04/02 06:51:44 |
|
|
*/ |
*/ |
#include <assert.h> |
#include <assert.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <err.h> |
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
|
|
*/ |
*/ |
|
|
void |
void |
mdoc_tokhash_free(void *htab) |
mdoc_hash_free(void *htab) |
{ |
{ |
|
|
free(htab); |
free(htab); |
Line 40 mdoc_tokhash_free(void *htab) |
|
Line 39 mdoc_tokhash_free(void *htab) |
|
|
|
|
|
void * |
void * |
mdoc_tokhash_alloc(void) |
mdoc_hash_alloc(void) |
{ |
{ |
int i, major, minor, ind; |
int i, major, minor, ind; |
const void **htab; |
const void **htab; |
|
|
htab = calloc(27 * 26 * 3, sizeof(struct mdoc_macro *)); |
htab = calloc(27 * 26 * 3, sizeof(struct mdoc_macro *)); |
if (NULL == htab) |
if (NULL == htab) |
err(1, "calloc"); |
return(NULL); |
|
|
for (i = 1; i < MDOC_MAX; i++) { |
for (i = 1; i < MDOC_MAX; i++) { |
major = mdoc_macronames[i][0]; |
major = mdoc_macronames[i][0]; |
Line 95 mdoc_tokhash_alloc(void) |
|
Line 94 mdoc_tokhash_alloc(void) |
|
|
|
|
|
int |
int |
mdoc_tokhash_find(const void *arg, const char *tmp) |
mdoc_hash_find(const void *arg, const char *tmp) |
{ |
{ |
int major, minor, ind, slot; |
int major, minor, ind, slot; |
const void **htab; |
const void **htab; |