ctags.rb 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -0
- data/Rakefile +23 -0
- data/ctags.rb.gemspec +23 -0
- data/ext/.gitignore +3 -0
- data/ext/extconf.rb +15 -0
- data/ext/vendor/exuberant-ctags/.gitignore +6 -0
- data/ext/vendor/exuberant-ctags/.indent.pro +31 -0
- data/ext/vendor/exuberant-ctags/COPYING +340 -0
- data/ext/vendor/exuberant-ctags/EXTENDING.html +386 -0
- data/ext/vendor/exuberant-ctags/FAQ +371 -0
- data/ext/vendor/exuberant-ctags/INSTALL +215 -0
- data/ext/vendor/exuberant-ctags/INSTALL.oth +73 -0
- data/ext/vendor/exuberant-ctags/MAINTAINERS +88 -0
- data/ext/vendor/exuberant-ctags/Makefile.in +222 -0
- data/ext/vendor/exuberant-ctags/NEWS +871 -0
- data/ext/vendor/exuberant-ctags/README +73 -0
- data/ext/vendor/exuberant-ctags/ant.c +42 -0
- data/ext/vendor/exuberant-ctags/argproc.c +505 -0
- data/ext/vendor/exuberant-ctags/args.c +274 -0
- data/ext/vendor/exuberant-ctags/args.h +63 -0
- data/ext/vendor/exuberant-ctags/asm.c +387 -0
- data/ext/vendor/exuberant-ctags/asp.c +328 -0
- data/ext/vendor/exuberant-ctags/awk.c +81 -0
- data/ext/vendor/exuberant-ctags/basic.c +203 -0
- data/ext/vendor/exuberant-ctags/beta.c +321 -0
- data/ext/vendor/exuberant-ctags/c.c +2932 -0
- data/ext/vendor/exuberant-ctags/cobol.c +50 -0
- data/ext/vendor/exuberant-ctags/config.h.in +277 -0
- data/ext/vendor/exuberant-ctags/configure +7704 -0
- data/ext/vendor/exuberant-ctags/configure.ac +532 -0
- data/ext/vendor/exuberant-ctags/ctags.1 +1186 -0
- data/ext/vendor/exuberant-ctags/ctags.h +28 -0
- data/ext/vendor/exuberant-ctags/ctags.html +2087 -0
- data/ext/vendor/exuberant-ctags/ctags.spec +40 -0
- data/ext/vendor/exuberant-ctags/debug.c +113 -0
- data/ext/vendor/exuberant-ctags/debug.h +70 -0
- data/ext/vendor/exuberant-ctags/descrip.mms +68 -0
- data/ext/vendor/exuberant-ctags/dosbatch.c +42 -0
- data/ext/vendor/exuberant-ctags/e_amiga.h +24 -0
- data/ext/vendor/exuberant-ctags/e_djgpp.h +47 -0
- data/ext/vendor/exuberant-ctags/e_mac.h +143 -0
- data/ext/vendor/exuberant-ctags/e_msoft.h +76 -0
- data/ext/vendor/exuberant-ctags/e_os2.h +37 -0
- data/ext/vendor/exuberant-ctags/e_qdos.h +34 -0
- data/ext/vendor/exuberant-ctags/e_riscos.h +58 -0
- data/ext/vendor/exuberant-ctags/e_vms.h +31 -0
- data/ext/vendor/exuberant-ctags/eiffel.c +1352 -0
- data/ext/vendor/exuberant-ctags/entry.c +847 -0
- data/ext/vendor/exuberant-ctags/entry.h +103 -0
- data/ext/vendor/exuberant-ctags/erlang.c +189 -0
- data/ext/vendor/exuberant-ctags/flex.c +2243 -0
- data/ext/vendor/exuberant-ctags/fortran.c +2197 -0
- data/ext/vendor/exuberant-ctags/general.h +127 -0
- data/ext/vendor/exuberant-ctags/get.c +669 -0
- data/ext/vendor/exuberant-ctags/get.h +50 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/all-wcprops +47 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/entries +112 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/README.txt.svn-base +5 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regcomp.c.svn-base +3818 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.c.svn-base +74 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex.h.svn-base +575 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.c.svn-base +1713 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regex_internal.h.svn-base +773 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/.svn/text-base/regexec.c.svn-base +4338 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/README.txt +5 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regcomp.c +3818 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex.c +74 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex.h +575 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.c +1713 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regex_internal.h +773 -0
- data/ext/vendor/exuberant-ctags/gnu_regex/regexec.c +4338 -0
- data/ext/vendor/exuberant-ctags/html.c +49 -0
- data/ext/vendor/exuberant-ctags/jscript.c +1572 -0
- data/ext/vendor/exuberant-ctags/keyword.c +258 -0
- data/ext/vendor/exuberant-ctags/keyword.h +34 -0
- data/ext/vendor/exuberant-ctags/lisp.c +139 -0
- data/ext/vendor/exuberant-ctags/lregex.c +704 -0
- data/ext/vendor/exuberant-ctags/lua.c +133 -0
- data/ext/vendor/exuberant-ctags/mac.c +273 -0
- data/ext/vendor/exuberant-ctags/magic.diff +21 -0
- data/ext/vendor/exuberant-ctags/main.c +584 -0
- data/ext/vendor/exuberant-ctags/main.h +32 -0
- data/ext/vendor/exuberant-ctags/maintainer.mak +476 -0
- data/ext/vendor/exuberant-ctags/make.c +217 -0
- data/ext/vendor/exuberant-ctags/matlab.c +44 -0
- data/ext/vendor/exuberant-ctags/mk_bc3.mak +46 -0
- data/ext/vendor/exuberant-ctags/mk_bc5.mak +49 -0
- data/ext/vendor/exuberant-ctags/mk_djg.mak +18 -0
- data/ext/vendor/exuberant-ctags/mk_manx.mak +65 -0
- data/ext/vendor/exuberant-ctags/mk_mingw.mak +31 -0
- data/ext/vendor/exuberant-ctags/mk_mpw.mak +130 -0
- data/ext/vendor/exuberant-ctags/mk_mvc.mak +40 -0
- data/ext/vendor/exuberant-ctags/mk_os2.mak +104 -0
- data/ext/vendor/exuberant-ctags/mk_qdos.mak +100 -0
- data/ext/vendor/exuberant-ctags/mk_sas.mak +63 -0
- data/ext/vendor/exuberant-ctags/mkinstalldirs +40 -0
- data/ext/vendor/exuberant-ctags/ocaml.c +1842 -0
- data/ext/vendor/exuberant-ctags/options.c +1842 -0
- data/ext/vendor/exuberant-ctags/options.h +155 -0
- data/ext/vendor/exuberant-ctags/parse.c +677 -0
- data/ext/vendor/exuberant-ctags/parse.h +129 -0
- data/ext/vendor/exuberant-ctags/parsers.h +63 -0
- data/ext/vendor/exuberant-ctags/pascal.c +267 -0
- data/ext/vendor/exuberant-ctags/perl.c +382 -0
- data/ext/vendor/exuberant-ctags/php.c +237 -0
- data/ext/vendor/exuberant-ctags/python.c +771 -0
- data/ext/vendor/exuberant-ctags/qdos.c +106 -0
- data/ext/vendor/exuberant-ctags/read.c +569 -0
- data/ext/vendor/exuberant-ctags/read.h +116 -0
- data/ext/vendor/exuberant-ctags/readtags.c +959 -0
- data/ext/vendor/exuberant-ctags/readtags.h +252 -0
- data/ext/vendor/exuberant-ctags/rexx.c +39 -0
- data/ext/vendor/exuberant-ctags/routines.c +891 -0
- data/ext/vendor/exuberant-ctags/routines.h +134 -0
- data/ext/vendor/exuberant-ctags/ruby.c +408 -0
- data/ext/vendor/exuberant-ctags/scheme.c +111 -0
- data/ext/vendor/exuberant-ctags/sh.c +115 -0
- data/ext/vendor/exuberant-ctags/slang.c +41 -0
- data/ext/vendor/exuberant-ctags/sml.c +212 -0
- data/ext/vendor/exuberant-ctags/sort.c +230 -0
- data/ext/vendor/exuberant-ctags/sort.h +32 -0
- data/ext/vendor/exuberant-ctags/source.mak +122 -0
- data/ext/vendor/exuberant-ctags/sql.c +2112 -0
- data/ext/vendor/exuberant-ctags/strlist.c +281 -0
- data/ext/vendor/exuberant-ctags/strlist.h +54 -0
- data/ext/vendor/exuberant-ctags/tcl.c +116 -0
- data/ext/vendor/exuberant-ctags/tex.c +524 -0
- data/ext/vendor/exuberant-ctags/verilog.c +340 -0
- data/ext/vendor/exuberant-ctags/vhdl.c +835 -0
- data/ext/vendor/exuberant-ctags/vim.c +636 -0
- data/ext/vendor/exuberant-ctags/vstring.c +232 -0
- data/ext/vendor/exuberant-ctags/vstring.h +85 -0
- data/ext/vendor/exuberant-ctags/yacc.c +40 -0
- data/lib/ctags/exuberant.rb +45 -0
- data/lib/ctags/version.rb +3 -0
- data/lib/ctags.rb +6 -0
- data/test/test_ctags.rb +24 -0
- metadata +233 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* $Id: read.h 659 2008-04-20 23:27:48Z elliotth $
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 1998-2002, Darren Hiebert
|
|
5
|
+
*
|
|
6
|
+
* This source code is released for free distribution under the terms of the
|
|
7
|
+
* GNU General Public License.
|
|
8
|
+
*
|
|
9
|
+
* External interface to read.c
|
|
10
|
+
*/
|
|
11
|
+
#ifndef _READ_H
|
|
12
|
+
#define _READ_H
|
|
13
|
+
|
|
14
|
+
#if defined(FILE_WRITE) || defined(VAXC)
|
|
15
|
+
# define CONST_FILE
|
|
16
|
+
#else
|
|
17
|
+
# define CONST_FILE const
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
* INCLUDE FILES
|
|
22
|
+
*/
|
|
23
|
+
#include "general.h" /* must always come first */
|
|
24
|
+
|
|
25
|
+
#include <stdio.h>
|
|
26
|
+
#include <ctype.h>
|
|
27
|
+
|
|
28
|
+
#include "parse.h"
|
|
29
|
+
#include "vstring.h"
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* MACROS
|
|
33
|
+
*/
|
|
34
|
+
#define getInputLineNumber() File.lineNumber
|
|
35
|
+
#define getInputFileName() vStringValue (File.source.name)
|
|
36
|
+
#define getInputFilePosition() File.filePosition
|
|
37
|
+
#define getSourceFileName() vStringValue (File.source.name)
|
|
38
|
+
#define getSourceFileTagPath() File.source.tagPath
|
|
39
|
+
#define getSourceLanguage() File.source.language
|
|
40
|
+
#define getSourceLanguageName() getLanguageName (File.source.language)
|
|
41
|
+
#define getSourceLineNumber() File.source.lineNumber
|
|
42
|
+
#define isLanguage(lang) (boolean)((lang) == File.source.language)
|
|
43
|
+
#define isHeaderFile() File.source.isHeader
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* DATA DECLARATIONS
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
enum eCharacters {
|
|
50
|
+
/* white space characters */
|
|
51
|
+
SPACE = ' ',
|
|
52
|
+
NEWLINE = '\n',
|
|
53
|
+
CRETURN = '\r',
|
|
54
|
+
FORMFEED = '\f',
|
|
55
|
+
TAB = '\t',
|
|
56
|
+
VTAB = '\v',
|
|
57
|
+
|
|
58
|
+
/* some hard to read characters */
|
|
59
|
+
DOUBLE_QUOTE = '"',
|
|
60
|
+
SINGLE_QUOTE = '\'',
|
|
61
|
+
BACKSLASH = '\\',
|
|
62
|
+
|
|
63
|
+
STRING_SYMBOL = ('S' + 0x80),
|
|
64
|
+
CHAR_SYMBOL = ('C' + 0x80)
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/* Maintains the state of the current source file.
|
|
68
|
+
*/
|
|
69
|
+
typedef struct sInputFile {
|
|
70
|
+
vString *name; /* name of input file */
|
|
71
|
+
vString *path; /* path of input file (if any) */
|
|
72
|
+
vString *line; /* last line read from file */
|
|
73
|
+
const unsigned char* currentLine; /* current line being worked on */
|
|
74
|
+
FILE *fp; /* stream used for reading the file */
|
|
75
|
+
unsigned long lineNumber; /* line number in the input file */
|
|
76
|
+
fpos_t filePosition; /* file position of current line */
|
|
77
|
+
int ungetch; /* a single character that was ungotten */
|
|
78
|
+
boolean eof; /* have we reached the end of file? */
|
|
79
|
+
boolean newLine; /* will the next character begin a new line? */
|
|
80
|
+
langType language; /* language of input file */
|
|
81
|
+
|
|
82
|
+
/* Contains data pertaining to the original source file in which the tag
|
|
83
|
+
* was defined. This may be different from the input file when #line
|
|
84
|
+
* directives are processed (i.e. the input file is preprocessor output).
|
|
85
|
+
*/
|
|
86
|
+
struct sSource {
|
|
87
|
+
vString *name; /* name to report for source file */
|
|
88
|
+
char *tagPath; /* path of source file relative to tag file */
|
|
89
|
+
unsigned long lineNumber;/* line number in the source file */
|
|
90
|
+
boolean isHeader; /* is source file a header file? */
|
|
91
|
+
langType language; /* language of source file */
|
|
92
|
+
} source;
|
|
93
|
+
} inputFile;
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* GLOBAL VARIABLES
|
|
97
|
+
*/
|
|
98
|
+
extern CONST_FILE inputFile File;
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
* FUNCTION PROTOTYPES
|
|
102
|
+
*/
|
|
103
|
+
extern void freeSourceFileResources (void);
|
|
104
|
+
extern boolean fileOpen (const char *const fileName, const langType language);
|
|
105
|
+
extern boolean fileEOF (void);
|
|
106
|
+
extern void fileClose (void);
|
|
107
|
+
extern int fileGetc (void);
|
|
108
|
+
extern int fileSkipToCharacter (int c);
|
|
109
|
+
extern void fileUngetc (int c);
|
|
110
|
+
extern const unsigned char *fileReadLine (void);
|
|
111
|
+
extern char *readLine (vString *const vLine, FILE *const fp);
|
|
112
|
+
extern char *readSourceLine (vString *const vLine, fpos_t location, long *const pSeekValue);
|
|
113
|
+
|
|
114
|
+
#endif /* _READ_H */
|
|
115
|
+
|
|
116
|
+
/* vi:set tabstop=4 shiftwidth=4: */
|