geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "general.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "read.h"
#include "read_p.h"
#include "debug.h"
#include "entry_p.h"
#include "routines.h"
#include "routines_p.h"
#include "options_p.h"
#include "parse_p.h"
#include "promise_p.h"
#include "stats_p.h"
#include "trace.h"
#include "trashbox.h"
Go to the source code of this file.
Classes | |
struct | sLangStack |
union | sInputLangInfo |
struct | sInputFileInfo |
struct | sComputPos |
struct | sInputLineFposMap |
struct | sNestedInputStreamInfo |
struct | sInputFile |
Macros | |
#define | FILE_WRITE |
#define | INITIAL_lineFposMap_LEN 256 |
#define | MAX_IN_MEMORY_FILE_SIZE (1024*1024) |
Typedefs | |
typedef struct sLangStack | langStack |
typedef union sInputLangInfo | inputLangInfo |
typedef struct sInputFileInfo | inputFileInfo |
typedef struct sComputPos | compoundPos |
typedef struct sInputLineFposMap | inputLineFposMap |
typedef struct sNestedInputStreamInfo | nestedInputStreamInfo |
typedef struct sInputFile | inputFile |
typedef enum eEolType | eolType |
Enumerations | |
enum | eEolType { eol_eof = 0 , eol_nl , eol_cr_nl } |
Functions | |
static void | langStackInit (langStack *langStack) |
static langType | langStackTop (langStack *langStack) |
static langType | langStackBotom (langStack *langStack) |
static void | langStackPush (langStack *langStack, langType type) |
static langType | langStackPop (langStack *langStack) |
static void | langStackClear (langStack *langStack) |
unsigned long | getInputLineNumber (void) |
int | getInputLineOffset (void) |
const char * | getInputFileName (void) |
MIOPos | getInputFilePosition (void) |
static compoundPos * | getInputFileCompoundPosForLine (unsigned int line) |
MIOPos | getInputFilePositionForLine (unsigned int line) |
long | getInputFileOffsetForLine (unsigned int line) |
langType | getInputLanguage (void) |
const char * | getInputLanguageName (void) |
const char * | getInputFileTagPath (void) |
bool | isInputLanguage (langType lang) |
bool | isInputHeaderFile (void) |
bool | isInputLanguageKindEnabled (int kindIndex) |
bool | isInputLanguageRoleEnabled (int kindIndex, int roleIndex) |
unsigned int | countInputLanguageKinds (void) |
unsigned int | countInputLanguageRoles (int kindIndex) |
bool | doesInputLanguageAllowNullTag (void) |
bool | doesInputLanguageRequestAutomaticFQTag (void) |
const char * | getSourceFileTagPath (void) |
langType | getSourceLanguage (void) |
unsigned long | getSourceLineNumber (void) |
static void | freeInputFileInfo (inputFileInfo *finfo) |
void | freeInputFileResources (void) |
const unsigned char * | getInputFileData (size_t *size) |
static void | freeLineFposMap (inputLineFposMap *lineFposMap) |
static void | allocLineFposMap (inputLineFposMap *lineFposMap) |
static void | appendLineFposMap (inputLineFposMap *lineFposMap, compoundPos *pos, bool crAdjustment) |
static int | compoundPosForOffset (const void *oft, const void *p) |
unsigned long | getInputLineNumberForFileOffset (long offset) |
static void | setOwnerDirectoryOfInputFile (const char *const fileName) |
static void | setInputFileParametersCommon (inputFileInfo *finfo, vString *const fileName, const langType language, stringList *holder) |
static void | resetLangOnStack (inputLangInfo *langInfo, langType lang) |
langType | baseLangOnStack (inputLangInfo *langInfo) |
static void | pushLangOnStack (inputLangInfo *langInfo, langType lang) |
static langType | popLangOnStack (inputLangInfo *langInfo) |
static void | clearLangOnStack (inputLangInfo *langInfo) |
static void | setInputFileParameters (vString *const fileName, const langType language) |
static void | setSourceFileParameters (vString *const fileName, const langType language) |
static bool | setSourceFileName (vString *const fileName) |
static void | skipWhite (char **str) |
static unsigned long | readLineNumber (char **str) |
static vString * | readFileName (char *s) |
static bool | parseLineDirective (char *s) |
MIO * | getMio (const char *const fileName, const char *const openMode, bool memStreamRequired) |
static bool | checkUTF8BOM (MIO *mio, bool skipIfFound) |
static void | rewindInputFile (inputFile *f) |
bool | openInputFile (const char *const fileName, const langType language, MIO *mio) |
void | resetInputFile (const langType language) |
void | closeInputFile (void) |
void * | getInputFileUserData (void) |
static void | fileNewline (bool crAdjustment) |
void | ungetcToInputFile (int c) |
static eolType | readLine (vString *const vLine, MIO *const mio) |
static vString * | iFileGetLine (void) |
int | getcFromInputFile (void) |
int | getNthPrevCFromInputFile (unsigned int nth, int def) |
int | skipToCharacterInInputFile (int c) |
int | skipToCharacterInInputFile2 (int c0, int c1) |
const unsigned char * | readLineFromInputFile (void) |
char * | readLineRaw (vString *const vLine, MIO *const mio) |
char * | readLineFromBypass (vString *const vLine, MIOPos location, long *const pSeekValue) |
void | pushNarrowedInputStream (unsigned long startLine, long startCharOffset, unsigned long endLine, long endCharOffset, unsigned long sourceLineOffset, int promise) |
bool | doesParserRunAsGuest (void) |
unsigned int | getNestedInputBoundaryInfo (unsigned long lineNumber) |
void | popNarrowedInputStream (void) |
void | pushLanguage (const langType language) |
langType | popLanguage (void) |
langType | getLanguageForBaseParser (void) |
bool | isThinStreamSpec (unsigned long startLine, long startCharOffset, unsigned long endLine, long endCharOffset, unsigned long sourceLineOffset) |
Variables | |
static inputLangInfo | inputLang |
static langType | sourceLang |
static inputFile | File |
static inputFile | BackupFile |
static compoundPos | StartOfLine |
#define INITIAL_lineFposMap_LEN 256 |
typedef struct sComputPos compoundPos |
typedef struct sInputFile inputFile |
typedef struct sInputFileInfo inputFileInfo |
typedef union sInputLangInfo inputLangInfo |
typedef struct sInputLineFposMap inputLineFposMap |
typedef struct sLangStack langStack |
typedef struct sNestedInputStreamInfo nestedInputStreamInfo |
|
static |
Definition at line 310 of file read.c.
References sInputLineFposMap::count, INITIAL_lineFposMap_LEN, sInputLineFposMap::pos, sInputLineFposMap::size, and xCalloc.
Referenced by openInputFile().
|
static |
Definition at line 318 of file read.c.
References sInputLineFposMap::count, sComputPos::crAdjustment, sComputPos::open, sInputLineFposMap::pos, pos, sInputLineFposMap::size, and xRealloc.
Referenced by fileNewline().
langType baseLangOnStack | ( | inputLangInfo * | langInfo | ) |
Definition at line 435 of file read.c.
References Assert, sLangStack::count, langStackBotom(), and sInputLangInfo::stack.
Referenced by getLanguageForBaseParser().
|
static |
Definition at line 641 of file read.c.
References mio_getc(), and mio_rewind().
Referenced by openInputFile().
|
static |
Definition at line 451 of file read.c.
References langStackClear(), and sInputLangInfo::stack.
Referenced by closeInputFile().
void closeInputFile | ( | void | ) |
Definition at line 772 of file read.c.
References addTotals(), clearLangOnStack(), eStat(), File, freeLineFposMap(), sInputFile::input, inputLang, sInputFile::lineFposMap, sInputFileInfo::lineNumber, sInputFile::mio, mio_unref(), sInputFileInfo::name, NULL, Option, sOptionValues::printTotals, fileStatus::size, and vStringValue.
Referenced by createTagsWithFallback().
|
static |
Definition at line 344 of file read.c.
References sComputPos::crAdjustment, sComputPos::offset, and pos.
Referenced by getInputLineNumberForFileOffset().
unsigned int countInputLanguageKinds | ( | void | ) |
Definition at line 232 of file read.c.
References countLanguageKinds(), and getInputLanguage().
unsigned int countInputLanguageRoles | ( | int | kindIndex | ) |
Definition at line 237 of file read.c.
References countLanguageRoles(), and getInputLanguage().
Referenced by makeSimpleRefTag().
bool doesInputLanguageAllowNullTag | ( | void | ) |
Definition at line 242 of file read.c.
References doesLanguageAllowNullTag(), and getInputLanguage().
Referenced by makeTagEntry().
bool doesInputLanguageRequestAutomaticFQTag | ( | void | ) |
Definition at line 247 of file read.c.
References doesLanguageRequestAutomaticFQTag(), and getInputLanguage().
Referenced by uncorkTagFile(), and writeTagEntry().
bool doesParserRunAsGuest | ( | void | ) |
Definition at line 1115 of file read.c.
References sNestedInputStreamInfo::endCharOffset, sNestedInputStreamInfo::endLine, File, sInputFile::nestedInputStreamInfo, sNestedInputStreamInfo::startCharOffset, and sNestedInputStreamInfo::startLine.
Referenced by getNestedInputBoundaryInfo(), and initTagEntryFull().
|
static |
Definition at line 799 of file read.c.
References appendLineFposMap(), BackupFile, DEBUG_RAW, debugPrintf(), DebugStatement, File, sInputFile::filePosition, sInputFile::input, lineBreak(), sInputFile::lineFposMap, sInputFileInfo::lineNumber, sInputFile::mio, NULL, Option, sInputFile::source, and StartOfLine.
Referenced by iFileGetLine().
|
static |
Definition at line 267 of file read.c.
References sInputFileInfo::name, NULL, sInputFileInfo::tagPath, and vStringDelete().
Referenced by freeInputFileResources().
void freeInputFileResources | ( | void | ) |
Definition at line 281 of file read.c.
References File, freeInputFileInfo(), sInputFile::input, sInputFile::line, NULL, sInputFile::path, sInputFile::source, and vStringDelete().
Referenced by ctags_cli_main().
|
static |
Definition at line 299 of file read.c.
References sInputLineFposMap::count, eFree(), NULL, sInputLineFposMap::pos, and sInputLineFposMap::size.
Referenced by closeInputFile().
int getcFromInputFile | ( | void | ) |
Definition at line 923 of file read.c.
References sInputFile::currentLine, DEBUG_READ, debugPutc(), DebugStatement, File, iFileGetLine(), line, NULL, sInputFile::ungetchBuf, sInputFile::ungetchIdx, and vStringValue.
Referenced by advanceChar(), findHaskellTags(), findPhpStart(), get_line(), get_next_char(), get_token(), getcAndCollect(), getFixedFormChar(), getFreeFormChar(), getLineType(), isOpenScriptLanguagePhp(), nextChar(), parseHeredoc(), parseIdentifier(), parseRegExp(), parseSelector(), parseString(), parseTemplateString(), readToken(), readTokenFull(), readTokenText(), readUnicodeEscapeSequence(), readUnicodeEscapeSequenceValue(), skip_rest_of_line(), skipLine(), skipSingleComment(), skipToCharacterInInputFile(), skipToCharacterInInputFile2(), skipToNextLine(), skipWhitespaces(), uugciGetC(), and vGetc().
|
static |
Definition at line 166 of file read.c.
References sInputLineFposMap::count, File, index, line, sInputFile::lineFposMap, and sInputLineFposMap::pos.
Referenced by getInputFileOffsetForLine(), and getInputFilePositionForLine().
const unsigned char * getInputFileData | ( | size_t * | size | ) |
Definition at line 291 of file read.c.
References File, sInputFile::mio, and mio_memory_get_data().
const char * getInputFileName | ( | void | ) |
Definition at line 154 of file read.c.
References File, sInputFile::input, sInputFileInfo::name, NULL, and vStringValue.
Referenced by addTag(), analyzePostParens(), anonGenerate(), createTags(), findCTags(), findFortranTags(), hackReject(), initTagEntryFull(), makeTagEntry(), matchMultilineRegexPattern(), matchMultitableRegex(), matchMultitableRegexTable(), matchTagPattern(), parseString(), printMessage(), printMultitableMessage(), runParserInNarrowedInputStream(), skipInitializer(), skipToMatch(), uwiPopMarker(), and uwiPushMarker().
long getInputFileOffsetForLine | ( | unsigned int | line | ) |
Definition at line 190 of file read.c.
References getInputFileCompoundPosForLine(), line, and sComputPos::offset.
Referenced by makePromiseForAreaSpecifiedWithOffsets(), and matchRegexPattern().
MIOPos getInputFilePosition | ( | void | ) |
Definition at line 161 of file read.c.
References File, sInputFile::filePosition, and sComputPos::pos.
Referenced by advanceToken(), clearPoolToken(), clearToken(), findCssTags(), findRstTags(), initForeignRefTagEntry(), initTagEntry(), initToken(), newToken(), pushNarrowedInputStream(), readToken(), readTokenFull(), and uugcGetFilePosition().
MIOPos getInputFilePositionForLine | ( | unsigned int | line | ) |
Definition at line 184 of file read.c.
References getInputFileCompoundPosForLine(), line, and sComputPos::pos.
Referenced by makeAsciidocTag(), matchTagPattern(), pushNarrowedInputStream(), and uugcGetFilePosition().
const char * getInputFileTagPath | ( | void | ) |
Definition at line 206 of file read.c.
References File, sInputFile::input, sInputFileInfo::tagPath, and vStringValue.
Referenced by initForeignRefTagEntry(), and initTagEntry().
void * getInputFileUserData | ( | void | ) |
Definition at line 792 of file read.c.
References File, sInputFile::mio, and mio_get_user_data().
langType getInputLanguage | ( | void | ) |
Definition at line 196 of file read.c.
References inputLang, langStackTop(), and sInputLangInfo::stack.
Referenced by analyzeKeyword(), anonGenerate(), countInputLanguageKinds(), countInputLanguageRoles(), doesInputLanguageAllowNullTag(), doesInputLanguageRequestAutomaticFQTag(), doesSubparserRun(), getInputLanguageName(), getNextSlaveParser(), getNextSubparser(), getSubparserRunningBaseparser(), iFileGetLine(), initRefTagEntry(), initTagEntry(), isInputLanguage(), isInputLanguageKindEnabled(), isInputLanguageRoleEnabled(), isParserMarkedNoEmission(), makeDefineTag(), parseFunction(), parseIdentifier(), readToken(), and scheduleRunningBaseparser().
const char * getInputLanguageName | ( | void | ) |
Definition at line 201 of file read.c.
References getInputLanguage(), and getLanguageName().
unsigned long getInputLineNumber | ( | void | ) |
Definition at line 142 of file read.c.
References File, sInputFile::input, and sInputFileInfo::lineNumber.
Referenced by advanceToken(), analyzePostParens(), clearPoolToken(), clearToken(), cppGetc(), createCTSTTags(), createTags(), findCssTags(), getInputLineNumberInRegPType(), getNestingLevel(), initForeignRefTagEntry(), initTagEntry(), initToken(), makeAsciidocTag(), makeFileTag(), matchRegexPattern(), newToken(), notifyRegexInputEnd(), parseString(), readTag(), readTagContent(), readToken(), readTokenFull(), skipInitializer(), skipScriptContent(), skipToMatch(), uugcGetLineNumber(), uugciGetC(), and uugcInjectC().
unsigned long getInputLineNumberForFileOffset | ( | long | offset | ) |
Definition at line 360 of file read.c.
References compoundPosForOffset(), sInputLineFposMap::count, File, sInputFile::lineFposMap, NULL, and sInputLineFposMap::pos.
Referenced by getInputLineNumberInRegPType(), makePromiseForAreaSpecifiedWithOffsets(), matchMultitableRegexTable(), matchTagPattern(), printInputLine(), and printMultitableMessage().
int getInputLineOffset | ( | void | ) |
Definition at line 147 of file read.c.
References sInputFile::currentLine, File, sInputFile::line, sInputFile::ungetchIdx, and vStringValue.
Referenced by readTag(), readTagContent(), and skipScriptContent().
langType getLanguageForBaseParser | ( | void | ) |
Definition at line 1164 of file read.c.
References baseLangOnStack(), and inputLang.
Referenced by doesSubparserRun().
MIO * getMio | ( | const char *const | fileName, |
const char *const | openMode, | ||
bool | memStreamRequired | ||
) |
Definition at line 607 of file read.c.
References eFree(), eFreeNoNullCheck(), eMalloc(), eRealloc(), eStat(), eStatFree(), MAX_IN_MEMORY_FILE_SIZE, mio_new_file(), mio_new_memory(), NULL, and fileStatus::size.
Referenced by openInputFile().
unsigned int getNestedInputBoundaryInfo | ( | unsigned long | lineNumber | ) |
Definition at line 1123 of file read.c.
References BOUNDARY_END, BOUNDARY_START, doesParserRunAsGuest(), sNestedInputStreamInfo::endCharOffset, sNestedInputStreamInfo::endLine, File, lineNumber, sInputFile::nestedInputStreamInfo, sNestedInputStreamInfo::startCharOffset, and sNestedInputStreamInfo::startLine.
Referenced by initTagEntryFull().
int getNthPrevCFromInputFile | ( | unsigned int | nth, |
int | def | ||
) |
Definition at line 961 of file read.c.
References sInputFile::currentLine, File, sInputFile::line, NULL, sInputFile::ungetchIdx, and vStringValue.
Referenced by cppGetc().
const char * getSourceFileTagPath | ( | void | ) |
Definition at line 252 of file read.c.
References File, sInputFile::source, sInputFileInfo::tagPath, and vStringValue.
Referenced by initForeignRefTagEntry(), initTagEntry(), and parseMio().
langType getSourceLanguage | ( | void | ) |
Definition at line 257 of file read.c.
References sourceLang.
Referenced by initForeignRefTagEntry(), and initTagEntry().
unsigned long getSourceLineNumber | ( | void | ) |
Definition at line 262 of file read.c.
References File, sInputFileInfo::lineNumber, and sInputFile::source.
Referenced by initForeignRefTagEntry(), initTagEntry(), and readTag().
|
static |
Definition at line 878 of file read.c.
References sInputFile::allLines, eol_cr_nl, File, fileNewline(), getInputLanguage(), sInputFile::line, sOptionValues::lineDirectives, matchLanguageMultilineRegex(), matchLanguageMultitableRegex(), matchLanguageRegex(), sInputFile::mio, mio_getpos(), mio_tell(), NULL, sComputPos::offset, Option, parseLineDirective(), sComputPos::pos, readLine(), StartOfLine, vStringCat(), vStringChar, vStringDelete(), vStringLength, vStringNew(), and vStringValue.
Referenced by getcFromInputFile(), and readLineFromInputFile().
bool isInputHeaderFile | ( | void | ) |
Definition at line 216 of file read.c.
References File, sInputFile::input, and sInputFileInfo::isHeader.
Referenced by makeDefineTag(), and makeTag().
bool isInputLanguage | ( | langType | lang | ) |
Definition at line 211 of file read.c.
References getInputLanguage().
Referenced by accessField(), addContext(), addContextSeparator(), addOtherFields(), analyzeIdentifier(), analyzeKeyword(), analyzeParens(), analyzePostParens(), checkIsClassEnum(), findCTags(), inheritingDeclaration(), initMemberInfo(), isContextualStatement(), isStatementEnd(), kindIndexForType(), makeTag(), nextToken(), parseParens(), processColon(), processToken(), qualifyCompoundTag(), qualifyFunctionDeclTag(), qualifyFunctionTag(), qualifyVariableTag(), readIdentifier(), readPackage(), readPackageOrNamespace(), setAccess(), skipPostArgumentStuff(), skipToMatch(), and tagCheck().
bool isInputLanguageKindEnabled | ( | int | kindIndex | ) |
Definition at line 221 of file read.c.
References getInputLanguage(), and isLanguageKindEnabled().
bool isInputLanguageRoleEnabled | ( | int | kindIndex, |
int | roleIndex | ||
) |
Definition at line 226 of file read.c.
References getInputLanguage(), and isLanguageRoleEnabled().
bool isThinStreamSpec | ( | unsigned long | startLine, |
long | startCharOffset, | ||
unsigned long | endLine, | ||
long | endCharOffset, | ||
unsigned long | sourceLineOffset | ||
) |
Definition at line 1210 of file read.c.
Referenced by makePromise(), and pushNarrowedInputStream().
Definition at line 1183 of file read.c.
References Assert, sLangStack::count, and sLangStack::languages.
Referenced by baseLangOnStack().
|
static |
Definition at line 1189 of file read.c.
References sLangStack::count, and langStackPop().
Referenced by clearLangOnStack(), and resetLangOnStack().
|
static |
Definition at line 1169 of file read.c.
References sLangStack::count, DEFAULT_TRASH_BOX, eFreeIndirect(), sLangStack::languages, sLangStack::size, and xCalloc.
Referenced by langStackPush().
Definition at line 1205 of file read.c.
References sLangStack::count, and sLangStack::languages.
Referenced by langStackClear(), and popLangOnStack().
Definition at line 1195 of file read.c.
References sLangStack::count, langStackInit(), sLangStack::languages, sLangStack::size, and xRealloc.
Referenced by pushLangOnStack(), and resetLangOnStack().
Definition at line 1177 of file read.c.
References Assert, sLangStack::count, and sLangStack::languages.
Referenced by getInputLanguage().
Definition at line 673 of file read.c.
References allocLineFposMap(), sInputFile::bomFound, checkUTF8BOM(), sInputFile::currentLine, DEFAULT_TRASH_BOX, doesParserRequireMemoryStream(), error(), File, sInputFile::filePosition, getLanguageName(), getMio(), sInputFile::input, invalidatePatternCache(), sInputFileInfo::isHeader, sInputFile::line, sInputFile::lineFposMap, sInputFileInfo::lineNumber, sInputFileInfo::lineNumberOrigin, sInputFile::mio, mio_getpos(), mio_memory_get_data(), mio_ref(), mio_rewind(), mio_tell(), mio_unref(), NULL, sComputPos::offset, PERROR, sComputPos::pos, setInputFileParameters(), setOwnerDirectoryOfInputFile(), setSourceFileParameters(), sInputFile::source, sInputFile::sourceTagPathHolder, StartOfLine, stringListClear(), stringListDelete(), stringListNew(), sInputFile::thinDepth, verbose(), vStringClear, vStringNewInit(), and WARNING.
Referenced by createTagsWithFallback().
|
static |
Definition at line 550 of file read.c.
References DEBUG_RAW, debugPrintf(), DebugStatement, File, sInputFileInfo::lineNumber, makeFileTag(), readFileName(), readLineNumber(), setSourceFileName(), skipWhite(), sInputFile::source, vStringDelete(), vStringLength, and vStringValue.
Referenced by iFileGetLine().
|
static |
Definition at line 446 of file read.c.
References langStackPop(), and sInputLangInfo::stack.
Referenced by popLanguage().
langType popLanguage | ( | void | ) |
Definition at line 1159 of file read.c.
References inputLang, and popLangOnStack().
Referenced by createTagsWithFallback(), hasLanguageScopeActionInRegex(), leaveSubparser(), makeQualifiedTagEntry(), parserCorkFlags(), scheduleRunningBaseparser(), and subparserColprintAddSubparsers().
void popNarrowedInputStream | ( | void | ) |
Definition at line 1141 of file read.c.
References BackupFile, File, sInputFile::mio, mio_unref(), sInputFile::thinDepth, and verbose().
Referenced by runParserInNarrowedInputStream().
|
static |
Definition at line 441 of file read.c.
References langStackPush(), and sInputLangInfo::stack.
Referenced by pushLanguage(), and setInputFileParameters().
void pushLanguage | ( | const langType | language | ) |
Definition at line 1154 of file read.c.
References inputLang, and pushLangOnStack().
Referenced by createTagsWithFallback(), enterSubparser(), hasLanguageScopeActionInRegex(), makeQualifiedTagEntry(), parserCorkFlags(), scheduleRunningBaseparser(), and subparserColprintAddSubparsers().
void pushNarrowedInputStream | ( | unsigned long | startLine, |
long | startCharOffset, | ||
unsigned long | endLine, | ||
long | endCharOffset, | ||
unsigned long | sourceLineOffset, | ||
int | promise | ||
) |
Definition at line 1054 of file read.c.
References Assert, BackupFile, sInputFile::bomFound, sNestedInputStreamInfo::endCharOffset, sNestedInputStreamInfo::endLine, error(), FATAL, File, getInputFilePosition(), getInputFilePositionForLine(), sInputFile::input, invalidatePatternCache(), isThinStreamSpec(), sInputFileInfo::lineNumberOrigin, sInputFile::mio, mio_memory_get_data(), mio_new_mio(), mio_seek(), mio_setpos(), mio_tell(), sInputFile::nestedInputStreamInfo, NULL, runModifiers(), sInputFile::source, sNestedInputStreamInfo::startCharOffset, sNestedInputStreamInfo::startLine, sInputFile::thinDepth, and verbose().
Referenced by runParserInNarrowedInputStream().
|
static |
Definition at line 528 of file read.c.
References skipWhite(), vStringNew(), and vStringPut().
Referenced by parseLineDirective().
Definition at line 829 of file read.c.
References eol_cr_nl, eol_eof, eol_nl, error(), FATAL, mio_eof(), mio_gets(), NULL, PERROR, vStringChar, vStringChop(), vStringClear, vStringLast, vStringLength, vStringResize(), vStringSetLength(), vStringSize, and vStringValue.
Referenced by iFileGetLine(), and readLineRaw().
Definition at line 1035 of file read.c.
References File, sInputFile::mio, mio_clearerr(), mio_getpos(), mio_setpos(), mio_tell(), NULL, and readLineRaw().
Referenced by readLineFromBypassForTag().
const unsigned char * readLineFromInputFile | ( | void | ) |
Definition at line 1000 of file read.c.
References DEBUG_READ, debugPrintf(), DebugStatement, iFileGetLine(), line, NULL, vStringStripNewline(), and vStringValue.
Referenced by createCTSTTags(), createRTags(), createTagsWithFallback1(), eatComment(), fileReadLineDriver(), findAbaqusTags(), findAbcTags(), findAsciidocTags(), findAsmTags(), findBasicTags(), findConfTags(), findDiffTags(), findDocBookTags(), findErlangTags(), findHxTags(), findLuaTags(), findMarkdownTags(), findMatlabTags(), findNsisTags(), findPascalTags(), findPerlTags(), findPythonTags(), findRstTags(), findRubyTags(), findShTags(), findTclTags(), findTeXTags(), findTxt2tagsTags(), isSubroutineDeclaration(), lex(), makeFileTag(), and parseClass().
|
static |
Definition at line 1016 of file read.c.
References error(), FATAL, NULL, readLine(), vStringLength, and vStringValue.
Referenced by determineEmacsModeAtEOF(), endEtagsFile(), extractEmacsModeAtFirstLine(), extractInterpreter(), extractMarkGeneric(), extractVimFileType(), internalSortTags(), isTagFile(), processTagRegexOption(), readLineFromBypass(), stringListNewFromFile(), and updatePseudoTags().
void resetInputFile | ( | const langType | language | ) |
Definition at line 751 of file read.c.
References sInputFile::allLines, Assert, sInputFile::currentLine, File, sInputFile::filePosition, hasLanguageMultilineRegexPatterns(), sInputFile::input, inputLang, sInputFile::line, sInputFileInfo::lineNumber, sInputFileInfo::lineNumberOrigin, sInputFile::mio, mio_getpos(), mio_tell(), NULL, sComputPos::offset, sComputPos::pos, resetLangOnStack(), rewindInputFile(), sInputFile::source, sourceLang, StartOfLine, vStringClear, and vStringNew().
Referenced by createTagsForFile().
|
static |
Definition at line 428 of file read.c.
References Assert, sLangStack::count, langStackClear(), langStackPush(), and sInputLangInfo::stack.
Referenced by resetInputFile().
|
static |
Definition at line 654 of file read.c.
References Assert, sInputFile::bomFound, CTAGS_ATTR_UNUSED, sInputFile::mio, mio_getc(), and mio_rewind().
Referenced by resetInputFile().
Definition at line 456 of file read.c.
References File, sInputFile::input, inputLang, NULL, pushLangOnStack(), and setInputFileParametersCommon().
Referenced by openInputFile().
|
static |
Definition at line 393 of file read.c.
References absoluteFilename(), getTagFileDirectory(), isAbsolutePath(), sInputFileInfo::isHeader, isIncludeFile(), sInputFileInfo::name, NULL, Option, relativeFilename(), stringListAdd(), sInputFileInfo::tagPath, sOptionValues::tagRelative, TREL_ALWAYS, TREL_NEVER, TREL_NO, vStringDelete(), vStringNewCopy(), vStringNewOwn(), and vStringValue.
Referenced by setInputFileParameters(), and setSourceFileParameters().
|
static |
Definition at line 376 of file read.c.
References baseFilename(), File, NULL, sInputFile::path, tail(), vStringDelete(), vStringNCopyS(), and vStringNew().
Referenced by openInputFile().
|
static |
Definition at line 470 of file read.c.
References combinePathAndFile(), File, getLanguageForFilenameAndContents(), isAbsolutePath(), LANG_IGNORE, NULL, sInputFile::path, setSourceFileParameters(), vStringNewCopy(), vStringNewOwn(), and vStringValue.
Referenced by parseLineDirective().
Definition at line 463 of file read.c.
References File, setInputFileParametersCommon(), sInputFile::source, sourceLang, and sInputFile::sourceTagPathHolder.
Referenced by openInputFile(), and setSourceFileName().
int skipToCharacterInInputFile | ( | int | c | ) |
Definition at line 972 of file read.c.
References getcFromInputFile().
Referenced by readToken(), readTokenFull(), and skipToCharacterInInputFile2().
int skipToCharacterInInputFile2 | ( | int | c0, |
int | c1 | ||
) |
Definition at line 982 of file read.c.
References getcFromInputFile(), and skipToCharacterInInputFile().
|
static |
Definition at line 495 of file read.c.
Referenced by parseLineDirective(), readFileName(), and readLineNumber().
void ungetcToInputFile | ( | int | c | ) |
Definition at line 813 of file read.c.
References ARRAY_SIZE, Assert, File, sInputFile::ungetchBuf, and sInputFile::ungetchIdx.
Referenced by findMakeTags(), findPhpStart(), get_next_char(), get_token(), getFixedFormChar(), getFreeFormChar(), handleUnicodeCodePoint(), parseHeredoc(), parseIdentifier(), parseRegExp(), parseSelector(), parseString(), parseTemplateString(), readIdentifier(), readToken(), readTokenFull(), readTokenText(), readUnicodeEscapeSequence(), readUnicodeEscapeSequenceValue(), skipLine(), skipSingleComment(), ungetcAndCollect(), and vGetc().
|
static |
Definition at line 135 of file read.c.
Referenced by fileNewline(), popNarrowedInputStream(), and pushNarrowedInputStream().
|
static |
Definition at line 134 of file read.c.
Referenced by closeInputFile(), doesParserRunAsGuest(), fileNewline(), freeInputFileResources(), getcFromInputFile(), getInputFileCompoundPosForLine(), getInputFileData(), getInputFileName(), getInputFilePosition(), getInputFileTagPath(), getInputFileUserData(), getInputLineNumber(), getInputLineNumberForFileOffset(), getInputLineOffset(), getNestedInputBoundaryInfo(), getNthPrevCFromInputFile(), getSourceFileTagPath(), getSourceLineNumber(), iFileGetLine(), isInputHeaderFile(), openInputFile(), parseLineDirective(), popNarrowedInputStream(), pushNarrowedInputStream(), readLineFromBypass(), resetInputFile(), setInputFileParameters(), setOwnerDirectoryOfInputFile(), setSourceFileName(), setSourceFileParameters(), and ungetcToInputFile().
|
static |
Definition at line 117 of file read.c.
Referenced by closeInputFile(), getInputLanguage(), getLanguageForBaseParser(), popLanguage(), pushLanguage(), resetInputFile(), and setInputFileParameters().
|
static |
Definition at line 118 of file read.c.
Referenced by getSourceLanguage(), resetInputFile(), and setSourceFileParameters().
|
static |
Definition at line 136 of file read.c.
Referenced by fileNewline(), iFileGetLine(), openInputFile(), and resetInputFile().