bc24d650d3d8c841a6fa01fc672ec9727d0eb267
[become] / src / name.h
1 /* -*-c-*-
2 *
3 * $Id: name.h,v 1.4 1997/09/17 10:26:11 mdw Exp $
4 *
5 * Looking up of names in symbol tables
6 *
7 * (c) 1997 EBI
8 */
9
10 /*----- Licensing notice --------------------------------------------------*
11 *
12 * This file is part of `become'
13 *
14 * `Become' is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * `Become' is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with `become'; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29 /*----- Revision history --------------------------------------------------*
30 *
31 * $Log: name.h,v $
32 * Revision 1.4 1997/09/17 10:26:11 mdw
33 * Use rewritten class handler. Support `none' class.
34 *
35 * Revision 1.3 1997/08/20 16:18:05 mdw
36 * Replace `name_reinit' by `name_end' for more sensible restart.
37 *
38 * Revision 1.2 1997/08/04 10:24:24 mdw
39 * Sources placed under CVS control.
40 *
41 * Revision 1.1 1997/07/21 13:47:46 mdw
42 * Initial revision
43 *
44 */
45
46 #ifndef NAMES_H
47 #define NAMES_H
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /*----- Required headers --------------------------------------------------*/
54
55 #ifndef CLASS_H
56 # include "class.h"
57 #endif
58
59 #ifndef SYM_H
60 # include "sym.h"
61 #endif
62
63 /*----- Data structures ---------------------------------------------------*/
64
65 typedef struct name {
66 sym_base base; /* Base block for symbol table */
67 class_node *c; /* Base class pointer */
68 } name;
69
70 /*----- Functions provided ------------------------------------------------*/
71
72 /* --- @name_init@ --- *
73 *
74 * Arguments: ---
75 *
76 * Returns: ---
77 *
78 * Use: Initialises the name table. Requires the user database to
79 * be populated (see @userdb_local@ and @userdb_yp@).
80 */
81
82 extern void name_init(void);
83
84 /* --- @name_end@ --- *
85 *
86 * Arguments: ---
87 *
88 * Returns: ---
89 *
90 * Use: Closes down the name database, so that it can be
91 * reinitialised.
92 */
93
94 extern void name_end(void);
95
96 /* --- @name_find@ --- *
97 *
98 * Arguments: @const char *p@ = pointer to name to look up
99 * @unsigned create@ = whether to create the item
100 * @unsigned *f@ = whether the item was created
101 *
102 * Returns: Pointer to a @name@ block containing the symbol, or
103 * zero if it wasn't found and we didn't want to create a
104 * new one.
105 *
106 * Use: Looks up a name in the symbol table and returns the
107 * item so located.
108 */
109
110 extern name *name_find(const char */*p*/,
111 unsigned /*create*/,
112 unsigned */*f*/);
113
114 /* --- @name_dump@ --- *
115 *
116 * Arguments: ---
117 *
118 * Returns: ---
119 *
120 * Use: Dumps a complete listing of the symbol table.
121 */
122
123 extern void name_dump(void);
124
125 /*----- That's all, folks -------------------------------------------------*/
126
127 #ifdef __cplusplus
128 }
129 #endif
130
131 #endif