Partial (low bits ignored, no direct transcoding into other RGB formats) support
[mplayer/glamo.git] / subopt-helper.h
blob18c6b4bf86f9646131cf1c4fcb8e1d708916c79e
1 #ifndef MPLAYER_SUBOPT_HELPER_H
2 #define MPLAYER_SUBOPT_HELPER_H
4 /**
5 * \file subopt-helper.h
7 * \brief Datatype and functions declarations for usage
8 * of the suboption parser.
12 #define OPT_ARG_BOOL 0
13 #define OPT_ARG_INT 1
14 #define OPT_ARG_STR 2
15 #define OPT_ARG_MSTRZ 3 ///< A malloced, zero terminated string, use free()!
16 #define OPT_ARG_FLOAT 4
18 typedef int (*opt_test_f)(void *);
20 /** simple structure for defining the option name, type and storage location */
21 typedef struct opt_s
23 const char * name; ///< string that identifies the option
24 int type; ///< option type as defined in subopt-helper.h
25 void * valp; ///< pointer to the mem where the value should be stored
26 opt_test_f test; ///< argument test func ( optional )
27 } opt_t;
29 /** parses the string for the options specified in opt */
30 int subopt_parse( char const * const str, const opt_t * opts );
33 /*------------------ arg specific types and declaration -------------------*/
34 typedef struct strarg_s
36 int len; ///< length of the string determined by the parser
37 char const * str; ///< pointer to position inside the parse string
38 } strarg_t;
41 int int_non_neg( int * i );
42 int int_pos( int * i );
44 int strargcmp(strarg_t *arg, const char *str);
45 int strargcasecmp(strarg_t *arg, char *str);
47 #endif /* MPLAYER_SUBOPT_HELPER_H */