Skip to content

Commit

Permalink
read: Some function renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Oct 10, 2016
1 parent dac3afb commit 2f4d43a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ctags/main/parse.c
Expand Up @@ -574,7 +574,7 @@ static bool createTagsForFile (const char *const fileName,
{
bool retried = false;

if (fileOpen (fileName, language))
if (openInputFile (fileName, language))
{

makeFileTag (fileName);
Expand All @@ -585,7 +585,7 @@ static bool createTagsForFile (const char *const fileName,
retried = LanguageTable [language]->parser2 (passCount);


fileClose ();
closeInputFile ();
}

return retried;
Expand Down
6 changes: 3 additions & 3 deletions ctags/main/read.c
Expand Up @@ -207,7 +207,7 @@ extern unsigned long getSourceLineNumber (void)
return File.source.lineNumber;
}

extern void freeSourceFileResources (void)
extern void freeInputFileResources (void)
{
vStringDelete (File.input.name);
vStringDelete (File.path);
Expand Down Expand Up @@ -404,7 +404,7 @@ static bool parseLineDirective (char *s)
/* This function opens an input file, and resets the line counter. If it
* fails, it will display an error message and leave the File.mio set to NULL.
*/
extern bool fileOpen (const char *const fileName, const langType language)
extern bool openInputFile (const char *const fileName, const langType language)
{
const char *const openMode = "rb";
bool opened = false;
Expand Down Expand Up @@ -487,7 +487,7 @@ extern bool bufferOpen (unsigned char *buffer, size_t buffer_size,
return opened;
}

extern void fileClose (void)
extern void closeInputFile (void)
{
if (File.mio != NULL)
{
Expand Down
12 changes: 6 additions & 6 deletions ctags/main/read.h
Expand Up @@ -69,24 +69,24 @@ extern bool doesInputLanguageAllowNullTag (void);
extern kindOption *getInputLanguageFileKind (void);
extern bool doesInputLanguageRequestAutomaticFQTag (void);

extern void freeSourceFileResources (void);
extern bool fileOpen (const char *const fileName, const langType language);
extern void fileClose (void);
extern void freeInputFileResources (void);
extern bool openInputFile (const char *const fileName, const langType language);
extern void closeInputFile (void);
extern int getcFromInputFile (void);
extern int getNthPrevCFromInputFile (unsigned int nth, int def);
extern int skipToCharacterInInputFile (int c);
extern void ungetcToInputFile (int c);
extern const unsigned char *readLineFromInputFile (void);
extern char *readLineRaw (vString *const vLine, MIO *const mio);
extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue);
extern bool bufferOpen (unsigned char *buffer, size_t buffer_size,
const char *const fileName, const langType language );
#define bufferClose fileClose

extern const char *getSourceFileTagPath (void);
extern const char *getSourceLanguageName (void);
extern unsigned long getSourceLineNumber (void);

/* Raw: reading from given a parameter, fp */
extern char *readLineRaw (vString *const vLine, MIO *const mio);

/* Bypass: reading from fp in inputFile WITHOUT updating fields in input fields */
extern char *readLineFromBypass (vString *const vLine, MIOPos location, long *const pSeekValue);

Expand Down
10 changes: 5 additions & 5 deletions src/tagmanager/tm_ctags_wrappers.c
Expand Up @@ -69,31 +69,31 @@ void tm_ctags_parse(guchar *buffer, gsize buffer_size,
while (retry && passCount < 3)
{
pass_callback(user_data);
if (!buffer && fileOpen (file_name, lang))
if (!buffer && openInputFile (file_name, lang))
{
if (LanguageTable [lang]->parser != NULL)
{
LanguageTable [lang]->parser ();
fileClose ();
closeInputFile ();
retry = FALSE;
break;
}
else if (LanguageTable [lang]->parser2 != NULL)
retry = LanguageTable [lang]->parser2 (passCount);
fileClose ();
closeInputFile ();
}
else if (buffer && bufferOpen (buffer, buffer_size, file_name, lang))
{
if (LanguageTable [lang]->parser != NULL)
{
LanguageTable [lang]->parser ();
bufferClose ();
closeInputFile ();
retry = FALSE;
break;
}
else if (LanguageTable [lang]->parser2 != NULL)
retry = LanguageTable [lang]->parser2 (passCount);
bufferClose ();
closeInputFile ();
}
else
{
Expand Down

0 comments on commit 2f4d43a

Please sign in to comment.