Update of Italian translation
[geany-mirror.git] / tagmanager / ctags / read.h
blobe3b15b1ade84e64367d84b72fd6d7e805aaa435b
1 /*
3 * Copyright (c) 1998-2001, Darren Hiebert
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 * External interface to read.c
9 */
10 #ifndef _READ_H
11 #define _READ_H
14 * INCLUDE FILES
16 #include "general.h" /* must always come first */
18 #include <stdio.h>
19 #include <ctype.h>
20 #include <mio/mio.h>
22 #include "parse.h"
23 #include "vstring.h"
26 * MACROS
28 #define getInputLineNumber() File.lineNumber
29 #define getInputFileName() vStringValue (File.source.name)
30 #define getInputFilePosition() File.filePosition
31 #define getSourceFileName() vStringValue (File.source.name)
32 #define getSourceFileTagPath() File.source.tagPath
33 #define getSourceLanguage() File.source.language
34 #define getSourceLanguageName() getLanguageName (File.source.language)
35 #define getSourceLineNumber() File.source.lineNumber
36 #define isLanguage(lang) (boolean)((lang) == File.source.language)
37 #define isHeaderFile() File.source.isHeader
40 * DATA DECLARATIONS
43 enum eCharacters {
44 /* White space characters.
46 SPACE = ' ',
47 NEWLINE = '\n',
48 CRETURN = '\r',
49 FORMFEED = '\f',
50 TAB = '\t',
51 VTAB = '\v',
53 /* Some hard to read characters.
55 DOUBLE_QUOTE = '"',
56 SINGLE_QUOTE = '\'',
57 BACKSLASH = '\\',
59 STRING_SYMBOL = ('S' + 0x80),
60 CHAR_SYMBOL = ('C' + 0x80)
63 /* Maintains the state of the current source file.
65 typedef struct sInputFile {
66 vString *name; /* name of input file */
67 vString *path; /* path of input file (if any) */
68 vString *line; /* last line read from file */
69 const unsigned char* currentLine; /* current line being worked on */
70 MIO *mio; /* stream used for reading the file */
71 unsigned long lineNumber; /* line number in the input file */
72 MIOPos filePosition; /* file position of current line */
73 int ungetch; /* a single character that was ungotten */
74 boolean eof; /* have we reached the end of file? */
75 boolean newLine; /* will the next character begin a new line? */
77 /* Contains data pertaining to the original source file in which the tag
78 * was defined. This may be different from the input file when #line
79 * directives are processed (i.e. the input file is preprocessor output).
81 struct sSource {
82 vString *name; /* name to report for source file */
83 char *tagPath; /* path of source file relative to tag file */
84 unsigned long lineNumber;/* line number in the source file */
85 boolean isHeader; /* is source file a header file? */
86 langType language; /* language of source file */
87 } source;
88 } inputFile;
91 * GLOBAL VARIABLES
93 /* should not be modified externally */
94 extern inputFile File;
97 * FUNCTION PROTOTYPES
99 extern void freeSourceFileResources (void);
100 extern boolean fileOpen (const char *const fileName, const langType language);
101 extern boolean fileEOF (void);
102 extern void fileClose (void);
103 extern int fileGetc (void);
104 extern void fileUngetc (int c);
105 extern const unsigned char *fileReadLine (void);
106 extern char *readLine (vString *const vLine, MIO *const mio);
107 extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue);
108 extern boolean bufferOpen (unsigned char *buffer, int buffer_size,
109 const char *const fileName, const langType language );
110 #define bufferClose fileClose
112 #endif /* _READ_H */
114 /* vi:set tabstop=8 shiftwidth=4: */