1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1987-01-05 17:20:13 +00:00
|
|
|
/* IDENTIFIER DESCRIPTOR */
|
|
|
|
|
1993-11-10 11:14:28 +00:00
|
|
|
#include <ansi.h>
|
|
|
|
|
1987-01-05 17:20:13 +00:00
|
|
|
/* This a generic package for maintaining a name list */
|
|
|
|
|
|
|
|
/* Instantiation parameters, supplied by #define, are :
|
|
|
|
IDF_TYPE: the type of the user-defined part of the idf-structure,
|
|
|
|
IDF_NAME: the selector name for this field in the idf_structure, and
|
|
|
|
IDF_HSIZE: the number of significant characters for hashing
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IDF_NAME
|
|
|
|
#define IDF_NAME id_user
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct idf {
|
1987-08-06 14:20:11 +00:00
|
|
|
struct idf *id_next; /* links idf-structures together */
|
1987-01-05 17:20:13 +00:00
|
|
|
char *id_text; /* string representing the name */
|
|
|
|
#ifdef IDF_TYPE
|
|
|
|
IDF_TYPE IDF_NAME; /* user defined type and selector */
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/* init_idf()
|
|
|
|
|
1993-11-10 11:14:28 +00:00
|
|
|
Initializes the namelist.
|
1987-01-05 17:20:13 +00:00
|
|
|
*/
|
2016-09-17 22:23:42 +00:00
|
|
|
extern void init_idf(void);
|
1987-01-05 17:20:13 +00:00
|
|
|
|
|
|
|
/* struct idf * str2idf(tg, cp)
|
|
|
|
char *tg;
|
|
|
|
int cp;
|
|
|
|
|
|
|
|
Adds the string indicated by "tg" to the namelist, and returns a
|
|
|
|
pointer to the entry.
|
|
|
|
If cp > 0, a copy of tg is made for id_text, otherwise tg itself
|
|
|
|
is used.
|
|
|
|
If cp < 0, the string is not entered, but only looked for.
|
|
|
|
*/
|
1993-10-22 14:09:28 +00:00
|
|
|
|
2016-09-17 22:23:42 +00:00
|
|
|
struct idf *str2idf(char* tg, int cp);
|
1987-01-05 17:20:13 +00:00
|
|
|
|
|
|
|
#define findidf(tg) str2idf(tg, -1)
|