Lines Matching refs:parsefile
76 struct parsefile { struct
77 struct parsefile *prev; /* preceding file on stack */ argument
94 static struct parsefile basepf = { /* top level input file */
98 static struct parsefile *parsefile = &basepf; /* current input file */ variable
130 parsenextc = parsefile->buf; in preadfd()
134 if (parsefile->fd == 0 && el) { in preadfd()
148 memcpy(parsefile->buf, rl_cp, nr); in preadfd()
157 nr = read(parsefile->fd, parsefile->buf, BUFSIZ); in preadfd()
163 if (parsefile->fd == 0 && errno == EWOULDBLOCK) { in preadfd()
195 while (parsefile->strpush) { in preadbuffer()
201 if (parsenleft == -1 && parsefile->strpush->ap != NULL) in preadbuffer()
207 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadbuffer()
218 p = parsefile->buf + (parsenextc - parsefile->buf); in preadbuffer()
249 if (parsefile->fd == 0 && hist && in preadbuffer()
279 if (parsefile->strpush) in preadateof()
281 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadateof()
309 if (parsefile->strpush) { in pushstring()
311 sp->prev = parsefile->strpush; in pushstring()
312 parsefile->strpush = sp; in pushstring()
314 sp = parsefile->strpush = &(parsefile->basestrpush); in pushstring()
329 struct strpush *sp = parsefile->strpush; in popstring()
342 parsefile->strpush = sp->prev; in popstring()
343 if (sp != &(parsefile->basestrpush)) in popstring()
396 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
398 if (parsefile->fd > 0) in setinputfd()
399 close(parsefile->fd); in setinputfd()
400 parsefile->fd = fd; in setinputfd()
401 if (parsefile->buf == NULL) in setinputfd()
402 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
420 parsefile->buf = NULL; in setinputstring()
435 struct parsefile *pf; in pushfile()
437 parsefile->nleft = parsenleft; in pushfile()
438 parsefile->lleft = parselleft; in pushfile()
439 parsefile->nextc = parsenextc; in pushfile()
440 parsefile->linno = plinno; in pushfile()
441 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile)); in pushfile()
442 pf->prev = parsefile; in pushfile()
446 parsefile = pf; in pushfile()
453 struct parsefile *pf = parsefile; in popfile()
462 parsefile = pf->prev; in popfile()
464 parsenleft = parsefile->nleft; in popfile()
465 parselleft = parsefile->lleft; in popfile()
466 parsenextc = parsefile->nextc; in popfile()
467 plinno = parsefile->linno; in popfile()
476 struct parsefile *
479 return parsefile; in getcurrentfile()
490 popfilesupto(struct parsefile *file) in popfilesupto()
492 while (parsefile != file && parsefile != &basepf) in popfilesupto()
494 if (parsefile != file) in popfilesupto()
505 while (parsefile != &basepf) in popallfiles()
520 if (parsefile->fd > 0) { in closescript()
521 close(parsefile->fd); in closescript()
522 parsefile->fd = 0; in closescript()