[geany/geany] 848fa0: Move eTagFile from entry.h to entry.c
Jiří Techet
git-noreply at xxxxx
Mon Dec 17 21:05:41 UTC 2018
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Sun, 09 Oct 2016 09:56:49 UTC
Commit: 848fa0dce3c95d8cdd767875e08d13e16d4121e6
https://github.com/geany/geany/commit/848fa0dce3c95d8cdd767875e08d13e16d4121e6
Log Message:
-----------
Move eTagFile from entry.h to entry.c
Add access functions and use them outside entry.c. In addition to functions
defined in uctags setMaxTagsLine() had to be added because it is needed
in parser.c (at the moment, will be probably gone in some of the next
commits).
Modified Paths:
--------------
ctags/main/entry.c
ctags/main/entry.h
ctags/main/parse.c
ctags/main/read.c
Modified: ctags/main/entry.c
62 lines changed, 62 insertions(+), 0 deletions(-)
===================================================================
@@ -68,6 +68,23 @@
# define O_RDWR _O_RDWR
#endif
+
+/* Maintains the state of the tag file.
+ */
+typedef struct eTagFile {
+ char *name;
+ 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;*/
+ vString *vLine;
+} tagFile;
+
/*
* DATA DEFINITIONS
*/
@@ -422,3 +439,48 @@ extern void setTagWriter (tagWriter *t)
{
/* writer = t; */
}
+
+extern unsigned long numTagsAdded(void)
+{
+ return TagFile.numTags.added;
+}
+
+extern void setNumTagsAdded (unsigned long nadded)
+{
+ TagFile.numTags.added = nadded;
+}
+
+extern unsigned long numTagsTotal(void)
+{
+ return TagFile.numTags.added + TagFile.numTags.prev;
+}
+
+extern unsigned long maxTagsLine (void)
+{
+ return (unsigned long)TagFile.max.line;
+}
+
+extern void setMaxTagsLine (unsigned long max)
+{
+ TagFile.max.line = max;
+}
+
+extern void invalidatePatternCache(void)
+{
+/* TagFile.patternCacheValid = false; */
+}
+
+extern void tagFilePosition (MIOPos *p)
+{
+ mio_getpos (TagFile.mio, p);
+}
+
+extern void setTagFilePosition (MIOPos *p)
+{
+ mio_setpos (TagFile.mio, p);
+}
+
+extern const char* getTagFileDirectory (void)
+{
+ return TagFile.directory;
+}
Modified: ctags/main/entry.h
35 lines changed, 12 insertions(+), 23 deletions(-)
===================================================================
@@ -36,28 +36,6 @@ typedef struct sTagField {
const char* value;
} tagField;
-/* Maintains the state of the tag file.
- */
-typedef struct eTagFile {
- char *name;
- 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;*/
- vString *vLine;
-} tagFile;
-
-typedef struct sTagFields {
- unsigned int count; /* number of additional extension flags */
- const char *const *label; /* list of labels for extension flags */
- const char *const *value; /* list of values for extension flags */
-} tagFields;
-
/* Information about the current tag candidate.
*/
struct sTagEntryInfo {
@@ -88,7 +66,6 @@ struct sTagEntryInfo {
/*
* GLOBAL VARIABLES
*/
-extern tagFile TagFile;
/*
* FUNCTION PROTOTYPES
@@ -102,4 +79,16 @@ extern void closeTagFile (const bool resize);
extern void makeTagEntry (const tagEntryInfo *const tag);
extern void initTagEntry (tagEntryInfo *const e, const char *const name, const kindOption *kind);
+extern unsigned long numTagsAdded(void);
+extern void setNumTagsAdded (unsigned long nadded);
+extern unsigned long numTagsTotal(void);
+extern unsigned long maxTagsLine(void);
+extern void setMaxTagsLine (unsigned long max);
+extern void invalidatePatternCache(void);
+extern void tagFilePosition (MIOPos *p);
+extern void setTagFilePosition (MIOPos *p);
+extern const char* getTagFileDirectory (void);
+extern void getTagScopeInformation (tagEntryInfo *const tag,
+ const char **kind, const char **name);
+
#endif /* CTAGS_MAIN_ENTRY_H */
Modified: ctags/main/parse.c
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -609,18 +609,18 @@ static bool createTagsForFile (const char *const fileName,
static bool createTagsWithFallback (const char *const fileName,
const langType language)
{
- const unsigned long numTags = TagFile.numTags.added;
- MIOPos tagFilePosition;
+ const unsigned long numTags = numTagsAdded ();
+ MIOPos filePosition;
unsigned int passCount = 0;
bool tagFileResized = false;
- mio_getpos (TagFile.mio, &tagFilePosition);
+ tagFilePosition (&filePosition);
while (createTagsForFile (fileName, language, ++passCount))
{
/* Restore prior state of tag file.
*/
- mio_setpos (TagFile.mio, &tagFilePosition);
- TagFile.numTags.added = numTags;
+ setTagFilePosition (&filePosition);
+ setNumTagsAdded (numTags);
tagFileResized = true;
}
return tagFileResized;
Modified: ctags/main/read.c
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -88,10 +88,10 @@ static void setSourceFileParameters (vString *const fileName, const langType lan
else
File.source.tagPath =
vStringNewOwn (relativeFilename (vStringValue (fileName),
- TagFile.directory));
+ getTagFileDirectory ()));
- if (vStringLength (fileName) > TagFile.max.file)
- TagFile.max.file = vStringLength (fileName);
+ if (vStringLength (fileName) > maxTagsLine ())
+ setMaxTagsLine (vStringLength (fileName));
File.source.isHeader = isIncludeFile (vStringValue (fileName));
File.input.isHeader = File.source.isHeader;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list