summaryrefslogtreecommitdiff
path: root/cmdutils.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-29 07:54:56 +0200
committerAnton Khirnov <anton@khirnov.net>2011-09-04 13:12:00 +0200
commit6361c5e1e61033259e91b480f23ae81bed775c8b (patch)
tree5aa1a4981835e2a49e09d20eb9a58fefb8d4979f /cmdutils.h
parent2f8e586df14649ebf1538dc610928c844e0068ec (diff)
cmdutils: allow storing per-stream/chapter/.... options in a generic way
Diffstat (limited to 'cmdutils.h')
-rw-r--r--cmdutils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmdutils.h b/cmdutils.h
index f0c9079647..003c928fc6 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -108,6 +108,16 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
*/
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
+typedef struct SpecifierOpt {
+ char *specifier; /**< stream/chapter/program/... specifier */
+ union {
+ uint8_t *str;
+ int i;
+ int64_t i64;
+ float f;
+ } u;
+} SpecifierOpt;
+
typedef struct {
const char *name;
int flags;
@@ -126,6 +136,9 @@ typedef struct {
#define OPT_DATA 0x1000
#define OPT_FUNC2 0x2000
#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */
+#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt.
+ Implies OPT_OFFSET. Next element after the offset is
+ an int containing element count in the array. */
union {
void *dst_ptr;
int (*func_arg)(const char *, const char *);