4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
31 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/types.h>
39 typedef struct fmd_buf
{
40 char *buf_name
; /* name of this buffer */
41 struct fmd_buf
*buf_next
; /* next buffer in hash chain */
42 void *buf_data
; /* buffer data storage */
43 size_t buf_size
; /* buffer size */
44 uint_t buf_flags
; /* buffer flags (see below) */
47 #define FMD_BUF_DIRTY 0x1 /* buffer is dirty (needs checkpoint) */
49 typedef void fmd_buf_f(fmd_buf_t
*, void *);
51 typedef struct fmd_buf_hash
{
52 fmd_buf_t
**bh_hash
; /* hash bucket array for buffers */
53 uint_t bh_hashlen
; /* length of hash bucket array */
54 uint_t bh_count
; /* number of buffers in hash */
57 extern void fmd_buf_hash_create(fmd_buf_hash_t
*);
58 extern size_t fmd_buf_hash_destroy(fmd_buf_hash_t
*);
59 extern void fmd_buf_hash_apply(fmd_buf_hash_t
*, fmd_buf_f
*, void *);
60 extern void fmd_buf_hash_commit(fmd_buf_hash_t
*);
61 extern uint_t
fmd_buf_hash_count(fmd_buf_hash_t
*);
63 extern fmd_buf_t
*fmd_buf_insert(fmd_buf_hash_t
*, const char *, size_t);
64 extern fmd_buf_t
*fmd_buf_lookup(fmd_buf_hash_t
*, const char *);
65 extern void fmd_buf_delete(fmd_buf_hash_t
*, const char *);
71 #endif /* _FMD_BUF_H */