RetroArch
Classes | Macros | Typedefs | Functions
config_file.h File Reference
#include <retro_common_api.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
Include dependency graph for config_file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  config_file
 
struct  config_file_cb
 
struct  config_file_entry
 

Macros

#define CONFIG_GET_BOOL_BASE(conf, base, var, key)
 
#define CONFIG_GET_INT_BASE(conf, base, var, key)
 
#define CONFIG_GET_FLOAT_BASE(conf, base, var, key)
 

Typedefs

typedef struct config_file config_file_t
 
typedef struct config_file_cb config_file_cb_t
 

Functions

config_file_tconfig_file_new (const char *path)
 
config_file_tconfig_file_new_with_callback (const char *path, config_file_cb_t *cb)
 
config_file_tconfig_file_new_from_string (const char *from_string)
 
void config_file_free (config_file_t *conf)
 
bool config_append_file (config_file_t *conf, const char *path)
 
bool config_entry_exists (config_file_t *conf, const char *entry)
 
bool config_get_entry_list_head (config_file_t *conf, struct config_file_entry *entry)
 
bool config_get_entry_list_next (struct config_file_entry *entry)
 
bool config_get_double (config_file_t *conf, const char *entry, double *in)
 
bool config_get_float (config_file_t *conf, const char *entry, float *in)
 
bool config_get_int (config_file_t *conf, const char *entry, int *in)
 
bool config_get_uint (config_file_t *conf, const char *entry, unsigned *in)
 
bool config_get_size_t (config_file_t *conf, const char *key, size_t *in)
 
bool config_get_hex (config_file_t *conf, const char *entry, unsigned *in)
 
bool config_get_char (config_file_t *conf, const char *entry, char *in)
 
bool config_get_string (config_file_t *conf, const char *entry, char **in)
 
bool config_get_array (config_file_t *conf, const char *entry, char *s, size_t len)
 
bool config_get_path (config_file_t *conf, const char *entry, char *s, size_t len)
 
bool config_get_config_path (config_file_t *conf, char *s, size_t len)
 
bool config_get_bool (config_file_t *conf, const char *entry, bool *in)
 
void config_set_double (config_file_t *conf, const char *entry, double value)
 
void config_set_float (config_file_t *conf, const char *entry, float value)
 
void config_set_int (config_file_t *conf, const char *entry, int val)
 
void config_set_hex (config_file_t *conf, const char *entry, unsigned val)
 
void config_set_uint64 (config_file_t *conf, const char *entry, uint64_t val)
 
void config_set_char (config_file_t *conf, const char *entry, char val)
 
void config_set_string (config_file_t *conf, const char *entry, const char *val)
 
void config_unset (config_file_t *conf, const char *key)
 
void config_set_path (config_file_t *conf, const char *entry, const char *val)
 
void config_set_bool (config_file_t *conf, const char *entry, bool val)
 
void config_set_uint (config_file_t *conf, const char *key, unsigned int val)
 
bool config_file_write (config_file_t *conf, const char *path)
 
void config_file_dump (config_file_t *conf, FILE *file)
 
bool config_file_exists (const char *path)
 

Macro Definition Documentation

◆ CONFIG_GET_BOOL_BASE

#define CONFIG_GET_BOOL_BASE (   conf,
  base,
  var,
  key 
)
Value:
do { \
bool tmp = false; \
if (config_get_bool(conf, key, &tmp)) \
base->var = tmp; \
} while(0)
bool config_get_bool(config_file_t *conf, const char *entry, bool *in)
Definition: config_file.c:824

◆ CONFIG_GET_FLOAT_BASE

#define CONFIG_GET_FLOAT_BASE (   conf,
  base,
  var,
  key 
)
Value:
do { \
float tmp = 0.0f; \
if (config_get_float(conf, key, &tmp)) \
base->var = tmp; \
} while(0)
bool config_get_float(config_file_t *conf, const char *entry, float *in)
Definition: config_file.c:652

