xref: /titanic_44/usr/src/cmd/abi/spectrans/spec2map/bucket.h (revision 753d2d2e8e7fd0c9bcf736d9bf2f2faf4d6234cc)
1*753d2d2eSraf /*
2*753d2d2eSraf  * CDDL HEADER START
3*753d2d2eSraf  *
4*753d2d2eSraf  * The contents of this file are subject to the terms of the
5*753d2d2eSraf  * Common Development and Distribution License, Version 1.0 only
6*753d2d2eSraf  * (the "License").  You may not use this file except in compliance
7*753d2d2eSraf  * with the License.
8*753d2d2eSraf  *
9*753d2d2eSraf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*753d2d2eSraf  * or http://www.opensolaris.org/os/licensing.
11*753d2d2eSraf  * See the License for the specific language governing permissions
12*753d2d2eSraf  * and limitations under the License.
13*753d2d2eSraf  *
14*753d2d2eSraf  * When distributing Covered Code, include this CDDL HEADER in each
15*753d2d2eSraf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*753d2d2eSraf  * If applicable, add the following below this CDDL HEADER, with the
17*753d2d2eSraf  * fields enclosed by brackets "[]" replaced with your own identifying
18*753d2d2eSraf  * information: Portions Copyright [yyyy] [name of copyright owner]
19*753d2d2eSraf  *
20*753d2d2eSraf  * CDDL HEADER END
21*753d2d2eSraf  */
22*753d2d2eSraf /*
23*753d2d2eSraf  * Copyright 1997-1999,2003 Sun Microsystems, Inc.  All rights reserved.
24*753d2d2eSraf  * Use is subject to license terms.
25*753d2d2eSraf  */
26*753d2d2eSraf 
27*753d2d2eSraf #ifndef	_BUCKET_H
28*753d2d2eSraf #define	_BUCKET_H
29*753d2d2eSraf 
30*753d2d2eSraf #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*753d2d2eSraf 
32*753d2d2eSraf #ifdef	__cplusplus
33*753d2d2eSraf extern "C" {
34*753d2d2eSraf #endif
35*753d2d2eSraf 
36*753d2d2eSraf struct bucketlist {
37*753d2d2eSraf 	struct bucket *bl_bucket;
38*753d2d2eSraf 	struct bucketlist *bl_next;
39*753d2d2eSraf };
40*753d2d2eSraf 
41*753d2d2eSraf typedef struct bucket {
42*753d2d2eSraf 	char *b_name;
43*753d2d2eSraf 	struct bucket *b_parent;
44*753d2d2eSraf 	struct bucketlist *b_uncles;
45*753d2d2eSraf 	struct bucket *b_thread;
46*753d2d2eSraf 	int b_has_locals;	/* Should contain ``local:*;'' */
47*753d2d2eSraf 	int b_has_protecteds;	/* Has ``protected:'' section */
48*753d2d2eSraf 	int b_was_printed;	/* For loop detection. */
49*753d2d2eSraf 	int b_weak;		/* Weak interface. */
50*753d2d2eSraf 	table_t *b_global_table;
51*753d2d2eSraf 	table_t *b_protected_table;
52*753d2d2eSraf } bucket_t;
53*753d2d2eSraf 
54*753d2d2eSraf 
55*753d2d2eSraf /* Bucket interfaces, general. */
56*753d2d2eSraf extern void create_lists(void);
57*753d2d2eSraf extern void delete_lists(void);
58*753d2d2eSraf extern void print_bucket(const bucket_t *);
59*753d2d2eSraf extern void print_all_buckets(void);
60*753d2d2eSraf 
61*753d2d2eSraf /* Transformation interfaces. */
62*753d2d2eSraf extern void sort_buckets(void);
63*753d2d2eSraf extern void thread_trees(void);
64*753d2d2eSraf extern void add_local(void);
65*753d2d2eSraf 
66*753d2d2eSraf /* Composite interfaces for insertion. */
67*753d2d2eSraf extern int add_by_name(const char *, const Interface *);
68*753d2d2eSraf extern int add_parent(const char *, const char *, int);
69*753d2d2eSraf extern int add_uncle(const char *, const char *, int);
70*753d2d2eSraf 
71*753d2d2eSraf /* Output Interfaces, iterators */
72*753d2d2eSraf extern bucket_t *first_list(void);
73*753d2d2eSraf extern bucket_t *next_list(void);
74*753d2d2eSraf extern bucket_t *first_from_list(const bucket_t *);
75*753d2d2eSraf extern bucket_t *next_from_list(void);
76*753d2d2eSraf 
77*753d2d2eSraf /* Output Interfaces, extraction. */
78*753d2d2eSraf extern char **parents_of(const bucket_t *);
79*753d2d2eSraf 
80*753d2d2eSraf extern void set_weak(const char *, int);
81*753d2d2eSraf 
82*753d2d2eSraf typedef struct {
83*753d2d2eSraf 	int h_hash;
84*753d2d2eSraf 	char *h_version_name;
85*753d2d2eSraf 	bucket_t *h_bucket;
86*753d2d2eSraf } hashmap_t;
87*753d2d2eSraf 
88*753d2d2eSraf #ifdef	__cplusplus
89*753d2d2eSraf }
90*753d2d2eSraf #endif
91*753d2d2eSraf 
92*753d2d2eSraf #endif /* _BUCKET_H */
93