girara
Functions
settings.h File Reference
#include "types.h"
#include "macros.h"
Include dependency graph for settings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool girara_setting_add (girara_session_t *session, const char *name, const void *value, girara_setting_type_t type, bool init_only, const char *description, girara_setting_callback_t callback, void *data) GIRARA_VISIBLE
 
bool girara_setting_set (girara_session_t *session, const char *name, const void *value) GIRARA_VISIBLE
 
bool girara_setting_get (girara_session_t *session, const char *name, void *dest) GIRARA_VISIBLE
 
girara_setting_tgirara_setting_find (girara_session_t *session, const char *name) GIRARA_VISIBLE
 
const char * girara_setting_get_name (const girara_setting_t *setting) GIRARA_VISIBLE
 
bool girara_setting_get_value (girara_setting_t *setting, void *dest) GIRARA_VISIBLE
 
girara_setting_type_t girara_setting_get_type (girara_setting_t *setting) GIRARA_VISIBLE
 
void girara_setting_set_value (girara_session_t *session, girara_setting_t *setting, const void *value) GIRARA_VISIBLE
 

Function Documentation

◆ girara_setting_add()

bool girara_setting_add ( girara_session_t *  session,
const char *  name,
const void *  value,
girara_setting_type_t  type,
bool  init_only,
const char *  description,
girara_setting_callback_t  callback,
void *  data 
)

Adds an additional entry in the settings list

Parameters
sessionThe used girara session
nameThe name of the setting
valueThe value of the setting
typeThe type of the setting
init_onlyWill only available on initialization
descriptionDescription of the setting
callbackFunction that is called when the setting changes
dataArbitrary data that can be used by callbacks
Returns
TRUE No error occurred
FALSE An error occurred

◆ girara_setting_find()

girara_setting_t * girara_setting_find ( girara_session_t *  session,
const char *  name 
)

Find a setting.

Parameters
sessionThe girara session
namename of the setting
Returns
the setting or NULL if it doesn't exist

◆ girara_setting_get()

bool girara_setting_get ( girara_session_t *  session,
const char *  name,
void *  dest 
)

Retrieve the value of a setting. If the setting is a string, the value stored in dest has to be deallocated with g_free.

Parameters
sessionThe used girara session
nameThe name of the setting
destA pointer to the destination of the result.
Returns
true if the setting exists, false otherwise.

◆ girara_setting_get_name()

const char * girara_setting_get_name ( const girara_setting_t setting)

Get the setting's name.

Parameters
settingThe setting
Returns
the setting's name

◆ girara_setting_get_type()

girara_setting_type_t girara_setting_get_type ( girara_setting_t setting)

Get the setting's value.

Parameters
settingThe setting
Returns
the value

◆ girara_setting_get_value()

bool girara_setting_get_value ( girara_setting_t setting,
void *  dest 
)

Get the setting's value. If the setting is a string, the value stored in dest has to be deallocated with g_free.

Parameters
settingThe setting
destA pointer to the destination of the result.
Returns
true if the setting exists, false otherwise.

◆ girara_setting_set()

bool girara_setting_set ( girara_session_t *  session,
const char *  name,
const void *  value 
)

Sets the value of a setting

Parameters
sessionThe used girara session
nameThe name of the setting
valueThe new value of the setting
Returns
TRUE No error occurred
FALSE An error occurred

◆ girara_setting_set_value()

void girara_setting_set_value ( girara_session_t *  session,
girara_setting_t setting,
const void *  value 
)

Set the setting's value. If session is NULL, the setting's callback won't be called.

Parameters
sessionThe girara session
settingThe setting
valueThe new value