version 1.2, 1996/06/11 12:53:53 |
version 1.3, 1997/07/13 21:21:18 |
|
|
h = hash(name); |
h = hash(name); |
vp = lookup(name); |
vp = lookup(name); |
if (vp == NOVAR) { |
if (vp == NOVAR) { |
vp = (struct var *) calloc(sizeof *vp, 1); |
vp = (struct var *) calloc(sizeof(*vp), 1); |
vp->v_name = vcopy(name); |
vp->v_name = vcopy(name); |
vp->v_link = variables[h]; |
vp->v_link = variables[h]; |
variables[h] = vp; |
variables[h] = vp; |
|
|
unsigned len; |
unsigned len; |
|
|
if (*str == '\0') |
if (*str == '\0') |
return ""; |
return(""); |
len = strlen(str) + 1; |
len = strlen(str) + 1; |
if ((new = malloc(len)) == NULL) |
if ((new = malloc(len)) == NULL) |
panic("Out of memory"); |
panic("Out of memory"); |
bcopy(str, new, (int) len); |
bcopy(str, new, (int) len); |
return new; |
return(new); |
} |
} |
|
|
/* |
/* |
|
|
} |
} |
if (h < 0 && (h = -h) < 0) |
if (h < 0 && (h = -h) < 0) |
h = 0; |
h = 0; |
return (h % HSHSIZE); |
return(h % HSHSIZE); |
} |
} |