version 1.12, 2009/09/16 14:40:56 |
version 1.15, 2009/09/23 11:53:45 |
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <limits.h> |
#include <limits.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
|
|
#include "libman.h" |
#include "libman.h" |
|
|
|
static u_char table[26 * 6]; |
|
|
static unsigned char table[26 * 6]; |
/* |
|
* XXX - this hash has global scope, so if intended for use as a library |
|
* with multiple callers, it will need re-invocation protection. |
|
*/ |
void |
void |
man_hash_init(void) |
man_hash_init(void) |
{ |
{ |
Line 42 man_hash_init(void) |
|
Line 46 man_hash_init(void) |
|
|
|
for (j = 0; j < 6; j++) |
for (j = 0; j < 6; j++) |
if (UCHAR_MAX == table[x + j]) { |
if (UCHAR_MAX == table[x + j]) { |
table[x + j] = i; |
table[x + j] = (u_char)i; |
break; |
break; |
} |
} |
assert(j < 6); |
assert(j < 6); |
} |
} |
} |
} |
|
|
|
|
int |
int |
man_hash_find(const char *tmp) |
man_hash_find(const char *tmp) |