1 /* Declarations for ident.
2 Copyright (C) 1995, 1996 Markus Armbruster */
4 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
5 ** All rights reserved.
7 ** Authors: Martin Trapp, Christian Schaefer
22 /* Caution: strings _not_ zero-terminated! */
23 #define ID_FROM_STR(str, len) \
24 (assert ((len) > 0), \
25 (const set_entry *)set_hinsert (id_set, (str), (len), ID_HASH ((str), (len))))
26 #define ID_TO_STR(id) ((const char *)&(id)->dptr[0])
27 #define ID_TO_STRLEN(id) ((id)->size)
28 #define ID_TO_HASH(id) ((long)(id) + (id)->hash)
30 ident *new_id_derived (const char *pfx, ident *);
31 ident *new_id_internal (void);
32 bool id_is_internal (ident *);
35 /* Vormals Debugunterstuetzung, entfernt (debug.h). */
36 # define ID_VRFY(id) ((void)0)
39 # define IDS_VRFY(id) ((void)0)
41 # define IDS_VRFY(id) ids_vrfy ((id))
42 void ids_vrfy (ident **id);
47 # define id_stats() set_stats (id_set)
49 # define id_stats() ((void)0)
55 #define ID_HASH(str, len) \
56 ((( ((unsigned char *)(str))[0] * 33 \
57 + ((unsigned char *)(str))[(len)>>1]) * 31 \
58 + ((unsigned char *)(str))[(len)-1]) * 9 \
64 # define id_from_str ID_FROM_STR
65 # define id_to_str ID_TO_STR
66 # define id_to_strlen ID_TO_STRLEN
69 int ident_print (XP_PAR1, const xprintf_info *, XP_PARN);
71 # endif /* _IDENT_T_H_ */