Lines Matching refs:parsefile
80 struct parsefile { struct
81 struct parsefile *prev; /* preceding file on stack */ argument
98 static struct parsefile basepf = { /* top level input file */
102 static struct parsefile *parsefile = &basepf; /* current input file */ variable
134 parsenextc = parsefile->buf; in preadfd()
138 if (parsefile->fd == 0 && el) { in preadfd()
152 memcpy(parsefile->buf, rl_cp, nr); in preadfd()
161 nr = read(parsefile->fd, parsefile->buf, BUFSIZ); in preadfd()
167 if (parsefile->fd == 0 && errno == EWOULDBLOCK) { in preadfd()
199 while (parsefile->strpush) { in preadbuffer()
205 if (parsenleft == -1 && parsefile->strpush->ap != NULL) in preadbuffer()
211 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadbuffer()
222 p = parsefile->buf + (parsenextc - parsefile->buf); in preadbuffer()
253 if (parsefile->fd == 0 && hist && in preadbuffer()
283 if (parsefile->strpush) in preadateof()
285 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadateof()
313 if (parsefile->strpush) { in pushstring()
315 sp->prev = parsefile->strpush; in pushstring()
316 parsefile->strpush = sp; in pushstring()
318 sp = parsefile->strpush = &(parsefile->basestrpush); in pushstring()
333 struct strpush *sp = parsefile->strpush; in popstring()
346 parsefile->strpush = sp->prev; in popstring()
347 if (sp != &(parsefile->basestrpush)) in popstring()
400 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
402 if (parsefile->fd > 0) in setinputfd()
403 close(parsefile->fd); in setinputfd()
404 parsefile->fd = fd; in setinputfd()
405 if (parsefile->buf == NULL) in setinputfd()
406 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
424 parsefile->buf = NULL; in setinputstring()
439 struct parsefile *pf; in pushfile()
441 parsefile->nleft = parsenleft; in pushfile()
442 parsefile->lleft = parselleft; in pushfile()
443 parsefile->nextc = parsenextc; in pushfile()
444 parsefile->linno = plinno; in pushfile()
445 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile)); in pushfile()
446 pf->prev = parsefile; in pushfile()
450 parsefile = pf; in pushfile()
457 struct parsefile *pf = parsefile; in popfile()
466 parsefile = pf->prev; in popfile()
468 parsenleft = parsefile->nleft; in popfile()
469 parselleft = parsefile->lleft; in popfile()
470 parsenextc = parsefile->nextc; in popfile()
471 plinno = parsefile->linno; in popfile()
480 struct parsefile *
483 return parsefile; in getcurrentfile()
494 popfilesupto(struct parsefile *file) in popfilesupto()
496 while (parsefile != file && parsefile != &basepf) in popfilesupto()
498 if (parsefile != file) in popfilesupto()
509 while (parsefile != &basepf) in popallfiles()
524 if (parsefile->fd > 0) { in closescript()
525 close(parsefile->fd); in closescript()
526 parsefile->fd = 0; in closescript()