📄 ctags.h
字号:
const char *path; /* -p default path for source files */
boolean recurse; /* -R recurse into directories */
boolean sorted; /* -u,--sort sort tags */
boolean xref; /* -x generate xref output instead */
const char *fileList; /* -L name of file containing names of files */
const char *tagFileName;/* -o name of tags file */
const char *const *headerExt; /* -h header extensions */
#ifdef DEBUG
int debugLevel; /* -D debugging output */
unsigned long breakLine;/* -b source line at which to call lineBreak() */
#endif
boolean startedAsEtags;
boolean braceFormat; /* use brace formatting to detect end of block */
unsigned int tagFileFormat; /* --format tag file format (level) */
boolean if0; /* --if0 examine code within "#if 0" branch */
langType language; /* --lang specified language override */
const char *const *langMap[(int)LANG_COUNT];
/* --langmap language-extension map */
boolean printTotals; /* --totals print cumulative statistics */
} optionValues;
/* Describes the type of tag being generated. This is used for debugging
* purposes only.
*/
typedef enum _tagType {
TAG_CLASS, /* class name */
TAG_DEFINE_OBJ, /* pre-processor define (object-like) */
TAG_DEFINE_FUNC, /* pre-processor define (function-like) */
TAG_ENUM, /* enumeration name */
TAG_ENUMERATOR, /* enumerator (enumeration value) */
TAG_FUNCDECL, /* function declaration */
TAG_FUNCTION, /* function (or method) definition */
TAG_INTERFACE, /* interface declaration */
TAG_MEMBER, /* structure, class or interface member */
TAG_NAMESPACE, /* namespace name */
TAG_SOURCE_FILE, /* source file */
TAG_STRUCT, /* structure name */
TAG_TYPEDEF, /* typedef name */
TAG_UNION, /* union name */
TAG_VARIABLE, /* variable definition */
TAG_EXTERN_VAR, /* external variable declaration */
TAG_NUMTYPES /* must be last */
} tagType;
#ifdef DEBUG
/* Defines the debugging levels.
*/
enum _debugLevels {
DEBUG_CPP = 1, /* echo characters out of pre-processor */
DEBUG_PARSE = 2, /* echo parsing results */
DEBUG_STATUS = 4, /* echo file status information */
DEBUG_OPTION = 8, /* echo option parsing */
DEBUG_RAW = 16 /* echo raw (filtered) characters */
};
#endif
/*----------------------------------------------------------------------------
* Used for describing a statement
*--------------------------------------------------------------------------*/
/* This describes the scoping of the current statement.
*/
typedef enum _tagScope {
SCOPE_GLOBAL, /* no storage class specified */
SCOPE_STATIC, /* static storage class */
SCOPE_EXTERN, /* external storage class */
SCOPE_FRIEND, /* declares visibility only */
SCOPE_TYPEDEF /* scoping depends upon context */
} tagScope;
/* Information about the current tag candidate.
*/
typedef struct _tagInfo {
long location; /* file position of line containing name */
unsigned long lineNumber; /* line number of tag */
char name[MaxNameLength];/* the name of the token */
} tagInfo;
typedef enum _memberType {
MEMBER_NONE,
MEMBER_ENUM, MEMBER_CLASS, MEMBER_INTERFACE, MEMBER_NAMESPACE,
MEMBER_STRUCT, MEMBER_UNION
} memberType;
typedef enum _visibilityType {
VIS_UNDEFINED, VIS_PUBLIC, VIS_PROTECTED, VIS_PRIVATE
} visibilityType;
/* Information about the parent class of a member (if any).
*/
typedef struct _memberInfo {
memberType type;
visibilityType visibility; /* current visibility section, if known */
boolean persistent; /* persistent across multiple statements? */
char parent[MaxNameLength]; /* name of the parent data type */
} memberInfo;
/* Defines the one nesting level of a preprocessor conditional.
*/
typedef struct _conditionalInfo {
boolean ignoreAllBranches; /* ignoring parent conditional branch */
boolean singleBranch; /* choose only one branch */
boolean branchChosen; /* branch already selected */
boolean ignoring; /* current ignore state */
} conditionalInfo;
/* Defines the current state of the pre-processor.
*/
typedef struct _cppState {
int ungetch; /* an ungotten character, if any */
boolean resolveRequired; /* must resolve if/else/elif/endif branch */
struct _directive {
enum _state {
DRCTV_NONE,
DRCTV_HASH,
DRCTV_IF,
DRCTV_DEFINE
} state;
boolean accept; /* is a directive syntatically permitted? */
tagInfo tag; /* the name associated with the directive */
unsigned int nestLevel; /* level 0 is not used */
conditionalInfo ifdef[MaxCppNestingLevel];
} directive;
} cppState;
/*============================================================================
= Global variables
============================================================================*/
extern tagFile TagFile;
extern sourceFile File;
extern optionValues Option;
extern cppState Cpp;
extern memberInfo NoClass;
/*============================================================================
= Function prototypes
============================================================================*/
extern void error __ARGS(( const errorSelection selection,
const char *const format, ... ));
extern unsigned long getFileSize __ARGS((const char *const name));
extern boolean isNormalFile __ARGS((const char *const name));
extern boolean isDirectory __ARGS((const char *const name));
extern boolean doesFileExist __ARGS((const char *const fileName));
extern void addTotals __ARGS(( const unsigned int files, const unsigned long lines, const unsigned long bytes));
extern char *readLine __ARGS((lineBuf *const pLineBuf, FILE *const fp));
extern const char *getExecutableName __ARGS((void));
extern const char *getTypeString __ARGS((const memberType mType));
extern const char *getVisibilityString __ARGS((const visibilityType visibility));
extern void makeTag __ARGS((const tagInfo *const tag,
const memberInfo *const pMember,
const tagScope scope, const tagType type));
extern void makeDefineTag __ARGS((const tagInfo *const tag,
const tagScope scope,
const boolean parameterized));
extern const char *tagTypeName __ARGS((const tagType type));
extern void addPseudoTags __ARGS((void));
extern unsigned long updatePseudoTags __ARGS((void));
extern boolean cppOpen __ARGS((const char *const name, const langType language, const boolean isHeader));
extern void cppClose __ARGS((void));
extern void cppUngetc __ARGS((const int c));
extern int cppGetc __ARGS((void));
extern boolean createTags __ARGS((const unsigned int nesting, const void *const parent));
extern void buildKeywordHash __ARGS((void));
extern boolean fileOpen __ARGS((const char *const name, const langType language, const boolean isHeader));
extern void fileClose __ARGS((void));
extern int fileGetc __ARGS((void));
extern void fileUngetc __ARGS((int c));
extern void freeLineBuffer __ARGS((lineBuf *const pLine));
extern char *getSourceLine __ARGS((lineBuf *const pLineBuffer, const long int location));
extern boolean isIgnoreToken __ARGS((const char *const name));
extern void freeIgnoreList __ARGS((void));
extern const char *getLanguageName __ARGS((const langType language));
extern boolean strequiv __ARGS((const char *s1, const char *s2));
extern char *const *parseOptions __ARGS((char *const *const argList));
extern void *parseEnvironmentOptions __ARGS((void));
extern void catFile __ARGS((const char *const name));
#ifdef EXTERNAL_SORT
extern void externalSortTags __ARGS((const boolean toStdout));
#else
extern void internalSortTags __ARGS((const boolean toStdout));
#endif
#ifdef DEBUG
extern void lineBreak __ARGS((void));
extern void debugPrintf __ARGS((const enum _debugLevels level, const char *const format, ... ));
extern void debugOpen __ARGS((const char *const fileName, const boolean isHeader, const langType language));
extern void debugPutc __ARGS((const int c, const int level));
extern void debugEntry __ARGS((const tagScope scope, const tagType type, const char *const tagName, const memberInfo *const pMember));
extern void debugParseNest __ARGS((const boolean increase, const unsigned int level));
extern void debugCppNest __ARGS((const boolean begin, const unsigned int ignore));
extern void debugCppIgnore __ARGS((const boolean ignore));
extern void clearString __ARGS((char *const string, const int length));
#endif
/* Possibly missing system prototypes.
*/
#if defined(NEED_PROTO_REMOVE) && defined(HAVE_REMOVE)
extern int remove __ARGS((const char *));
#endif
#if defined(NEED_PROTO_UNLINK) && !defined(HAVE_REMOVE)
extern void *unlink __ARGS((const char *));
#endif
#ifdef NEED_PROTO_MALLOC
extern void *malloc __ARGS((size_t));
#endif
#ifdef NEED_PROTO_GETENV
extern char *getenv __ARGS((const char *));
#endif
#ifdef NEED_PROTO_STRSTR
extern char *strstr __ARGS((const char *str, const char *substr));
#endif
/* vi:set tabstop=8 shiftwidth=4: */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -