2
* $Id: options.h,v 1.12 2006/05/30 04:37:12 darren Exp $
4
* Copyright (c) 1998-2003, Darren Hiebert
6
* This source code is released for free distribution under the terms of the
7
* GNU General Public License.
9
* Defines external interface to option processing.
14
#if defined(OPTION_WRITE) || defined(VAXC)
17
# define CONST_OPTION const
23
#include "general.h" /* must always come first */
36
typedef enum { OPTION_NONE, OPTION_SHORT, OPTION_LONG } optionType;
38
typedef struct sCookedArgs {
45
const char* parameter;
50
typedef enum eLocate {
51
EX_MIX, /* line numbers for defines, patterns otherwise */
52
EX_LINENUM, /* -n only line numbers in tag file */
53
EX_PATTERN /* -N only patterns in tag file */
56
typedef enum sortType {
63
boolean fileNames; /* include tags for source file names */
64
boolean qualifiedTags; /* include tags for qualified class members */
65
boolean fileScope; /* include tags of file scope only */
68
struct sExtFields { /* extension field content control */
71
boolean implementation;
83
/* This stores the command line options.
85
typedef struct sOptionValues {
86
struct sInclude include;/* --extra extra tag inclusion */
87
struct sExtFields extensionFields;/* --fields extension field control */
88
stringList* ignore; /* -I name of file containing tokens to ignore */
89
boolean append; /* -a append to "tags" file */
90
boolean backward; /* -B regexp patterns search backwards */
91
boolean etags; /* -e output Emacs style tags file */
92
exCmd locate; /* --excmd EX command used to locate tag */
93
boolean recurse; /* -R recurse into directories */
94
sortType sorted; /* -u,--sort sort tags */
95
boolean verbose; /* -V verbose */
96
boolean xref; /* -x generate xref output instead */
97
char *fileList; /* -L name of file containing names of files */
98
char *tagFileName; /* -o name of tags file */
99
stringList* headerExt; /* -h header extensions */
100
stringList* etagsInclude;/* --etags-include list of TAGS files to include*/
101
unsigned int tagFileFormat;/* --format tag file format (level) */
102
boolean if0; /* --if0 examine code within "#if 0" branch */
103
boolean kindLong; /* --kind-long */
104
langType language; /* --lang specified language override */
105
boolean followLinks; /* --link follow symbolic links? */
106
boolean filter; /* --filter behave as filter: files in, tags out */
107
char* filterTerminator; /* --filter-terminator string to output */
108
boolean tagRelative; /* --tag-relative file paths relative to tag file */
109
boolean printTotals; /* --totals print cumulative statistics */
110
boolean lineDirectives; /* --linedirectives process #line directives */
112
long debugLevel; /* -D debugging output */
113
unsigned long breakLine;/* -b source line at which to call lineBreak() */
120
extern CONST_OPTION optionValues Option;
123
* FUNCTION PROTOTYPES
125
extern void verbose (const char *const format, ...) __printf__ (1, 2);
126
extern void freeList (stringList** const pString);
127
extern void setDefaultTagFileName (void);
128
extern void checkOptions (void);
129
extern boolean filesRequired (void);
130
extern void testEtagsInvocation (void);
132
extern cookedArgs* cArgNewFromString (const char* string);
133
extern cookedArgs* cArgNewFromArgv (char* const* const argv);
134
extern cookedArgs* cArgNewFromFile (FILE* const fp);
135
extern cookedArgs* cArgNewFromLineFile (FILE* const fp);
136
extern void cArgDelete (cookedArgs* const current);
137
extern boolean cArgOff (cookedArgs* const current);
138
extern boolean cArgIsOption (cookedArgs* const current);
139
extern const char* cArgItem (cookedArgs* const current);
140
extern void cArgForth (cookedArgs* const current);
142
extern boolean isExcludedFile (const char* const name);
143
extern boolean isIncludeFile (const char *const fileName);
144
extern boolean isIgnoreToken (const char *const name, boolean *const pIgnoreParens, const char **const replacement);
145
extern void parseOption (cookedArgs* const cargs);
146
extern void parseOptions (cookedArgs* const cargs);
147
extern void previewFirstOption (cookedArgs* const cargs);
148
extern void readOptionConfiguration (void);
149
extern void initOptions (void);
150
extern void freeOptionResources (void);
152
#endif /* _OPTIONS_H */
154
/* vi:set tabstop=4 shiftwidth=4: */