Settings functions¶
- Settings functions
- smf_settings_get()
- smf_settings_group_load()
- smf_settings_group_get_value()
- smf_settings_group_get_string()
- smf_settings_group_get_boolean()
- smf_settings_group_get_integer()
- smf_settings_group_get_double()
- smf_settings_group_get_string_list()
- smf_settings_group_free()
smf_settings_get()¶
Get all core settings
1 SMFSettings_T *smf_settings_get(void);
Return value
- returns A SMFSettings_T object
smf_settings_group_load()¶
Load all settings from specified group.
1 int smf_settings_group_load(char *group_name);
Parameter
- group_name - wanted group
Return value
- returns 0 on success or -1 in case of error
smf_settings_group_get_value()¶
Returns the raw value associated with key under the selected group. Use smf_settings_group_get_string() to retrieve an unescaped UTF-8 string.
1 char *smf_settings_group_get_value(char *key);
Parameter
- key - a key
Return value
- returns a newly allocated string or NULL if the specified key cannot be found.
smf_settings_group_get_string()¶
Returns the string value associated with key under the selected group. Unlike group_settings_get_value(), this function handles escape sequences like \s.
1 char *smf_settings_group_get_string(char *key);
Parameter
- key - a key
Return value
- returns a newly allocated string or NULL if the specified key cannot be found.
smf_settings_group_get_boolean()¶
Returns the boolean values associated with key under the selected group as integer.
1 int smf_settings_group_get_boolean(char *key);
Parameter
- key - a key
Return value
- returns the value associated with the key as a integer, or 0 if the key was not found or could not be parsed.
smf_settings_group_get_integer()¶
Returns the value associated with key under the selected group as an integer.
1 int smf_settings_group_get_integer(char *key);
Parameter
- key - a key
Return value
- returns he value associated with the key as an integer, or 0 if the key was not found or could not be parsed.
smf_settings_group_get_double()¶
Returns the value associated with key under the selected group as a double.
1 double smf_settings_group_get_double(char *key);
Parameter
- key - a key
Return value
- returns the value associated with the key as a double, or 0.0 if the key was not found or could not be parsed.
smf_settings_group_get_string_list()¶
Returns the values associated with key under the selected group.
1 char **smf_settings_group_get_string_list(char *key, int length);
Parameter
- key - a key
Return value
- returns a NULL-terminated string array or NULL if the specified key cannot be found.
smf_settings_group_free()¶
Free space allocated bye smf_settings_group_load()
1 void smf_settings_group_free(void);