|
|
|
@ -175,10 +175,10 @@ zzs_done(void)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
zzs_add(char *key, register Sym *rec)
|
|
|
|
|
zzs_add(char *key, Sym *rec)
|
|
|
|
|
{
|
|
|
|
|
register unsigned int h=0;
|
|
|
|
|
register char *p=key;
|
|
|
|
|
unsigned int h=0;
|
|
|
|
|
char *p=key;
|
|
|
|
|
|
|
|
|
|
HASH_FUN(p, h);
|
|
|
|
|
rec->hash = h; /* save hash code for fast comp later */
|
|
|
|
@ -195,9 +195,9 @@ zzs_add(char *key, register Sym *rec)
|
|
|
|
|
Sym *
|
|
|
|
|
zzs_get(char *key)
|
|
|
|
|
{
|
|
|
|
|
register unsigned int h=0;
|
|
|
|
|
register char *p=key;
|
|
|
|
|
register Sym *q;
|
|
|
|
|
unsigned int h=0;
|
|
|
|
|
char *p=key;
|
|
|
|
|
Sym *q;
|
|
|
|
|
|
|
|
|
|
HASH_FUN(p, h);
|
|
|
|
|
|
|
|
|
@ -219,12 +219,12 @@ zzs_get(char *key)
|
|
|
|
|
* Will do nothing if all list pointers are NULL
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
zzs_del(register Sym *p)
|
|
|
|
|
zzs_del(Sym *p)
|
|
|
|
|
{
|
|
|
|
|
if ( p == NULL ) {fprintf(stderr, "zzs_del(NULL)\n"); exit(1);}
|
|
|
|
|
if ( p->prev == NULL ) /* Head of list */
|
|
|
|
|
{
|
|
|
|
|
register Sym **t = p->head;
|
|
|
|
|
Sym **t = p->head;
|
|
|
|
|
|
|
|
|
|
if ( t == NULL ) return; /* not part of symbol table */
|
|
|
|
|
(*t) = p->next;
|
|
|
|
@ -260,9 +260,9 @@ zzs_scope(Sym **scope)
|
|
|
|
|
|
|
|
|
|
/* Remove a scope described by 'scope'. Return pointer to 1st element in scope */
|
|
|
|
|
Sym *
|
|
|
|
|
zzs_rmscope(register Sym **scope)
|
|
|
|
|
zzs_rmscope(Sym **scope)
|
|
|
|
|
{
|
|
|
|
|
register Sym *p;
|
|
|
|
|
Sym *p;
|
|
|
|
|
Sym *start;
|
|
|
|
|
|
|
|
|
|
if ( scope == NULL ) return(NULL);
|
|
|
|
@ -277,13 +277,13 @@ zzs_stat(void)
|
|
|
|
|
{
|
|
|
|
|
static unsigned short count[20];
|
|
|
|
|
unsigned int i,n=0,low=0, hi=0;
|
|
|
|
|
register Sym **p;
|
|
|
|
|
Sym **p;
|
|
|
|
|
float avg=0.0;
|
|
|
|
|
|
|
|
|
|
for (i=0; i<20; i++) count[i] = 0;
|
|
|
|
|
for (p=table; p<&(table[size]); p++)
|
|
|
|
|
{
|
|
|
|
|
register Sym *q = *p;
|
|
|
|
|
Sym *q = *p;
|
|
|
|
|
unsigned int len;
|
|
|
|
|
|
|
|
|
|
if ( q != NULL && low==0 ) low = p-table;
|
|
|
|
@ -328,7 +328,7 @@ Sym *
|
|
|
|
|
zzs_new(char *text)
|
|
|
|
|
{
|
|
|
|
|
Sym *p;
|
|
|
|
|
char *zzs_strdup(register char *s);
|
|
|
|
|
char *zzs_strdup(char *s);
|
|
|
|
|
|
|
|
|
|
if ( (p = (Sym *) calloc(1,sizeof(Sym))) == 0 )
|
|
|
|
|
{
|
|
|
|
@ -353,9 +353,9 @@ zzs_newadd(char *text)
|
|
|
|
|
* Bump the pointer into the string table to next avail position.
|
|
|
|
|
*/
|
|
|
|
|
char *
|
|
|
|
|
zzs_strdup(register char *s)
|
|
|
|
|
zzs_strdup(char *s)
|
|
|
|
|
{
|
|
|
|
|
register char *start=strp;
|
|
|
|
|
char *start=strp;
|
|
|
|
|
|
|
|
|
|
while ( *s != '\0' )
|
|
|
|
|
{
|
|
|
|
|