diff --git a/ctags/main/get.c b/ctags/main/get.c index ce41ed960d..9843f9db86 100644 --- a/ctags/main/get.c +++ b/ctags/main/get.c @@ -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); @@ -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); @@ -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 ()) @@ -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)) { @@ -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; @@ -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; @@ -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; } @@ -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; @@ -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; } @@ -546,7 +546,7 @@ static int isCxxRawLiteralDelimiterChar (int c) static int skipToEndOfCxxRawLiteralString (void) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { @@ -573,7 +573,7 @@ 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; @@ -581,7 +581,7 @@ static int skipToEndOfCxxRawLiteralString (void) fileUngetc (c); } } - while ((c = fileGetc ()) != EOF); + while ((c = getcFromInputFile ()) != EOF); c = STRING_SYMBOL; } return c; @@ -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) @@ -639,7 +639,7 @@ extern int cppGetc (void) } else do { - c = fileGetc (); + c = getcFromInputFile (); process: switch (c) { @@ -698,7 +698,7 @@ extern int cppGetc (void) case BACKSLASH: { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == NEWLINE) continue; @@ -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; @@ -740,7 +740,7 @@ extern int cppGetc (void) */ case '<': { - int next = fileGetc (); + int next = getcFromInputFile (); switch (next) { case ':': c = '['; break; @@ -751,7 +751,7 @@ extern int cppGetc (void) } case ':': { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == '>') c = ']'; else @@ -760,7 +760,7 @@ extern int cppGetc (void) } case '%': { - int next = fileGetc (); + int next = getcFromInputFile (); switch (next) { case '>': c = '}'; break; @@ -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; @@ -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 diff --git a/ctags/main/read.c b/ctags/main/read.c index 39676dcad8..c0995b7703 100644 --- a/ctags/main/read.c +++ b/ctags/main/read.c @@ -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; @@ -509,7 +509,7 @@ extern int fileSkipToCharacter (int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } diff --git a/ctags/main/read.h b/ctags/main/read.h index c5e183dcea..d47c545332 100644 --- a/ctags/main/read.h +++ b/ctags/main/read.h @@ -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); diff --git a/ctags/parsers/css.c b/ctags/parsers/css.c index ffedff38ba..4e0264f854 100644 --- a/ctags/parsers/css.c +++ b/ctags/parsers/css.c @@ -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); @@ -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) @@ -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) @@ -103,7 +103,7 @@ static void readToken (tokenInfo *const token) case '/': /* maybe comment start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '*') { fileUngetc (d); @@ -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; diff --git a/ctags/parsers/fortran.c b/ctags/parsers/fortran.c index e0fdebfd79..edd1eac38b 100644 --- a/ctags/parsers/fortran.c +++ b/ctags/parsers/fortran.c @@ -523,7 +523,7 @@ static int skipLine (void) int c; do - c = fileGetc (); + c = getcFromInputFile (); while (c != EOF && c != '\n'); return c; @@ -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 @@ -628,7 +628,7 @@ static int getFixedFormChar (void) else #endif { - c = fileGetc (); + c = getcFromInputFile (); ++Column; } if (c == '\n') @@ -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 @@ -684,7 +684,7 @@ static int getFixedFormChar (void) Column = 5; do { - c = fileGetc (); + c = getcFromInputFile (); ++Column; } while (isBlank (c)); if (c == '\n') @@ -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 @@ -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') { @@ -743,7 +743,7 @@ static int getFreeFormChar (boolean inComment) while (advanceLine) { while (isspace (c)) - c = fileGetc (); + c = getcFromInputFile (); if (c == '!' || (NewLine && c == '#')) { c = skipToNextLine (); @@ -751,7 +751,7 @@ static int getFreeFormChar (boolean inComment) continue; } if (c == '&') - c = fileGetc (); + c = getcFromInputFile (); else advanceLine = FALSE; } diff --git a/ctags/parsers/go.c b/ctags/parsers/go.c index 3ece43a1b2..95627a0a6c 100644 --- a/ctags/parsers/go.c +++ b/ctags/parsers/go.c @@ -176,12 +176,12 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (!end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; else if (c == '\\' && delimiter != '`') { - c = fileGetc (); + c = getcFromInputFile (); if (c != '\'' && c != '\"') vStringPut (string, '\\'); vStringPut (string, c); @@ -200,7 +200,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); fileUngetc (c); /* always unget, LF might add a semicolon */ @@ -220,7 +220,7 @@ static void readToken (tokenInfo *const token) getNextChar: do { - c = fileGetc (); + c = getcFromInputFile (); token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); if (c == '\n' && (lastTokenType == TOKEN_IDENTIFIER || @@ -254,7 +254,7 @@ static void readToken (tokenInfo *const token) case '/': { boolean hasNewline = FALSE; - int d = fileGetc (); + int d = getcFromInputFile (); switch (d) { case '/': @@ -271,14 +271,14 @@ static void readToken (tokenInfo *const token) { do { - d = fileGetc (); + d = getcFromInputFile (); if (d == '\n') { hasNewline = TRUE; } } while (d != EOF && d != '*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -306,7 +306,7 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '-') token->type = TOKEN_LEFT_ARROW; else diff --git a/ctags/parsers/haskell.c b/ctags/parsers/haskell.c index 6aa7915cb6..82031a6fdb 100644 --- a/ctags/parsers/haskell.c +++ b/ctags/parsers/haskell.c @@ -56,7 +56,7 @@ static void skip_rest_of_line(void) { int c; do { - c = fileGetc(); + c = getcFromInputFile(); } while (c != EOF && c != '\n'); } @@ -65,7 +65,7 @@ static int get_line(char *buf) int i = 0; int c; do { - c = fileGetc(); + c = getcFromInputFile(); buf[i++] = c; } while (c != EOF && c != '\n' && i < 1000); buf[i] = '\0'; @@ -75,10 +75,10 @@ static int get_line(char *buf) static int get_next_char(void) { int c, nxt; - c = fileGetc(); + c = getcFromInputFile(); if (c == EOF) return c; - nxt = fileGetc(); + nxt = getcFromInputFile(); if (nxt == EOF) return c; fileUngetc(nxt); @@ -116,12 +116,12 @@ static int isident(char c) static int get_token(char *token, int n) { - int c = fileGetc(); + int c = getcFromInputFile(); int i = n; while (c != EOF && isident(c) && i < 1000) { token[i] = c; i++; - c = fileGetc(); + c = getcFromInputFile(); } token[i] = '\0'; if (c == EOF) @@ -244,7 +244,7 @@ static void findHaskellTags (int is_literate) } if (is_literate && !in_tex_lit_code) { if (c == '>') { - c = fileGetc(); + c = getcFromInputFile(); if (c == ' ') { c = get_next_char(); if (!isident(c)) { @@ -294,7 +294,7 @@ static void findHaskellTags (int is_literate) continue; } do { - if ((c = fileGetc()) == EOF) + if ((c = getcFromInputFile()) == EOF) return; } while (c == ' ' || c == '\t'); arg[0] = c; diff --git a/ctags/parsers/jscript.c b/ctags/parsers/jscript.c index 915e3d46b5..31383720bf 100644 --- a/ctags/parsers/jscript.c +++ b/ctags/parsers/jscript.c @@ -329,7 +329,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -339,7 +339,7 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (! end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; else if (c == '\\') @@ -350,12 +350,12 @@ static void parseString (vString *const string, const int delimiter) * Also, handle the fact that produces an empty * sequence. * See ECMA-262 7.8.4 */ - c = fileGetc(); + c = getcFromInputFile(); if (c != '\r' && c != '\n') vStringPut(string, c); else if (c == '\r') { - c = fileGetc(); + c = getcFromInputFile(); if (c != '\n') fileUngetc (c); } @@ -383,18 +383,18 @@ static void parseRegExp (void) do { - c = fileGetc (); + c = getcFromInputFile (); if (! in_range && c == '/') { do /* skip flags */ { - c = fileGetc (); + c = getcFromInputFile (); } while (isalpha (c)); fileUngetc (c); break; } else if (c == '\\') - c = fileGetc (); /* skip next character */ + c = getcFromInputFile (); /* skip next character */ else if (c == '[') in_range = TRUE; else if (c == ']') @@ -412,7 +412,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); fileUngetc (c); /* unget non-identifier character */ @@ -441,7 +441,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt i = 0; do { - c = fileGetc (); + c = getcFromInputFile (); i++; } while (c == '\t' || c == ' ' || @@ -475,7 +475,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt case '+': case '-': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == c) /* ++ or -- */ token->type = TOKEN_POSTFIX_OPERATOR; else @@ -545,7 +545,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt break; case '\\': - c = fileGetc (); + c = getcFromInputFile (); if (c != '\\' && c != '"' && !isspace (c)) fileUngetc (c); token->type = TOKEN_CHARACTER; @@ -555,7 +555,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt case '/': { - int d = fileGetc (); + int d = getcFromInputFile (); if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { @@ -588,7 +588,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt do { skipToCharacter ('*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -612,7 +612,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt /* skip shebang in case of e.g. Node.js scripts */ if (token->lineNumber > 1) token->type = TOKEN_UNDEFINED; - else if ((c = fileGetc ()) != '!') + else if ((c = getcFromInputFile ()) != '!') { fileUngetc (c); token->type = TOKEN_UNDEFINED; diff --git a/ctags/parsers/json.c b/ctags/parsers/json.c index ffbbf58d39..095ba4bbe0 100644 --- a/ctags/parsers/json.c +++ b/ctags/parsers/json.c @@ -149,7 +149,7 @@ static void readTokenFull (tokenInfo *const token, vStringClear (token->string); do - c = fileGetc (); + c = getcFromInputFile (); while (c == '\t' || c == ' ' || c == '\r' || c == '\n'); token->lineNumber = getSourceLineNumber (); @@ -171,7 +171,7 @@ static void readTokenFull (tokenInfo *const token, token->type = TOKEN_STRING; while (TRUE) { - c = fileGetc (); + c = getcFromInputFile (); /* we don't handle unicode escapes but they are safe */ if (escaped) escaped = FALSE; @@ -196,7 +196,7 @@ static void readTokenFull (tokenInfo *const token, do { vStringPut (token->string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (c != EOF && isIdentChar (c)); vStringTerminate (token->string); diff --git a/ctags/parsers/make.c b/ctags/parsers/make.c index 02a6b089a0..ef47f08eda 100644 --- a/ctags/parsers/make.c +++ b/ctags/parsers/make.c @@ -41,10 +41,10 @@ static kindOption MakeKinds [] = { static int nextChar (void) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == '\\') { - c = fileGetc (); + c = getcFromInputFile (); if (c == '\n') c = nextChar (); } diff --git a/ctags/parsers/php.c b/ctags/parsers/php.c index f51db6e1c5..36894eba88 100644 --- a/ctags/parsers/php.c +++ b/ctags/parsers/php.c @@ -493,7 +493,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -502,9 +502,9 @@ static void parseString (vString *const string, const int delimiter) { while (TRUE) { - int c = fileGetc (); + int c = getcFromInputFile (); - if (c == '\\' && (c = fileGetc ()) != EOF) + if (c == '\\' && (c = getcFromInputFile ()) != EOF) vStringPut (string, (char) c); else if (c == EOF || c == delimiter) break; @@ -544,21 +544,21 @@ static void parseHeredoc (vString *const string) do { - c = fileGetc (); + c = getcFromInputFile (); } while (c == ' ' || c == '\t'); if (c == '\'' || c == '"') { quote = c; - c = fileGetc (); + c = getcFromInputFile (); } for (len = 0; len < (sizeof delimiter / sizeof delimiter[0]) - 1; len++) { if (! isIdentChar (c)) break; delimiter[len] = (char) c; - c = fileGetc (); + c = getcFromInputFile (); } delimiter[len] = 0; @@ -568,14 +568,14 @@ static void parseHeredoc (vString *const string) { if (c != quote) /* no closing quote for quoted identifier, give up */ goto error; - c = fileGetc (); + c = getcFromInputFile (); } if (c != '\r' && c != '\n') /* missing newline, give up */ goto error; do { - c = fileGetc (); + c = getcFromInputFile (); if (c != '\r' && c != '\n') vStringPut (string, (char) c); @@ -585,9 +585,9 @@ static void parseHeredoc (vString *const string) int nl = c; int extra = EOF; - c = fileGetc (); + c = getcFromInputFile (); for (len = 0; c != 0 && (c - delimiter[len]) == 0; len++) - c = fileGetc (); + c = getcFromInputFile (); if (delimiter[len] != 0) fileUngetc (c); @@ -602,7 +602,7 @@ static void parseHeredoc (vString *const string) } else if (c == ';') { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '\r' || d == '\n') { /* put back the semicolon since it's not part of the @@ -643,7 +643,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, (char) c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); fileUngetc (c); vStringTerminate (string); @@ -668,7 +668,7 @@ static boolean isSpace (int c) static int skipWhitespaces (int c) { while (isSpace (c)) - c = fileGetc (); + c = getcFromInputFile (); return c; } @@ -682,36 +682,36 @@ static boolean isOpenScriptLanguagePhp (int c) /* */ - c = skipWhitespaces (fileGetc ()); + c = skipWhitespaces (getcFromInputFile ()); if (c == '"' || c == '\'') { quote = c; - c = fileGetc (); + c = getcFromInputFile (); } if (tolower (c) != 'p' || - tolower ((c = fileGetc ())) != 'h' || - tolower ((c = fileGetc ())) != 'p' || - (quote != 0 && (c = fileGetc ()) != quote) || - (c = skipWhitespaces (fileGetc ())) != '>') + tolower ((c = getcFromInputFile ())) != 'h' || + tolower ((c = getcFromInputFile ())) != 'p' || + (quote != 0 && (c = getcFromInputFile ()) != quote) || + (c = skipWhitespaces (getcFromInputFile ())) != '>') return FALSE; return TRUE; @@ -722,16 +722,16 @@ static int findPhpStart (void) int c; do { - if ((c = fileGetc ()) == '<') + if ((c = getcFromInputFile ()) == '<') { - c = fileGetc (); + c = getcFromInputFile (); /* in single-line comments leaves PHP mode */ else if (c == '?') { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == '>') InPhp = FALSE; else @@ -794,7 +794,7 @@ static void readToken (tokenInfo *const token) InPhp = TRUE; } else - c = fileGetc (); + c = getcFromInputFile (); c = skipWhitespaces (c); @@ -818,7 +818,7 @@ static void readToken (tokenInfo *const token) case '=': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '=' || d == '>') token->type = TOKEN_OPERATOR; else @@ -839,17 +839,17 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '/') { /* */ - if (tolower ((d = fileGetc ())) == 's' && - tolower ((d = fileGetc ())) == 'c' && - tolower ((d = fileGetc ())) == 'r' && - tolower ((d = fileGetc ())) == 'i' && - tolower ((d = fileGetc ())) == 'p' && - tolower ((d = fileGetc ())) == 't' && - (d = skipWhitespaces (fileGetc ())) == '>') + if (tolower ((d = getcFromInputFile ())) == 's' && + tolower ((d = getcFromInputFile ())) == 'c' && + tolower ((d = getcFromInputFile ())) == 'r' && + tolower ((d = getcFromInputFile ())) == 'i' && + tolower ((d = getcFromInputFile ())) == 'p' && + tolower ((d = getcFromInputFile ())) == 't' && + (d = skipWhitespaces (getcFromInputFile ())) == '>') { InPhp = FALSE; goto getNextChar; @@ -860,7 +860,7 @@ static void readToken (tokenInfo *const token) token->type = TOKEN_UNDEFINED; } } - else if (d == '<' && (d = fileGetc ()) == '<') + else if (d == '<' && (d = getcFromInputFile ()) == '<') { token->type = TOKEN_STRING; parseHeredoc (token->string); @@ -883,7 +883,7 @@ static void readToken (tokenInfo *const token) case '*': case '%': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '=') fileUngetc (d); token->type = TOKEN_OPERATOR; @@ -892,7 +892,7 @@ static void readToken (tokenInfo *const token) case '/': /* division or comment start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '/') /* single-line comment */ { skipSingleComment (); @@ -905,7 +905,7 @@ static void readToken (tokenInfo *const token) c = skipToCharacter ('*'); if (c != EOF) { - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -925,7 +925,7 @@ static void readToken (tokenInfo *const token) case '$': /* variable start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (! isIdentChar (d)) { fileUngetc (d); @@ -941,7 +941,7 @@ static void readToken (tokenInfo *const token) case '?': /* maybe the end of the PHP chunk */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '>') { InPhp = FALSE; diff --git a/ctags/parsers/powershell.c b/ctags/parsers/powershell.c index e6d2fec193..d41b5969b8 100644 --- a/ctags/parsers/powershell.c +++ b/ctags/parsers/powershell.c @@ -197,7 +197,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -206,9 +206,9 @@ static void parseString (vString *const string, const int delimiter) { while (TRUE) { - int c = fileGetc (); + int c = getcFromInputFile (); - if (c == '\\' && (c = fileGetc ()) != EOF) + if (c == '\\' && (c = getcFromInputFile ()) != EOF) vStringPut (string, (char) c); else if (c == EOF || c == delimiter) break; @@ -224,7 +224,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, (char) c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); fileUngetc (c); vStringTerminate (string); @@ -245,7 +245,7 @@ static boolean isSpace (int c) static int skipWhitespaces (int c) { while (isSpace (c)) - c = fileGetc (); + c = getcFromInputFile (); return c; } @@ -254,10 +254,10 @@ static int skipSingleComment (void) int c; do { - c = fileGetc (); + c = getcFromInputFile (); if (c == '\r') { - int next = fileGetc (); + int next = getcFromInputFile (); if (next != '\n') fileUngetc (next); else @@ -276,7 +276,7 @@ static void readToken (tokenInfo *const token) getNextChar: - c = fileGetc (); + c = getcFromInputFile (); c = skipWhitespaces (c); token->lineNumber = getSourceLineNumber (); @@ -307,7 +307,7 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '#') { /* <# ... #> multiline comment */ @@ -316,7 +316,7 @@ static void readToken (tokenInfo *const token) c = skipToCharacter ('#'); if (c != EOF) { - c = fileGetc (); + c = getcFromInputFile (); if (c == '>') break; else @@ -344,7 +344,7 @@ static void readToken (tokenInfo *const token) case '/': case '%': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '=') fileUngetc (d); token->type = TOKEN_OPERATOR; @@ -353,7 +353,7 @@ static void readToken (tokenInfo *const token) case '$': /* variable start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (! isIdentChar (d)) { fileUngetc (d); diff --git a/ctags/parsers/rust.c b/ctags/parsers/rust.c index bdbcc4be8e..b7544c4fba 100644 --- a/ctags/parsers/rust.c +++ b/ctags/parsers/rust.c @@ -141,7 +141,7 @@ static void writeCurTokenToStr (lexerState *lexer, vString *out_str) static void advanceChar (lexerState *lexer) { lexer->cur_c = lexer->next_c; - lexer->next_c = fileGetc(); + lexer->next_c = getcFromInputFile(); } /* Reads N characters from the file */ diff --git a/ctags/parsers/sql.c b/ctags/parsers/sql.c index 63d9b984ac..3409d29bbb 100644 --- a/ctags/parsers/sql.c +++ b/ctags/parsers/sql.c @@ -466,13 +466,13 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (! end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; /* else if (c == '\\') { - c = fileGetc(); // This maybe a ' or ". // + c = getcFromInputFile(); // This maybe a ' or ". // vStringPut(string, c); } */ @@ -493,7 +493,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); if (!isspace (c)) @@ -511,7 +511,7 @@ static void readToken (tokenInfo *const token) getNextChar: do { - c = fileGetc (); + c = getcFromInputFile (); token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); /* @@ -551,7 +551,7 @@ static void readToken (tokenInfo *const token) break; case '-': - c = fileGetc (); + c = getcFromInputFile (); if (c == '-') /* -- is this the start of a comment? */ { fileSkipToCharacter ('\n'); @@ -569,7 +569,7 @@ static void readToken (tokenInfo *const token) case '>': { const int initial = c; - int d = fileGetc (); + int d = getcFromInputFile (); if (d == initial) { if (initial == '<') @@ -586,7 +586,7 @@ static void readToken (tokenInfo *const token) } case '\\': - c = fileGetc (); + c = getcFromInputFile (); if (c != '\\' && c != '"' && c != '\'' && !isspace (c)) fileUngetc (c); token->type = TOKEN_CHARACTER; @@ -596,7 +596,7 @@ static void readToken (tokenInfo *const token) case '/': { - int d = fileGetc (); + int d = getcFromInputFile (); if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { @@ -610,7 +610,7 @@ static void readToken (tokenInfo *const token) do { fileSkipToCharacter ('*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else diff --git a/ctags/parsers/verilog.c b/ctags/parsers/verilog.c index fab6a5a48a..5b4a92d487 100644 --- a/ctags/parsers/verilog.c +++ b/ctags/parsers/verilog.c @@ -122,7 +122,7 @@ static int vGetc (void) { int c; if (Ungetc == '\0') - c = fileGetc (); + c = getcFromInputFile (); else { c = Ungetc; @@ -130,13 +130,13 @@ static int vGetc (void) } if (c == '/') { - int c2 = fileGetc (); + int c2 = getcFromInputFile (); if (c2 == EOF) longjmp (Exception, (int) ExceptionEOF); else if (c2 == '/') /* strip comment until end-of-line */ { do - c = fileGetc (); + c = getcFromInputFile (); while (c != '\n' && c != EOF); } else if (c2 == '*') /* strip block comment */ @@ -152,7 +152,7 @@ static int vGetc (void) { int c2; do - c2 = fileGetc (); + c2 = getcFromInputFile (); while (c2 != '"' && c2 != EOF); c = '@'; } diff --git a/ctags/parsers/vhdl.c b/ctags/parsers/vhdl.c index df6f314f76..d94f79a594 100644 --- a/ctags/parsers/vhdl.c +++ b/ctags/parsers/vhdl.c @@ -119,7 +119,7 @@ static int vGetc (void) { int c; if (Ungetc == '\0') - c = fileGetc (); + c = getcFromInputFile (); else { c = Ungetc; @@ -127,13 +127,13 @@ static int vGetc (void) } if (c == '-') { - int c2 = fileGetc (); + int c2 = getcFromInputFile (); if (c2 == EOF) longjmp (Exception, (int) ExceptionEOF); else if (c2 == '-') /* strip comment until end-of-line */ { do - c = fileGetc (); + c = getcFromInputFile (); while (c != '\n' && c != EOF); } else