geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "general.h"
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
#include <limits.h>
#include "debug.h"
#include "entry_p.h"
#include "field.h"
#include "fmt_p.h"
#include "kind.h"
#include "nestlevel.h"
#include "options_p.h"
#include "ptag_p.h"
#include "rbtree.h"
#include "read.h"
#include "read_p.h"
#include "routines.h"
#include "routines_p.h"
#include "parse_p.h"
#include "ptrarray.h"
#include "sort_p.h"
#include "strlist.h"
#include "subparser_p.h"
#include "trashbox.h"
#include "writer_p.h"
#include "xtag_p.h"
Go to the source code of this file.
Classes | |
struct | eTagFile |
struct | eTagFile::sNumTags |
struct | eTagFile::sMax |
struct | sTagEntryInfoX |
struct | anyKindsEntryInScopeData |
Macros | |
#define | USE_REPLACEMENT_TRUNCATE |
#define | field(x) (fields + ((size_t) (x) * fieldLength)) |
#define | WHOLE_FILE -1L |
Typedefs | |
typedef struct eTagFile | tagFile |
typedef struct sTagEntryInfoX | tagEntryInfoX |
Functions | |
void | freeTagFileResources (void) |
const char * | tagFileName (void) |
void | abort_if_ferror (MIO *const mio) |
static void | rememberMaxLengths (const size_t nameLength, const size_t lineLength) |
static void | addCommonPseudoTags (void) |
void | makeFileTag (const char *const fileName) |
static void | updateSortedFlag (const char *const line, MIO *const mio, MIOPos startOfLine) |
static long unsigned int | updatePseudoTags (MIO *const mio) |
static bool | isValidTagAddress (const char *const excmd) |
static bool | isCtagsLine (const char *const line) |
static bool | isEtagsLine (const char *const line) |
static bool | isTagFile (const char *const filename) |
void | openTagFile (void) |
static void | copyBytes (MIO *const fromMio, MIO *const toMio, const long size) |
static void | copyFile (const char *const from, const char *const to, const long size) |
static int | replacementTruncate (const char *const name, const long size) |
static void | internalSortTagFile (void) |
static void | sortTagFile (void) |
static void | resizeTagFile (const long newSize) |
static void | writeEtagsIncludes (MIO *const mio) |
void | closeTagFile (const bool resize) |
static size_t | appendInputLine (int putc_func(char, void *), const char *const line, unsigned int patternLengthLimit, void *data, bool *omitted) |
static int | vstring_putc (char c, void *data) |
static int | vstring_puts (const char *s, void *data) |
char * | readLineFromBypassForTag (vString *const vLine, const tagEntryInfo *const tag, long *const pSeekValue) |
size_t | truncateTagLineAfterTag (char *const line, const char *const token, const bool discardNewline) |
static char * | getFullQualifiedScopeNameFromCorkQueue (const tagEntryInfo *inner_scope) |
void | getTagScopeInformation (tagEntryInfo *const tag, const char **kind, const char **name) |
static int | makePatternStringCommon (const tagEntryInfo *const tag, int(*putc_func)(char, void *), int(*puts_func)(const char *, void *), void *output) |
char * | makePatternString (const tagEntryInfo *const tag) |
static tagField * | tagFieldNew (fieldType ftype, const char *value, bool valueOwner) |
static void | tagFieldDelete (tagField *f) |
static void | attachParserFieldGeneric (tagEntryInfo *const tag, fieldType ftype, const char *value, bool valueOwner) |
void | attachParserField (tagEntryInfo *const tag, bool inCorkQueue, fieldType ftype, const char *value) |
void | attachParserFieldToCorkEntry (int index, fieldType ftype, const char *value) |
const tagField * | getParserFieldForIndex (const tagEntryInfo *tag, int index) |
const char * | getParserFieldValueForType (tagEntryInfo *const tag, fieldType ftype) |
static void | copyParserFields (const tagEntryInfo *const tag, tagEntryInfo *slot) |
static tagEntryInfo * | newNilTagEntry (unsigned int corkFlags) |
static tagEntryInfoX * | copyTagEntry (const tagEntryInfo *const tag, unsigned int corkFlags) |
static void | clearParserFields (tagEntryInfo *const tag) |
static void | deleteTagEnry (void *data) |
static void | corkSymtabPut (tagEntryInfoX *scope, const char *name, tagEntryInfoX *item) |
bool | foreachEntriesInScope (int corkIndex, const char *name, entryForeachFunc func, void *data) |
static bool | findName (int corkIndex, tagEntryInfo *entry, void *data) |
int | anyEntryInScope (int corkIndex, const char *name) |
static bool | findNameOfKinds (int corkIndex, tagEntryInfo *entry, void *data) |
int | anyKindEntryInScope (int corkIndex, const char *name, int kind) |
int | anyKindsEntryInScope (int corkIndex, const char *name, const int *kinds, int count) |
int | anyKindsEntryInScopeRecursive (int corkIndex, const char *name, const int *kinds, int count) |
void | registerEntry (int corkIndex) |
static int | queueTagEntry (const tagEntryInfo *const tag) |
void | setupWriter (void *writerClientData) |
bool | teardownWriter (const char *filename) |
static bool | isTagWritable (const tagEntryInfo *const tag) |
static void | buildFqTagCache (tagEntryInfo *const tag) |
static void | writeTagEntry (const tagEntryInfo *const tag) |
bool | writePseudoTag (const ptagDesc *desc, const char *const fileName, const char *const pattern, const char *const parserName) |
void | corkTagFile (unsigned int corkFlags) |
void | uncorkTagFile (void) |
tagEntryInfo * | getEntryInCorkQueue (int n) |
tagEntryInfo * | getEntryOfNestingLevel (const NestingLevel *nl) |
size_t | countEntryInCorkQueue (void) |
int | makePlaceholder (const char *const name) |
int | makeTagEntry (const tagEntryInfo *const tag) |
int | makeQualifiedTagEntry (const tagEntryInfo *const e) |
static void | initTagEntryFull (tagEntryInfo *const e, const char *const name, unsigned long lineNumber, langType langType_, MIOPos filePosition, const char *inputFileName, int kindIndex, roleBitsType roleBits, const char *sourceFileName, langType sourceLangType, long sourceLineNumberDifference) |
void | initTagEntry (tagEntryInfo *const e, const char *const name, int kindIndex) |
void | initRefTagEntry (tagEntryInfo *const e, const char *const name, int kindIndex, int roleIndex) |
void | initForeignRefTagEntry (tagEntryInfo *const e, const char *const name, langType langType, int kindIndex, int roleIndex) |
static void | markTagExtraBitFull (tagEntryInfo *const tag, xtagType extra, bool mark) |
void | markTagExtraBit (tagEntryInfo *const tag, xtagType extra) |
bool | isTagExtraBitMarked (const tagEntryInfo *const tag, xtagType extra) |
bool | isTagExtra (const tagEntryInfo *const tag) |
static void | assignRoleFull (tagEntryInfo *const e, int roleIndex, bool assign) |
void | assignRole (tagEntryInfo *const e, int roleIndex) |
bool | isRoleAssigned (const tagEntryInfo *const e, int roleIndex) |
unsigned long | numTagsAdded (void) |
void | setNumTagsAdded (unsigned long nadded) |
unsigned long | numTagsTotal (void) |
unsigned long | maxTagsLine (void) |
void | invalidatePatternCache (void) |
void | tagFilePosition (MIOPos *p) |
void | setTagFilePosition (MIOPos *p) |
const char * | getTagFileDirectory (void) |
static bool | markAsPlaceholder (int index, tagEntryInfo *e, void *data) |
void | markAllEntriesInScopeAsPlaceholder (int index) |
Variables | |
static tagFile | TagFile |
static bool | TagsToStdout = false |
#define field | ( | x | ) | (fields + ((size_t) (x) * fieldLength)) |
#define WHOLE_FILE -1L |
typedef struct sTagEntryInfoX tagEntryInfoX |
void abort_if_ferror | ( | MIO *const | mio | ) |
Definition at line 158 of file entry.c.
References error(), FATAL, mio_error(), NULL, and PERROR.
Referenced by closeTagFile(), endEtagsFile(), writePseudoTag(), and writeTagEntry().
|
static |
Definition at line 173 of file entry.c.
References isPtagCommonInParsers(), LANG_IGNORE, makePtagIfEnabled(), Option, and PTAG_COUNT.
Referenced by openTagFile().
int anyEntryInScope | ( | int | corkIndex, |
const char * | name | ||
) |
Definition at line 1334 of file entry.c.
References CORK_NIL, findName(), foreachEntriesInScope(), index, and name.
int anyKindEntryInScope | ( | int | corkIndex, |
const char * | name, | ||
int | kind | ||
) |
Definition at line 1366 of file entry.c.
References anyKindsEntryInScope(), and name.
int anyKindsEntryInScope | ( | int | corkIndex, |
const char * | name, | ||
const int * | kinds, | ||
int | count | ||
) |
Definition at line 1372 of file entry.c.
References CORK_NIL, count, findNameOfKinds(), foreachEntriesInScope(), anyKindsEntryInScopeData::index, anyKindsEntryInScopeData::kinds, and name.
Referenced by anyKindEntryInScope().
int anyKindsEntryInScopeRecursive | ( | int | corkIndex, |
const char * | name, | ||
const int * | kinds, | ||
int | count | ||
) |
Definition at line 1388 of file entry.c.
References CORK_NIL, count, sTagEntryInfo::extensionFields, findNameOfKinds(), foreachEntriesInScope(), getEntryInCorkQueue(), anyKindsEntryInScopeData::index, anyKindsEntryInScopeData::kinds, name, and sTagEntryInfo::scopeIndex.
|
static |
Definition at line 653 of file entry.c.
References BACKSLASH, sOptionValues::backward, CRETURN, line, NEWLINE, and Option.
Referenced by makePatternStringCommon().
void assignRole | ( | tagEntryInfo *const | e, |
int | roleIndex | ||
) |
Definition at line 1964 of file entry.c.
References assignRoleFull().
Referenced by createCTSTTags(), and matchTagPattern().
|
static |
Definition at line 1940 of file entry.c.
References Assert, AssertNotReached, countLanguageRoles(), sTagEntryInfo::extensionFields, sTagEntryInfo::kindIndex, sTagEntryInfo::langType, makeRoleBit(), markTagExtraBitFull(), ROLE_DEFINITION_INDEX, sTagEntryInfo::roleBits, and XTAG_REFERENCE_TAGS.
Referenced by assignRole().
void attachParserField | ( | tagEntryInfo *const | tag, |
bool | inCorkQueue, | ||
fieldType | ftype, | ||
const char * | value | ||
) |
Definition at line 969 of file entry.c.
References Assert, attachParserFieldGeneric(), eStrdup(), NULL, PARSER_TRASH_BOX_TAKE_BACK, and sTagEntryInfo::parserFieldsDynamic.
Referenced by attachParserFieldToCorkEntry(), createCTSTTags(), makeSectionRstTag(), and matchTagPattern().
|
static |
Definition at line 945 of file entry.c.
References attachParserFieldGeneric(), sTagField::ftype, NULL, PARSER_TRASH_BOX, sTagEntryInfo::parserFields, sTagEntryInfo::parserFieldsDynamic, PRE_ALLOCATED_PARSER_FIELDS, ptrArrayAdd(), ptrArrayDelete(), ptrArrayNew(), tagFieldDelete(), tagFieldNew(), sTagEntryInfo::usedParserFields, sTagField::value, and sTagField::valueOwner.
Referenced by attachParserField(), attachParserFieldGeneric(), and copyParserFields().
void attachParserFieldToCorkEntry | ( | int | index, |
fieldType | ftype, | ||
const char * | value | ||
) |
Definition at line 987 of file entry.c.
References attachParserField(), getEntryInCorkQueue(), and index.
|
static |
Definition at line 1519 of file entry.c.
References getTagScopeInformation(), and NULL.
Referenced by writeTagEntry().
|
static |
Definition at line 1108 of file entry.c.
References eFree(), FIELD_UNKNOWN, sTagField::ftype, NULL, sTagEntryInfo::parserFields, sTagEntryInfo::parserFieldsDynamic, PRE_ALLOCATED_PARSER_FIELDS, ptrArrayDelete(), sTagEntryInfo::usedParserFields, sTagField::value, and sTagField::valueOwner.
Referenced by deleteTagEnry().
void closeTagFile | ( | const bool | resize | ) |
Definition at line 605 of file entry.c.
References abort_if_ferror(), DEBUG_STATUS, debugPrintf(), DebugStatement, eFree(), error(), sOptionValues::etags, FATAL, eTagFile::mio, mio_flush(), mio_seek(), mio_tell(), mio_unref(), eTagFile::name, NULL, Option, PERROR, resizeTagFile(), sortTagFile(), TagFile, TagsToStdout, and writeEtagsIncludes().
Referenced by batchMakeTags(), and parseFileWithMio().
Definition at line 453 of file entry.c.
References eFree(), error(), FATAL, mio_read(), mio_write(), PERROR, and xMalloc.
Referenced by copyFile().
|
static |
Definition at line 472 of file entry.c.
References copyBytes(), error(), FATAL, mio_new_file(), mio_unref(), NULL, and PERROR.
Referenced by replacementTruncate().
|
static |
Definition at line 1021 of file entry.c.
References Assert, attachParserFieldGeneric(), eStrdup(), sTagField::ftype, getParserFieldForIndex(), sTagEntryInfo::usedParserFields, and sTagField::value.
Referenced by copyTagEntry().
|
static |
Definition at line 1052 of file entry.c.
References sTagEntryInfo::access, copyParserFields(), CORK_NIL, sTagEntryInfoX::corkIndex, countXtags(), eStrdup(), sTagEntryInfo::extensionFields, sTagEntryInfo::extraDynamic, sTagEntryInfo::fileScope, sTagEntryInfo::implementation, sTagEntryInfo::inheritance, sTagEntryInfo::inputFileName, sTagEntryInfo::name, NULL, PARSER_TRASH_BOX_TAKE_BACK, sTagEntryInfo::parserFieldsDynamic, sTagEntryInfo::pattern, RB_ROOT, sTagEntryInfo::scopeName, sTagEntryInfo::signature, sTagEntryInfo::sourceFileName, sTagEntryInfoX::symtab, sTagEntryInfo::typeRef, sTagEntryInfo::usedParserFields, xCalloc, xMalloc, and XTAG_COUNT.
Referenced by queueTagEntry().
|
static |
Definition at line 1178 of file entry.c.
References AssertNotReached, container_of, sTagEntryInfo::lineNumber, sTagEntryInfo::name, NULL, rb_insert_color(), rb_link_node(), rb_root::rb_node, scope, sTagEntryInfoX::slot, sTagEntryInfoX::symnode, and verbose().
Referenced by registerEntry().
void corkTagFile | ( | unsigned int | corkFlags | ) |
Definition at line 1588 of file entry.c.
References eTagFile::cork, eTagFile::corkFlags, eTagFile::corkQueue, deleteTagEnry(), newNilTagEntry(), ptrArrayAdd(), ptrArrayNew(), and TagFile.
Referenced by createTagsWithFallback1().
size_t countEntryInCorkQueue | ( | void | ) |
Definition at line 1650 of file entry.c.
References eTagFile::corkQueue, ptrArrayCount(), and TagFile.
|
static |
Definition at line 1133 of file entry.c.
References sTagEntryInfo::access, clearParserFields(), eFree(), sTagEntryInfo::extensionFields, sTagEntryInfo::extraDynamic, sTagEntryInfo::fileScope, sTagEntryInfo::implementation, sTagEntryInfo::inheritance, sTagEntryInfo::inputFileName, KIND_FILE_INDEX, sTagEntryInfo::kindIndex, sTagEntryInfo::name, sTagEntryInfo::pattern, sTagEntryInfo::scopeName, sTagEntryInfo::signature, sTagEntryInfo::sourceFileName, and sTagEntryInfo::typeRef.
Referenced by corkTagFile().
|
static |
|
static |
Definition at line 1350 of file entry.c.
References anyKindsEntryInScopeData::count, entry, anyKindsEntryInScopeData::index, and anyKindsEntryInScopeData::kinds.
Referenced by anyKindsEntryInScope(), and anyKindsEntryInScopeRecursive().
bool foreachEntriesInScope | ( | int | corkIndex, |
const char * | name, | ||
entryForeachFunc | func, | ||
void * | data | ||
) |
Definition at line 1229 of file entry.c.
References container_of, eTagFile::corkQueue, entry, name, NULL, ptrArrayItem(), rb_last(), rb_node::rb_left, rb_next(), rb_root::rb_node, rb_prev(), rb_node::rb_right, sTagEntryInfoX::slot, sTagEntryInfoX::symnode, sTagEntryInfoX::symtab, TagFile, and verbose().
Referenced by anyEntryInScope(), anyKindsEntryInScope(), anyKindsEntryInScopeRecursive(), and markAllEntriesInScopeAsPlaceholder().
void freeTagFileResources | ( | void | ) |
Definition at line 142 of file entry.c.
References eTagFile::directory, eFree(), NULL, TagFile, eTagFile::vLine, and vStringDelete().
Referenced by ctags_cli_main().
tagEntryInfo * getEntryInCorkQueue | ( | int | n | ) |
Definition at line 1635 of file entry.c.
References CORK_NIL, eTagFile::corkQueue, NULL, ptrArrayCount(), ptrArrayItem(), and TagFile.
Referenced by anyKindsEntryInScopeRecursive(), attachParserFieldToCorkEntry(), createCTSTTags(), dumpSstack(), fillEndLineFieldOfUpperScopes(), getEntryOfNestingLevel(), getFullQualifiedScopeNameFromCorkQueue(), getTagScopeInformation(), and matchTagPattern().
tagEntryInfo * getEntryOfNestingLevel | ( | const NestingLevel * | nl | ) |
Definition at line 1643 of file entry.c.
References NestingLevel::corkIndex, getEntryInCorkQueue(), and NULL.
Referenced by constructParentString(), emitRubyTag(), enterUnnamedScope(), findRubyTags(), getNestingLevel(), makeAsciidocTag(), makeSectionRstTag(), makeTargetRstTag(), and nestingLevelsToScope().
|
static |
Definition at line 753 of file entry.c.
References getEntryInCorkQueue(), KIND_GHOST_INDEX, sTagEntryInfo::kindIndex, sTagEntryInfo::langType, NULL, scope, scopeSeparatorFor(), stringListAdd(), stringListCount(), stringListDelete(), stringListLast(), stringListNew(), stringListRemoveLast(), vStringCat(), vStringCatS(), vStringDelete(), vStringDeleteUnwrap(), vStringNew(), and vStringNewInit().
Referenced by getTagScopeInformation().
const tagField * getParserFieldForIndex | ( | const tagEntryInfo * | tag, |
int | index | ||
) |
Definition at line 996 of file entry.c.
References index, NULL, sTagEntryInfo::parserFields, sTagEntryInfo::parserFieldsDynamic, PRE_ALLOCATED_PARSER_FIELDS, ptrArrayItem(), and sTagEntryInfo::usedParserFields.
Referenced by addParserFields(), copyParserFields(), doesFieldHaveTabOrNewlineChar(), getParserFieldValueForType(), hasTagEntryTabOrNewlineChar(), printTagField(), and renderFieldCommon().
const char * getParserFieldValueForType | ( | tagEntryInfo *const | tag, |
fieldType | ftype | ||
) |
Definition at line 1010 of file entry.c.
References sTagField::ftype, getParserFieldForIndex(), NULL, sTagEntryInfo::usedParserFields, and sTagField::value.
const char * getTagFileDirectory | ( | void | ) |
Definition at line 2024 of file entry.c.
References eTagFile::directory, and TagFile.
Referenced by setInputFileParametersCommon().
void getTagScopeInformation | ( | tagEntryInfo *const | tag, |
const char ** | kind, | ||
const char ** | name | ||
) |
Definition at line 803 of file entry.c.
References Assert, eTagFile::corkQueue, sTagEntryInfo::extensionFields, getEntryInCorkQueue(), getFullQualifiedScopeNameFromCorkQueue(), getLanguageKind(), KIND_GHOST_INDEX, LANG_AUTO, sTagEntryInfo::langType, sKindDefinition::name, name, NULL, ptrArrayCount(), scope, sTagEntryInfo::scopeIndex, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeLangType, sTagEntryInfo::scopeName, and TagFile.
Referenced by buildFqTagCache(), doesContainAnyCharInFieldScope(), renderFieldScope(), renderFieldScopeKindName(), renderFieldScopeNoEscape(), and write_entry().
void initForeignRefTagEntry | ( | tagEntryInfo *const | e, |
const char *const | name, | ||
langType | langType, | ||
int | kindIndex, | ||
int | roleIndex | ||
) |
Definition at line 1844 of file entry.c.
References getInputFilePosition(), getInputFileTagPath(), getInputLineNumber(), getSourceFileTagPath(), getSourceLanguage(), getSourceLineNumber(), initTagEntryFull(), makeRoleBit(), and name.
Referenced by initRefTagEntry().
void initRefTagEntry | ( | tagEntryInfo *const | e, |
const char *const | name, | ||
int | kindIndex, | ||
int | roleIndex | ||
) |
Definition at line 1838 of file entry.c.
References getInputLanguage(), initForeignRefTagEntry(), and name.
Referenced by addReferenceTag(), createCTSTTags(), initRegexTag(), makeConstTag(), and makeSimpleRefTag().
void initTagEntry | ( | tagEntryInfo *const | e, |
const char *const | name, | ||
int | kindIndex | ||
) |
Definition at line 1823 of file entry.c.
References getInputFilePosition(), getInputFileTagPath(), getInputLanguage(), getInputLineNumber(), getSourceFileTagPath(), getSourceLanguage(), getSourceLineNumber(), initTagEntryFull(), and name.
Referenced by addTag(), createCTSTTags(), createPascalTag(), emitRubyTag(), enterUnnamedScope(), findConfTags(), findCssTags(), findPerlTags(), initPhpEntry(), initPowerShellEntry(), makeAbcTag(), makeAsciidocTag(), makeBibTag(), makeClassTag(), makeDefineTag(), makeFileTag(), makeFortranTag(), makeFunctionTag(), makeJsonTag(), makeJsTagCommon(), makeMarkdownTag(), makeMemberTag(), makeNamespacePhpTag(), makePlaceholder(), makeRTag(), makeSectionRstTag(), makeSqlTag(), makeTag(), makeTargetRstTag(), makeTxt2tagsTag(), makeVariableTag(), and prepareTag().
|
static |
Definition at line 1769 of file entry.c.
References Assert, sTagEntryInfo::boundaryInfo, CORK_NIL, countLanguageKinds(), countLanguageRoles(), doesParserRunAsGuest(), doesSubparserRun(), EX_LINENUM, sTagEntryInfo::extensionFields, FIELD_UNKNOWN, sTagEntryInfo::filePosition, filePosition, sTagField::ftype, getInputFileName(), getNestedInputBoundaryInfo(), if(), sTagEntryInfo::inputFileName, isParserMarkedNoEmission(), KIND_GHOST_INDEX, sTagEntryInfo::kindIndex, LANG_AUTO, sTagEntryInfo::langType, sTagEntryInfo::lineNumber, lineNumber, sTagEntryInfo::lineNumberEntry, sOptionValues::locate, makeRoleBit(), markTagExtraBit(), sTagEntryInfo::name, name, NULL, Option, sTagEntryInfo::parserFields, sTagEntryInfo::placeholder, PRE_ALLOCATED_PARSER_FIELDS, sTagEntryInfo::roleBits, sTagEntryInfo::scopeIndex, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeLangType, sTagEntryInfo::sourceFileName, sTagEntryInfo::sourceLangType, sTagEntryInfo::sourceLineNumberDifference, sTagEntryInfo::usedParserFields, XTAG_GUEST, XTAG_REFERENCE_TAGS, and XTAG_SUBPARSER.
Referenced by initForeignRefTagEntry(), and initTagEntry().
|
static |
Definition at line 510 of file entry.c.
References eTagFile::sNumTags::added, failedSort(), internalSortTags(), eTagFile::mio, mio_new_file(), mio_seek(), mio_unref(), NULL, eTagFile::numTags, eTagFile::sNumTags::prev, TagFile, tagFileName(), and TagsToStdout.
Referenced by sortTagFile().
void invalidatePatternCache | ( | void | ) |
Definition at line 1997 of file entry.c.
References eTagFile::patternCacheValid, and TagFile.
Referenced by openInputFile(), and pushNarrowedInputStream().
|
static |
|
static |
bool isRoleAssigned | ( | const tagEntryInfo *const | e, |
int | roleIndex | ||
) |
Definition at line 1969 of file entry.c.
References sTagEntryInfo::extensionFields, makeRoleBit(), ROLE_DEFINITION_INDEX, and sTagEntryInfo::roleBits.
Referenced by isTagWritable().
bool isTagExtra | ( | const tagEntryInfo *const | tag | ) |
Definition at line 1932 of file entry.c.
References isTagExtraBitMarked(), and XTAG_COUNT.
bool isTagExtraBitMarked | ( | const tagEntryInfo *const | tag, |
xtagType | extra | ||
) |
Definition at line 1904 of file entry.c.
References Assert, countXtags(), sTagEntryInfo::extra, sTagEntryInfo::extraDynamic, index, XTAG_COUNT, and XTAG_UNKNOWN.
Referenced by isTagExtra(), isTagWritable(), makeQualifiedTagEntry(), renderFieldExtras(), uncorkTagFile(), and writeTagEntry().
|
static |
Definition at line 359 of file entry.c.
References errno, filename, isCtagsLine(), isEtagsLine(), line, mio_new_file(), mio_unref(), NULL, readLineRaw(), TagFile, and eTagFile::vLine.
Referenced by openTagFile().
|
static |
Definition at line 1467 of file entry.c.
References countLanguageRoles(), error(), sTagEntryInfo::extensionFields, getLanguageKind(), isLanguageKindEnabled(), isLanguageKindRefOnly(), isLanguageRoleEnabled(), isRoleAssigned(), isTagExtraBitMarked(), isXtagEnabled(), sTagEntryInfo::kindIndex, sTagEntryInfo::langType, makeRoleBit(), sTagEntryInfo::name, sKindDefinition::name, sTagEntryInfo::placeholder, sTagEntryInfo::roleBits, WARNING, XTAG_ANONYMOUS, and XTAG_REFERENCE_TAGS.
Referenced by makeTagEntry(), and uncorkTagFile().
|
static |
void makeFileTag | ( | const char *const | fileName | ) |
Definition at line 182 of file entry.c.
References baseFilename(), sTagEntryInfo::endLine, sTagEntryInfo::extensionFields, FIELD_END_LINE, getInputLineNumber(), initTagEntry(), isFieldEnabled(), sTagEntryInfo::isFileEntry, isXtagEnabled(), KIND_FILE_INDEX, sTagEntryInfo::lineNumber, sTagEntryInfo::lineNumberEntry, makeTagEntry(), markTagExtraBit(), NULL, readLineFromInputFile(), and XTAG_FILE_NAMES.
Referenced by createTagsWithFallback(), and parseLineDirective().
char * makePatternString | ( | const tagEntryInfo *const | tag | ) |
Definition at line 921 of file entry.c.
References makePatternStringCommon(), vstring_putc(), vstring_puts(), vStringDeleteUnwrap(), and vStringNew().
Referenced by renderFieldPattern().
|
static |
Definition at line 844 of file entry.c.
References appendInputLine(), sOptionValues::backward, BOUNDARY_START, sTagEntryInfo::boundaryInfo, sTagEntryInfo::filePosition, line, sTagEntryInfo::name, NULL, Option, eTagFile::patternCacheValid, sOptionValues::patternLengthLimit, readLineFromBypassForTag(), TagFile, sTagEntryInfo::truncateLineAfterTag, truncateTagLineAfterTag(), eTagFile::vLine, vstring_putc(), vstring_puts(), vStringLength, vStringNewOrClearWithAutoRelease(), and vStringValue.
Referenced by makePatternString().
int makePlaceholder | ( | const char *const | name | ) |
Definition at line 1655 of file entry.c.
References initTagEntry(), KIND_GHOST_INDEX, sTagEntryInfo::lineNumber, makeTagEntry(), name, and sTagEntryInfo::placeholder.
Referenced by makeSimplePlaceholder().
int makeQualifiedTagEntry | ( | const tagEntryInfo *const | e | ) |
Definition at line 1705 of file entry.c.
References CORK_NIL, sTagEntryInfo::extensionFields, isTagExtraBitMarked(), isXtagEnabled(), KIND_GHOST_INDEX, sTagEntryInfo::kindIndex, sTagEntryInfo::langType, makeTagEntry(), markTagExtraBit(), sTagEntryInfo::name, NULL, popLanguage(), pushLanguage(), sTagEntryInfo::scopeIndex, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeName, scopeSeparatorFor(), vStringCatS(), vStringNewOrClearWithAutoRelease(), vStringValue, XTAG_QUALIFIED_TAGS, and XTAG_SUBPARSER.
Referenced by uncorkTagFile().
int makeTagEntry | ( | const tagEntryInfo *const | tag | ) |
Definition at line 1675 of file entry.c.
References Assert, eTagFile::cork, CORK_NIL, doesInputLanguageAllowNullTag(), error(), getInputFileName(), isTagWritable(), sTagEntryInfo::lineNumber, sTagEntryInfo::name, notifyMakeTagEntry(), NULL, sTagEntryInfo::placeholder, queueTagEntry(), TagFile, WARNING, and writeTagEntry().
Referenced by addReferenceTag(), addTag(), createCTSTTags(), emitRubyTag(), enterUnnamedScope(), findConfTags(), findCssTags(), findPerlTags(), makeAbcTag(), makeAsciidocTag(), makeBibTag(), makeClassOrIfaceTag(), makeClassTag(), makeConstTag(), makeDefineTag(), makeExtraTagEntry(), makeFileTag(), makeFortranTag(), makeFunctionTag(), makeJsonTag(), makeJsTagCommon(), makeMarkdownTag(), makeMemberTag(), makeNamespacePhpTag(), makePascalTag(), makePlaceholder(), makeQualifiedTagEntry(), makeRTag(), makeSectionRstTag(), makeSimplePhpTag(), makeSimplePowerShellTag(), makeSimpleRefTag(), makeSqlTag(), makeTag(), makeTargetRstTag(), makeTxt2tagsTag(), makeVariableTag(), and matchTagPattern().
void markAllEntriesInScopeAsPlaceholder | ( | int | index | ) |
Definition at line 2036 of file entry.c.
References foreachEntriesInScope(), index, markAsPlaceholder(), and NULL.
Referenced by markAsPlaceholder().
|
static |
Definition at line 2029 of file entry.c.
References index, markAllEntriesInScopeAsPlaceholder(), and sTagEntryInfo::placeholder.
Referenced by markAllEntriesInScopeAsPlaceholder().
void markTagExtraBit | ( | tagEntryInfo *const | tag, |
xtagType | extra | ||
) |
Definition at line 1899 of file entry.c.
References markTagExtraBitFull().
Referenced by initRegexTag(), initTagEntryFull(), makeConstTag(), makeFileTag(), makeJsTagCommon(), makeQualifiedTagEntry(), markTagExtraBitFull(), and matchTagPattern().
|
static |
Definition at line 1860 of file entry.c.
References Assert, countXtags(), eFree(), sTagEntryInfo::extra, sTagEntryInfo::extraDynamic, index, markTagExtraBit(), PARSER_TRASH_BOX, xCalloc, XTAG_COUNT, and XTAG_UNKNOWN.
Referenced by assignRoleFull(), and markTagExtraBit().
unsigned long maxTagsLine | ( | void | ) |
Definition at line 1992 of file entry.c.
References eTagFile::sMax::line, eTagFile::max, and TagFile.
Referenced by printTotals().
|
static |
Definition at line 1043 of file entry.c.
References CORK_NIL, sTagEntryInfoX::corkIndex, KIND_FILE_INDEX, sTagEntryInfo::kindIndex, RB_ROOT, sTagEntryInfoX::slot, sTagEntryInfoX::symtab, and xCalloc.
Referenced by corkTagFile().
unsigned long numTagsAdded | ( | void | ) |
Definition at line 1977 of file entry.c.
References eTagFile::sNumTags::added, eTagFile::numTags, and TagFile.
Referenced by createTagsWithFallback1(), endEtagsFile(), and printTotals().
unsigned long numTagsTotal | ( | void | ) |
Definition at line 1987 of file entry.c.
References eTagFile::sNumTags::added, eTagFile::numTags, eTagFile::sNumTags::prev, and TagFile.
Referenced by printTotals().
void openTagFile | ( | void | ) |
Definition at line 379 of file entry.c.
References absoluteDirname(), addCommonPseudoTags(), sOptionValues::append, CurrentDirectory, eTagFile::directory, doesFileExist(), eFreeNoNullCheck(), eRealloc(), error(), eStrdup(), sOptionValues::etags, FATAL, sOptionValues::interactive, isDestinationStdout(), isTagFile(), isXtagEnabled(), eTagFile::mio, mio_new_file(), mio_new_memory(), mio_unref(), eTagFile::name, NULL, eTagFile::numTags, Option, PERROR, eTagFile::sNumTags::prev, setDefaultTagFileName(), TagFile, sOptionValues::tagFileName, TagsToStdout, tempFile(), updatePseudoTags(), eTagFile::vLine, vStringNew(), and XTAG_PSEUDO_TAGS.
Referenced by batchMakeTags(), and parseFileWithMio().
|
static |
Definition at line 1429 of file entry.c.
References copyTagEntry(), CORK_NIL, eTagFile::corkFlags, eTagFile::corkQueue, entry, error(), sTagEntryInfo::inputFileName, sTagEntryInfo::lineNumber, ptrArrayAdd(), ptrArrayCount(), TagFile, and WARNING.
Referenced by makeTagEntry().
char * readLineFromBypassForTag | ( | vString *const | vLine, |
const tagEntryInfo *const | tag, | ||
long *const | pSeekValue | ||
) |
Definition at line 724 of file entry.c.
References Assert, sTagEntryInfo::filePosition, NULL, sTagEntryInfo::pattern, and readLineFromBypass().
Referenced by makePatternStringCommon(), renderFieldCompactInputLine(), and writeEtagsEntry().
void registerEntry | ( | int | corkIndex | ) |
Definition at line 1417 of file entry.c.
References Assert, CORK_NIL, CORK_SYMTAB, eTagFile::corkFlags, eTagFile::corkQueue, corkSymtabPut(), sTagEntryInfo::extensionFields, sTagEntryInfo::name, ptrArrayItem(), scope, sTagEntryInfo::scopeIndex, sTagEntryInfoX::slot, and TagFile.
|
static |
Definition at line 164 of file entry.c.
References eTagFile::sMax::line, eTagFile::max, eTagFile::sMax::tag, and TagFile.
Referenced by writePseudoTag(), and writeTagEntry().
|
static |
Definition at line 493 of file entry.c.
References copyFile(), eFree(), mio_unref(), name, NULL, tempFile(), tempName, and WHOLE_FILE.
Referenced by resizeTagFile().
|
static |
Definition at line 555 of file entry.c.
References close, errno, eTagFile::mio, mio_try_resize(), eTagFile::name, open, replacementTruncate(), and TagFile.
Referenced by closeTagFile().
void setNumTagsAdded | ( | unsigned long | nadded | ) |
Definition at line 1982 of file entry.c.
References eTagFile::sNumTags::added, eTagFile::numTags, and TagFile.
Referenced by createTagsWithFallback1(), and endEtagsFile().
void setTagFilePosition | ( | MIOPos * | p | ) |
Definition at line 2013 of file entry.c.
References error(), FATAL, eTagFile::mio, mio_setpos(), NULL, PERROR, and TagFile.
Referenced by createTagsWithFallback1().
void setupWriter | ( | void * | writerClientData | ) |
Definition at line 1457 of file entry.c.
References eTagFile::mio, TagFile, and writerSetup().
Referenced by parseMio().
|
static |
Definition at line 537 of file entry.c.
References eTagFile::sNumTags::added, catFile(), internalSortTagFile(), eTagFile::mio, eTagFile::numTags, Option, SO_UNSORTED, sOptionValues::sorted, TagFile, TagsToStdout, and verbose().
Referenced by closeTagFile().
|
static |
Definition at line 938 of file entry.c.
References eFree(), sTagField::value, and sTagField::valueOwner.
Referenced by attachParserFieldGeneric().
Definition at line 928 of file entry.c.
References sTagField::ftype, sTagField::value, sTagField::valueOwner, and xMalloc.
Referenced by attachParserFieldGeneric().
const char * tagFileName | ( | void | ) |
Definition at line 149 of file entry.c.
References eTagFile::name, and TagFile.
Referenced by internalSortTagFile(), and writeSortedTags().
void tagFilePosition | ( | MIOPos * | p | ) |
Definition at line 2002 of file entry.c.
References error(), FATAL, eTagFile::mio, mio_getpos(), NULL, PERROR, and TagFile.
Referenced by createTagsWithFallback1().
bool teardownWriter | ( | const char * | filename | ) |
Definition at line 1462 of file entry.c.
References filename, eTagFile::mio, TagFile, and writerTeardown().
Referenced by parseMio().
size_t truncateTagLineAfterTag | ( | char *const | line, |
const char *const | token, | ||
const bool | discardNewline | ||
) |
Definition at line 735 of file entry.c.
References line, NULL, and strstr().
Referenced by makePatternStringCommon(), and writeEtagsEntry().
void uncorkTagFile | ( | void | ) |
Definition at line 1600 of file entry.c.
References eTagFile::cork, CORK_NIL, eTagFile::corkQueue, doesInputLanguageRequestAutomaticFQTag(), sTagEntryInfo::extensionFields, isTagExtraBitMarked(), isTagWritable(), isXtagEnabled(), KIND_GHOST_INDEX, makeQualifiedTagEntry(), NULL, ptrArrayCount(), ptrArrayDelete(), ptrArrayItem(), sTagEntryInfo::scopeIndex, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeName, sTagEntryInfo::skipAutoFQEmission, TagFile, writeTagEntry(), and XTAG_QUALIFIED_TAGS.
Referenced by createTagsWithFallback1().
|
static |
Definition at line 250 of file entry.c.
References Assert, entry, line, mio_getpos(), NULL, PSEUDO_TAG_PREFIX, readLineRaw(), TagFile, updateSortedFlag(), and eTagFile::vLine.
Referenced by openTagFile().
Definition at line 209 of file entry.c.
References error(), line, mio_getc(), mio_getpos(), mio_putc(), mio_setpos(), nextLine, NULL, Option, SO_FOLDSORTED, SO_SORTED, sOptionValues::sorted, and WARNING.
Referenced by updatePseudoTags().
|
static |
Definition at line 696 of file entry.c.
References vStringPut().
Referenced by makePatternString(), and makePatternStringCommon().
|
static |
Definition at line 703 of file entry.c.
References vStringCatS(), and vStringLength.
Referenced by makePatternString(), and makePatternStringCommon().
|
static |
Definition at line 592 of file entry.c.
References sOptionValues::etagsInclude, mio_printf(), Option, stringListCount(), stringListItem(), and vStringValue.
Referenced by closeTagFile().
bool writePseudoTag | ( | const ptagDesc * | desc, |
const char *const | fileName, | ||
const char *const | pattern, | ||
const char *const | parserName | ||
) |
Definition at line 1568 of file entry.c.
References abort_if_ferror(), eTagFile::sNumTags::added, eTagFile::mio, sPtagDesc::name, eTagFile::numTags, rememberMaxLengths(), TagFile, and writerWritePtag().
Referenced by makeExtraDescriptionPseudoTag(), makeFieldDescriptionPseudoTag(), makeKindDescriptionPseudoTag(), makeKindSeparatorsPseudoTags(), ptagMakeAuthor(), ptagMakeCtagsOutputExcmd(), ptagMakeCtagsOutputFilesep(), ptagMakeCtagsOutputMode(), ptagMakeFormat(), ptagMakeHowSorted(), ptagMakePatternLengthLimit(), ptagMakeProcCwd(), ptagMakeProgName(), ptagMakeProgURL(), and ptagMakeProgVersion().
|
static |
Definition at line 1524 of file entry.c.
References abort_if_ferror(), eTagFile::sNumTags::added, Assert, buildFqTagCache(), debugEntry(), DebugStatement, doesInputLanguageRequestAutomaticFQTag(), includeExtensionFlags, isTagExtraBitMarked(), isXtagEnabled(), KIND_GHOST_INDEX, sTagEntryInfo::kindIndex, eTagFile::mio, mio_flush(), sTagEntryInfo::name, eTagFile::numTags, Option, OUTPUT_PATH_SEPARATOR, PATH_SEPARATOR, rememberMaxLengths(), sTagEntryInfo::skipAutoFQEmission, TagFile, writerWriteTag(), and XTAG_QUALIFIED_TAGS.
Referenced by makeTagEntry(), and uncorkTagFile().
|
static |
Definition at line 113 of file entry.c.
Referenced by closeTagFile(), corkTagFile(), countEntryInCorkQueue(), foreachEntriesInScope(), freeTagFileResources(), getEntryInCorkQueue(), getTagFileDirectory(), getTagScopeInformation(), internalSortTagFile(), invalidatePatternCache(), isTagFile(), makePatternStringCommon(), makeTagEntry(), maxTagsLine(), numTagsAdded(), numTagsTotal(), openTagFile(), queueTagEntry(), registerEntry(), rememberMaxLengths(), resizeTagFile(), setNumTagsAdded(), setTagFilePosition(), setupWriter(), sortTagFile(), tagFileName(), tagFilePosition(), teardownWriter(), uncorkTagFile(), updatePseudoTags(), writePseudoTag(), and writeTagEntry().
|
static |
Definition at line 125 of file entry.c.
Referenced by closeTagFile(), internalSortTagFile(), openTagFile(), and sortTagFile().