forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
field.h
105 lines (85 loc) · 2.15 KB
/
field.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
*
* Copyright (c) 2015, Red Hat, Inc.
* Copyright (c) 2015, Masatake YAMATO
*
* Author: Masatake YAMATO <[email protected]>
*
* This source code is released for free distribution under the terms of the
* GNU General Public License version 2 or (at your option) any later version.
*
*/
#ifndef CTAGS_MAIN_FIELD_H
#define CTAGS_MAIN_FIELD_H
/*
* INCLUDE FILES
*/
#include "general.h"
#include "types.h"
#include "vstring.h"
/*
* DATA DECLARATIONS
*/
typedef enum eFieldType { /* extension field content control */
FIELD_UNKNOWN = -1,
/* BASIC FIELDS */
FIELD_NAME,
FIELD_INPUT_FILE,
FIELD_PATTERN,
FIELD_COMPACT_INPUT_LINE,
/* EXTENSION FIELDS */
FIELD_EXTENSION_START,
FIELD_ACCESS = FIELD_EXTENSION_START,
FIELD_FILE_SCOPE,
FIELD_INHERITANCE,
FIELD_KIND_LONG,
FIELD_KIND,
FIELD_LANGUAGE,
FIELD_IMPLEMENTATION,
FIELD_LINE_NUMBER,
FIELD_SIGNATURE,
FIELD_SCOPE,
FIELD_TYPE_REF,
FIELD_KIND_KEY,
/* EXTENSION FIELDS NEWLY INTRODUCED IN UCTAGS */
FIELD_ROLES,
FIELD_REF_MARK,
FIELD_SCOPE_KEY,
FIELD_EXTRAS,
FIELD_XPATH,
FIELD_SCOPE_KIND_LONG,
FIELD_END_LINE,
FIELD_BUILTIN_LAST = FIELD_END_LINE,
} fieldType ;
#define fieldDataTypeFalgs "sib" /* used in --list-fields */
typedef enum eFieldDataType {
FIELDTYPE_STRING = 1 << 0,
FIELDTYPE_INTEGER = 1 << 1,
FIELDTYPE_BOOL = 1 << 2,
/* used in --list-fields */
FIELDTYPE_END_MARKER = 1 << 3,
} fieldDataType;
typedef const char* (*fieldRenderer)(const tagEntryInfo *const,
const char *,
vString *);
#define FIELD_LETTER_NO_USE '\0'
struct sFieldDefinition {
/* letter, and ftype are initialized in the main part,
not in a parser. */
#define NUL_FIELD_LETTER '\0'
unsigned char letter;
const char* name;
const char* description;
bool enabled;
fieldRenderer render;
fieldRenderer renderNoEscaping;
bool (* doesContainAnyChar) (const tagEntryInfo *const, const char*, const char *);
bool (* isValueAvailable) (const tagEntryInfo *const);
fieldDataType dataType; /* used in json output */
unsigned int ftype; /* Given from the main part */
};
/*
* FUNCTION PROTOTYPES
*/
extern bool isFieldEnabled (fieldType type);
#endif /* CTAGS_MAIN_FIELD_H */