xref: /titanic_41/usr/src/cmd/abi/spectrans/spec2map/bucket.h (revision 1bdd6c0e3710e91cb1f31aa78de33cb638494480)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1997-1999,2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_BUCKET_H
28 #define	_BUCKET_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 struct bucketlist {
37 	struct bucket *bl_bucket;
38 	struct bucketlist *bl_next;
39 };
40 
41 typedef struct bucket {
42 	char *b_name;
43 	struct bucket *b_parent;
44 	struct bucketlist *b_uncles;
45 	struct bucket *b_thread;
46 	int b_has_locals;	/* Should contain ``local:*;'' */
47 	int b_has_protecteds;	/* Has ``protected:'' section */
48 	int b_was_printed;	/* For loop detection. */
49 	int b_weak;		/* Weak interface. */
50 	table_t *b_global_table;
51 	table_t *b_protected_table;
52 } bucket_t;
53 
54 
55 /* Bucket interfaces, general. */
56 extern void create_lists(void);
57 extern void delete_lists(void);
58 extern void print_bucket(const bucket_t *);
59 extern void print_all_buckets(void);
60 
61 /* Transformation interfaces. */
62 extern void sort_buckets(void);
63 extern void thread_trees(void);
64 extern void add_local(void);
65 
66 /* Composite interfaces for insertion. */
67 extern int add_by_name(const char *, const Interface *);
68 extern int add_parent(const char *, const char *, int);
69 extern int add_uncle(const char *, const char *, int);
70 
71 /* Output Interfaces, iterators */
72 extern bucket_t *first_list(void);
73 extern bucket_t *next_list(void);
74 extern bucket_t *first_from_list(const bucket_t *);
75 extern bucket_t *next_from_list(void);
76 
77 /* Output Interfaces, extraction. */
78 extern char **parents_of(const bucket_t *);
79 
80 extern void set_weak(const char *, int);
81 
82 typedef struct {
83 	int h_hash;
84 	char *h_version_name;
85 	bucket_t *h_bucket;
86 } hashmap_t;
87 
88 #ifdef	__cplusplus
89 }
90 #endif
91 
92 #endif /* _BUCKET_H */
93