Skip to content

Commit

Permalink
Rename fileGetc() to getcFromInputFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Jul 30, 2016
1 parent 1e36d23 commit acdc440
Show file tree
Hide file tree
Showing 16 changed files with 172 additions and 172 deletions.
58 changes: 29 additions & 29 deletions ctags/main/get.c
Expand Up @@ -180,7 +180,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength)
{
if (i > 0)
{
c = fileGetc ();
c = getcFromInputFile ();
if (c == EOF || ! isalpha (c))
{
fileUngetc (c);
Expand All @@ -203,7 +203,7 @@ static void readIdentifier (int c, vString *const name)
do
{
vStringPut (name, c);
c = fileGetc ();
c = getcFromInputFile ();
} while (c != EOF && isident (c));
fileUngetc (c);
vStringTerminate (name);
Expand Down Expand Up @@ -334,7 +334,7 @@ static void directiveDefine (const int c)
if (isident1 (c))
{
readIdentifier (c, Cpp.directive.name);
nc = fileGetc ();
nc = getcFromInputFile ();
fileUngetc (nc);
parameterized = (boolean) (nc == '(');
if (! isIgnore ())
Expand All @@ -353,7 +353,7 @@ static void directivePragma (int c)
/* generate macro tag for weak name */
do
{
c = fileGetc ();
c = getcFromInputFile ();
} while (c == SPACE);
if (isident1 (c))
{
Expand Down Expand Up @@ -435,7 +435,7 @@ static boolean handleDirective (const int c)
static Comment isComment (void)
{
Comment comment;
const int next = fileGetc ();
const int next = getcFromInputFile ();

if (next == '*')
comment = COMMENT_C;
Expand All @@ -456,15 +456,15 @@ static Comment isComment (void)
*/
int skipOverCComment (void)
{
int c = fileGetc ();
int c = getcFromInputFile ();

while (c != EOF)
{
if (c != '*')
c = fileGetc ();
c = getcFromInputFile ();
else
{
const int next = fileGetc ();
const int next = getcFromInputFile ();

if (next != '/')
c = next;
Expand All @@ -484,10 +484,10 @@ static int skipOverCplusComment (void)
{
int c;

while ((c = fileGetc ()) != EOF)
while ((c = getcFromInputFile ()) != EOF)
{
if (c == BACKSLASH)
fileGetc (); /* throw away next character, too */
getcFromInputFile (); /* throw away next character, too */
else if (c == NEWLINE)
break;
}
Expand All @@ -499,15 +499,15 @@ static int skipOverCplusComment (void)
*/
static int skipOverDComment (void)
{
int c = fileGetc ();
int c = getcFromInputFile ();

while (c != EOF)
{
if (c != '+')
c = fileGetc ();
c = getcFromInputFile ();
else
{
const int next = fileGetc ();
const int next = getcFromInputFile ();

if (next != '/')
c = next;
Expand All @@ -528,10 +528,10 @@ static int skipToEndOfString (boolean ignoreBackslash)
{
int c;

while ((c = fileGetc ()) != EOF)
while ((c = getcFromInputFile ()) != EOF)
{
if (c == BACKSLASH && ! ignoreBackslash)
fileGetc (); /* throw away next character, too */
getcFromInputFile (); /* throw away next character, too */
else if (c == DOUBLE_QUOTE)
break;
}
Expand All @@ -546,7 +546,7 @@ static int isCxxRawLiteralDelimiterChar (int c)

static int skipToEndOfCxxRawLiteralString (void)
{
int c = fileGetc ();
int c = getcFromInputFile ();

if (c != '(' && ! isCxxRawLiteralDelimiterChar (c))
{
Expand All @@ -573,15 +573,15 @@ static int skipToEndOfCxxRawLiteralString (void)
{
unsigned int i = 0;

while ((c = fileGetc ()) != EOF && i < delimLen && delim[i] == c)
while ((c = getcFromInputFile ()) != EOF && i < delimLen && delim[i] == c)
i++;
if (i == delimLen && c == DOUBLE_QUOTE)
break;
else
fileUngetc (c);
}
}
while ((c = fileGetc ()) != EOF);
while ((c = getcFromInputFile ()) != EOF);
c = STRING_SYMBOL;
}
return c;
Expand All @@ -596,11 +596,11 @@ static int skipToEndOfChar (void)
int c;
int count = 0, veraBase = '\0';

while ((c = fileGetc ()) != EOF)
while ((c = getcFromInputFile ()) != EOF)
{
++count;
if (c == BACKSLASH)
fileGetc (); /* throw away next character, too */
getcFromInputFile (); /* throw away next character, too */
else if (c == SINGLE_QUOTE)
break;
else if (c == NEWLINE)
Expand Down Expand Up @@ -639,7 +639,7 @@ extern int cppGetc (void)
}
else do
{
c = fileGetc ();
c = getcFromInputFile ();
process:
switch (c)
{
Expand Down Expand Up @@ -698,7 +698,7 @@ extern int cppGetc (void)

case BACKSLASH:
{
int next = fileGetc ();
int next = getcFromInputFile ();

if (next == NEWLINE)
continue;
Expand All @@ -709,12 +709,12 @@ extern int cppGetc (void)

case '?':
{
int next = fileGetc ();
int next = getcFromInputFile ();
if (next != '?')
fileUngetc (next);
else
{
next = fileGetc ();
next = getcFromInputFile ();
switch (next)
{
case '(': c = '['; break;
Expand All @@ -740,7 +740,7 @@ extern int cppGetc (void)
*/
case '<':
{
int next = fileGetc ();
int next = getcFromInputFile ();
switch (next)
{
case ':': c = '['; break;
Expand All @@ -751,7 +751,7 @@ extern int cppGetc (void)
}
case ':':
{
int next = fileGetc ();
int next = getcFromInputFile ();
if (next == '>')
c = ']';
else
Expand All @@ -760,7 +760,7 @@ extern int cppGetc (void)
}
case '%':
{
int next = fileGetc ();
int next = getcFromInputFile ();
switch (next)
{
case '>': c = '}'; break;
Expand All @@ -773,7 +773,7 @@ extern int cppGetc (void)
default:
if (c == '@' && Cpp.hasAtLiteralStrings)
{
int next = fileGetc ();
int next = getcFromInputFile ();
if (next == DOUBLE_QUOTE)
{
Cpp.directive.accept = FALSE;
Expand Down Expand Up @@ -810,7 +810,7 @@ extern int cppGetc (void)
(! isident (prev2) && (prev == 'L' || prev == 'u' || prev == 'U')) ||
(! isident (prev3) && (prev2 == 'u' && prev == '8')))
{
int next = fileGetc ();
int next = getcFromInputFile ();
if (next != DOUBLE_QUOTE)
fileUngetc (next);
else
Expand Down
4 changes: 2 additions & 2 deletions ctags/main/read.c
Expand Up @@ -455,7 +455,7 @@ static vString *iFileGetLine (void)

/* Do not mix use of fileReadLine () and fileGetc () for the same file.
*/
extern int fileGetc (void)
extern int getcFromInputFile (void)
{
int c;

Expand Down Expand Up @@ -509,7 +509,7 @@ extern int fileSkipToCharacter (int c)
int d;
do
{
d = fileGetc ();
d = getcFromInputFile ();
} while (d != EOF && d != c);
return d;
}
Expand Down
2 changes: 1 addition & 1 deletion ctags/main/read.h
Expand Up @@ -106,7 +106,7 @@ extern void freeSourceFileResources (void);
extern boolean fileOpen (const char *const fileName, const langType language);
extern boolean fileEOF (void);
extern void fileClose (void);
extern int fileGetc (void);
extern int getcFromInputFile (void);
extern int fileGetNthPrevC (unsigned int nth, int def);
extern int fileSkipToCharacter (int c);
extern void fileUngetc (int c);
Expand Down
16 changes: 8 additions & 8 deletions ctags/parsers/css.c
Expand Up @@ -60,7 +60,7 @@ static void parseSelector (vString *const string, const int firstChar)
do
{
vStringPut (string, (char) c);
c = fileGetc ();
c = getcFromInputFile ();
} while (isSelectorChar (c));
fileUngetc (c);
vStringTerminate (string);
Expand All @@ -74,9 +74,9 @@ static void readToken (tokenInfo *const token)

getNextChar:

c = fileGetc ();
c = getcFromInputFile ();
while (isspace (c))
c = fileGetc ();
c = getcFromInputFile ();

token->type = c;
switch (c)
Expand All @@ -90,9 +90,9 @@ static void readToken (tokenInfo *const token)
do
{
vStringPut (token->string, c);
c = fileGetc ();
c = getcFromInputFile ();
if (c == '\\')
c = fileGetc ();
c = getcFromInputFile ();
}
while (c != EOF && c != delimiter);
if (c != EOF)
Expand All @@ -103,7 +103,7 @@ static void readToken (tokenInfo *const token)

case '/': /* maybe comment start */
{
int d = fileGetc ();
int d = getcFromInputFile ();
if (d != '*')
{
fileUngetc (d);
Expand All @@ -112,11 +112,11 @@ static void readToken (tokenInfo *const token)
}
else
{
d = fileGetc ();
d = getcFromInputFile ();
do
{
c = d;
d = fileGetc ();
d = getcFromInputFile ();
}
while (d != EOF && ! (c == '*' && d == '/'));
goto getNextChar;
Expand Down
20 changes: 10 additions & 10 deletions ctags/parsers/fortran.c
Expand Up @@ -523,7 +523,7 @@ static int skipLine (void)
int c;

do
c = fileGetc ();
c = getcFromInputFile ();
while (c != EOF && c != '\n');

return c;
Expand All @@ -546,7 +546,7 @@ static lineType getLineType (void)

do /* read in first 6 "margin" characters */
{
int c = fileGetc ();
int c = getcFromInputFile ();

/* 3.2.1 Comment_Line. A comment line is any line that contains
* a C or an asterisk in column 1, or contains only blank characters
Expand Down Expand Up @@ -628,7 +628,7 @@ static int getFixedFormChar (void)
else
#endif
{
c = fileGetc ();
c = getcFromInputFile ();
++Column;
}
if (c == '\n')
Expand All @@ -644,7 +644,7 @@ static int getFixedFormChar (void)
}
else if (c == '&') /* check for free source form */
{
const int c2 = fileGetc ();
const int c2 = getcFromInputFile ();
if (c2 == '\n')
longjmp (Exception, (int) ExceptionFixedFormat);
else
Expand Down Expand Up @@ -684,7 +684,7 @@ static int getFixedFormChar (void)
Column = 5;
do
{
c = fileGetc ();
c = getcFromInputFile ();
++Column;
} while (isBlank (c));
if (c == '\n')
Expand All @@ -707,14 +707,14 @@ static int skipToNextLine (void)
{
int c = skipLine ();
if (c != EOF)
c = fileGetc ();
c = getcFromInputFile ();
return c;
}

static int getFreeFormChar (boolean inComment)
{
boolean advanceLine = FALSE;
int c = fileGetc ();
int c = getcFromInputFile ();

/* If the last nonblank, non-comment character of a FORTRAN 90
* free-format text line is an ampersand then the next non-comment
Expand All @@ -723,7 +723,7 @@ static int getFreeFormChar (boolean inComment)
if (! inComment && c == '&')
{
do
c = fileGetc ();
c = getcFromInputFile ();
while (isspace (c) && c != '\n');
if (c == '\n')
{
Expand All @@ -743,15 +743,15 @@ static int getFreeFormChar (boolean inComment)
while (advanceLine)
{
while (isspace (c))
c = fileGetc ();
c = getcFromInputFile ();
if (c == '!' || (NewLine && c == '#'))
{
c = skipToNextLine ();
NewLine = TRUE;
continue;
}
if (c == '&')
c = fileGetc ();
c = getcFromInputFile ();
else
advanceLine = FALSE;
}
Expand Down

0 comments on commit acdc440

Please sign in to comment.