-
Notifications
You must be signed in to change notification settings - Fork 3
/
style.h
139 lines (130 loc) · 3.34 KB
/
style.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
struct arena;
struct arena_scope;
struct buffer;
struct options;
struct style;
/* Supported clang format options and values. */
#define FOR_STYLES(OP) \
OP(After) \
OP(Align) \
OP(AlignAfterOpenBracket) \
OP(AlignAfterOperator) \
OP(AlignEscapedNewlines) \
OP(AlignOperands) \
OP(AlignWithSpaces) \
OP(All) \
OP(AllDefinitions) \
OP(Always) \
OP(AlwaysBreak) \
OP(AlwaysBreakAfterReturnType) \
OP(BasedOnStyle) \
OP(Chromium) \
OP(Google) \
OP(InheritParentConfig) \
OP(LLVM) \
OP(Microsoft) \
OP(OpenBSD) \
OP(Before) \
OP(BitFieldColonSpacing) \
OP(BlockIndent) \
OP(Both) \
OP(BraceWrapping) \
OP(AfterCaseLabel) \
OP(AfterClass) \
OP(AfterControlStatement) \
OP(AfterEnum) \
OP(AfterExternBlock) \
OP(AfterFunction) \
OP(AfterNamespace) \
OP(AfterObjCDeclaration) \
OP(AfterStruct) \
OP(AfterUnion) \
OP(BeforeCatch) \
OP(BeforeElse) \
OP(BeforeLambdaBody) \
OP(BeforeWhile) \
OP(IndentBraces) \
OP(SplitEmptyFunction) \
OP(SplitEmptyNamespace) \
OP(SplitEmptyRecord) \
OP(BreakBeforeBinaryOperators) \
OP(Allman) \
OP(Attach) \
OP(Custom) \
OP(GNU) \
OP(Linux) \
OP(Mozilla) \
OP(Stroustrup) \
OP(WebKit) \
OP(Whitesmiths) \
OP(BreakBeforeBraces) \
OP(BreakBeforeTernaryOperators) \
OP(CaseInsensitive) \
OP(CaseSensitive) \
OP(ColumnLimit) \
OP(ContinuationIndentWidth) \
OP(DontAlign) \
OP(False) \
OP(ForContinuationAndIndentation) \
OP(ForIndentation) \
OP(IncludeBlocks) \
OP(Merge) \
OP(Preserve) \
OP(Regroup) \
OP(IncludeCategories) \
OP(IncludeGuards) \
OP(IndentWidth) \
OP(Language) \
OP(Cpp) \
OP(CSharp) \
OP(Java) \
OP(JavaScript) \
OP(Json) \
OP(ObjC) \
OP(Proto) \
OP(TableGen) \
OP(TextProto) \
OP(Verilog) \
OP(Left) \
OP(MultiLine) \
OP(Never) \
OP(NonAssignment) \
OP(None) \
OP(Priority) \
OP(Regex) \
OP(Right) \
OP(SortIncludes) \
OP(SortPriority) \
OP(TopLevel) \
OP(TopLevelDefinitions) \
OP(True) \
OP(UseTab)
enum style_keyword {
First = 1,
#define DO(style) style,
FOR_STYLES(DO)
#undef DO
Last,
};
struct include_priority {
int group;
int sort;
};
void style_init(void);
void style_shutdown(void);
void style_dump_keywords(struct buffer *);
struct style *style_parse(const char *, struct arena_scope *,
struct arena *, const struct options *);
struct style *style_parse_buffer(const struct buffer *, const char *,
struct arena_scope *, struct arena *, const struct options *);
unsigned int style(const struct style *, int);
int style_brace_wrapping(const struct style *, int);
int *style_include_priorities(const struct style *);
struct include_priority style_include_priority(const struct style *,
const char *);
const char *style_keyword_str(enum style_keyword);
static inline int
style_use_tabs(const struct style *st)
{
return style(st, UseTab) != Never;
}