3 # Ref: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5924
5 # FF: uncrustify config file for Wireshark (based on cheese-indent.cfg and
6 # linux.cfg... taken somewhere from the Net)
7 # http://uncrustify.sourceforge.net/
10 # uncrustify -c ../../tools/ws-coding-style.cfg --replace packet-dccp.c
13 # The number of columns to indent per level.
14 # Usually 2, 3, 4, or 8.
15 indent_columns = 4 # number, FF: 8 on linux
17 # How to use tabs when indenting code
19 # 1=indent with tabs, align with spaces
20 # 2=indent and align with tabs
21 indent_with_tabs = 0 # number, FF: spaces only, questionable... as
22 # everything about this topic :-)
24 # Spaces to indent '{' from level
25 indent_brace = 0 # number
27 # Spaces to indent 'case' from 'switch'
28 # Usually 0 or indent_columns.
29 indent_switch_case = 0 #indent_columns # number
31 # Add or remove space around arithmetic operator '+', '-', '/', '*', etc
32 sp_arith = force # ignore/add/remove/force
34 # Add or remove space around assignment operator '=', '+=', etc
35 sp_assign = force # ignore/add/remove/force
37 # Add or remove space around assignment '=' in enum
38 sp_enum_assign = force # ignore/add/remove/force
40 # Add or remove space around boolean operators '&&' and '||'
41 sp_bool = force # ignore/add/remove/force
43 # Add or remove space around compare operator '<', '>', '==', etc
44 sp_compare = force # ignore/add/remove/force
46 # Add or remove space inside '(' and ')'
47 sp_inside_paren = remove # ignore/add/remove/force
49 # Add or remove space between nested parens
50 sp_paren_paren = remove # ignore/add/remove/force
52 # Add or remove space before pointer star '*'
53 sp_before_ptr_star = force # ignore/add/remove/force
55 # Add or remove space between pointer stars '*'
56 sp_between_ptr_star = remove # ignore/add/remove/force
58 # Add or remove space after pointer star '*', if followed by a word.
59 sp_after_ptr_star = remove # ignore/add/remove/force
61 # Add or remove space before reference sign '&'
62 sp_before_byref = force # ignore/add/remove/force
64 # Add or remove space after reference sign '&', if followed by a word.
65 sp_after_byref = remove # ignore/add/remove/force
67 # Add or remove space between type and word
68 sp_after_type = force # ignore/add/remove/force
70 # Add or remove space before '(' of 'if', 'for', 'switch', and 'while'
71 sp_before_sparen = force # ignore/add/remove/force
73 # Add or remove space inside if-condition '(' and ')'
74 sp_inside_sparen = remove # ignore/add/remove/force
76 # Add or remove space after ')' of 'if', 'for', 'switch', and 'while'
77 sp_after_sparen = force # ignore/add/remove/force
79 # Add or remove space between ')' and '{' of 'if', 'for', 'switch', and 'while'
80 sp_sparen_brace = force # ignore/add/remove/force
82 # Add or remove space before empty statement ';' on 'if', 'for' and 'while'
83 sp_special_semi = remove # ignore/add/remove/force
85 # Add or remove space before ';'
86 sp_before_semi = remove # ignore/add/remove/force
88 # Add or remove space before ';' in non-empty 'for' statements
89 sp_before_semi_for = remove # ignore/add/remove/force
91 # Add or remove space inside '[' and ']'
92 sp_inside_square = remove # ignore/add/remove/force
94 # Add or remove space before '[' (except '[]')
95 sp_before_square = remove # ignore/add/remove/force
97 # Add or remove space before '[]'
98 sp_before_squares = remove # ignore/add/remove/force
100 # Add or remove space after ','
101 sp_after_comma = force # ignore/add/remove/force
103 # Add or remove space before ','
104 sp_before_comma = remove # ignore/add/remove/force
106 # Add or remove space after C/D cast, ie 'cast(int)a' vs 'cast(int) a' or '(int)a' vs '(int) a'
107 sp_after_cast = force # ignore/add/remove/force
109 # Add or remove spaces inside cast parens
110 sp_inside_paren_cast = remove # ignore/add/remove/force
112 # Add or remove space between 'sizeof' and '('
113 sp_sizeof_paren = force # ignore/add/remove/force
115 # Add or remove space inside '{' and '}'
116 sp_inside_braces = remove # ignore/add/remove/force
118 # Add or remove space inside '{}'
119 sp_inside_braces_empty = remove # ignore/add/remove/force
121 # Add or remove space inside enum '{' and '}'
122 sp_inside_braces_enum = remove # ignore/add/remove/force
124 # Add or remove space inside struct/union '{' and '}'
125 sp_inside_braces_struct = remove # ignore/add/remove/force
127 # Add or remove space between function name and '(' on function declaration
128 sp_func_proto_paren = remove # ignore/add/remove/force, FF was force
130 # Add or remove space between function name and '(' on function definition
131 sp_func_def_paren = remove # ignore/add/remove/force, FF was force
133 # Add or remove space inside empty function '()'
134 sp_inside_fparens = remove # ignore/add/remove/force
136 # Add or remove space inside function '(' and ')'
137 sp_inside_fparen = remove # ignore/add/remove/force
139 # Add or remove space between function name and '(' on function calls
140 sp_func_call_paren = remove # ignore/add/remove/force, FF: was 'force'
141 sp_func_call_user_paren = remove # ignore/add/remove/force
142 set func_call_user _ N_
144 # Add or remove space between 'return' and '('
145 sp_return_paren = force # ignore/add/remove/force
147 # Add or remove space between 'defined' and '(' in '#if defined (FOO)'
148 sp_defined_paren = force # ignore/add/remove/force
150 # Add or remove space between macro and value
151 sp_macro = force # ignore/add/remove/force
153 # Add or remove space between macro function ')' and value
154 sp_macro_func = force # ignore/add/remove/force
156 # Add or remove space around the ':' in 'b ? t : f'
157 sp_cond_colon = force # ignore/add/remove/force
159 # Add or remove space around the '?' in 'b ? t : f'
160 sp_cond_question = force # ignore/add/remove/force
162 # Add or remove space before a semicolon of an empty part of a for statment.
163 sp_before_semi_for_empty = force # ignore/add/remove/force
165 # How to align the star in variable definitions.
167 # 1=Part of the variable
169 align_var_def_star_style = 2 # number (FF: see align_typedef_star_style)
171 # How to align the '&' in variable definitions.
173 # 1=Part of the variable
175 align_var_def_amp_style = 2 # number
177 # Align variable definitions in prototypes and functions
178 align_func_params = true # false/true
180 # Whether to align the colon in struct bit fields
181 align_var_def_colon = true # false/true
183 # Whether to align inline struct/enum/union variable definitions
184 align_var_def_inline = true # false/true
186 # The span for aligning function prototypes (0=don't align)
187 align_func_proto_span = 1 # number
189 # The span for aligning on '#define' bodies (0=don't align)
190 align_pp_define_span = 0 # number
192 # Controls the positioning of the '*' in typedefs. Just try it.
193 # 0: Align on typdef type, ignore '*'
194 # 1: The '*' is part of type name: typedef int *pint;
195 # 2: The '*' is part of the type, but dangling: typedef int *pint;
196 align_typedef_star_style = 2 # number
198 # Controls the positioning of the '&' in typedefs. Just try it.
199 # 0: Align on typdef type, ignore '&'
200 # 1: The '&' is part of type name: typedef int &pint;
201 # 2: The '&' is part of the type, but dangling: typedef int &pint;
202 align_typedef_amp_style = 2 # number
204 # Whether to align macros wrapped with a backslash and a newline.
205 # This will not work right if the macro contains a multi-line comment.
206 align_nl_cont = true # false/true
208 # The span for aligning struct/union (0=don't align)
209 align_var_struct_span = 1 # number
211 # The threshold for aligning struct/union member definitions (0=no limit)
212 align_var_struct_thresh = 1 # number
214 # The gap for aligning struct/union member definitions
215 align_var_struct_gap = 1 # number
217 # The span for aligning struct initializer values (0=don't align)
218 align_struct_init_span = 1 # number
220 # The gap for aligning variable definitions
221 align_var_def_gap = 1 # number
223 # The span for aligning on '=' in assignments (0=don't align)
224 align_assign_span = 0 # number
226 # The span for aligning on '=' in enums (0=don't align)
227 align_enum_equ_span = 0 # number
229 # The span for aligning variable definitions (0=don't align)
230 align_var_def_span = 0 # number
232 # Add or remove newline at the end of the file
233 nl_end_of_file = force # ignore/add/remove/force
235 # The number of newlines at the end of the file (only used if nl_end_of_file is 'add' or 'force')
236 nl_end_of_file_min = 1 # number
238 # Add or remove newline between '=' and '{'
239 nl_assign_brace = remove # ignore/add/remove/force
241 # Add or remove newline between 'enum' and '{'
242 nl_enum_brace = force # ignore/add/remove/force
244 # Add or remove newline between 'struct and '{'
245 nl_struct_brace = force # ignore/add/remove/force
247 # Add or remove newline between 'union' and '{'
248 nl_union_brace = force # ignore/add/remove/force
250 # Add or remove newline between 'if' and '{'
251 nl_if_brace = remove # ignore/add/remove/force, FF: was 'force'
253 # Add or remove newline between '}' and 'else'
254 nl_brace_else = remove # ignore/add/remove/force, FF: was 'force'
256 # Add or remove newline between a function call's ')' and '{', as in:
257 # list_for_each(item, &list) { }
258 nl_fcall_brace = force # ignore/add/remove/force
260 # Add or remove newline between 'else if' and '{'
261 # If set to ignore, nl_if_brace is used instead
262 nl_elseif_brace = remove # ignore/add/remove/force, FF: was 'force'
264 # Add or remove newline between 'else' and '{'
265 nl_else_brace = remove # ignore/add/remove/force, FF: was 'force'
267 # Add or remove newline between 'else' and 'if'
268 nl_else_if = remove # ignore/add/remove/force
270 # Add or remove newline between 'for' and '{'
271 nl_for_brace = force # ignore/add/remove/force
273 # Add or remove newline between 'while' and '{'
274 nl_while_brace = remove # ignore/add/remove/force, FF: was 'force'
276 # Add or remove newline between 'do' and '{'
277 nl_do_brace = force # ignore/add/remove/force
279 # Add or remove newline between '}' and 'while' of 'do' statement
280 nl_brace_while = force # ignore/add/remove/force
282 # Add or remove newline between 'switch' and '{'
283 nl_switch_brace = remove # ignore/add/remove/force
285 # Add or remove newline between return type and function name in definition
286 nl_func_type_name = force # ignore/add/remove/force
288 # Add or remove newline between return type and function name in a prototype
289 nl_func_proto_type_name = remove # ignore/add/remove/force
291 # Add or remove newline between a function name and the opening '('
292 nl_func_paren = remove # ignore/add/remove/force
294 # Add or remove newline after '(' in a function declaration
295 nl_func_decl_start = remove # ignore/add/remove/force
297 # Add or remove newline after each ',' in a function declaration
298 nl_func_decl_args = ignore # ignore/add/remove/force
300 # Add or remove newline before the ')' in a function declaration
301 nl_func_decl_end = remove # ignore/add/remove/force
303 # Add or remove newline between function signature and '{'
304 nl_fdef_brace = force # ignore/add/remove/force
306 # The number of newlines after '}' of a multi-line function body
307 nl_after_func_body = 2 # number
309 # The number of newlines after '}' of a single line function body
310 nl_after_func_body_one_liner = 2 # number
312 # The number of newlines after a block of variable definitions
313 nl_func_var_def_blk = 1 # number
315 # The minimum number of newlines before a multi-line comment.
316 # Doesn't apply if after a brace open or another multi-line comment.
317 nl_before_block_comment = 2 # number
319 # The minimum number of newlines before a single-line C comment.
320 # Doesn't apply if after a brace open or other single-line C comments.
321 nl_before_c_comment = 2 # number
323 # The minimum number of newlines before a CPP comment.
324 # Doesn't apply if after a brace open or other CPP comments.
325 nl_before_cpp_comment = 2 # number
327 # Don't touch one-line braced assignments - 'foo_t f = { 1, 2 };'
328 nl_assign_leave_one_liners = true # false/true
330 # Whether to not put blanks after '#ifxx', '#elxx', or before '#endif'
331 nl_squeeze_ifdef = true # false/true
333 # Whether to remove blank lines after '{'
334 eat_blanks_after_open_brace = true # false/true
336 # Whether to remove blank lines before '}'
337 eat_blanks_before_close_brace = true # false/true
339 # Whether to put a star on subsequent comment lines
340 cmt_star_cont = true # false/true
342 # Whether to group c-comments that look like they are in a block
343 cmt_c_group = true # false/true
345 # Whether to group cpp-comments that look like they are in a block
346 cmt_cpp_group = false # false/true
348 # Whether to change cpp-comments into c-comments
349 cmt_cpp_to_c = true # false/true
351 # If pp_indent_at_level=false, specifies the number of columns to indent per
353 pp_indent_count = indent_columns # number
355 # Add or remove indent of preprocessor directives
356 pp_indent = remove # ignore/add/remove/force FF: was 'force'
358 # Try to limit code width to N number of columns
359 code_width = 80 # number
361 # Whether to fully split long function protos/calls at commas
362 ls_func_split_full = false # false/true, FF: was 'true'