xref: /illumos-gate/usr/src/cmd/abi/spectrans/spec2map/bucket.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
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 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 struct bucketlist {
35 	struct bucket *bl_bucket;
36 	struct bucketlist *bl_next;
37 };
38 
39 typedef struct bucket {
40 	char *b_name;
41 	struct bucket *b_parent;
42 	struct bucketlist *b_uncles;
43 	struct bucket *b_thread;
44 	int b_has_locals;	/* Should contain ``local:*;'' */
45 	int b_has_protecteds;	/* Has ``protected:'' section */
46 	int b_was_printed;	/* For loop detection. */
47 	int b_weak;		/* Weak interface. */
48 	table_t *b_global_table;
49 	table_t *b_protected_table;
50 } bucket_t;
51 
52 
53 /* Bucket interfaces, general. */
54 extern void create_lists(void);
55 extern void delete_lists(void);
56 extern void print_bucket(const bucket_t *);
57 extern void print_all_buckets(void);
58 
59 /* Transformation interfaces. */
60 extern void sort_buckets(void);
61 extern void thread_trees(void);
62 extern void add_local(void);
63 
64 /* Composite interfaces for insertion. */
65 extern int add_by_name(const char *, const Interface *);
66 extern int add_parent(const char *, const char *, int);
67 extern int add_uncle(const char *, const char *, int);
68 
69 /* Output Interfaces, iterators */
70 extern bucket_t *first_list(void);
71 extern bucket_t *next_list(void);
72 extern bucket_t *first_from_list(const bucket_t *);
73 extern bucket_t *next_from_list(void);
74 
75 /* Output Interfaces, extraction. */
76 extern char **parents_of(const bucket_t *);
77 
78 extern void set_weak(const char *, int);
79 
80 typedef struct {
81 	int h_hash;
82 	char *h_version_name;
83 	bucket_t *h_bucket;
84 } hashmap_t;
85 
86 #ifdef	__cplusplus
87 }
88 #endif
89 
90 #endif /* _BUCKET_H */
91