File indexing completed on 2025-01-26 04:44:00

0001 #ifndef BT_SYM_H
0002 #define BT_SYM_H
0003 
0004 #include <ctype.h>
0005 
0006 /*
0007  * Declarations for symbol table in sym.c
0008  */
0009 
0010 /* define some hash function */
0011 #ifndef HASH_FUN
0012 #define HASH_FUN(p, h) while ( *p != '\0' ) h = (h<<1) + tolower (*p++);
0013 #endif
0014 
0015 /* minimum symbol table record */
0016 typedef struct _sym
0017 {
0018    char        *symbol;         /* the macro name */
0019    char        *text;           /* its expansion */
0020    struct _sym *next, *prev, **head, *scope;
0021    unsigned int hash;
0022 } Sym, *SymPtr;
0023 
0024 void zzs_init(int, int);
0025 void zzs_free(void);
0026 void zzs_done(void);
0027 void zzs_add(const char *, Sym *);
0028 Sym *zzs_get(const char *);
0029 void zzs_del(Sym *);
0030 void zzs_keydel(char *);
0031 Sym **zzs_scope(Sym **);
0032 Sym *zzs_rmscope(Sym **);
0033 void zzs_stat(void);
0034 Sym *zzs_new(const char *);
0035 Sym *zzs_newadd(const char *);
0036 char *zzs_strdup(const char *);
0037 
0038 #endif