Lines Matching refs:parsefile

66 MKINIT struct parsefile basepf;	/* top level input file */
68 struct parsefile *parsefile = &basepf; /* current input file */
110 if (parsefile->unget)
111 return parsefile->lastc[--parsefile->unget];
113 if (--parsefile->nleft >= 0)
114 c = (signed char)*parsefile->nextc++;
118 parsefile->lastc[1] = parsefile->lastc[0];
119 parsefile->lastc[0] = c;
144 char *buf = parsefile->buf;
145 parsefile->nextc = buf;
150 if (parsefile->fd == 0 && iflag) {
186 nr = read(parsefile->fd, buf, IBUFSIZ - 1);
192 if (parsefile->fd == 0 && errno == EWOULDBLOCK) {
235 if (unlikely(parsefile->strpush)) {
237 parsefile->nleft == -1 &&
238 parsefile->strpush->ap &&
239 parsefile->nextc[-1] != ' ' &&
240 parsefile->nextc[-1] != '\t'
247 if (unlikely(parsefile->nleft == EOF_NLEFT ||
248 parsefile->buf == NULL))
252 more = parsefile->lleft;
256 parsefile->lleft = parsefile->nleft = EOF_NLEFT;
261 q = parsefile->nextc;
279 parsefile->nleft = q - parsefile->nextc - 1;
296 parsefile->nleft = q - parsefile->nextc - 1;
297 if (parsefile->nleft < 0)
302 parsefile->lleft = more;
308 if (parsefile->fd == 0 && iflag && something) {
314 addtohistory(parsefile->nextc, strlen(parsefile->nextc));
322 out2str(parsefile->nextc);
330 return (signed char)*parsefile->nextc++;
341 parsefile->unget++;
345 * Push a string back onto the input at this current parsefile level.
357 if (parsefile->strpush) {
359 sp->prev = parsefile->strpush;
360 parsefile->strpush = sp;
362 sp = parsefile->strpush = &(parsefile->basestrpush);
363 sp->prevstring = parsefile->nextc;
364 sp->prevnleft = parsefile->nleft;
365 sp->unget = parsefile->unget;
366 memcpy(sp->lastc, parsefile->lastc, sizeof(sp->lastc));
372 parsefile->nextc = s;
373 parsefile->nleft = len;
374 parsefile->unget = 0;
381 struct strpush *sp = parsefile->strpush;
385 if (parsefile->nextc[-1] == ' ' ||
386 parsefile->nextc[-1] == '\t') {
397 parsefile->nextc = sp->prevstring;
398 parsefile->nleft = sp->prevnleft;
399 parsefile->unget = sp->unget;
400 memcpy(parsefile->lastc, sp->lastc, sizeof(sp->lastc));
402 parsefile->strpush = sp->prev;
403 if (sp != &(parsefile->basestrpush))
444 parsefile->buf = 0;
446 parsefile->fd = fd;
447 if (parsefile->buf == NULL)
448 parsefile->buf = ckmalloc(IBUFSIZ);
449 parsefile->lleft = parsefile->nleft = 0;
463 parsefile->nextc = string;
464 parsefile->nleft = strlen(string);
465 parsefile->buf = NULL;
480 struct parsefile *pf;
482 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile));
483 pf->prev = parsefile;
488 parsefile = pf;
495 struct parsefile *pf = parsefile;
504 parsefile = pf->prev;
517 while (parsefile != &basepf)
532 if (parsefile->fd > 0) {
533 close(parsefile->fd);
534 parsefile->fd = 0;