c4f2d992 |
1 | /* -*-c-*- |
2 | * |
c758e654 |
3 | * $Id: name.h,v 1.5 1998/01/12 16:46:15 mdw Exp $ |
c4f2d992 |
4 | * |
5 | * Looking up of names in symbol tables |
6 | * |
c758e654 |
7 | * (c) 1998 EBI |
c4f2d992 |
8 | */ |
9 | |
03f996bd |
10 | /*----- Licensing notice --------------------------------------------------* |
c4f2d992 |
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 |
03f996bd |
25 | * along with `become'; if not, write to the Free Software Foundation, |
26 | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
c4f2d992 |
27 | */ |
28 | |
29 | /*----- Revision history --------------------------------------------------* |
30 | * |
31 | * $Log: name.h,v $ |
c758e654 |
32 | * Revision 1.5 1998/01/12 16:46:15 mdw |
33 | * Fix copyright date. |
34 | * |
35 | * Revision 1.4 1997/09/17 10:26:11 mdw |
2e11036b |
36 | * Use rewritten class handler. Support `none' class. |
37 | * |
38 | * Revision 1.3 1997/08/20 16:18:05 mdw |
e6677daf |
39 | * Replace `name_reinit' by `name_end' for more sensible restart. |
40 | * |
03f996bd |
41 | * Revision 1.2 1997/08/04 10:24:24 mdw |
42 | * Sources placed under CVS control. |
43 | * |
44 | * Revision 1.1 1997/07/21 13:47:46 mdw |
c4f2d992 |
45 | * Initial revision |
46 | * |
47 | */ |
48 | |
49 | #ifndef NAMES_H |
50 | #define NAMES_H |
51 | |
52 | #ifdef __cplusplus |
53 | extern "C" { |
54 | #endif |
55 | |
56 | /*----- Required headers --------------------------------------------------*/ |
57 | |
58 | #ifndef CLASS_H |
59 | # include "class.h" |
60 | #endif |
61 | |
62 | #ifndef SYM_H |
63 | # include "sym.h" |
64 | #endif |
65 | |
66 | /*----- Data structures ---------------------------------------------------*/ |
67 | |
68 | typedef struct name { |
69 | sym_base base; /* Base block for symbol table */ |
2e11036b |
70 | class_node *c; /* Base class pointer */ |
c4f2d992 |
71 | } name; |
72 | |
73 | /*----- Functions provided ------------------------------------------------*/ |
74 | |
75 | /* --- @name_init@ --- * |
76 | * |
77 | * Arguments: --- |
78 | * |
79 | * Returns: --- |
80 | * |
81 | * Use: Initialises the name table. Requires the user database to |
82 | * be populated (see @userdb_local@ and @userdb_yp@). |
83 | */ |
84 | |
85 | extern void name_init(void); |
86 | |
e6677daf |
87 | /* --- @name_end@ --- * |
c4f2d992 |
88 | * |
89 | * Arguments: --- |
90 | * |
91 | * Returns: --- |
92 | * |
e6677daf |
93 | * Use: Closes down the name database, so that it can be |
94 | * reinitialised. |
c4f2d992 |
95 | */ |
96 | |
e6677daf |
97 | extern void name_end(void); |
c4f2d992 |
98 | |
99 | /* --- @name_find@ --- * |
100 | * |
101 | * Arguments: @const char *p@ = pointer to name to look up |
102 | * @unsigned create@ = whether to create the item |
103 | * @unsigned *f@ = whether the item was created |
104 | * |
105 | * Returns: Pointer to a @name@ block containing the symbol, or |
106 | * zero if it wasn't found and we didn't want to create a |
107 | * new one. |
108 | * |
109 | * Use: Looks up a name in the symbol table and returns the |
110 | * item so located. |
111 | */ |
112 | |
113 | extern name *name_find(const char */*p*/, |
114 | unsigned /*create*/, |
115 | unsigned */*f*/); |
116 | |
117 | /* --- @name_dump@ --- * |
118 | * |
03f996bd |
119 | * Arguments: --- |
c4f2d992 |
120 | * |
121 | * Returns: --- |
122 | * |
123 | * Use: Dumps a complete listing of the symbol table. |
124 | */ |
125 | |
03f996bd |
126 | extern void name_dump(void); |
c4f2d992 |
127 | |
128 | /*----- That's all, folks -------------------------------------------------*/ |
129 | |
130 | #ifdef __cplusplus |
131 | } |
132 | #endif |
133 | |
134 | #endif |