entry: Sync initTagEntry() code
For now use "source" instead of "input" for various functions inside read.c which we need as we don't initialize "input" yet.
This commit is contained in:
parent
f23b56b027
commit
00920360da
@ -504,17 +504,75 @@ out:
|
||||
return r;
|
||||
}
|
||||
|
||||
extern void initTagEntry (tagEntryInfo *const e, const char *const name, const kindOption *kind)
|
||||
extern void initTagEntry (tagEntryInfo *const e, const char *const name,
|
||||
const kindOption *kind)
|
||||
{
|
||||
Assert (File.source.name != NULL);
|
||||
initTagEntryFull(e, name,
|
||||
getInputLineNumber (),
|
||||
getInputLanguageName (),
|
||||
getInputFilePosition (),
|
||||
getInputFileTagPath (),
|
||||
kind,
|
||||
ROLE_INDEX_DEFINITION,
|
||||
getSourceFileTagPath(),
|
||||
getSourceLanguageName(),
|
||||
getSourceLineNumber() - getInputLineNumber ());
|
||||
}
|
||||
|
||||
extern void initRefTagEntry (tagEntryInfo *const e, const char *const name,
|
||||
const kindOption *kind, int roleIndex)
|
||||
{
|
||||
initTagEntryFull(e, name,
|
||||
getInputLineNumber (),
|
||||
getInputLanguageName (),
|
||||
getInputFilePosition (),
|
||||
getInputFileTagPath (),
|
||||
kind,
|
||||
roleIndex,
|
||||
getSourceFileTagPath(),
|
||||
getSourceLanguageName(),
|
||||
getSourceLineNumber() - getInputLineNumber ());
|
||||
}
|
||||
|
||||
extern void initTagEntryFull (tagEntryInfo *const e, const char *const name,
|
||||
unsigned long lineNumber,
|
||||
const char* language,
|
||||
MIOPos filePosition,
|
||||
const char *inputFileName,
|
||||
const kindOption *kind,
|
||||
int roleIndex,
|
||||
const char *sourceFileName,
|
||||
const char* sourceLanguage,
|
||||
long sourceLineNumberDifference)
|
||||
{
|
||||
int i;
|
||||
Assert (getInputFileName() != NULL);
|
||||
|
||||
memset (e, 0, sizeof (tagEntryInfo));
|
||||
e->lineNumberEntry = (bool) (Option.locate == EX_LINENUM);
|
||||
e->lineNumber = getSourceLineNumber ();
|
||||
e->language = getSourceLanguageName ();
|
||||
e->filePosition = getInputFilePosition ();
|
||||
e->sourceFileName = getSourceFileTagPath ();
|
||||
e->lineNumber = lineNumber;
|
||||
/* e->boundaryInfo = getNestedInputBoundaryInfo (lineNumber); */
|
||||
e->language = language;
|
||||
e->filePosition = filePosition;
|
||||
e->inputFileName = inputFileName;
|
||||
e->name = name;
|
||||
e->extensionFields.scopeIndex = CORK_NIL;
|
||||
e->kind = kind;
|
||||
|
||||
Assert (roleIndex >= ROLE_INDEX_DEFINITION);
|
||||
Assert (kind == NULL || roleIndex < kind->nRoles);
|
||||
e->extensionFields.roleIndex = roleIndex;
|
||||
if (roleIndex > ROLE_INDEX_DEFINITION)
|
||||
markTagExtraBit (e, XTAG_REFERENCE_TAGS);
|
||||
|
||||
e->sourceLanguage = sourceLanguage;
|
||||
e->sourceFileName = sourceFileName;
|
||||
e->sourceLineNumberDifference = sourceLineNumberDifference;
|
||||
|
||||
e->usedParserFields = 0;
|
||||
|
||||
for ( i = 0; i < PRE_ALLOCATED_PARSER_FIELDS; i++ )
|
||||
e->parserFields[i].ftype = FIELD_UNKNOWN;
|
||||
}
|
||||
|
||||
extern void setTagWriter (tagWriter *t)
|
||||
|
@ -114,7 +114,20 @@ extern const char *tagFileName (void);
|
||||
extern void openTagFile (void);
|
||||
extern void closeTagFile (const bool resize);
|
||||
extern int makeTagEntry (const tagEntryInfo *const tag);
|
||||
extern void initTagEntry (tagEntryInfo *const e, const char *const name, const kindOption *kind);
|
||||
extern void initTagEntry (tagEntryInfo *const e, const char *const name,
|
||||
const kindOption *kind);
|
||||
extern void initRefTagEntry (tagEntryInfo *const e, const char *const name,
|
||||
const kindOption *kind, int roleIndex);
|
||||
extern void initTagEntryFull (tagEntryInfo *const e, const char *const name,
|
||||
unsigned long lineNumber,
|
||||
const char* language,
|
||||
MIOPos filePosition,
|
||||
const char *inputFileName,
|
||||
const kindOption *kind,
|
||||
int roleIndex,
|
||||
const char *sourceFileName,
|
||||
const char* sourceLanguage,
|
||||
long sourceLineNumberDifference);
|
||||
|
||||
extern unsigned long numTagsAdded(void);
|
||||
extern void setNumTagsAdded (unsigned long nadded);
|
||||
|
@ -35,6 +35,21 @@ static MIOPos StartOfLine; /* holds deferred position of start of line */
|
||||
* FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
extern langType getInputLanguage (void)
|
||||
{
|
||||
return File.source.language;
|
||||
}
|
||||
|
||||
extern const char *getInputLanguageName (void)
|
||||
{
|
||||
return getLanguageName (getInputLanguage());
|
||||
}
|
||||
|
||||
extern const char *getInputFileTagPath (void)
|
||||
{
|
||||
return vStringValue (File.source.tagPath);
|
||||
}
|
||||
|
||||
extern kindOption *getInputLanguageFileKind (void)
|
||||
{
|
||||
return getLanguageFileKind (File.input.language);
|
||||
|
@ -98,6 +98,9 @@ extern inputFile File;
|
||||
*/
|
||||
|
||||
/* InputFile: reading from fp in inputFile with updating fields in input fields */
|
||||
extern langType getInputLanguage (void);
|
||||
extern const char *getInputLanguageName (void);
|
||||
extern const char *getInputFileTagPath (void);
|
||||
extern kindOption *getInputLanguageFileKind (void);
|
||||
|
||||
extern void freeSourceFileResources (void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user