Lines Matching refs:parsefile
76 * The parsefile structure pointed to by the global variable parsefile
80 struct parsefile {
81 struct parsefile *prev; /* preceding file on stack */
94 int parsenleft; /* copy of parsefile->nleft */
95 static int parselleft; /* copy of parsefile->lleft */
96 const char *parsenextc; /* copy of parsefile->nextc */
98 static struct parsefile basepf = { /* top level input file */
102 static struct parsefile *parsefile = &basepf; /* current input file */
163 parsenextc = parsefile->buf;
167 if (parsefile->fd == 0 && el) {
181 memcpy(parsefile->buf, rl_cp, nr);
190 nr = read(parsefile->fd, parsefile->buf, BUFSIZ);
196 if (parsefile->fd == 0 && errno == EWOULDBLOCK) {
229 while (parsefile->strpush) {
235 if (parsenleft == -1 && parsefile->strpush->ap != NULL)
241 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL)
254 q = p = parsefile->buf + (parsenextc - parsefile->buf);
287 if (parsefile->fd == 0 && hist &&
317 if (parsefile->strpush)
319 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL)
337 * Push a string back onto the input at this current parsefile level.
347 if (parsefile->strpush) {
349 sp->prev = parsefile->strpush;
350 parsefile->strpush = sp;
352 sp = parsefile->strpush = &(parsefile->basestrpush);
367 struct strpush *sp = parsefile->strpush;
380 parsefile->strpush = sp->prev;
381 if (sp != &(parsefile->basestrpush))
422 parsefile->buf = ckmalloc(BUFSIZ + 1);
424 if (parsefile->fd > 0)
425 close(parsefile->fd);
426 parsefile->fd = fd;
427 if (parsefile->buf == NULL)
428 parsefile->buf = ckmalloc(BUFSIZ + 1);
446 parsefile->buf = NULL;
461 struct parsefile *pf;
463 parsefile->nleft = parsenleft;
464 parsefile->lleft = parselleft;
465 parsefile->nextc = parsenextc;
466 parsefile->linno = plinno;
467 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile));
468 pf->prev = parsefile;
472 parsefile = pf;
479 struct parsefile *pf = parsefile;
488 parsefile = pf->prev;
490 parsenleft = parsefile->nleft;
491 parselleft = parsefile->lleft;
492 parsenextc = parsefile->nextc;
493 plinno = parsefile->linno;
502 struct parsefile *
505 return parsefile;
516 popfilesupto(struct parsefile *file)
518 while (parsefile != file && parsefile != &basepf)
520 if (parsefile != file)
531 while (parsefile != &basepf)
546 if (parsefile->fd > 0) {
547 close(parsefile->fd);
548 parsefile->fd = 0;