Lines Matching refs:file
530 register FILEINFO *file; in getfile() local
534 file = (FILEINFO *) getmem(sizeof (FILEINFO) + bufsize + size); in getfile()
535 file->parent = infile; /* Chain files together */ in getfile()
536 file->fp = NULL; /* No file yet */ in getfile()
537 file->filename = savestring(name); /* Save file/macro name */ in getfile()
538 file->progname = NULL; /* No #line seen yet */ in getfile()
539 file->unrecur = 0; /* No macro fixup */ in getfile()
540 file->bptr = file->buffer; /* Initialize line ptr */ in getfile()
541 file->buffer[0] = EOS; /* Force first read */ in getfile()
542 file->line = 0; /* (Not used just yet) */ in getfile()
545 infile = file; /* New current file */ in getfile()
547 return (file); /* All done. */ in getfile()
725 FILEINFO *file; in dumpadef() local
735 file = getfile( strlen( dp->repl ), dp->name ); in dumpadef()
736 strcpy( file->buffer, dp->repl ); in dumpadef()
783 register FILEINFO *file; in get() local
788 if ((file = infile) == NULL) in get()
793 file->filename, recursion, line, in get()
794 file->bptr - file->buffer, file->buffer); in get()
803 if ((c = *file->bptr++ & 0xFF) == EOS) { in get()
809 if (file->fp == NULL) { /* NULL if macro */ in get()
811 recursion -= file->unrecur; in get()
814 infile = file->parent; /* Unwind file chain */ in get()
817 if ((file->bptr = fgets(file->buffer, NBUFF, file->fp)) in get()
822 line, file->filename, file->buffer); in get()
828 if( file->fp != stdin ) in get()
829 fclose(file->fp); /* Close finished file */ in get()
830 if ((infile = file->parent) != NULL) { in get()
846 free(file->filename); /* Free name and */ in get()
847 if (file->progname != NULL) /* if a #line was seen, */ in get()
848 free(file->progname); /* free it, too. */ in get()
849 free((char *) file); /* Free file space */ in get()
858 if (c == DEF_MAGIC && file->fp != NULL) /* Don't allow delete */ in get()
860 if (file->parent != NULL) { /* Macro or #include */ in get()
862 file->parent->unrecur += popped; in get()
864 recursion -= file->parent->unrecur; in get()
867 file->parent->unrecur = 0; in get()
935 if (*file->bptr == '\n' in get()
936 || type[*file->bptr & 0xFF] == SPA) in get()
942 return ((file->bptr[-1] = COM_SEP)); in get()
944 return ((file->bptr[-1] = ' ')); in get()
1015 register FILEINFO *file; in unget() local
1017 if ((file = infile) == NULL) in unget()
1019 if (--file->bptr < file->buffer) in unget()
1021 if (*file->bptr == '\n') /* Ungetting a newline? */ in unget()
1031 register FILEINFO *file; in ungetstring() local
1035 file = getfile(strlen(text) + 1, ""); in ungetstring()
1036 strcpy(file->buffer, text); in ungetstring()
1071 register FILEINFO *file; in domsg() local
1079 if ((file = infile) == NULL) in domsg()
1081 if (file->fp != NULL) { in domsg()
1082 tp = file->buffer; /* Print current file */ in domsg()
1087 while ((file = file->parent) != NULL) { /* Print #includes, too */ in domsg()
1088 if (file->fp == NULL) in domsg()
1089 fprintf(stderr, "from macro %s\n", file->filename); in domsg()
1091 tp = file->buffer; in domsg()
1093 (file->progname != NULL) in domsg()
1094 ? file->progname : file->filename, in domsg()
1095 file->line, tp); in domsg()