libmcs
0.6.0
|
#include "libmcs/mcs.h"
Functions | |
void | mcs_handle_class_init (void) |
Initialises the mowgli.object.class for the mcs.handle object. | |
mcs_handle_t * | mcs_new (char *domain) |
void | mcs_destroy (mcs_handle_t *self) |
Destroys an mcs.handle object. | |
mcs_response_t | mcs_get_string (mcs_handle_t *self, const char *section, const char *key, char **value) |
Public function to retrieve a string value from a configuration database. | |
mcs_response_t | mcs_get_int (mcs_handle_t *self, const char *section, const char *key, int *value) |
Public function to retrieve an integer value from a configuration database. | |
mcs_response_t | mcs_get_bool (mcs_handle_t *self, const char *section, const char *key, int *value) |
Public function to retrieve a boolean value from a configuration database. | |
mcs_response_t | mcs_get_float (mcs_handle_t *self, const char *section, const char *key, float *value) |
Public function to retrieve a floating point value from a configuration database. | |
mcs_response_t | mcs_get_double (mcs_handle_t *self, const char *section, const char *key, double *value) |
Public function to retrieve a double-precision floating point value from a configuration database. | |
mcs_response_t | mcs_set_string (mcs_handle_t *self, const char *section, const char *key, const char *value) |
Public function to set a string value in a configuration database. | |
mcs_response_t | mcs_set_int (mcs_handle_t *self, const char *section, const char *key, int value) |
Public function to set an integer value in a configuration database. | |
mcs_response_t | mcs_set_bool (mcs_handle_t *self, const char *section, const char *key, int value) |
Public function to set a boolean value in a configuration database. | |
mcs_response_t | mcs_set_float (mcs_handle_t *self, const char *section, const char *key, float value) |
Public function to set a floating point value in a configuration database. | |
mcs_response_t | mcs_set_double (mcs_handle_t *self, const char *section, const char *key, double value) |
Public function to set a double-precision floating point value in a configuration database. | |
mcs_response_t | mcs_unset_key (mcs_handle_t *self, const char *section, const char *key) |
Public function to remove a value from a configuration database. | |
mowgli_queue_t * | mcs_get_keys (mcs_handle_t *self, const char *section) |
Public function to retrieve a mowgli.queue of keys from a configuration database. | |
mowgli_queue_t * | mcs_get_sections (mcs_handle_t *self) |
Public function to retrieve a mowgli.queue of sections from a configuration database. | |
Variables | |
mowgli_queue_t * | mcs_backends_lst = NULL |
A list of registered backends. |
void mcs_destroy | ( | mcs_handle_t * | self | ) |
Destroys an mcs.handle object.
This function is considered deprecated since version 0.6. It should not be used in any newly written code.
mcs_response_t mcs_get_bool | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
int * | value | ||
) |
Public function to retrieve a boolean value from a configuration database.
This function is the public interface for retrieving a boolean value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to look in. |
key | The key to look up. |
value | A memory location to put the value in. |
mcs_response_t mcs_get_double | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
double * | value | ||
) |
Public function to retrieve a double-precision floating point value from a configuration database.
This function is the public interface for retrieving a double value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to look in. |
key | The key to look up. |
value | A memory location to put the value in. |
mcs_response_t mcs_get_float | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
float * | value | ||
) |
Public function to retrieve a floating point value from a configuration database.
This function is the public interface for retrieving a float value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to look in. |
key | The key to look up. |
value | A memory location to put the value in. |
mcs_response_t mcs_get_int | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
int * | value | ||
) |
Public function to retrieve an integer value from a configuration database.
This function is the public interface for retrieving an integer value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to look in. |
key | The key to look up. |
value | A memory location to put the value in. |
mowgli_queue_t* mcs_get_keys | ( | mcs_handle_t * | self, |
const char * | section | ||
) |
Public function to retrieve a mowgli.queue of keys from a configuration database.
This function is the public interface for retrieving a mowgli.queue of keys from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to search. |
mowgli_queue_t* mcs_get_sections | ( | mcs_handle_t * | self | ) |
Public function to retrieve a mowgli.queue of sections from a configuration database.
This function is the public interface for retrieving a mowgli.queue of sections from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
mcs_response_t mcs_get_string | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
char ** | value | ||
) |
Public function to retrieve a string value from a configuration database.
This function is the public interface for retrieving a string value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to look in. |
key | The key to look up. |
value | A memory location to put the value in. |
void mcs_handle_class_init | ( | void | ) |
Initialises the mowgli.object.class for the mcs.handle object.
Referenced by mcs_init().
mcs_handle_t* mcs_new | ( | char * | domain | ) |
References mcs_backend_select(), mcs_backends_lst, mcs_backend_t::mcs_new, and mcs_backend_t::name.
mcs_response_t mcs_set_bool | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
int | value | ||
) |
Public function to set a boolean value in a configuration database.
This function is the public interface for boolean a string value in a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to set the value in. |
key | The key to set. |
value | The value to set. |
mcs_response_t mcs_set_double | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
double | value | ||
) |
Public function to set a double-precision floating point value in a configuration database.
This function is the public interface for setting a double value in a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to set the value in. |
key | The key to set. |
value | The value to set. |
mcs_response_t mcs_set_float | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
float | value | ||
) |
Public function to set a floating point value in a configuration database.
This function is the public interface for setting a float value in a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to set the value in. |
key | The key to set. |
value | The value to set. |
mcs_response_t mcs_set_int | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
int | value | ||
) |
Public function to set an integer value in a configuration database.
This function is the public interface for setting an integer value in a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to set the value in. |
key | The key to set. |
value | The value to set. |
mcs_response_t mcs_set_string | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key, | ||
const char * | value | ||
) |
Public function to set a string value in a configuration database.
This function is the public interface for setting a string value in a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to set the value in. |
key | The key to set. |
value | The value to set. |
mcs_response_t mcs_unset_key | ( | mcs_handle_t * | self, |
const char * | section, | ||
const char * | key | ||
) |
Public function to remove a value from a configuration database.
This function is the public interface for removing a value from a configuration database via a configuration backend class.
self | The mcs.handle object that represents the configuration database. |
section | The section to unset the value in. |
key | The key to unset. |
mowgli_queue_t* mcs_backends_lst = NULL |
A list of registered backends.
This is a list of registered backends. It is not part of the public API.
Referenced by mcs_backend_get_list(), mcs_backend_register(), mcs_backend_unregister(), mcs_fini(), and mcs_new().