1178481Sjb/*
2178481Sjb * CDDL HEADER START
3178481Sjb *
4178481Sjb * The contents of this file are subject to the terms of the
5178481Sjb * Common Development and Distribution License, Version 1.0 only
6178481Sjb * (the "License").  You may not use this file except in compliance
7178481Sjb * with the License.
8178481Sjb *
9178481Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10178481Sjb * or http://www.opensolaris.org/os/licensing.
11178481Sjb * See the License for the specific language governing permissions
12178481Sjb * and limitations under the License.
13178481Sjb *
14178481Sjb * When distributing Covered Code, include this CDDL HEADER in each
15178481Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16178481Sjb * If applicable, add the following below this CDDL HEADER, with the
17178481Sjb * fields enclosed by brackets "[]" replaced with your own identifying
18178481Sjb * information: Portions Copyright [yyyy] [name of copyright owner]
19178481Sjb *
20178481Sjb * CDDL HEADER END
21178481Sjb */
22178481Sjb/*
23178481Sjb * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24178481Sjb * Use is subject to license terms.
25178481Sjb */
26178481Sjb
27178481Sjb#ifndef _HASH_H
28178481Sjb#define	_HASH_H
29178481Sjb
30178481Sjb#pragma ident	"%Z%%M%	%I%	%E% SMI"
31178481Sjb
32178481Sjb/*
33178481Sjb * Routines for manipulating hash tables
34178481Sjb */
35178481Sjb
36178481Sjb#ifdef __cplusplus
37178481Sjbextern "C" {
38178481Sjb#endif
39178481Sjb
40178481Sjbtypedef struct hash hash_t;
41178481Sjb
42178481Sjbhash_t *hash_new(int, int (*)(int, void *), int (*)(void *, void *));
43178481Sjbvoid hash_add(hash_t *, void *);
44178481Sjbvoid hash_merge(hash_t *, hash_t *);
45178481Sjbvoid hash_remove(hash_t *, void *);
46178481Sjbint hash_find(hash_t *, void *, void **);
47178481Sjbint hash_find_iter(hash_t *, void *, int (*)(void *, void *), void *);
48178481Sjbint hash_iter(hash_t *, int (*)(void *, void *), void *);
49178481Sjbint hash_match(hash_t *, void *, int (*)(void *, void *), void *);
50178481Sjbint hash_count(hash_t *);
51178481Sjbint hash_name(int, const char *);
52178481Sjbvoid hash_stats(hash_t *, int);
53178481Sjbvoid hash_free(hash_t *, void (*)(void *, void *), void *);
54178481Sjb
55178481Sjb#ifdef __cplusplus
56178481Sjb}
57178481Sjb#endif
58178481Sjb
59178481Sjb#endif /* _HASH_H */
60