Branch: refs/heads/master
Author: Jiřà Techet <techet(a)gmail.com>
Committer: Jiřà Techet <techet(a)gmail.com>
Date: Mon, 10 Oct 2016 22:22:48 UTC
Commit: eecfff0da799e6c399a53fe1e5b4dc8072fb4ca2
https://github.com/geany/geany/commit/eecfff0da799e6c399a53fe1e5b4dc8072fb4…
Log Message:
-----------
read: Add some extra data structures
Modified Paths:
--------------
ctags/main/read.c
Modified: ctags/main/read.c
34 lines changed, 34 insertions(+), 0 deletions(-)
===================================================================
@@ -38,9 +38,19 @@
* DATA DECLARATIONS
*/
+typedef struct sLangStack {
+ langType *languages;
+ unsigned int count;
+ unsigned int size;
+} langStack;
/* Maintains the state of the current input file.
*/
+typedef union sInputLangInfo {
+ langStack stack;
+ langType type;
+} inputLangInfo;
+
typedef struct sInputFileInfo {
vString *name; /* name to report for input file */
vString *tagPath; /* path of input file relative to tag file */
@@ -53,6 +63,19 @@ typedef struct sInputFileInfo {
langType language; /* language of input file */
} inputFileInfo;
+typedef struct sInputLineFposMap {
+ MIOPos *pos;
+ unsigned int count;
+ unsigned int size;
+} inputLineFposMap;
+
+typedef struct sNestedInputStreamInfo {
+ unsigned long startLine;
+ int startCharOffset;
+ unsigned long endLine;
+ int endCharOffset;
+} nestedInputStreamInfo;
+
typedef struct sInputFile {
vString *path; /* path of input file (if any) */
vString *line; /* last line read from file */
@@ -68,6 +91,17 @@ typedef struct sInputFile {
*/
inputFileInfo input; /* name, lineNumber */
inputFileInfo source;
+
+ nestedInputStreamInfo nestedInputStreamInfo;
+
+ /* sourceTagPathHolder is a kind of trash box.
+ The buffer pointed by tagPath field of source field can
+ be referred from tagsEntryInfo instances. sourceTagPathHolder
+ is used keeping the buffer till all processing about the current
+ input file is done. After all processing is done, the buffers
+ in sourceTagPathHolder are destroied. */
+ stringList * sourceTagPathHolder;
+ inputLineFposMap lineFposMap;
} inputFile;
/*
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiřà Techet <techet(a)gmail.com>
Committer: Jiřà Techet <techet(a)gmail.com>
Date: Mon, 10 Oct 2016 22:13:25 UTC
Commit: c1acde7eff0cb98ec34588c7d45bcfe1be20e7e8
https://github.com/geany/geany/commit/c1acde7eff0cb98ec34588c7d45bcfe1be20e…
Log Message:
-----------
read: move sInputFileInfo, sInputFile and File to read.c
Modified Paths:
--------------
ctags/main/read.c
ctags/main/read.h
Modified: ctags/main/read.c
41 lines changed, 38 insertions(+), 3 deletions(-)
===================================================================
@@ -35,12 +35,47 @@
#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
*/
Modified: ctags/main/read.h
36 lines changed, 0 insertions(+), 36 deletions(-)
===================================================================
@@ -48,42 +48,6 @@ enum eCharacters {
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
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).