/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines for manipulating hash tables
*/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/sysmacros.h>
#include "hash.h"
#include "memory.h"
#include "list.h"
struct hash {
int h_nbuckets;
int (*h_hashfn)(int, void *);
int (*h_cmp)(void *, void *);
};
struct hash_data {
int (*hd_fun)();
void *hd_key;
void *hd_private;
void *hd_ret;
};
static int
{
}
static int
{
}
int
{
const char *c;
ulong_t g;
int h = 0;
for (c = name; *c; c++) {
h = (h << 4) + *c;
if ((g = (h & 0xf0000000)) != 0) {
h ^= (g >> 24);
h ^= g;
}
}
return (h % nbuckets);
}
hash_t *
{
return (hash);
}
void
{
}
static int
{
return (0);
}
void
{
}
static int
{
}
void
{
(int (*)())hash_remove_cb, hash);
}
int
void *private)
{
}
static int
{
int cbrc;
int rc = 0;
return (cbrc);
}
return (rc);
}
int
void *private)
{
&hd));
}
/* stop on first match */
static int
{
return (-1);
}
return (0);
}
int
{
int ret;
return (ret);
}
int
{
int cumrc = 0;
int cbrc;
int i;
for (i = 0; i < hash->h_nbuckets; i++) {
private)) < 0)
return (cbrc);
}
}
return (cumrc);
}
int
{
int num, i;
return (num);
}
void
{
int i;
return;
for (i = 0; i < hash->h_nbuckets; i++)
}
void
{
int minidx = 0;
int maxidx = 0;
int count;
int i;
minidx = i;
}
maxidx = i;
}
}
printf("Hash statistics:\n");
}