aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd/fuse_opt.h
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2019-12-09 19:53:47 +0000
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-23 16:41:36 +0000
commit7387863d033e8028aa09a815736617a7c4490827 (patch)
tree82a8c5dc4298c99fb950bef908ccda357e5aa2a8 /tools/virtiofsd/fuse_opt.h
parenta3e23f325439a290c504d6bbc48c2e742149ecab (diff)
virtiofsd: Format imported files to qemu style
Mostly using a set like: indent -nut -i 4 -nlp -br -cs -ce --no-space-after-function-call-names file clang-format -style=file -i -- file clang-tidy -fix-errors -checks=readability-braces-around-statements file clang-format -style=file -i -- file With manual cleanups. The .clang-format used is below. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com> Language: Cpp AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false # although we like it, it creates churn AlignConsecutiveDeclarations: false AlignEscapedNewlinesLeft: true AlignOperands: true AlignTrailingComments: false # churn AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None # AlwaysBreakAfterDefinitionReturnType is taken into account AlwaysBreakBeforeMultilineStrings: false BinPackArguments: true BinPackParameters: true BraceWrapping: AfterControlStatement: false AfterEnum: false AfterFunction: true AfterStruct: false AfterUnion: false BeforeElse: false IndentBraces: false BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeTernaryOperators: false BreakStringLiterals: true ColumnLimit: 80 ContinuationIndentWidth: 4 Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false ForEachMacros: [ 'CPU_FOREACH', 'CPU_FOREACH_REVERSE', 'CPU_FOREACH_SAFE', 'IOMMU_NOTIFIER_FOREACH', 'QLIST_FOREACH', 'QLIST_FOREACH_ENTRY', 'QLIST_FOREACH_RCU', 'QLIST_FOREACH_SAFE', 'QLIST_FOREACH_SAFE_RCU', 'QSIMPLEQ_FOREACH', 'QSIMPLEQ_FOREACH_SAFE', 'QSLIST_FOREACH', 'QSLIST_FOREACH_SAFE', 'QTAILQ_FOREACH', 'QTAILQ_FOREACH_REVERSE', 'QTAILQ_FOREACH_SAFE', 'QTAILQ_RAW_FOREACH', 'RAMBLOCK_FOREACH' ] IncludeCategories: - Regex: '^"qemu/osdep.h' Priority: -3 - Regex: '^"(block|chardev|crypto|disas|exec|fpu|hw|io|libdecnumber|migration|monitor|net|qapi|qemu|qom|standard-headers|sysemu|ui)/' Priority: -2 - Regex: '^"(elf.h|qemu-common.h|glib-compat.h|qemu-io.h|trace-tcg.h)' Priority: -1 - Regex: '.*' Priority: 1 IncludeIsMainRegex: '$' IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false KeepEmptyLinesAtTheStartOfBlocks: false MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ? MacroBlockEnd: '.*_END$' MaxEmptyLinesToKeep: 2 PointerAlignment: Right ReflowComments: true SortIncludes: true SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInContainerLiterals: true SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Auto UseTab: Never ... Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/fuse_opt.h')
-rw-r--r--tools/virtiofsd/fuse_opt.h79
1 files changed, 44 insertions, 35 deletions
diff --git a/tools/virtiofsd/fuse_opt.h b/tools/virtiofsd/fuse_opt.h
index 69102555be..8f59b4d301 100644
--- a/tools/virtiofsd/fuse_opt.h
+++ b/tools/virtiofsd/fuse_opt.h
@@ -1,10 +1,10 @@
/*
- FUSE: Filesystem in Userspace
- Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
-
- This program can be distributed under the terms of the GNU LGPLv2.
- See the file COPYING.LIB.
-*/
+ * FUSE: Filesystem in Userspace
+ * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
+ *
+ * This program can be distributed under the terms of the GNU LGPLv2.
+ * See the file COPYING.LIB.
+ */
#ifndef FUSE_OPT_H_
#define FUSE_OPT_H_
@@ -37,7 +37,7 @@
*
* - 'offsetof(struct foo, member)' actions i) and iii)
*
- * - -1 action ii)
+ * - -1 action ii)
*
* The 'offsetof()' macro is defined in the <stddef.h> header.
*
@@ -48,7 +48,7 @@
*
* The types of templates are:
*
- * 1) "-x", "-foo", "--foo", "--foo-bar", etc. These match only
+ * 1) "-x", "-foo", "--foo", "--foo-bar", etc. These match only
* themselves. Invalid values are "--" and anything beginning
* with "-o"
*
@@ -71,58 +71,67 @@
* freed.
*/
struct fuse_opt {
- /** Matching template and optional parameter formatting */
- const char *templ;
+ /** Matching template and optional parameter formatting */
+ const char *templ;
- /**
- * Offset of variable within 'data' parameter of fuse_opt_parse()
- * or -1
- */
- unsigned long offset;
+ /**
+ * Offset of variable within 'data' parameter of fuse_opt_parse()
+ * or -1
+ */
+ unsigned long offset;
- /**
- * Value to set the variable to, or to be passed as 'key' to the
- * processing function. Ignored if template has a format
- */
- int value;
+ /**
+ * Value to set the variable to, or to be passed as 'key' to the
+ * processing function. Ignored if template has a format
+ */
+ int value;
};
/**
- * Key option. In case of a match, the processing function will be
+ * Key option. In case of a match, the processing function will be
* called with the specified key.
*/
-#define FUSE_OPT_KEY(templ, key) { templ, -1U, key }
+#define FUSE_OPT_KEY(templ, key) \
+ { \
+ templ, -1U, key \
+ }
/**
- * Last option. An array of 'struct fuse_opt' must end with a NULL
+ * Last option. An array of 'struct fuse_opt' must end with a NULL
* template value
*/
-#define FUSE_OPT_END { NULL, 0, 0 }
+#define FUSE_OPT_END \
+ { \
+ NULL, 0, 0 \
+ }
/**
* Argument list
*/
struct fuse_args {
- /** Argument count */
- int argc;
+ /** Argument count */
+ int argc;
- /** Argument vector. NULL terminated */
- char **argv;
+ /** Argument vector. NULL terminated */
+ char **argv;
- /** Is 'argv' allocated? */
- int allocated;
+ /** Is 'argv' allocated? */
+ int allocated;
};
/**
* Initializer for 'struct fuse_args'
*/
-#define FUSE_ARGS_INIT(argc, argv) { argc, argv, 0 }
+#define FUSE_ARGS_INIT(argc, argv) \
+ { \
+ argc, argv, 0 \
+ }
/**
* Key value passed to the processing function if an option did not
* match any template
*/
-#define FUSE_OPT_KEY_OPT -1
+#define FUSE_OPT_KEY_OPT -1
/**
* Key value passed to the processing function for all non-options
@@ -130,7 +139,7 @@ struct fuse_args {
* Non-options are the arguments beginning with a character other than
* '-' or all arguments after the special '--' option
*/
-#define FUSE_OPT_KEY_NONOPT -2
+#define FUSE_OPT_KEY_NONOPT -2
/**
* Special key value for options to keep
@@ -174,7 +183,7 @@ struct fuse_args {
* @return -1 on error, 0 if arg is to be discarded, 1 if arg should be kept
*/
typedef int (*fuse_opt_proc_t)(void *data, const char *arg, int key,
- struct fuse_args *outargs);
+ struct fuse_args *outargs);
/**
* Option parsing function
@@ -197,7 +206,7 @@ typedef int (*fuse_opt_proc_t)(void *data, const char *arg, int key,
* @return -1 on error, 0 on success
*/
int fuse_opt_parse(struct fuse_args *args, void *data,
- const struct fuse_opt opts[], fuse_opt_proc_t proc);
+ const struct fuse_opt opts[], fuse_opt_proc_t proc);
/**
* Add an option to a comma separated option list