File: popfile.c

package info (click to toggle)
icmake 6.22-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,148 kB
  • ctags: 1,042
  • sloc: ansic: 9,241; makefile: 1,134; sh: 235; asm: 126
file content (34 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
\funcref{popfile}{void popfile ()}
    {}
    {}
    {}
    {pushfile()}
    {popfile.c}
    {
        Function {\em popfile()} is called from {\em process()} when the
        currently processed file is at end-of-file. This is indicated
        by the {\em lexer()} return value {\em l\_eof}.

        {\em popfile()} closes the file pointer associated with the processed
        file and decreases the filestack pointer {\em filesp}. See {\em
        pushfile()} for a description of the filestack.

        If the processed file is a file which is included by an {\em \#include}
        directive, then a `\#' character is written to the output file. This
        signals the next pass of {\em icmake}, the compiler, that an included
        file ends. If the filestack is empty; i.e., when the processed file is
        the main file, no `\#' is written to the output file.
    }
*/

#include "icm-pp.h"

void popfile ()
{
    fclose (filestack [filesp].f);
    filesp--;

    if (! nofileinfo && filesp != -1)
        fprintf (outfile, "\n#\n");
}