Functions

configuration.c File Reference

Functions for setting and deleting configuration parameters in the database. More...

#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <sqlite3.h>
#include <eurephia_nullsafe.h>
#include <eurephia_context.h>
#include <eurephia_log.h>
#include <eurephia_values.h>
#include <eurephia_xml.h>
#include "../sqlite.h"
Include dependency graph for configuration.c:

Go to the source code of this file.

Functions

static int config_set (eurephiaCTX *ctx, const char *key, const char *val)
static int config_delete (eurephiaCTX *ctx, const char *key)
xmlDoc * validate_key_value (eurephiaCTX *ctx, const char *key, const char *value)
xmlDoc * eDBadminConfiguration (eurephiaCTX *ctx, xmlDoc *cfgxml)

Detailed Description

Functions for setting and deleting configuration parameters in the database.

Author:
David Sommerseth <dazo@users.sourceforge.net>
Date:
2009-09-13

Definition in file configuration.c.


Function Documentation

static int config_delete ( eurephiaCTX ctx,
const char *  key 
) [static]

Internal function. Deletes a configuration parameter from the database.

Parameters:
ctx eurephiaCTX
key String (char *) containing the key to be deleted.
Returns:
Returns 1 on success, otherwise 0

< Messages intended when debugging. Only for log level > 10

< The context is used via the eurephiadm console utility

< The context is used via a web based utility

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

< Input data or processing revealed unexpected data. Log level never > 2

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

Definition at line 105 of file configuration.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int config_set ( eurephiaCTX ctx,
const char *  key,
const char *  val 
) [static]

Internal function. Sets a configuration parameter in the database. If the key already exists, it will be replaced. This operation will immediately update the in-memory copy of the setting.

Parameters:
ctx eurephiaCTX
key String (char *) containing the key name of the value
val String (char *) with the value to be stored
Returns:
Returns 1 on success, otherwise 0

< Messages intended when debugging. Only for log level > 10

< The context is used via the eurephiadm console utility

< The context is used via a web based utility

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

Definition at line 57 of file configuration.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* eDBadminConfiguration ( eurephiaCTX ctx,
xmlDoc *  cfgxml 
)

Set or delete configuration parameters in the database. This operation will also update the in-memory copy of the configuration

Parameters:
ctx eurephiaCTX
cfgxml XML document specifying the operation

XML format skeleton for setting or deleting configuration parameters

 <eurephia format="1">
      <configuration>
         <set key="{name of the key}">{Value to be assigned}</set>
         <delete key="{name of the key"}/>
      </configuration>
 </eurephia>

Only one operation can be called per request to this function.

Returns:
Returns a valid XML document with information about the operation, or NULL on fatal errors.
See also:
eurephiaXML_CreateDoc()

< Messages intended when debugging. Only for log level > 10

< The context is used via the eurephiadm console utility

< The context is used via a web based utility

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

Definition at line 170 of file configuration.c.

Here is the call graph for this function:

xmlDoc* validate_key_value ( eurephiaCTX ctx,
const char *  key,
const char *  value 
)

Internal function. Validates if key or value strings are NULL or not.

Parameters:
ctx eurephiaCTX
key char pointer to the key string
value char pointer to the value string
Returns:
Returns NULL if key and value is not NULL. Otherwise an eurephia XML document with an error description will be returned.

Definition at line 151 of file configuration.c.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines