Skip to content

Commit

Permalink
main: introduce a function make a tag a placeholder
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed May 15, 2021
1 parent d76ae2d commit a4f5984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,12 +1652,17 @@ extern size_t countEntryInCorkQueue (void)
return ptrArrayCount (TagFile.corkQueue);
}

extern void markTagPlaceholder (tagEntryInfo *e, bool placeholder)
{
e->placeholder = placeholder;
}

extern int makePlaceholder (const char *const name)
{
tagEntryInfo e;

initTagEntry (&e, name, KIND_GHOST_INDEX);
e.placeholder = 1;
markTagPlaceholder(&e, true);

/*
* makePlaceholder may be called even before reading any bytes
Expand Down
1 change: 1 addition & 0 deletions main/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ extern void attachParserFieldToCorkEntry (int index, fieldType ftype, const char
extern const char* getParserFieldValueForType (tagEntryInfo *const tag, fieldType ftype);

extern int makePlaceholder (const char *const name);
extern void markTagPlaceholder (tagEntryInfo *e, bool placeholder);

/* Marking all tag entries entries under the scope specified
* with index recursively.
Expand Down

0 comments on commit a4f5984

Please sign in to comment.