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()
392 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
394 if (parsefile->fd > 0) in setinputfd()
395 close(parsefile->fd); in setinputfd()
396 parsefile->fd = fd; in setinputfd()
397 if (parsefile->buf == NULL) in setinputfd()
398 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
416 parsefile->buf = NULL; in setinputstring()
431 struct parsefile *pf; in pushfile()
433 parsefile->nleft = parsenleft; in pushfile()
434 parsefile->lleft = parselleft; in pushfile()
435 parsefile->nextc = parsenextc; in pushfile()
436 parsefile->linno = plinno; in pushfile()
437 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile)); in pushfile()
438 pf->prev = parsefile; in pushfile()
442 parsefile = pf; in pushfile()
449 struct parsefile *pf = parsefile; in popfile()
458 parsefile = pf->prev; in popfile()
460 parsenleft = parsefile->nleft; in popfile()
461 parselleft = parsefile->lleft; in popfile()
462 parsenextc = parsefile->nextc; in popfile()
463 plinno = parsefile->linno; in popfile()
472 struct parsefile *
475 return parsefile; in getcurrentfile()
486 popfilesupto(struct parsefile *file) in popfilesupto()
488 while (parsefile != file && parsefile != &basepf) in popfilesupto()
490 if (parsefile != file) in popfilesupto()
501 while (parsefile != &basepf) in popallfiles()
516 if (parsefile->fd > 0) { in closescript()
517 close(parsefile->fd); in closescript()
518 parsefile->fd = 0; in closescript()