Browse code

Replace cmdutils_common_opts.h by a macro

Diego Biurrun authored on 2011/05/18 00:06:57
Showing 6 changed files
... ...
@@ -103,8 +103,7 @@ FFLIBS := avutil
103 103
 
104 104
 DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.avpreset)
105 105
 
106
-SKIPHEADERS = cmdutils_common_opts.h                                    \
107
-              compat/w32pthreads.h
106
+SKIPHEADERS = compat/w32pthreads.h
108 107
 
109 108
 # first so "all" becomes default target
110 109
 all: all-yes
... ...
@@ -2474,7 +2474,7 @@ fail:
2474 2474
 #define OFFSET(x) offsetof(OptionsContext, x)
2475 2475
 const OptionDef options[] = {
2476 2476
     /* main options */
2477
-#include "cmdutils_common_opts.h"
2477
+    CMDUTILS_COMMON_OPTIONS
2478 2478
     { "f",              HAS_ARG | OPT_STRING | OPT_OFFSET |
2479 2479
                         OPT_INPUT | OPT_OUTPUT,                      { .off       = OFFSET(format) },
2480 2480
         "force format", "fmt" },
... ...
@@ -2904,7 +2904,7 @@ static int opt_duration(void *optctx, const char *opt, const char *arg)
2904 2904
 
2905 2905
 #define OFF(x) offsetof(PlayerState, x)
2906 2906
 static const OptionDef options[] = {
2907
-#include "cmdutils_common_opts.h"
2907
+    CMDUTILS_COMMON_OPTIONS
2908 2908
     { "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" },
2909 2909
     { "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" },
2910 2910
     { "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" },
... ...
@@ -1094,7 +1094,7 @@ static int opt_pretty(void *optctx, const char *opt, const char *arg)
1094 1094
 }
1095 1095
 
1096 1096
 static const OptionDef real_options[] = {
1097
-#include "cmdutils_common_opts.h"
1097
+    CMDUTILS_COMMON_OPTIONS
1098 1098
     { "f", HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
1099 1099
     { "of", HAS_ARG, {.func_arg = opt_output_format}, "output the document either as ini or json", "output_format" },
1100 1100
     { "unit", OPT_BOOL, {&show_value_unit},
... ...
@@ -182,6 +182,26 @@ typedef struct OptionDef {
182 182
 void show_help_options(const OptionDef *options, const char *msg, int req_flags,
183 183
                        int rej_flags, int alt_flags);
184 184
 
185
+#define CMDUTILS_COMMON_OPTIONS                                                                                         \
186
+    { "L",           OPT_EXIT,             { .func_arg = show_license },     "show license" },                          \
187
+    { "h",           OPT_EXIT,             { .func_arg = show_help },        "show help", "topic" },                    \
188
+    { "?",           OPT_EXIT,             { .func_arg = show_help },        "show help", "topic" },                    \
189
+    { "help",        OPT_EXIT,             { .func_arg = show_help },        "show help", "topic" },                    \
190
+    { "-help",       OPT_EXIT,             { .func_arg = show_help },        "show help", "topic" },                    \
191
+    { "version",     OPT_EXIT,             { .func_arg = show_version },     "show version" },                          \
192
+    { "formats",     OPT_EXIT,             { .func_arg = show_formats },     "show available formats" },                \
193
+    { "codecs",      OPT_EXIT,             { .func_arg = show_codecs },      "show available codecs" },                 \
194
+    { "decoders",    OPT_EXIT,             { .func_arg = show_decoders },    "show available decoders" },               \
195
+    { "encoders",    OPT_EXIT,             { .func_arg = show_encoders },    "show available encoders" },               \
196
+    { "bsfs",        OPT_EXIT,             { .func_arg = show_bsfs },        "show available bit stream filters" },     \
197
+    { "protocols",   OPT_EXIT,             { .func_arg = show_protocols },   "show available protocols" },              \
198
+    { "filters",     OPT_EXIT,             { .func_arg = show_filters },     "show available filters" },                \
199
+    { "pix_fmts",    OPT_EXIT,             { .func_arg = show_pix_fmts },    "show available pixel formats" },          \
200
+    { "sample_fmts", OPT_EXIT,             { .func_arg = show_sample_fmts }, "show available audio sample formats" },   \
201
+    { "loglevel",    HAS_ARG,              { .func_arg = opt_loglevel },     "set libav* logging level", "loglevel" },  \
202
+    { "v",           HAS_ARG,              { .func_arg = opt_loglevel },     "set libav* logging level", "loglevel" },  \
203
+    { "cpuflags",    HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags },     "set CPU flags mask", "mask" },            \
204
+
185 205
 /**
186 206
  * Show help for all options with given flags in class and all its
187 207
  * children.
188 208
deleted file mode 100644
... ...
@@ -1,18 +0,0 @@
1
-    { "L"          , OPT_EXIT, {.func_arg = show_license},      "show license" },
2
-    { "h"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
3
-    { "?"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
4
-    { "help"       , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
5
-    { "-help"      , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
6
-    { "version"    , OPT_EXIT, {.func_arg = show_version},      "show version" },
7
-    { "formats"    , OPT_EXIT, {.func_arg = show_formats  },    "show available formats" },
8
-    { "codecs"     , OPT_EXIT, {.func_arg = show_codecs   },    "show available codecs" },
9
-    { "decoders"   , OPT_EXIT, {.func_arg = show_decoders },    "show available decoders" },
10
-    { "encoders"   , OPT_EXIT, {.func_arg = show_encoders },    "show available encoders" },
11
-    { "bsfs"       , OPT_EXIT, {.func_arg = show_bsfs     },    "show available bit stream filters" },
12
-    { "protocols"  , OPT_EXIT, {.func_arg = show_protocols},    "show available protocols" },
13
-    { "filters"    , OPT_EXIT, {.func_arg = show_filters  },    "show available filters" },
14
-    { "pix_fmts"   , OPT_EXIT, {.func_arg = show_pix_fmts },    "show available pixel formats" },
15
-    { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
16
-    { "loglevel"   , HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
17
-    { "v",           HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
18
-    { "cpuflags",    HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags },  "set CPU flags mask", "mask" },