/*
* 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 (c) 1994, 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "med_hash.h"
#include "med_local.h"
#ifdef _KERNEL
#endif /* _KERNEL */
#define VERIFY_HASH_REALLOC
static int
{
}
static int
{
char *cp;
int hv = 0;
;
}
int
int hsz,
int bsz,
int (*hfunc)(void *, int, int),
int (*cfunc)(void *, void *, int),
void (*kffunc)(void *),
void (*dffunc)(void *)
)
{
int i;
return (-1);
}
return (-1);
}
}
/* Hash function */
else
/* Compare function */
else
/* Key free function */
else
/* Data free function */
else
return (0);
}
int
{
"add_cache(): init_cache() not called.\n");
return (-1);
}
} else {
#ifdef VERIFY_HASH_REALLOC
#endif /* VERIFY_HASH_REALLOC */
titempp =
#ifdef _KERNEL
#else /* !_KERNEL */
#endif /* _KERNEL */
} else
}
"add_cache(): out of memory\n");
return (-1);
}
}
return (0);
}
Item *
{
int i;
"lookup_cache(): init_cache() not called.\n");
return (Null_Item);
}
return (Null_Item);
}
Item *
{
"first_item(): init_cache() not called.\n");
return (Null_Item);
}
/* void */;
*iidx = 0;
} else {
*bidx = -1;
*iidx = -1;
}
return (itemp);
}
Item *
{
"next_item(): init_cache() not called.\n");
return (Null_Item);
}
} else {
for (++(*bidx);
(*bidx)++)
/* void */;
*iidx = 0;
} else {
*bidx = -1;
*iidx = -1;
}
}
} else {
*bidx = -1;
*iidx = -1;
}
return (itemp);
}
void
{
int i;
int j;
"des_cache(): init_cache() not called.\n");
return;
}
}
}
}
}
int
{
int bidx;
int iidx;
int tidx;
int retval = 0;
"del_cache(): init_cache() not called.\n");
return (-1);
}
datalen)) {
break;
}
} else {
}
}
} else {
"del_cache(): item not found.\n");
retval = -1;
}
return (retval);
}
#ifdef DEBUG
void
{
int bidx;
"cache_stat(): init_cache() not called.\n");
return;
}
(void) printf(
(void) printf(
" Utilization %d%%",
}
(void) printf("\n");
}
}
}
void
{
int bidx;
int iidx;
"pr_cache(): init_cache() not called.\n");
return;
}
}
}
}
#endif /* DEBUG */