core/configuration.h File Reference

#include <glib.h>

Include dependency graph for configuration.h:


Typedefs

typedef _BotDeviceConfiguration BotDeviceConfiguration

Functions

gboolean bot_configuration_load_from_file (const gchar *filename)
gchar * bot_configuration_get_value (BotDeviceConfiguration *configuration, const gchar *key)
BotDeviceConfigurationbot_configuration_new ()
void bot_configuration_free (BotDeviceConfiguration *configuration)
void bot_configuration_set_value (BotDeviceConfiguration *configuration, const gchar *key, const gchar *value)

Detailed Description

Device configuration functions

Overview

The configuration system is based around simple dictionary objects encapsulated by BotDeviceConfiguration. Each configuration object corresponds to the configuration of a single device. This file provides mechanisms for creating, destroying, loading and otherwise manipulating these objects.

BotDeviceConfiguration *config = bot_configuration_new();
bot_configuration_set_value(config, "port", "2000");

Typedef Documentation

typedef struct _BotDeviceConfiguration BotDeviceConfiguration

Opaque configuration object

Examples:
maximal_driver.c.


Function Documentation

void bot_configuration_free ( BotDeviceConfiguration configuration  ) 

Free a BotDeviceConfiguration object

Parameters:
configuration The configuration object to free

gchar* bot_configuration_get_value ( BotDeviceConfiguration configuration,
const gchar *  key 
)

Retrieve the value associated with a given key from a configuration.

Parameters:
configuration The configuration in question
key The key to query
Returns:
The associated value or NULL if no value was found
Examples:
maximal_driver.c.

gboolean bot_configuration_load_from_file ( const gchar *  filename  ) 

Load a configuration from a file by loading the specified drivers and instantiating devices with the associated configuration.

Parameters:
filename The file to load

BotDeviceConfiguration* bot_configuration_new (  ) 

Create a new BotDeviceConfiguration object

Returns:
A newly created configuration object

void bot_configuration_set_value ( BotDeviceConfiguration configuration,
const gchar *  key,
const gchar *  value 
)

Set the value associated with a given key.

Both key and value are copied by this operation so may be immediately freed if desired.

Parameters:
configuration The configuration in question
key A key
value The value to associate with key


(c) 2006 Edinburgh Robotics Ltd.
Generated on Fri Feb 2 11:24:04 2007 for libbot by doxygen 1.5.1