OpenICC-Configuration-API - Version 0.1.0
Data Structures | Functions
Configuration API

Data Structures

struct  openiccConfig_s
 Low level Configuration Object. More...
 
struct  openiccDB_s
 High level Configuration Object. More...
 

Functions

const char **const openiccConfigGetDeviceClasses (const char **device_classes, int *count)
 get default device class More...
 
const char * openiccGetShortKeyFromFullKeyPath (const char *key, char **temp)
 get a plain key name More...
 
int openiccDBSetString (const char *keyName, openiccSCOPE_e scope, const char *value, const char *comment)
 set a key name to a value More...
 
char * openiccDBSearchEmptyKeyname (const char *keyParentName, openiccSCOPE_e scope)
 get a empty key name to add a new config group to a array More...
 

Detailed Description

The Configuration API provides a way to store key/value pairs in a canonical way into JSON format DB files.

Function Documentation

const char** const openiccConfigGetDeviceClasses ( const char **  device_classes,
int *  count 
)
char * openiccDBSearchEmptyKeyname ( const char *  keyParentName,
openiccSCOPE_e  scope 
)

get a empty key name to add a new config group to a array

Parameters
[in]keyParentNamea key name string
[in]scopespecify to intended user or system scope
Returns
the free key name from the array
Examples:
test.c.

References openiccDB_s::openiccDB_NewFrom(), and openiccDB_s::openiccDB_Release().

int openiccDBSetString ( const char *  keyName,
openiccSCOPE_e  scope,
const char *  value,
const char *  comment 
)

set a key name to a value

Parameters
[in]keyNamea key name string
[in]scopespecify to intended user or system scope
[in]valuea value string
[in]commenta comment string; The keyName will be deleted with value=NULL and comment="delete".
Returns
0 - success, >=1 - error, <0 - issue
Examples:
test.c.

References openiccDB_s::openiccDB_NewFrom(), and openiccDB_s::openiccDB_Release().

const char * openiccGetShortKeyFromFullKeyPath ( const char *  key,
char **  temp 
)

get a plain key name

This function takes in a key of pattern: "path1/path2/key.attribute" and returns a pure key: "key" without path parts or attributes.

Parameters
[in]keya key name string
[in]tempa temporary string to be freed by the user
Returns
the short key name
Examples:
test.c.