Data Structures | |
union | rte_option_value |
union | rte_option_value_ptr |
struct | rte_option_info |
Enumerations | |
enum | rte_option_type { RTE_OPTION_BOOL = 1, RTE_OPTION_INT, RTE_OPTION_REAL, RTE_OPTION_STRING, RTE_OPTION_MENU } |
Functions | |
rte_option_info * | rte_context_option_info_enum (rte_context *context, unsigned int index) |
rte_option_info * | rte_context_option_info_by_keyword (rte_context *context, const char *keyword) |
rte_bool | rte_context_option_get (rte_context *context, const char *keyword, rte_option_value *value) |
rte_bool | rte_context_option_set (rte_context *context, const char *keyword,...) |
char * | rte_context_option_print (rte_context *context, const char *keyword,...) |
rte_bool | rte_context_option_menu_get (rte_context *context, const char *keyword, unsigned int *entry) |
rte_bool | rte_context_option_menu_set (rte_context *context, const char *keyword, unsigned int entry) |
rte_bool | rte_context_options_reset (rte_context *context) |
enum rte_option_type |
Option type.
rte_option_info* rte_context_option_info_enum | ( | rte_context * | context, | |
unsigned int | index | |||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
index | Index into the option table. |
Enumerates the options available of the given context. You should start at index 0, incrementing by one.
NULL
if the index is out of bounds. rte_option_info* rte_context_option_info_by_keyword | ( | rte_context * | context, | |
const char * | keyword | |||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. |
Similar to rte_context_option_info_enum() but this function tries to find the option info by keyword.
NULL
if the keyword was not found. rte_bool rte_context_option_get | ( | rte_context * | context, | |
const char * | keyword, | |||
rte_option_value * | value | |||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. | |
value | A place to store the option value. |
This function queries the current value of the option. When the option is a string, you must free() value.str when no longer needed.
TRUE
on success, otherwise value remained unchanged. rte_bool rte_context_option_set | ( | rte_context * | context, | |
const char * | keyword, | |||
... | ||||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. | |
... | New value to set. |
Sets the value of the option. Make sure you are casting the value to the correct type (int, double, char *).
Typical usage is:
rte_context_option_set (context, "frame_rate", (double) 3.141592);
TRUE
on success. char* rte_context_option_print | ( | rte_context * | context, | |
const char * | keyword, | |||
... | ||||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. | |
... | Option value. |
Return a string representation of the option value. When for example the option is a memory size, a value of 2048 may result in a string "2 KB". Make sure you are casting the value to the correct type (int, double, char *). You must free() the returned string when no longer needed.
NULL
on failure. rte_bool rte_context_option_menu_get | ( | rte_context * | context, | |
const char * | keyword, | |||
unsigned int * | entry | |||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. | |
entry | A place to store the current menu entry. |
Similar to rte_context_option_get() this function queries the current value of the named option, but returns this value as number of the corresponding menu entry. Naturally this must be an option with menu or the function will fail.
TRUE
on success, otherwise value remained unchanged. rte_bool rte_context_option_menu_set | ( | rte_context * | context, | |
const char * | keyword, | |||
unsigned int | entry | |||
) |
context | Initialized rte_context as returned by rte_context_new(). | |
keyword | Keyword identifying the option as in rte_option_info. | |
entry | Menu entry to be selected. |
Similar to rte_context_option_set() this function sets the value of the named option, however it does so by number of the corresponding menu entry. Naturally this must be an option with menu, or the function will fail.
TRUE
on success, otherwise the option is not changed. rte_bool rte_context_options_reset | ( | rte_context * | context | ) |
context | Initialized rte_context as returned by rte_context_new(). |
Resets all options of the context to their respective default, that is the value they have after calling rte_context_new().
TRUE
on success, on failure some options may be reset and some not.