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)
|
||||
# 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,13 +80,17 @@ 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;
|
||||
|
||||
/*
|
||||
@ -90,13 +98,19 @@ typedef struct eTagFile {
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user