Sync the beginning of entry.c/h
Mostly sTagEntryInfo and eTagFile taken from uctags and sync of includes.
This commit is contained in:
parent
848fa0dce3
commit
4cde630dd7
@ -22,7 +22,9 @@
|
|||||||
#if defined (HAVE_TYPES_H)
|
#if defined (HAVE_TYPES_H)
|
||||||
# include <types.h> /* to declare off_t on some hosts */
|
# include <types.h> /* to declare off_t on some hosts */
|
||||||
#endif
|
#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
|
/* These header files provide for the functions necessary to do file
|
||||||
* truncation.
|
* truncation.
|
||||||
@ -34,23 +36,25 @@
|
|||||||
# include <io.h>
|
# include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ctags.h"
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "entry.h"
|
#include "entry.h"
|
||||||
|
#include "field.h"
|
||||||
|
#include "fmt.h"
|
||||||
|
#include "kind.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "output.h"
|
||||||
|
#include "ptag.h"
|
||||||
#include "read.h"
|
#include "read.h"
|
||||||
|
#include "routines.h"
|
||||||
#include "sort.h"
|
#include "sort.h"
|
||||||
#include "strlist.h"
|
#include "strlist.h"
|
||||||
#include "routines.h"
|
#include "xtag.h"
|
||||||
#include "output.h"
|
#include "ctags.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MACROS
|
* MACROS
|
||||||
*/
|
*/
|
||||||
#define PSEUDO_TAG_PREFIX "!_"
|
|
||||||
|
|
||||||
#define includeExtensionFlags() (Option.tagFileFormat > 1)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Portability defines
|
* Portability defines
|
||||||
@ -76,13 +80,17 @@ typedef struct eTagFile {
|
|||||||
char *directory;
|
char *directory;
|
||||||
MIO *mio;
|
MIO *mio;
|
||||||
struct sNumTags { unsigned long added, prev; } numTags;
|
struct sNumTags { unsigned long added, prev; } numTags;
|
||||||
struct sMax { size_t line, tag, file; } max;
|
struct sMax { size_t line, tag; } max;
|
||||||
/* struct sEtags {
|
|
||||||
char *name;
|
|
||||||
MIO *mio;
|
|
||||||
size_t byteCount;
|
|
||||||
} etags;*/
|
|
||||||
vString *vLine;
|
vString *vLine;
|
||||||
|
|
||||||
|
unsigned int cork;
|
||||||
|
struct sCorkQueue {
|
||||||
|
struct sTagEntryInfo* queue;
|
||||||
|
unsigned int length;
|
||||||
|
unsigned int count;
|
||||||
|
} corkQueue;
|
||||||
|
|
||||||
|
bool patternCacheValid;
|
||||||
} tagFile;
|
} tagFile;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -90,13 +98,19 @@ typedef struct eTagFile {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
tagFile TagFile = {
|
tagFile TagFile = {
|
||||||
NULL, /* tag file name */
|
NULL, /* tag file name */
|
||||||
NULL, /* tag file directory (absolute) */
|
NULL, /* tag file directory (absolute) */
|
||||||
NULL, /* file pointer */
|
NULL, /* file pointer */
|
||||||
{ 0, 0 }, /* numTags */
|
{ 0, 0 }, /* numTags */
|
||||||
{ 0, 0, 0 }, /* max */
|
{ 0, 0 }, /* max */
|
||||||
/* { NULL, NULL, 0 },*/ /* etags */
|
NULL, /* vLine */
|
||||||
NULL /* vLine */
|
.cork = false,
|
||||||
|
.corkQueue = {
|
||||||
|
.queue = NULL,
|
||||||
|
.length = 0,
|
||||||
|
.count = 0
|
||||||
|
},
|
||||||
|
.patternCacheValid = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool TagsToStdout = false;
|
static bool TagsToStdout = false;
|
||||||
@ -118,7 +132,8 @@ extern int ftruncate (int fd, off_t length);
|
|||||||
|
|
||||||
extern void freeTagFileResources (void)
|
extern void freeTagFileResources (void)
|
||||||
{
|
{
|
||||||
eFree (TagFile.directory);
|
if (TagFile.directory != NULL)
|
||||||
|
eFree (TagFile.directory);
|
||||||
vStringDelete (TagFile.vLine);
|
vStringDelete (TagFile.vLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,17 +15,21 @@
|
|||||||
#include "general.h" /* must always come first */
|
#include "general.h" /* must always come first */
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "field.h"
|
#include "field.h"
|
||||||
#include "mio.h"
|
|
||||||
#include "vstring.h"
|
|
||||||
#include "kind.h"
|
#include "kind.h"
|
||||||
|
#include "vstring.h"
|
||||||
|
#include "xtag.h"
|
||||||
|
#include "mio.h"
|
||||||
|
#include "nestlevel.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MACROS
|
* MACROS
|
||||||
*/
|
*/
|
||||||
#define WHOLE_FILE -1L
|
#define WHOLE_FILE -1L
|
||||||
|
#define includeExtensionFlags() (Option.tagFileFormat > 1)
|
||||||
|
|
||||||
#define NO_PARSER_FIELD -1
|
|
||||||
#define CORK_NIL 0
|
#define CORK_NIL 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -39,16 +43,25 @@ typedef struct sTagField {
|
|||||||
/* Information about the current tag candidate.
|
/* Information about the current tag candidate.
|
||||||
*/
|
*/
|
||||||
struct sTagEntryInfo {
|
struct sTagEntryInfo {
|
||||||
bool lineNumberEntry; /* pattern or line number entry */
|
unsigned int lineNumberEntry:1; /* pattern or line number entry */
|
||||||
unsigned long lineNumber; /* line number of tag */
|
unsigned int isFileScope :1; /* is tag visible only within input file? */
|
||||||
MIOPos filePosition; /* file position of line containing tag */
|
unsigned int isFileEntry :1; /* is this just an entry for a file name? */
|
||||||
const char* language; /* language of source file */
|
unsigned int truncateLine :1; /* truncate tag line at end of tag name? */
|
||||||
bool isFileScope; /* is tag visible only within source file? */
|
unsigned int placeholder :1; /* This is just a part of scope context.
|
||||||
bool isFileEntry; /* is this just an entry for a file name? */
|
Put this entry to cork queue but
|
||||||
bool truncateLine; /* truncate tag line at end of tag name? */
|
don't print it to tags file. */
|
||||||
const char *sourceFileName; /* name of source file */
|
|
||||||
const char *name; /* name of the tag */
|
unsigned long lineNumber; /* line number of tag */
|
||||||
const kindOption *kind; /* kind descriptor */
|
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 {
|
struct {
|
||||||
const char* access;
|
const char* access;
|
||||||
const char* fileScope;
|
const char* fileScope;
|
||||||
@ -57,16 +70,42 @@ struct sTagEntryInfo {
|
|||||||
|
|
||||||
const kindOption* scopeKind;
|
const kindOption* scopeKind;
|
||||||
const char* scopeName;
|
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;
|
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
|
* GLOBAL VARIABLES
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FUNCTION PROTOTYPES
|
* FUNCTION PROTOTYPES
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user