◆ CONFIG_GET_INT_BASE

#define CONFIG_GET_INT_BASE (   conf,
  base,
  var,
  key 
)
Value:
do { \
int tmp = 0; \
if (config_get_int(conf, key, &tmp)) \
base->var = tmp; \
} while(0)
bool config_get_int(config_file_t *conf, const char *entry, int *in)
Definition: config_file.c:665

Typedef Documentation

◆ config_file_cb_t

◆ config_file_t

typedef struct config_file config_file_t

Function Documentation

◆ config_append_file()

bool config_append_file ( config_file_t conf,
const char *  path 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_entry_exists()

bool config_entry_exists ( config_file_t conf,
const char *  entry 
)
Here is the call graph for this function:

◆ config_file_dump()

void config_file_dump ( config_file_t conf,
FILE file 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_exists()

bool config_file_exists ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_free()

void config_file_free ( config_file_t conf)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_new()

config_file_t* config_file_new ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_new_from_string()

config_file_t* config_file_new_from_string ( const char *  from_string)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_new_with_callback()

config_file_t* config_file_new_with_callback ( const char *  path,
config_file_cb_t cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_file_write()

bool config_file_write ( config_file_t conf,
const char *  path 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_array()

bool config_get_array ( config_file_t conf,
const char *  entry,
char *  s,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_bool()

bool config_get_bool ( config_file_t conf,
const char *  entry,
bool in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_char()

bool config_get_char ( config_file_t conf,
const char *  entry,
char *  in 
)
Here is the call graph for this function:

◆ config_get_config_path()

bool config_get_config_path ( config_file_t conf,
char *  s,
size_t  len 
)
Here is the caller graph for this function:

◆ config_get_double()

bool config_get_double ( config_file_t conf,
const char *  entry,
double *  in 
)
Here is the call graph for this function:

◆ config_get_entry_list_head()

bool config_get_entry_list_head ( config_file_t conf,
struct config_file_entry entry 
)
Here is the caller graph for this function:

◆ config_get_entry_list_next()

bool config_get_entry_list_next ( struct config_file_entry entry)
Here is the caller graph for this function:

◆ config_get_float()

bool config_get_float ( config_file_t conf,
const char *  entry,
float *  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_hex()

bool config_get_hex ( config_file_t conf,
const char *  entry,
unsigned *  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_int()

bool config_get_int ( config_file_t conf,
const char *  entry,
int *  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_path()

bool config_get_path ( config_file_t conf,
const char *  entry,
char *  s,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_size_t()

bool config_get_size_t ( config_file_t conf,
const char *  key,
size_t *  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_string()

bool config_get_string ( config_file_t conf,
const char *  entry,
char **  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_get_uint()

bool config_get_uint ( config_file_t conf,
const char *  entry,
unsigned *  in 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_bool()

void config_set_bool ( config_file_t conf,
const char *  entry,
bool  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_char()

void config_set_char ( config_file_t conf,
const char *  entry,
char  val 
)
Here is the call graph for this function:

◆ config_set_double()

void config_set_double ( config_file_t conf,
const char *  entry,
double  value 
)
Here is the call graph for this function:

◆ config_set_float()

void config_set_float ( config_file_t conf,
const char *  entry,
float  value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_hex()

void config_set_hex ( config_file_t conf,
const char *  entry,
unsigned  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_int()

void config_set_int ( config_file_t conf,
const char *  entry,
int  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_path()

void config_set_path ( config_file_t conf,
const char *  entry,
const char *  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_string()

void config_set_string ( config_file_t conf,
const char *  entry,
const char *  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_uint()

void config_set_uint ( config_file_t conf,
const char *  key,
unsigned int  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_set_uint64()

void config_set_uint64 ( config_file_t conf,
const char *  entry,
uint64_t  val 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_unset()

void config_unset ( config_file_t conf,
const char *  key 
)
Here is the call graph for this function:
Here is the caller graph for this function: