8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / tools / ctf / cvt / strtab.h
blob7176e073782568db1ccf9face34c12400c119a8f
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright (c) 2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _STRTAB_H
28 #define _STRTAB_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
38 typedef struct strhash {
39 const char *str_data; /* pointer to actual string data */
40 ulong_t str_buf; /* index of string data buffer */
41 size_t str_off; /* offset in bytes of this string */
42 size_t str_len; /* length in bytes of this string */
43 struct strhash *str_next; /* next string in hash chain */
44 } strhash_t;
46 typedef struct strtab {
47 strhash_t **str_hash; /* array of hash buckets */
48 ulong_t str_hashsz; /* size of hash bucket array */
49 char **str_bufs; /* array of buffer pointers */
50 char *str_ptr; /* pointer to current buffer location */
51 ulong_t str_nbufs; /* size of buffer pointer array */
52 size_t str_bufsz; /* size of individual buffer */
53 ulong_t str_nstrs; /* total number of strings in strtab */
54 size_t str_size; /* total size of strings in bytes */
55 } strtab_t;
57 extern void strtab_create(strtab_t *);
58 extern void strtab_destroy(strtab_t *);
59 extern size_t strtab_insert(strtab_t *, const char *);
60 extern size_t strtab_size(const strtab_t *);
61 extern ssize_t strtab_write(const strtab_t *,
62 ssize_t (*)(const void *, size_t, void *), void *);
63 extern void strtab_print(const strtab_t *);
65 #ifdef __cplusplus
67 #endif
69 #endif /* _STRTAB_H */