Kaydet (Commit) c1acde7e authored tarafından Jiří Techet's avatar Jiří Techet

read: move sInputFileInfo, sInputFile and File to read.c

üst 63fbe2f6
...@@ -35,12 +35,47 @@ ...@@ -35,12 +35,47 @@
#include <regex.h> #include <regex.h>
/* /*
* DATA DEFINITIONS * DATA DECLARATIONS
*/ */
inputFile File; /* globally read through macros */
static MIOPos StartOfLine; /* holds deferred position of start of line */
/* Maintains the state of the current input file.
*/
typedef struct sInputFileInfo {
vString *name; /* name to report for input file */
vString *tagPath; /* path of input file relative to tag file */
unsigned long lineNumber;/* line number in the input file */
unsigned long lineNumberOrigin; /* The value set to `lineNumber'
when `resetInputFile' is called
on the input stream.
This is needed for nested stream. */
bool isHeader; /* is input file a header file? */
langType language; /* language of input file */
} inputFileInfo;
typedef struct sInputFile {
vString *path; /* path of input file (if any) */
vString *line; /* last line read from file */
const unsigned char* currentLine; /* current line being worked on */
MIO *mio; /* MIO stream used for reading the file */
MIOPos filePosition; /* file position of current line */
unsigned int ungetchIdx;
int ungetchBuf[3]; /* characters that were ungotten */
/* Contains data pertaining to the original `source' file in which the tag
* was defined. This may be different from the `input' file when #line
* directives are processed (i.e. the input file is preprocessor output).
*/
inputFileInfo input; /* name, lineNumber */
inputFileInfo source;
} inputFile;
/*
* DATA DEFINITIONS
*/
static inputFile File; /* static read through functions */
static MIOPos StartOfLine; /* holds deferred position of start of line */
/* /*
* FUNCTION DEFINITIONS * FUNCTION DEFINITIONS
*/ */
......
...@@ -48,42 +48,6 @@ enum eCharacters { ...@@ -48,42 +48,6 @@ enum eCharacters {
CHAR_SYMBOL = ('C' + 0xff) CHAR_SYMBOL = ('C' + 0xff)
}; };
/* Maintains the state of the current input file.
*/
typedef struct sInputFileInfo {
vString *name; /* name to report for input file */
vString *tagPath; /* path of input file relative to tag file */
unsigned long lineNumber;/* line number in the input file */
unsigned long lineNumberOrigin; /* The value set to `lineNumber'
when `resetInputFile' is called
on the input stream.
This is needed for nested stream. */
bool isHeader; /* is input file a header file? */
langType language; /* language of input file */
} inputFileInfo;
typedef struct sInputFile {
vString *path; /* path of input file (if any) */
vString *line; /* last line read from file */
const unsigned char* currentLine; /* current line being worked on */
MIO *mio; /* MIO stream used for reading the file */
MIOPos filePosition; /* file position of current line */
unsigned int ungetchIdx;
int ungetchBuf[3]; /* characters that were ungotten */
/* Contains data pertaining to the original source file in which the tag
* was defined. This may be different from the input file when #line
* directives are processed (i.e. the input file is preprocessor output).
*/
inputFileInfo input; /* name, lineNumber */
inputFileInfo source;
} inputFile;
/*
* GLOBAL VARIABLES
*/
/* should not be modified externally */
extern inputFile File;
/* /*
* FUNCTION PROTOTYPES * FUNCTION PROTOTYPES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment