Merge branch 'stable-3.17' of git://git.infradead.org/users/pcmoore/selinux
[cascardo/linux.git] / tools / perf / util / parse-options.h
index d8dac8a..b59ba85 100644 (file)
@@ -98,6 +98,7 @@ struct option {
        parse_opt_cb *callback;
        intptr_t defval;
        bool *set;
+       void *data;
 };
 
 #define check_vtype(v, type) ( BUILD_BUG_ON_ZERO(!__builtin_types_compatible_p(typeof(v), type)) + v )
@@ -131,6 +132,10 @@ struct option {
        { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l),\
        .value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d,\
        .flags = PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NOARG}
+#define OPT_CALLBACK_OPTARG(s, l, v, d, a, h, f) \
+       { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
+         .value = (v), (a), .help = (h), .callback = (f), \
+         .flags = PARSE_OPT_OPTARG, .data = (d) }
 
 /* parse_options() will filter out the processed options and leave the
  * non-option argments in argv[].