xref: /Universal-ctags/main/read_p.h (revision 9128cdba03f06a84dcbe056af23316712f0db1b7)
1 /*
2 *   Copyright (c) 1998-2002, Darren Hiebert
3 *
4 *   This source code is released for free distribution under the terms of the
5 *   GNU General Public License version 2 or (at your option) any later version.
6 *
7 *   Main part private interface to read.c
8 */
9 #ifndef CTAGS_MAIN_READ_PRIVATE_H
10 #define CTAGS_MAIN_READ_PRIVATE_H
11 
12 /*
13 *   INCLUDE FILES
14 */
15 #include "general.h"  /* must always come first */
16 
17 #include "mio.h"
18 #include "types.h"
19 #include "vstring.h"
20 
21 /*
22 *   DATA DECLARATIONS
23 */
24 
25 enum nestedInputBoundaryFlag {
26 	BOUNDARY_START = 1UL << 0,
27 	BOUNDARY_END   = 1UL << 1,
28 };
29 
30 /*
31 *   FUNCTION PROTOTYPES
32 */
33 
34 extern const char *getInputLanguageName (void);
35 extern const char *getInputFileTagPath (void);
36 
37 extern long getInputFileOffsetForLine (unsigned int line);
38 
39 extern unsigned int countInputLanguageKinds (void);
40 extern unsigned int countInputLanguageRoles (int kindIndex);
41 
42 extern bool doesInputLanguageAllowNullTag (void);
43 extern bool doesInputLanguageRequestAutomaticFQTag (const tagEntryInfo *e);
44 extern bool doesParserRunAsGuest (void);
45 extern bool doesSubparserRun (void);
46 extern langType getLanguageForBaseParser (void);
47 
48 extern bool isParserMarkedNoEmission (void);
49 extern void freeInputFileResources (void);
50 
51 /* Stream opened by getMio can be passed to openInputFile as the 3rd
52    argument. If the 3rd argument is NULL, openInputFile calls getMio
53    internally. The 3rd argument is introduced for reusing mio object
54    created in parser guessing stage. */
55 extern bool openInputFile (const char *const fileName, const langType language, MIO *mio, time_t mtime);
56 extern MIO *getMio (const char *const fileName, const char *const openMode,
57 				    bool memStreamRequired);
58 extern void resetInputFile (const langType language);
59 extern void closeInputFile (void);
60 extern void *getInputFileUserData(void);
61 
62 extern unsigned int getNestedInputBoundaryInfo (unsigned long lineNumber);
63 
64 extern const char *getSourceFileTagPath (void);
65 extern langType getSourceLanguage (void);
66 
67 extern time_t getInputFileMtime (void);
68 
69 /* Bypass: reading from fp in inputFile WITHOUT updating fields in input fields */
70 extern char *readLineFromBypass (vString *const vLine, MIOPos location, long *const pSeekValue);
71 extern void   pushNarrowedInputStream (
72 				       bool useMemoryStreamInput,
73 				       unsigned long startLine, long startCharOffset,
74 				       unsigned long endLine, long endCharOffset,
75 				       unsigned long sourceLineOffset,
76 				       int promise);
77 extern void   popNarrowedInputStream  (void);
78 
79 #define THIN_STREAM_SPEC 0, 0, 0, 0, 0
80 extern bool isThinStreamSpec(unsigned long startLine, long startCharOffset,
81 							 unsigned long endLine, long endCharOffset,
82 							 unsigned long sourceLineOffset);
83 
84 #endif  /* CTAGS_MAIN_READ_PRIVATE_H */
85