Pristine Ack-5.5
[Ack-5.5.git] / modules / src / idf / idf_pkg.spec
1 /* $Id: idf_pkg.spec,v 1.6 1994/06/24 11:16:34 ceriel Exp $ */
2 /* IDENTIFIER DESCRIPTOR */
3
4 #include <ansi.h>
5
6 /* This a generic package for maintaining a name list */
7
8 /* Instantiation parameters, supplied by #define, are :
9         IDF_TYPE: the type of the user-defined part of the idf-structure,
10         IDF_NAME: the selector name for this field in the idf_structure, and
11         IDF_HSIZE: the number of significant characters for hashing
12 */
13
14 #ifndef IDF_NAME
15 #define IDF_NAME id_user
16 #endif
17
18 struct idf      {
19         struct idf *id_next;    /* links idf-structures together */
20         char *id_text;          /* string representing the name */
21 #ifdef IDF_TYPE
22         IDF_TYPE IDF_NAME;      /* user defined type and selector */
23 #endif
24 };
25
26 /*      init_idf()
27
28         Initializes the namelist.
29 */
30 _PROTOTYPE(void init_idf, (void));
31
32 /*      struct idf * str2idf(tg, cp)
33                 char *tg;
34                 int cp;
35
36         Adds the string indicated by "tg" to the namelist, and returns a
37         pointer to the entry.
38         If cp > 0, a copy of tg is made for id_text, otherwise tg itself
39         is used.
40         If cp < 0, the string is not entered, but only looked for.
41 */
42
43 _PROTOTYPE(struct idf *str2idf, (char *, int));
44
45 #define findidf(tg)     str2idf(tg, -1)