Lines Matching refs:fp
219 struct Frame *fp = NULL; /* frame pointer. bottom level unused */ variable
236 fp = frame = (struct Frame *) calloc(nframe += 100, sizeof(struct Frame)); in call()
243 dprintf( ("calling %s, %d args (%d in defn), fp=%d\n", s, ncall, ndef, (int) (fp-frame)) ); in call()
250 dprintf( ("evaluate args[%d], fp=%d:\n", i, (int) (fp-frame)) ); in call()
267 fp++; /* now ok to up frame */ in call()
268 if (fp >= frame + nframe) { in call()
269 int dfp = fp - frame; /* old index */ in call()
274 fp = frame + dfp; in call()
276 fp->fcncell = fcn; in call()
277 fp->args = args; in call()
278 fp->nargs = ndef; /* number defined with (excess are locals) */ in call()
279 fp->retval = gettemp(); in call()
281 dprintf( ("start exec of %s, fp=%d\n", s, (int) (fp-frame)) ); in call()
283 dprintf( ("finished exec of %s, fp=%d\n", s, (int) (fp-frame)) ); in call()
286 Cell *t = fp->args[i]; in call()
315 z = fp->retval; /* return value */ in call()
317 fp--; in call()
340 dprintf( ("arg(%d), fp->nargs=%d\n", n, fp->nargs) ); in arg()
341 if (n+1 > fp->nargs) in arg()
343 n+1, fp->fcncell->nval); in arg()
344 return fp->args[n]; in arg()
363 setsval(fp->retval, getsval(y)); in jump()
364 fp->retval->fval = getfval(y); in jump()
365 fp->retval->tval |= NUM; in jump()
368 setsval(fp->retval, getsval(y)); in jump()
370 setfval(fp->retval, getfval(y)); in jump()
395 FILE *fp; in getline() local
410 fp = openfile(mode, getsval(x)); in getline()
412 if (fp == NULL) in getline()
415 n = readrec(&buf, &bufsize, fp); in getline()
965 FILE *fp; in awkprintf() local
985 fp = redirect(ptoi(a[1]), a[2]); in awkprintf()
987 fwrite(buf, len, 1, fp); in awkprintf()
988 fflush(fp); in awkprintf()
989 if (ferror(fp)) in awkprintf()
990 FATAL("write error on %s", filename(fp)); in awkprintf()
1471 FILE *fp; in bltin() local
1543 } else if ((fp = openfile(FFLUSH, getsval(x))) == NULL) in bltin()
1546 u = fflush(fp); in bltin()
1567 FILE *fp; in printstat() local
1570 fp = stdout; in printstat()
1572 fp = redirect(ptoi(a[1]), a[2]); in printstat()
1575 fputs(getpssval(y), fp); in printstat()
1578 fputs(*ORS, fp); in printstat()
1580 fputs(*OFS, fp); in printstat()
1583 fflush(fp); in printstat()
1584 if (ferror(fp)) in printstat()
1585 FATAL("write error on %s", filename(fp)); in printstat()
1599 FILE *fp; in redirect() local
1605 fp = openfile(a, fname); in redirect()
1606 if (fp == NULL) in redirect()
1609 return fp; in redirect()
1613 FILE *fp; member
1624 files[0].fp = stdin; in stdinit()
1625 files[1].fp = stdout; in stdinit()
1626 files[2].fp = stderr; in stdinit()
1633 FILE *fp = 0; in openfile() local
1640 return files[i].fp; in openfile()
1642 return files[i].fp; in openfile()
1648 if (files[i].fp == 0) in openfile()
1655 fp = fopen(s, "w"); in openfile()
1657 fp = fopen(s, "a"); in openfile()
1660 fp = popen(s, "w"); in openfile()
1662 fp = popen(s, "r"); in openfile()
1664 fp = strcmp(s, "-") == 0 ? stdin : fopen(s, "r"); /* "-" is stdin */ in openfile()
1667 if (fp != NULL) { in openfile()
1669 files[i].fp = fp; in openfile()
1672 return fp; in openfile()
1675 const char *filename(FILE *fp) in filename() argument
1680 if (fp == files[i].fp) in filename()
1696 if (ferror(files[i].fp)) in closefile()
1699 stat = pclose(files[i].fp); in closefile()
1701 stat = fclose(files[i].fp); in closefile()
1707 files[i].fp = NULL; in closefile()
1721 if (files[i].fp) { in closeall()
1722 if (ferror(files[i].fp)) in closeall()
1725 stat = pclose(files[i].fp); in closeall()
1727 stat = fclose(files[i].fp); in closeall()
1739 if (files[i].fp) in flush_all()
1740 fflush(files[i].fp); in flush_all()