Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sun, 09 Oct 2016 10:40:08 UTC Commit: 4cde630dd78282cead151a9afb14bd7056c7f407 https://github.com/geany/geany/commit/4cde630dd78282cead151a9afb14bd7056c7f4...
Log Message: ----------- Sync the beginning of entry.c/h
Mostly sTagEntryInfo and eTagFile taken from uctags and sync of includes.
Modified Paths: -------------- ctags/main/entry.c ctags/main/entry.h
Modified: ctags/main/entry.c 57 lines changed, 36 insertions(+), 21 deletions(-) =================================================================== @@ -22,7 +22,9 @@ #if defined (HAVE_TYPES_H) # include <types.h> /* to declare off_t on some hosts */ #endif - +#if defined (HAVE_UNISTD_H) +# include <unistd.h> /* to declare close (), ftruncate (), truncate () */ +#endif
/* These header files provide for the functions necessary to do file * truncation. @@ -34,23 +36,25 @@ # include <io.h> #endif
-#include "ctags.h" #include "debug.h" #include "entry.h" +#include "field.h" +#include "fmt.h" +#include "kind.h" #include "main.h" #include "options.h" +#include "output.h" +#include "ptag.h" #include "read.h" +#include "routines.h" #include "sort.h" #include "strlist.h" -#include "routines.h" -#include "output.h" +#include "xtag.h" +#include "ctags.h"
/* * MACROS */ -#define PSEUDO_TAG_PREFIX "!_" - -#define includeExtensionFlags() (Option.tagFileFormat > 1)
/* * Portability defines @@ -76,27 +80,37 @@ typedef struct eTagFile { char *directory; MIO *mio; struct sNumTags { unsigned long added, prev; } numTags; - struct sMax { size_t line, tag, file; } max; -/* struct sEtags { - char *name; - MIO *mio; - size_t byteCount; - } etags;*/ + struct sMax { size_t line, tag; } max; vString *vLine; + + unsigned int cork; + struct sCorkQueue { + struct sTagEntryInfo* queue; + unsigned int length; + unsigned int count; + } corkQueue; + + bool patternCacheValid; } tagFile;
/* * DATA DEFINITIONS */
tagFile TagFile = { - NULL, /* tag file name */ - NULL, /* tag file directory (absolute) */ - NULL, /* file pointer */ - { 0, 0 }, /* numTags */ - { 0, 0, 0 }, /* max */ -/* { NULL, NULL, 0 },*/ /* etags */ - NULL /* vLine */ + NULL, /* tag file name */ + NULL, /* tag file directory (absolute) */ + NULL, /* file pointer */ + { 0, 0 }, /* numTags */ + { 0, 0 }, /* max */ + NULL, /* vLine */ + .cork = false, + .corkQueue = { + .queue = NULL, + .length = 0, + .count = 0 + }, + .patternCacheValid = false, };
static bool TagsToStdout = false; @@ -118,7 +132,8 @@ extern int ftruncate (int fd, off_t length);
extern void freeTagFileResources (void) { - eFree (TagFile.directory); + if (TagFile.directory != NULL) + eFree (TagFile.directory); vStringDelete (TagFile.vLine); }
Modified: ctags/main/entry.h 69 lines changed, 54 insertions(+), 15 deletions(-) =================================================================== @@ -15,17 +15,21 @@ #include "general.h" /* must always come first */ #include "types.h"
+#include <stdio.h> + #include "field.h" -#include "mio.h" -#include "vstring.h" #include "kind.h" +#include "vstring.h" +#include "xtag.h" +#include "mio.h" +#include "nestlevel.h"
/* * MACROS */ #define WHOLE_FILE -1L +#define includeExtensionFlags() (Option.tagFileFormat > 1)
-#define NO_PARSER_FIELD -1 #define CORK_NIL 0
/* @@ -39,16 +43,25 @@ typedef struct sTagField { /* Information about the current tag candidate. */ struct sTagEntryInfo { - bool lineNumberEntry; /* pattern or line number entry */ - unsigned long lineNumber; /* line number of tag */ - MIOPos filePosition; /* file position of line containing tag */ - const char* language; /* language of source file */ - bool isFileScope; /* is tag visible only within source file? */ - bool isFileEntry; /* is this just an entry for a file name? */ - bool truncateLine; /* truncate tag line at end of tag name? */ - const char *sourceFileName; /* name of source file */ - const char *name; /* name of the tag */ - const kindOption *kind; /* kind descriptor */ + unsigned int lineNumberEntry:1; /* pattern or line number entry */ + unsigned int isFileScope :1; /* is tag visible only within input file? */ + unsigned int isFileEntry :1; /* is this just an entry for a file name? */ + unsigned int truncateLine :1; /* truncate tag line at end of tag name? */ + unsigned int placeholder :1; /* This is just a part of scope context. + Put this entry to cork queue but + don't print it to tags file. */ + + unsigned long lineNumber; /* line number of tag */ + const char* pattern; /* pattern for locating input line + * (may be NULL if not present) *//* */ + unsigned int boundaryInfo; /* info about nested input stream */ + MIOPos filePosition; /* file position of line containing tag */ + const char* language; /* language of input file */ + const char *inputFileName; /* name of input file */ + const char *name; /* name of the tag */ + const kindOption *kind; /* kind descriptor */ + unsigned char extra[ ((XTAG_COUNT) / 8) + 1 ]; + struct { const char* access; const char* fileScope; @@ -57,16 +70,42 @@ struct sTagEntryInfo {
const kindOption* scopeKind; const char* scopeName; + int scopeIndex; /* cork queue entry for upper scope tag. + This field is meaningful if the value + is not CORK_NIL and scope[0] and scope[1] are + NULL. */ + + const char* signature;
- const char *signature; /* Argument list for functions and macros with arguments */ const char *varType; - } extensionFields; /* list of extension fields*/ + +#define ROLE_INDEX_DEFINITION -1 + int roleIndex; /* for role of reference tag */ + +#ifdef HAVE_LIBXML + const char* xpath; +#endif + unsigned long endLine; + } extensionFields; /* list of extension fields*/ + +#define PRE_ALLOCATED_PARSER_FIELDS 5 +#define NO_PARSER_FIELD -1 + unsigned int usedParserFields; + tagField parserFields [PRE_ALLOCATED_PARSER_FIELDS]; + + /* Following source* fields are used only when #line is found + in input and --line-directive is given in ctags command line. */ + const char* sourceLanguage; + const char *sourceFileName; + unsigned long sourceLineNumberDifference; };
+ /* * GLOBAL VARIABLES */
+ /* * FUNCTION PROTOTYPES */
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).