version 1.16, 1999/12/08 23:09:46 |
version 1.17, 2001/09/08 00:12:40 |
|
|
} |
} |
} |
} |
tempfree(fcn); |
tempfree(fcn); |
if (isexit(y) || isnext(y) || isnextfile(y)) |
if (isexit(y) || isnext(y)) |
return y; |
return y; |
tempfree(y); /* this can free twice! */ |
tempfree(y); /* this can free twice! */ |
z = fp->retval; /* return value */ |
z = fp->retval; /* return value */ |
|
|
y = gettemp(); |
y = gettemp(); |
y->csub = CCOPY; /* prevents freeing until call is over */ |
y->csub = CCOPY; /* prevents freeing until call is over */ |
y->nval = x->nval; /* BUG? */ |
y->nval = x->nval; /* BUG? */ |
y->sval = x->sval ? tostring(x->sval) : NULL; |
if (isstr(x)) |
|
y->sval = tostring(x->sval); |
y->fval = x->fval; |
y->fval = x->fval; |
y->tval = x->tval & ~(CON|FLD|REC|DONTFREE); /* copy is not constant or field */ |
y->tval = x->tval & ~(CON|FLD|REC|DONTFREE); /* copy is not constant or field */ |
/* is DONTFREE right? */ |
/* is DONTFREE right? */ |
|
|
if (k <= 1) { |
if (k <= 1) { |
tempfree(x); |
tempfree(x); |
tempfree(y); |
tempfree(y); |
if (a[2] != 0) |
if (a[2] != 0) { |
tempfree(z); |
tempfree(z); |
|
} |
x = gettemp(); |
x = gettemp(); |
setsval(x, ""); |
setsval(x, ""); |
return(x); |
return(x); |
|
|
for (t = fmt; (*t++ = *s) != '\0'; s++) { |
for (t = fmt; (*t++ = *s) != '\0'; s++) { |
if (!adjbuf(&fmt, &fmtsz, MAXNUMSIZE+1+t-fmt, recsize, &t, 0)) |
if (!adjbuf(&fmt, &fmtsz, MAXNUMSIZE+1+t-fmt, recsize, &t, 0)) |
FATAL("format item %.30s... ran format() out of memory", os); |
FATAL("format item %.30s... ran format() out of memory", os); |
if (isalpha(*s) && *s != 'l' && *s != 'h' && *s != 'L') |
if (isalpha((uschar)*s) && *s != 'l' && *s != 'h' && *s != 'L') |
break; /* the ansi panoply */ |
break; /* the ansi panoply */ |
if (*s == '*') { |
if (*s == '*') { |
x = execute(a); |
x = execute(a); |
|
|
sprintf(num, "%d", n); |
sprintf(num, "%d", n); |
buf[0] = *s; |
buf[0] = *s; |
buf[1] = 0; |
buf[1] = 0; |
if (isdigit(buf[0])) |
if (isdigit((uschar)buf[0])) |
setsymtab(num, buf, atof(buf), STR|NUM, (Array *) ap->sval); |
setsymtab(num, buf, atof(buf), STR|NUM, (Array *) ap->sval); |
else |
else |
setsymtab(num, buf, 0.0, STR, (Array *) ap->sval); |
setsymtab(num, buf, 0.0, STR, (Array *) ap->sval); |
|
|
} |
} |
tempfree(ap); |
tempfree(ap); |
tempfree(y); |
tempfree(y); |
if (a[2] != 0 && arg3type == STRING) |
if (a[2] != 0 && arg3type == STRING) { |
tempfree(x); |
tempfree(x); |
|
} |
x = gettemp(); |
x = gettemp(); |
x->tval = NUM; |
x->tval = NUM; |
x->fval = n; |
x->fval = n; |
|
|
x = execute(a[0]); |
x = execute(a[0]); |
if (isbreak(x)) |
if (isbreak(x)) |
return True; |
return True; |
if (isnext(x) || isnextfile(x) || isexit(x) || isret(x)) |
if (isnext(x) || isexit(x) || isret(x)) |
return(x); |
return(x); |
tempfree(x); |
tempfree(x); |
x = execute(a[1]); |
x = execute(a[1]); |
|
|
buf = tostring(getsval(x)); |
buf = tostring(getsval(x)); |
if (t == FTOUPPER) { |
if (t == FTOUPPER) { |
for (p = buf; *p; p++) |
for (p = buf; *p; p++) |
if (islower(*p)) |
if (islower((uschar) *p)) |
*p = toupper(*p); |
*p = toupper(*p); |
} else { |
} else { |
for (p = buf; *p; p++) |
for (p = buf; *p; p++) |
if (isupper(*p)) |
if (isupper((uschar) *p)) |
*p = tolower(*p); |
*p = tolower(*p); |
} |
} |
tempfree(x); |
tempfree(x); |
|
|
n = n; |
n = n; |
x = execute(a[0]); |
x = execute(a[0]); |
getsval(x); |
getsval(x); |
for (i = 0; i < FOPEN_MAX; i++) |
stat = -1; |
|
for (i = 0; i < FOPEN_MAX; i++) { |
if (files[i].fname && strcmp(x->sval, files[i].fname) == 0) { |
if (files[i].fname && strcmp(x->sval, files[i].fname) == 0) { |
if (ferror(files[i].fp)) |
if (ferror(files[i].fp)) |
WARNING( "i/o error occurred on %s", files[i].fname ); |
WARNING( "i/o error occurred on %s", files[i].fname ); |
|
|
files[i].fname = NULL; /* watch out for ref thru this */ |
files[i].fname = NULL; /* watch out for ref thru this */ |
files[i].fp = NULL; |
files[i].fp = NULL; |
} |
} |
|
} |
tempfree(x); |
tempfree(x); |
return(True); |
x = gettemp(); |
|
setfval(x, (Awkfloat) stat); |
|
return(x); |
} |
} |
|
|
void closeall(void) |
void closeall(void) |
{ |
{ |
int i, stat; |
int i, stat; |
|
|
for (i = 0; i < FOPEN_MAX; i++) |
for (i = 0; i < FOPEN_MAX; i++) { |
if (files[i].fp) { |
if (files[i].fp) { |
if (ferror(files[i].fp)) |
if (ferror(files[i].fp)) |
WARNING( "i/o error occurred on %s", files[i].fname ); |
WARNING( "i/o error occurred on %s", files[i].fname ); |
|
|
if (stat == EOF) |
if (stat == EOF) |
WARNING( "i/o error occurred while closing %s", files[i].fname ); |
WARNING( "i/o error occurred while closing %s", files[i].fname ); |
} |
} |
|
} |
} |
} |
|
|
void backsub(char **pb_ptr, char **sptr_ptr); |
void backsub(char **pb_ptr, char **sptr_ptr); |