xine-lib 1.2.11
Data Structures | Macros | Functions | Variables
configfile.c File Reference
#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_tconfig_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_tconfig_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_tconfig_lookup_entry (config_values_t *this, const char *key)
 
static cfg_entry_tconfig_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_tconfig_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_tconfig_entry_translation_user = NULL
 

Macro Definition Documentation

◆ FIND_ONLY

#define FIND_ONLY   0x7fffffff

◆ get_string

#define get_string (   s)
Value:
{ \
uint32_t len = _X_LE_32 (p); p[0] = 0; p += 4; \
if (len > left) \
break; \
left -= len; \
s = (char *)p; p += len; \
}
#define _X_LE_32(x)
Definition: bswap.h:63

◆ LOG_MODULE

#define LOG_MODULE   "configfile"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MAX_SORT_KEY

#define MAX_SORT_KEY   320

◆ SINGLE_CHUNK_ENUMS

#define SINGLE_CHUNK_ENUMS

◆ XCS_BUF_SIZE

#define XCS_BUF_SIZE   4096

Function Documentation

◆ _cfg_any_rem()

static int _cfg_any_rem ( cfg_entry_t entry,
xine_config_cb_t  callback,
void *  data,
size_t  data_size 
)
static

◆ _cfg_cb_add()

static void _cfg_cb_add ( cfg_entry_t entry,
xine_config_cb_t  callback,
void *  data 
)
static

◆ _cfg_cb_clear()

static int _cfg_cb_clear ( cfg_entry_t entry)
static

◆ _cfg_cb_clear_report()

static int _cfg_cb_clear_report ( xine_t xine,
cfg_entry_t entry 
)
static

◆ _cfg_cb_d_rem()

static int _cfg_cb_d_rem ( cfg_entry_t entry,
xine_config_cb_t  callback,
void *  data,
size_t  data_size 
)
static

◆ _cfg_cb_rem()

static int _cfg_cb_rem ( cfg_entry_t entry,
xine_config_cb_t  callback 
)
static

◆ _cfg_d_rem()

static int _cfg_d_rem ( cfg_entry_t entry,
void *  data,
size_t  data_size 
)
static

◆ _cfg_relay()

static void _cfg_relay ( void *  data,
xine_cfg_entry_t e 
)
static

◆ _x_config_change_opt()

int _x_config_change_opt ( config_values_t config,
const char *  opt 
)

◆ _x_config_init()

config_values_t * _x_config_init ( void  )

◆ _x_config_unregister_cb_class_d()

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.

◆ _x_config_unregister_cb_class_p()

void _x_config_unregister_cb_class_p ( config_values_t this,
xine_config_cb_t  callback 
)

References _cfg_cb_rem(), and _x_assert.

◆ config_array()

static cfg_entry_t ** config_array ( config_values_t this,
cfg_entry_t **  tab,
int *  n 
)
static

References cfg_entry_s::next.

Referenced by config_insert().

◆ config_dispose()

static void config_dispose ( config_values_t this)
static

◆ config_free_string()

static void config_free_string ( config_values_t this,
char **  str 
)
static

References _x_freep().

Referenced by _x_config_init().

◆ config_get_serialized_entry()

static char * config_get_serialized_entry ( config_values_t this,
const char *  key 
)
static

◆ config_insert()

static cfg_entry_t * config_insert ( config_values_t this,
const char *  key,
int  exp_level 
)
static

◆ config_lookup_entry()

static cfg_entry_t * config_lookup_entry ( config_values_t this,
const char *  key 
)
static

◆ config_lookup_entry_int()

static cfg_entry_t * config_lookup_entry_int ( config_values_t this,
const char *  key 
)
static

◆ config_lookup_entry_safe()

static cfg_entry_t * config_lookup_entry_safe ( config_values_t this,
const char *  key 
)
static

◆ config_lookup_num()

static int config_lookup_num ( config_values_t this,
const char *  key,
int  def_value 
)
static

◆ config_lookup_string()

static char * config_lookup_string ( config_values_t this,
const char *  key 
)
static

◆ config_make_sort_key()

static void config_make_sort_key ( char *  dest,
const char *  key,
int  exp_level 
)
static

References config_section_enum(), key, and MAX_SORT_KEY.

Referenced by config_insert().

◆ config_parse_enum()

static int config_parse_enum ( const char *  str,
const char **  values 
)
static

◆ config_register_bool()

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

◆ config_register_enum()

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

◆ config_register_filename()

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

◆ config_register_key()

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

◆ config_register_num()

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

◆ config_register_range()

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

◆ config_register_serialized_entry()

static char * config_register_serialized_entry ( config_values_t this,
const char *  value 
)
static

◆ config_register_string()

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

◆ config_reset_value()

static void config_reset_value ( cfg_entry_t entry)
static

◆ config_section_enum()

static int config_section_enum ( const char *  sect)
static

Referenced by config_make_sort_key().

◆ config_set_new_entry_callback()

static void config_set_new_entry_callback ( config_values_t this,
xine_config_cb_t  new_entry_cb,
void *  cbdata 
)
static

Referenced by _x_config_init().

◆ config_shallow_copy()

static void config_shallow_copy ( xine_cfg_entry_t dest,
const cfg_entry_t src 
)
static

◆ config_translate_key()

static const char * config_translate_key ( const char *  key,
char **  tmp 
)
static

◆ config_unregister_callbacks()

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 
)
static

◆ config_unregister_cb()

static void config_unregister_cb ( config_values_t this,
const char *  key 
)
static

◆ config_unset_new_entry_callback()

static void config_unset_new_entry_callback ( config_values_t this)
static

References NULL.

Referenced by _x_config_init().

◆ config_update_num()

static void config_update_num ( config_values_t this,
const char *  key,
int  value 
)
static

◆ config_update_num_e()

static void config_update_num_e ( cfg_entry_t entry,
int  value 
)
static

◆ config_update_string()

static void config_update_string ( config_values_t this,
const char *  key,
const char *  value 
)
static

◆ config_update_string_e()

static void config_update_string_e ( cfg_entry_t entry,
const char *  value 
)
static

◆ config_xlate_internal()

static const char * config_xlate_internal ( const char *  key,
const xine_config_entry_translation_t trans 
)
static

◆ config_xlate_old()

static const char * config_xlate_old ( const char *  s)
static

References NULL.

Referenced by config_translate_key().

◆ put_int()

static void put_int ( uint8_t **  dest,
int  value 
)
static

◆ put_string()

static void put_string ( uint8_t **  dest,
const char *  value,
uint32_t  value_len 
)
static

References put_int().

Referenced by config_get_serialized_entry().

◆ str_array_dup()

static char ** str_array_dup ( const char **  from,
uint32_t *  n 
)
static

References NULL, and xine_small_memcpy.

Referenced by config_register_enum().

◆ str_array_free()

static void str_array_free ( char **  a)
static

◆ xine_config_load()

void xine_config_load ( xine_t xine,
const char *  filename 
)

◆ xine_config_save()

void xine_config_save ( xine_t xine,
const char *  filename 
)

◆ xine_config_set_translation_user()

void xine_config_set_translation_user ( const xine_config_entry_translation_t xlate)

Variable Documentation

◆ config_entry_translation_user

const xine_config_entry_translation_t* config_entry_translation_user = NULL
static