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 "types.h"
#include <stdint.h>
#include "field.h"
#include "xtag.h"
#include "mio.h"
#include "ptrarray.h"
#include "nestlevel.h"
Go to the source code of this file.
Classes | |
struct | sTagField |
struct | sTagEntryInfo |
Macros | |
#define | ROLE_DEFINITION_INDEX -1 |
#define | ROLE_DEFINITION_NAME "def" |
#define | ROLE_MAX_COUNT (sizeof(roleBitsType) * 8) |
#define | PRE_ALLOCATED_PARSER_FIELDS 5 |
#define | NO_PARSER_FIELD -1 |
#define | CORK_NIL 0 |
Typedefs | |
typedef struct sTagField | tagField |
typedef uint64_t | roleBitsType |
typedef bool(* | entryForeachFunc) (int corkIndex, tagEntryInfo *entry, void *data) |
Functions | |
int | makeTagEntry (const tagEntryInfo *const tag) |
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 type, int kindIndex, int roleIndex) |
void | assignRole (tagEntryInfo *const e, int roleIndex) |
bool | isRoleAssigned (const tagEntryInfo *const e, int roleIndex) |
int | makeQualifiedTagEntry (const tagEntryInfo *const e) |
tagEntryInfo * | getEntryInCorkQueue (int n) |
tagEntryInfo * | getEntryOfNestingLevel (const NestingLevel *nl) |
size_t | countEntryInCorkQueue (void) |
void | registerEntry (int corkIndex) |
bool | foreachEntriesInScope (int corkIndex, const char *name, entryForeachFunc func, void *data) |
int | anyEntryInScope (int corkIndex, const char *name) |
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 | markTagExtraBit (tagEntryInfo *const tag, xtagType extra) |
bool | isTagExtraBitMarked (const tagEntryInfo *const tag, xtagType extra) |
bool | isTagExtra (const tagEntryInfo *const tag) |
void | attachParserField (tagEntryInfo *const tag, bool inCorkQueue, fieldType ftype, const char *value) |
void | attachParserFieldToCorkEntry (int index, fieldType ftype, const char *value) |
const char * | getParserFieldValueForType (tagEntryInfo *const tag, fieldType ftype) |
int | makePlaceholder (const char *const name) |
void | markAllEntriesInScopeAsPlaceholder (int index) |
#define ROLE_MAX_COUNT (sizeof(roleBitsType) * 8) |
typedef bool(* entryForeachFunc) (int corkIndex, tagEntryInfo *entry, void *data) |
typedef uint64_t roleBitsType |
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.
void assignRole | ( | tagEntryInfo *const | e, |
int | roleIndex | ||
) |
Definition at line 1964 of file entry.c.
References assignRoleFull().
Referenced by createCTSTTags(), and matchTagPattern().
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().
void attachParserFieldToCorkEntry | ( | int | index, |
fieldType | ftype, | ||
const char * | value | ||
) |
Definition at line 987 of file entry.c.
References attachParserField(), getEntryInCorkQueue(), and index.
size_t countEntryInCorkQueue | ( | void | ) |
Definition at line 1650 of file entry.c.
References eTagFile::corkQueue, ptrArrayCount(), and TagFile.
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().
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().
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.
void initForeignRefTagEntry | ( | tagEntryInfo *const | e, |
const char *const | name, | ||
langType | type, | ||
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().
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().
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().
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().
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.