/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <string.h>
#include <stdlib.h>
static int calc_hash(const char *);
hash_node_t **
{
return (hash);
}
int
{
int index;
if (!node) {
return (-1);
}
/*
* possible enhancement would be to search
* in this index for a duplicate
*/
return (0);
}
/*
* lookup
*
* Description:
* Searches the hash to find a node.
*
* Return values:
* 0 if not found.
* pointer to node if found.
*/
void *
{
int index;
while (node) {
}
return (0);
}
void *
{
int index;
void *retval;
return (0);
}
return (retval);
}
}
/* did we find it? */
if (node) {
return (retval);
}
return (0);
}
void
{
int i;
for (i = 0; i < HASH_PRIME; i++) {
p = hash[ i ];
while (p) {
if (callback) {
}
free(p);
p = next;
}
}
}
/* ---------------------------------------------------------------------- */
/*
* Basic rotating hash, as per Knuth.
*/
static int
{
unsigned int hash, i;
}
return (hash % HASH_PRIME);
}