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
136 parsenextc = parsefile->buf; in preadfd()
140 if (parsefile->fd == 0 && el) { in preadfd()
154 memcpy(parsefile->buf, rl_cp, nr); in preadfd()
163 nr = read(parsefile->fd, parsefile->buf, BUFSIZ); in preadfd()
169 if (parsefile->fd == 0 && errno == EWOULDBLOCK) { in preadfd()
201 while (parsefile->strpush) { in preadbuffer()
207 if (parsenleft == -1 && parsefile->strpush->ap != NULL) in preadbuffer()
213 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadbuffer()
224 p = parsefile->buf + (parsenextc - parsefile->buf); in preadbuffer()
255 if (parsefile->fd == 0 && hist && in preadbuffer()
285 if (parsefile->strpush) in preadateof()
287 if (parsenleft == EOF_NLEFT || parsefile->buf == NULL) in preadateof()
315 if (parsefile->strpush) { in pushstring()
317 sp->prev = parsefile->strpush; in pushstring()
318 parsefile->strpush = sp; in pushstring()
320 sp = parsefile->strpush = &(parsefile->basestrpush); in pushstring()
335 struct strpush *sp = parsefile->strpush; in popstring()
348 parsefile->strpush = sp->prev; in popstring()
349 if (sp != &(parsefile->basestrpush)) in popstring()
390 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
392 if (parsefile->fd > 0) in setinputfd()
393 close(parsefile->fd); in setinputfd()
394 parsefile->fd = fd; in setinputfd()
395 if (parsefile->buf == NULL) in setinputfd()
396 parsefile->buf = ckmalloc(BUFSIZ + 1); in setinputfd()
414 parsefile->buf = NULL; in setinputstring()
429 struct parsefile *pf; in pushfile()
431 parsefile->nleft = parsenleft; in pushfile()
432 parsefile->lleft = parselleft; in pushfile()
433 parsefile->nextc = parsenextc; in pushfile()
434 parsefile->linno = plinno; in pushfile()
435 pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile)); in pushfile()
436 pf->prev = parsefile; in pushfile()
440 parsefile = pf; in pushfile()
447 struct parsefile *pf = parsefile; in popfile()
456 parsefile = pf->prev; in popfile()
458 parsenleft = parsefile->nleft; in popfile()
459 parselleft = parsefile->lleft; in popfile()
460 parsenextc = parsefile->nextc; in popfile()
461 plinno = parsefile->linno; in popfile()
470 struct parsefile *
473 return parsefile; in getcurrentfile()
484 popfilesupto(struct parsefile *file) in popfilesupto()
486 while (parsefile != file && parsefile != &basepf) in popfilesupto()
488 if (parsefile != file) in popfilesupto()
499 while (parsefile != &basepf) in popallfiles()
514 if (parsefile->fd > 0) { in closescript()
515 close(parsefile->fd); in closescript()
516 parsefile->fd = 0; in closescript()