xine-lib 1.2.11
|
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <xine/configfile.h>
#include "bswap.h"
#include <xine/xineutils.h>
#include <xine/xine_internal.h>
#include "xine_private.h"
Data Structures | |
struct | _cfg_cb_info_t |
struct | _cfg_cb_relay_t |
Macros | |
#define | LOG_MODULE "configfile" |
#define | LOG_VERBOSE |
#define | SINGLE_CHUNK_ENUMS |
#define | MAX_SORT_KEY 320 |
#define | FIND_ONLY 0x7fffffff |
#define | XCS_BUF_SIZE 4096 |
#define | get_string(s) |
Functions | |
static void | _cfg_relay (void *data, xine_cfg_entry_t *e) |
static int | _cfg_cb_clear (cfg_entry_t *entry) |
static int | _cfg_cb_clear_report (xine_t *xine, cfg_entry_t *entry) |
static int | _cfg_cb_d_rem (cfg_entry_t *entry, xine_config_cb_t callback, void *data, size_t data_size) |
static int | _cfg_cb_rem (cfg_entry_t *entry, xine_config_cb_t callback) |
static int | _cfg_d_rem (cfg_entry_t *entry, void *data, size_t data_size) |
static int | _cfg_any_rem (cfg_entry_t *entry, xine_config_cb_t callback, void *data, size_t data_size) |
static void | _cfg_cb_add (cfg_entry_t *entry, xine_config_cb_t callback, void *data) |
static const char * | config_xlate_old (const char *s) |
static int | config_section_enum (const char *sect) |
static void | config_make_sort_key (char *dest, const char *key, int exp_level) |
static cfg_entry_t ** | config_array (config_values_t *this, cfg_entry_t **tab, int *n) |
static cfg_entry_t * | config_insert (config_values_t *this, const char *key, int exp_level) |
static const char * | config_xlate_internal (const char *key, const xine_config_entry_translation_t *trans) |
static const char * | config_translate_key (const char *key, char **tmp) |
static cfg_entry_t * | config_lookup_entry_int (config_values_t *this, const char *key) |
static char ** | str_array_dup (const char **from, uint32_t *n) |
static void | str_array_free (char **a) |
static cfg_entry_t * | config_lookup_entry (config_values_t *this, const char *key) |
static cfg_entry_t * | config_lookup_entry_safe (config_values_t *this, const char *key) |
static char * | config_lookup_string (config_values_t *this, const char *key) |
static void | config_free_string (config_values_t *this, char **str) |
static int | config_lookup_num (config_values_t *this, const char *key, int def_value) |
static void | config_reset_value (cfg_entry_t *entry) |
static void | config_shallow_copy (xine_cfg_entry_t *dest, const cfg_entry_t *src) |
static cfg_entry_t * | config_register_key (config_values_t *this, const char *key, int exp_level, xine_config_cb_t changed_cb, void *cb_data, const char *description, const char *help) |
static char * | config_register_string (config_values_t *this, const char *key, const char *def_value, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static char * | config_register_filename (config_values_t *this, const char *key, const char *def_value, int req_type, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static int | config_register_num (config_values_t *this, const char *key, int def_value, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static int | config_register_bool (config_values_t *this, const char *key, int def_value, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static int | config_register_range (config_values_t *this, const char *key, int def_value, int min, int max, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static int | config_parse_enum (const char *str, const char **values) |
static int | config_register_enum (config_values_t *this, const char *key, int def_value, char **values, const char *description, const char *help, int exp_level, xine_config_cb_t changed_cb, void *cb_data) |
static void | config_update_num_e (cfg_entry_t *entry, int value) |
static void | config_update_num (config_values_t *this, const char *key, int value) |
static void | config_update_string_e (cfg_entry_t *entry, const char *value) |
static void | config_update_string (config_values_t *this, const char *key, const char *value) |
void | xine_config_set_translation_user (const xine_config_entry_translation_t *xlate) |
void | xine_config_load (xine_t *xine, const char *filename) |
void | xine_config_save (xine_t *xine, const char *filename) |
static void | config_dispose (config_values_t *this) |
static void | config_unregister_cb (config_values_t *this, const char *key) |
static int | config_unregister_callbacks (config_values_t *this, const char *key, xine_config_cb_t changed_cb, void *cb_data, size_t cb_data_size) |
void | _x_config_unregister_cb_class_d (config_values_t *this, void *callback_data) |
void | _x_config_unregister_cb_class_p (config_values_t *this, xine_config_cb_t callback) |
static void | config_set_new_entry_callback (config_values_t *this, xine_config_cb_t new_entry_cb, void *cbdata) |
static void | config_unset_new_entry_callback (config_values_t *this) |
static void | put_int (uint8_t **dest, int value) |
static void | put_string (uint8_t **dest, const char *value, uint32_t value_len) |
static char * | config_get_serialized_entry (config_values_t *this, const char *key) |
static char * | config_register_serialized_entry (config_values_t *this, const char *value) |
config_values_t * | _x_config_init (void) |
allocate and init a new xine config object More... | |
int | _x_config_change_opt (config_values_t *config, const char *opt) |
interpret stream_setup part of mrls for config value changes More... | |
Variables | |
static const xine_config_entry_translation_t * | config_entry_translation_user = NULL |
#define FIND_ONLY 0x7fffffff |
#define get_string | ( | s | ) |
#define LOG_MODULE "configfile" |
#define LOG_VERBOSE |
#define MAX_SORT_KEY 320 |
#define SINGLE_CHUNK_ENUMS |
#define XCS_BUF_SIZE 4096 |
|
static |
References _cfg_cb_clear(), _cfg_cb_d_rem(), _cfg_cb_rem(), and _cfg_d_rem().
Referenced by config_unregister_callbacks().
|
static |
|
static |
References _cfg_relay(), cfg_entry_s::callback, cfg_entry_s::callback_data, cfg_entry_s::next, NULL, and _cfg_cb_relay_t::used.
Referenced by _cfg_any_rem(), and config_unregister_cb().
|
static |
References _cfg_relay(), cfg_entry_s::callback, cfg_entry_s::callback_data, cfg_entry_s::key, cfg_entry_s::next, NULL, _cfg_cb_relay_t::used, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by config_dispose().
|
static |
References _cfg_relay(), cfg_entry_s::callback, _cfg_cb_info_t::callback, cfg_entry_s::callback_data, _cfg_cb_info_t::data, _cfg_cb_relay_t::items, cfg_entry_s::next, NULL, PTR_IN_RANGE, and _cfg_cb_relay_t::used.
Referenced by _cfg_any_rem().
|
static |
References _cfg_relay(), cfg_entry_s::callback, _cfg_cb_info_t::callback, cfg_entry_s::callback_data, _cfg_cb_info_t::data, _cfg_cb_relay_t::items, cfg_entry_s::next, NULL, and _cfg_cb_relay_t::used.
Referenced by _cfg_any_rem(), and _x_config_unregister_cb_class_p().
|
static |
|
static |
References _cfg_cb_info_t::callback, _cfg_cb_info_t::data, _cfg_cb_relay_t::items, and _cfg_cb_relay_t::used.
Referenced by _cfg_cb_add(), _cfg_cb_clear(), _cfg_cb_clear_report(), _cfg_cb_d_rem(), _cfg_cb_rem(), and _cfg_d_rem().
int _x_config_change_opt | ( | config_values_t * | config, |
const char * | opt | ||
) |
interpret stream_setup part of mrls for config value changes
References _, config_values_s::config_lock, config_lookup_entry_safe(), config_update_string_e(), cfg_entry_s::exp_level, key, config_values_s::lookup_entry, cfg_entry_s::num_value, cfg_entry_s::type, config_values_s::xine, XINE_CONFIG_SECURITY, XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, XINE_CONFIG_TYPE_RANGE, XINE_CONFIG_TYPE_STRING, XINE_CONFIG_TYPE_UNKNOWN, XINE_VERBOSITY_LOG, and xprintf.
Referenced by open_internal().
config_values_t * _x_config_init | ( | void | ) |
allocate and init a new xine config object
References config_dispose(), config_free_string(), config_get_serialized_entry(), config_lookup_entry(), config_lookup_num(), config_lookup_string(), config_parse_enum(), config_register_bool(), config_register_enum(), config_register_filename(), config_register_num(), config_register_range(), config_register_serialized_entry(), config_register_string(), config_set_new_entry_callback(), config_unregister_callbacks(), config_unregister_cb(), config_unset_new_entry_callback(), config_update_num(), config_update_string(), and NULL.
Referenced by xine_new().
void _x_config_unregister_cb_class_d | ( | config_values_t * | config, |
void * | callback_data | ||
) |
deprecated in favour of config_values_t->unregister_callbacks ().
References _cfg_d_rem(), and _x_assert.
void _x_config_unregister_cb_class_p | ( | config_values_t * | this, |
xine_config_cb_t | callback | ||
) |
References _cfg_cb_rem(), and _x_assert.
|
static |
References cfg_entry_s::next.
Referenced by config_insert().
|
static |
References _cfg_cb_clear_report(), _x_freep(), config_reset_value(), cfg_entry_s::key, lprintf, cfg_entry_s::next, NULL, cfg_entry_s::unknown_value, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _x_config_init().
|
static |
References _x_freep().
Referenced by _x_config_init().
|
static |
References config_lookup_entry(), config_lookup_entry_int(), cfg_entry_s::description, cfg_entry_s::enum_values, cfg_entry_s::exp_level, cfg_entry_s::help, cfg_entry_s::key, key, NULL, cfg_entry_s::num_default, cfg_entry_s::num_value, put_int(), put_string(), cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::str_default, cfg_entry_s::type, and xine_base64_encode().
Referenced by _x_config_init().
|
static |
References cfg_entry_s::callback, cfg_entry_s::callback_data, cfg_entry_s::config, config_array(), config_make_sort_key(), cfg_entry_s::description, cfg_entry_s::enum_values, cfg_entry_s::exp_level, FIND_ONLY, cfg_entry_s::help, cfg_entry_s::key, key, MAX_SORT_KEY, cfg_entry_s::next, NULL, cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::str_default, cfg_entry_s::str_value, cfg_entry_s::type, cfg_entry_s::unknown_value, and XINE_CONFIG_TYPE_UNKNOWN.
Referenced by config_lookup_entry_int(), config_register_key(), and xine_config_load().
|
static |
References config_lookup_entry_int(), and key.
Referenced by _x_config_init(), config_get_serialized_entry(), and config_lookup_entry_safe().
|
static |
References config_insert(), config_translate_key(), FIND_ONLY, key, and NULL.
Referenced by config_get_serialized_entry(), config_lookup_entry(), and config_lookup_entry_safe().
|
static |
References config_lookup_entry(), config_lookup_entry_int(), and key.
Referenced by _x_config_change_opt(), config_lookup_num(), config_lookup_string(), config_unregister_callbacks(), config_unregister_cb(), config_update_num(), and config_update_string().
|
static |
References config_lookup_entry_safe(), key, cfg_entry_s::num_value, cfg_entry_s::type, XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, XINE_CONFIG_TYPE_RANGE, XINE_VERBOSITY_LOG, and xprintf.
Referenced by _x_config_init().
|
static |
References config_lookup_entry_safe(), key, NULL, cfg_entry_s::str_value, cfg_entry_s::type, XINE_CONFIG_TYPE_STRING, XINE_VERBOSITY_LOG, and xprintf.
Referenced by _x_config_init().
|
static |
References config_section_enum(), key, and MAX_SORT_KEY.
Referenced by config_insert().
|
static |
References lprintf.
Referenced by _x_config_init(), config_register_enum(), and config_update_string_e().
|
static |
|
static |
References config_parse_enum(), config_register_key(), cfg_entry_s::enum_values, key, cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, str_array_dup(), str_array_free(), cfg_entry_s::type, cfg_entry_s::unknown_value, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_UNKNOWN, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _x_config_init().
|
static |
|
static |
References _cfg_cb_add(), config_insert(), config_reset_value(), config_shallow_copy(), cfg_entry_s::description, cfg_entry_s::exp_level, FIND_ONLY, cfg_entry_s::help, key, lprintf, NULL, cfg_entry_s::type, and XINE_CONFIG_TYPE_UNKNOWN.
Referenced by config_register_bool(), config_register_enum(), config_register_filename(), config_register_num(), config_register_range(), and config_register_string().
|
static |
|
static |
References config_register_key(), key, cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::type, cfg_entry_s::unknown_value, XINE_CONFIG_TYPE_RANGE, XINE_CONFIG_TYPE_UNKNOWN, xine_str2int32(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _x_config_init().
|
static |
References _X_LE_32, FIND_ONLY, get_string, key, NULL, xine_base64_decode(), XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, XINE_CONFIG_TYPE_RANGE, and XINE_CONFIG_TYPE_STRING.
Referenced by _x_config_init().
|
static |
|
static |
References cfg_entry_s::description, cfg_entry_s::enum_values, cfg_entry_s::help, NULL, cfg_entry_s::num_value, str_array_free(), cfg_entry_s::str_default, and cfg_entry_s::str_value.
Referenced by config_dispose(), and config_register_key().
|
static |
Referenced by config_make_sort_key().
|
static |
Referenced by _x_config_init().
|
static |
References xine_cfg_entry_s::callback, cfg_entry_s::callback, xine_cfg_entry_s::callback_data, cfg_entry_s::callback_data, xine_cfg_entry_s::description, cfg_entry_s::description, xine_cfg_entry_s::enum_values, cfg_entry_s::enum_values, xine_cfg_entry_s::exp_level, cfg_entry_s::exp_level, xine_cfg_entry_s::help, cfg_entry_s::help, xine_cfg_entry_s::key, cfg_entry_s::key, xine_cfg_entry_s::num_default, cfg_entry_s::num_default, xine_cfg_entry_s::num_value, cfg_entry_s::num_value, xine_cfg_entry_s::range_max, cfg_entry_s::range_max, xine_cfg_entry_s::range_min, cfg_entry_s::range_min, xine_cfg_entry_s::str_default, cfg_entry_s::str_default, xine_cfg_entry_s::str_value, cfg_entry_s::str_value, xine_cfg_entry_s::type, cfg_entry_s::type, xine_cfg_entry_s::unknown_value, and cfg_entry_s::unknown_value.
Referenced by config_register_key(), config_update_num_e(), and config_update_string_e().
|
static |
References _x_asprintf(), config_entry_translation_user, config_xlate_internal(), config_xlate_old(), key, and NULL.
Referenced by config_lookup_entry_int(), and xine_config_load().
|
static |
References _cfg_any_rem(), config_lookup_entry_safe(), key, cfg_entry_s::next, and NULL.
Referenced by _x_config_init().
|
static |
References _cfg_cb_clear(), _x_assert, config_lookup_entry_safe(), key, cfg_entry_s::next, and NULL.
Referenced by _x_config_init().
|
static |
References NULL.
Referenced by _x_config_init().
|
static |
References config_lookup_entry_safe(), config_update_num_e(), cfg_entry_s::key, key, lprintf, cfg_entry_s::type, XINE_CONFIG_TYPE_STRING, XINE_CONFIG_TYPE_UNKNOWN, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _x_config_init().
|
static |
References cfg_entry_s::callback, cfg_entry_s::callback_data, config_shallow_copy(), cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::type, XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, and XINE_CONFIG_TYPE_RANGE.
Referenced by config_update_num().
|
static |
References config_lookup_entry_safe(), config_update_string_e(), key, lprintf, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by _x_config_init().
|
static |
References cfg_entry_s::callback, cfg_entry_s::callback_data, config_parse_enum(), config_shallow_copy(), cfg_entry_s::enum_values, NULL, cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::str_value, cfg_entry_s::type, cfg_entry_s::unknown_value, XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, XINE_CONFIG_TYPE_RANGE, XINE_CONFIG_TYPE_STRING, and xine_str2int32().
Referenced by _x_config_change_opt(), config_update_string(), and xine_config_load().
|
static |
References key, xine_config_entry_translation_t::new_name, NULL, and xine_config_entry_translation_t::old_name.
Referenced by config_translate_key().
|
static |
References NULL.
Referenced by config_translate_key().
|
static |
Referenced by config_get_serialized_entry(), and put_string().
|
static |
References put_int().
Referenced by config_get_serialized_entry().
|
static |
References NULL, and xine_small_memcpy.
Referenced by config_register_enum().
|
static |
Referenced by config_register_enum(), and config_reset_value().
void xine_config_load | ( | xine_t * | xine, |
const char * | filename | ||
) |
References _, xine_s::config, CONFIG_FILE_VERSION, config_insert(), config_translate_key(), config_update_string_e(), FIND_ONLY, key, lprintf, NULL, xine_log(), XINE_LOG_MSG, and xine_str2int32().
void xine_config_save | ( | xine_t * | xine, |
const char * | filename | ||
) |
References _, xine_s::config, CONFIG_FILE_VERSION, cfg_entry_s::description, cfg_entry_s::enum_values, cfg_entry_s::key, lprintf, cfg_entry_s::next, NULL, cfg_entry_s::num_default, cfg_entry_s::num_value, cfg_entry_s::range_max, cfg_entry_s::range_min, cfg_entry_s::str_default, cfg_entry_s::str_value, cfg_entry_s::type, cfg_entry_s::unknown_value, XCS_BUF_SIZE, XINE_CONFIG_TYPE_BOOL, XINE_CONFIG_TYPE_ENUM, XINE_CONFIG_TYPE_NUM, XINE_CONFIG_TYPE_RANGE, XINE_CONFIG_TYPE_STRING, XINE_CONFIG_TYPE_UNKNOWN, xine_int32_2str(), XINE_MAX_INT32_STR, XINE_PATH_MAX, xine_uint32_2str(), XINE_VERBOSITY_LOG, and xprintf.
void xine_config_set_translation_user | ( | const xine_config_entry_translation_t * | xlate | ) |
References config_entry_translation_user.
|
static |
Referenced by config_translate_key(), and xine_config_set_translation_user().