libmcs  0.6.0
Functions | Variables
mcs_handle_factory.c File Reference
#include "libmcs/mcs.h"

Functions

void mcs_handle_class_init (void)
 Initialises the mowgli.object.class for the mcs.handle object.
mcs_handle_tmcs_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.

Function Documentation

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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to look in.
keyThe key to look up.
valueA memory location to put the value in.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to look in.
keyThe key to look up.
valueA memory location to put the value in.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to look in.
keyThe key to look up.
valueA memory location to put the value in.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to look in.
keyThe key to look up.
valueA memory location to put the value in.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to search.
Returns:
A mowgli.queue of key names in the requested section.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
Returns:
A mowgli.queue of section names in the requested section.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to look in.
keyThe key to look up.
valueA memory location to put the value in.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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)
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to set the value in.
keyThe key to set.
valueThe value to set.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to set the value in.
keyThe key to set.
valueThe value to set.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to set the value in.
keyThe key to set.
valueThe value to set.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to set the value in.
keyThe key to set.
valueThe value to set.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to set the value in.
keyThe key to set.
valueThe value to set.
Returns:
A mcs_response_t value representing the success or failure of the transaction.
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.

Parameters:
selfThe mcs.handle object that represents the configuration database.
sectionThe section to unset the value in.
keyThe key to unset.
Returns:
A mcs_response_t value representing the success or failure of the transaction.

Variable Documentation

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().