Settings
[System]


Data Structures

struct  _AlpSettingsCryptoAttributes
struct  _AlpSettingsEntry
struct  _AlpSettingsValue

Crypto

Security/Crypto extensions

#define ALP_SETTINGS_CRYPTO_ATTR_DEFAULT   (&ALP_SETTINGS_CRYPTO_ATTR_DEFAULT_STRUCT)
 crypto attributes - default settings
#define ALP_SETTINGS_CRYPTO_ATTR_NONE   (&ALP_SETTINGS_CRYPTO_ATTR_NONE_STRUCT)
 crypto attributes - none (unencrypted)
#define ALP_SETTINGS_CRYPTO_ATTR_OFF   (&ALP_SETTINGS_CRYPTO_ATTR_OFF_STRUCT)
 crypto attributes - off (uncrypted, store directly)
typedef _AlpSettingsCryptoAttributes AlpSettingsCryptoAttributes
 A type representing Crypto Attributes.
alp_status_t alp_settings_set_crypto_attributes (AlpSettingsContext *context, const AlpSettingsCryptoAttributes *crypto_attributes)
 Sets crypto attributes for current context.

Defines

#define ALP_NOTIFY_EVENT_SETTINGS_KEY_CHANGE   "/alp/settings/keychange"
#define ALP_SETTINGS_RPC
#define ALP_SETTINGS_VERSION   1
#define ALP_STATUS_SETTINGS_ARGUMENT_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000a0000)
#define ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000b0000)
#define ALP_STATUS_SETTINGS_ENTRY_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00080000)
#define ALP_STATUS_SETTINGS_ENTRY_ITERATOR_AT_END   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00040000)
#define ALP_STATUS_SETTINGS_ENTRY_ITERATOR_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00050000)
#define ALP_STATUS_SETTINGS_ERROR   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00010000)
#define ALP_STATUS_SETTINGS_INCORRECT_TYPE   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00070000)
#define ALP_STATUS_SETTINGS_KEY_EXISTS   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000d0000)
#define ALP_STATUS_SETTINGS_KEY_NOT_FOUND   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00020000)
#define ALP_STATUS_SETTINGS_PERMISSION_DENIED   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000c0000)
#define ALP_STATUS_SETTINGS_STORAGE_FULL   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00200000)
#define ALP_STATUS_SETTINGS_VALUE_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00090000)
#define ALP_STATUS_SETTINGS_VALUE_NOT_DIR   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00060000)
#define ALP_STATUS_SETTINGS_VALUE_NOT_FOUND   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00030000)
#define ALP_STATUS_SETTINGS_VERSION_MISMATCH   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000e0000)
#define ALP_STATUS_SETTINGS_VS_BLOB_EXPORT_BAD   (ALP_CLASS_SETTINGS | 0x00150000 )
#define ALP_STATUS_SETTINGS_VS_BLOB_HDR_BAD   (ALP_CLASS_SETTINGS | 0x00160000 )
#define ALP_STATUS_SETTINGS_VS_BLOB_KEY_BAD   (ALP_CLASS_SETTINGS | 0x00170000 )
#define ALP_STATUS_SETTINGS_VS_BLOB_MAC_BAD   (ALP_CLASS_SETTINGS | 0x00130000 )
#define ALP_STATUS_SETTINGS_VS_BLOB_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00140000 )
#define ALP_STATUS_SETTINGS_VS_DATA_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00190000 )
#define ALP_STATUS_SETTINGS_VS_ENC_UNDEFINED   (ALP_CLASS_SETTINGS | 0x00110000 )
#define ALP_STATUS_SETTINGS_VS_INPUT_PARAM_BAD   (ALP_CLASS_SETTINGS | 0x000f0000 )
#define ALP_STATUS_SETTINGS_VS_MAC_UNDEFINED   (ALP_CLASS_SETTINGS | 0x00120000 )
#define ALP_STATUS_SETTINGS_VS_MASTER_BAD   (ALP_CLASS_SETTINGS | 0x001C0000 )
#define ALP_STATUS_SETTINGS_VS_OPENSSL_BAD   (ALP_CLASS_SETTINGS | 0x001B0000 )
#define ALP_STATUS_SETTINGS_VS_OUTPUT_PARAM_BAD   (ALP_CLASS_SETTINGS | 0x00100000 )
#define ALP_STATUS_SETTINGS_VS_PAYLOAD_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00180000)
#define ALP_STATUS_SETTINGS_VS_RAND_BAD   (ALP_CLASS_SETTINGS | 0x001A0000 )
#define SETTINGS_APP_ID   "com.access.sys.settings"
#define SETTINGS_CHANNEL_NAME   "alp settings"
#define SETTINGS_TIMEOUT   500000
#define SETTINGS_VALUE_INITIALIZER   { ALP_SETTINGS_TYPE_INVALID, { 0 } }

Typedefs

typedef _AlpSettingsContext AlpSettingsContext
 Opaque type for representing a preference service instance.
typedef _AlpSettingsEntry AlpSettingsEntry
 A type representing a key and preference value pair; must be initialized to 0 before use.
typedef _AlpSettingsEntryIterator AlpSettingsEntryIterator
 The iterator for traversing a dir tree key value.
typedef _AlpSettingsValue AlpSettingsValue
 A type representing a preference value; must be initialized to 0 before use.

Enumerations

enum  AlpSettingsFilters {
  ALP_SETTINGS_FILTER_NONE = 0x0, ALP_SETTINGS_FILTER_DIR = 0x1, ALP_SETTINGS_FILTER_NORMAL = 0x2, ALP_SETTINGS_FILTER_DEFAULT = 0x4,
  ALP_SETTINGS_FILTER_ALL = ~0
}
enum  AlpSettingsValueType {
  ALP_SETTINGS_TYPE_INVALID = 0, ALP_SETTINGS_TYPE_STRING, ALP_SETTINGS_TYPE_INT, ALP_SETTINGS_TYPE_FLOAT,
  ALP_SETTINGS_TYPE_BOOL, ALP_SETTINGS_TYPE_LIST, ALP_SETTINGS_TYPE_DIR, ALP_SETTINGS_TYPE_BLOB
}
 Enums for types of preference values. More...

Functions

ALP_SETTINGS_RPC alp_status_t alp_settings_begin_transaction (AlpSettingsContext *context)
 Begins a transaction in which all changes will occur in one shot automatically.
ALP_SETTINGS_RPC alp_status_t alp_settings_cancel_transaction (AlpSettingsContext *context)
 Cancels a transaction which has accumulated a serious of previous write commands.
alp_status_t alp_settings_close (AlpSettingsContext *context)
 Frees the reference to the preference service.
ALP_SETTINGS_RPC alp_status_t alp_settings_complete_transaction (AlpSettingsContext *context)
 Commits a transaction which has accumulated a serious of previous write commands.
ALP_SETTINGS_RPC alp_status_t alp_settings_delete (AlpSettingsContext *context, const char *key)
 Deletes the current key setting, and reverts the key value to default if there is one.
ALP_SETTINGS_RPC alp_status_t alp_settings_delete_tree (AlpSettingsContext *context, const char *key)
 Deletes the all keys (subtree) below a given key as well as that key.
ALP_SETTINGS_RPC alp_status_t alp_settings_delete_tree_keeping_defaults (AlpSettingsContext *context, const char *key)
 Deletes the all keys (subtree) below a given key as well as that key, except keeping default keys intact.
AlpSettingsEntryalp_settings_entry_alloc (void)
 Allocate and return a new entry structure. Entry is initialized to 0.
void alp_settings_entry_free (AlpSettingsEntry *e)
 Deallocates a previously allocated entry object.
alp_status_t alp_settings_entry_get_key_value (const AlpSettingsEntry *entry, char *key, unsigned int key_size, AlpSettingsValue *value)
 Returns the key and the value of the key of an value entry.
void alp_settings_entry_list_free (GList *list)
 Deallocates a list of entry objects; the list is used to represent a list of key-value entries.
alp_status_t alp_settings_entry_set_key_value (AlpSettingsEntry *entry, const char *key, const AlpSettingsValue *value)
 Sets the key and the value of the key of an value entry; old resources are freed, if exist.
const char * alp_settings_errmsg (alp_status_t error)
 Return a string describing a Settings error code.
alp_status_t alp_settings_findkeys_end (AlpSettingsEntryIterator *iterator)
 Completes the traversal represented by the iterator; the associated resources are freed.
alp_status_t alp_settings_findkeys_get_key (AlpSettingsEntryIterator *iterator, char *key, unsigned int key_size)
 Returns the key of the key pointed by an iterator separately.
alp_status_t alp_settings_findkeys_next (AlpSettingsEntryIterator *iterator)
 Advances the iterator to the next key in the list.
ALP_SETTINGS_RPC alp_status_t alp_settings_findkeys_start (AlpSettingsContext *context, const char *dir_path, AlpSettingsEntryIterator **iterator)
 Begin the traversal of the value of a key which is a list of subkeys.
ALP_SETTINGS_RPC alp_status_t alp_settings_get (AlpSettingsContext *context, const char *key, AlpSettingsValue *value)
 Get the current value of a key.
alp_status_t alp_settings_get_cwd (AlpSettingsContext *context, char *buf, size_t buf_size)
 Get the current "directory" in the key space then following key paths which are not absolute are treated as relative to the "directory".
ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_gid (AlpSettingsContext *context, gid_t *gid)
 Get the default gid used when creating new keys.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_mode (AlpSettingsContext *context, mode_t *mode)
 Get the permission used when creating new keys.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_uid (AlpSettingsContext *context, uid_t *uid)
 Get the default gid used when creating new keys.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_gid (AlpSettingsContext *context, const char *key, gid_t *id)
 Get the group id of an existing key.
alp_status_t alp_settings_get_key_blob_value (AlpSettingsContext *context, const char *key, char *value, int buffer_size, int *value_size)
 Get a Blob key-value pair.
alp_status_t alp_settings_get_key_bool_value (AlpSettingsContext *context, const char *key, gboolean *value)
 Get a boolean key-value pair.
alp_status_t alp_settings_get_key_float_value (AlpSettingsContext *context, const char *key, double *value)
 Get a float key-value pair.
alp_status_t alp_settings_get_key_int_value (AlpSettingsContext *context, const char *key, int *value)
 Get an integer key-value pair.
alp_status_t alp_settings_get_key_string_value (AlpSettingsContext *context, const char *key, char *value, unsigned int value_size)
 Get a string key-value pair.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_mode (AlpSettingsContext *context, const char *key, mode_t *mode)
 Get the permission on an existing key.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_multiple_by_glob (AlpSettingsContext *context, const char *key_glob, GList **entries)
 Reads many keys at a time, specified via the key_glob pattern on keys. The key entries returned will contained the value of the key if it exists, otherwise it will contain the value of the associated default key. If neither a key nor any associated default exist matching the key_glob pattern, then an empty list will be return. An entry will never be returned with a default key name.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_multiple_by_glob_full (AlpSettingsContext *context, const char *key_glob, const uint32_t filters, GList **entries)
 Reads many keys at a time, as specified via the key_glob pattern on keys and filters arguments. This function differs from most of the other get API functions in that it treats normal keys (i.e. one that is not a directory key nor have a .default suffix in the key name) and default keys the same way. Hence, a normal key will only be included in the returned list (assuming it isn't being filtered out) if it exists. Additionally, default keys will now be included in the returned list (also assuming they aren't being filtered out).
ALP_SETTINGS_RPC alp_status_t alp_settings_get_type (AlpSettingsContext *context, const char *key, AlpSettingsValueType *type)
 Get the type of the value of a key.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_uid (AlpSettingsContext *context, const char *key, uid_t *id)
 Get the current user id of a key.
ALP_SETTINGS_RPC alp_status_t alp_settings_get_value_size (AlpSettingsContext *context, const char *key, size_t *size)
 Get the type of the value of a key.
ALP_SETTINGS_RPC alp_status_t alp_settings_import_from_file (AlpSettingsContext *context, const char *file)
 Install a set of preferences from an XML file en masse.
alp_status_t alp_settings_init (void)
 Initialize the Settings system.
ALP_SETTINGS_RPC alp_status_t alp_settings_list_keys (AlpSettingsContext *context, const gchar *pattern, AlpSettingsEntryIterator **iterator)
 Return a list of keys matching the specified glob pattern.
alp_status_t alp_settings_open (AlpSettingsContext **context)
 Obtain the preference service.
ALP_SETTINGS_RPC alp_status_t alp_settings_set (AlpSettingsContext *context, const char *key, const AlpSettingsValue *value)
 Set the value of a key; a new key is created if the key does not exist and the old value is overwritten if the key already exists.
alp_status_t alp_settings_set_cwd (AlpSettingsContext *context, const char *cwd)
 Set the current "directory" in the key space then following key paths which are not absolute will be treated as relative to the "directory".
ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_gid (AlpSettingsContext *context, gid_t gid)
 Set the gid used when creating new keys.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_mode (AlpSettingsContext *context, mode_t mode)
 Set the permission used when creating new keys.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_uid (AlpSettingsContext *context, uid_t uid)
 Set the uid used when creating new keys; this API only can be used by root; every other uid results in PERMISSION_DENIED error.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_gid (AlpSettingsContext *context, const char *key, gid_t id)
 Set the group id of an existing key.
alp_status_t alp_settings_set_key_blob_value (AlpSettingsContext *context, const char *key, const char *value, int value_size)
 Set a float.
alp_status_t alp_settings_set_key_bool_value (AlpSettingsContext *context, const char *key, gboolean value)
 Set a boolean key-value pair.
alp_status_t alp_settings_set_key_directory (AlpSettingsContext *context, const char *key)
 Create a directory: this call fails if a key with the same name already exists.
alp_status_t alp_settings_set_key_float_value (AlpSettingsContext *context, const char *key, double value)
 Set a float.
alp_status_t alp_settings_set_key_int_value (AlpSettingsContext *context, const char *key, int value)
 Set an integer key-value pair.
alp_status_t alp_settings_set_key_string_value (AlpSettingsContext *context, const char *key, const char *value)
 Set a string key-value pair.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_mode (AlpSettingsContext *context, const char *key, mode_t mode)
 Set the permission on an existing key.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_multiple (AlpSettingsContext *context, GList *entries)
 Writes many keys at a time.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_notification_on_off (AlpSettingsContext *context, int on_off)
 Set the key change notification to be on or off.
ALP_SETTINGS_RPC alp_status_t alp_settings_set_uid (AlpSettingsContext *context, const char *key, uid_t id)
 Set the user id on an existing key.
AlpSettingsValuealp_settings_value_alloc (void)
 Allocate a new value structure. Value is initialized to 0.
void alp_settings_value_clean (AlpSettingsValue *e)
 Deallocates resources used by a value object but not the value object itself.
void alp_settings_value_free (AlpSettingsValue *e)
 Deallocates a previously allocated value object.
alp_status_t alp_settings_value_get_bool (AlpSettingsValue *value, gboolean *b)
 Get the boolean preference value contained in an value object.
alp_status_t alp_settings_value_get_float (AlpSettingsValue *value, double *f)
 Get the float preference value contained in an value object.
alp_status_t alp_settings_value_get_int (AlpSettingsValue *value, int *i)
 Get the integer preference value contained in an value object.
alp_status_t alp_settings_value_get_list (AlpSettingsValue *value, GList **list)
 Get the dir (list) preference value contained in an value object.
alp_status_t alp_settings_value_get_string (AlpSettingsValue *value, char *string, unsigned int string_size)
 Get the string preference value contained in an value object.
void alp_settings_value_list_free (GList *l)
 Deallocates a list of value objects; the list is used to represent a list value.
alp_status_t alp_settings_value_set_bool (AlpSettingsValue *value, gboolean b)
 Create a bool preference value; the old value, if any, is freed.
alp_status_t alp_settings_value_set_float (AlpSettingsValue *value, double f)
 Create a float preference value; the old value, if any, is freed.
alp_status_t alp_settings_value_set_int (AlpSettingsValue *value, int i)
 Create an integer preference value; the old value, if any, is freed.
alp_status_t alp_settings_value_set_list (AlpSettingsValue *value, const GList *list)
 Set a list (dir) preference value; the old value, if any, is freed.
alp_status_t alp_settings_value_set_string (AlpSettingsValue *value, const char *string)
 Set a string preference value; the old value, if any, is freed.


Define Documentation

#define ALP_NOTIFY_EVENT_SETTINGS_KEY_CHANGE   "/alp/settings/keychange"
 

#define ALP_SETTINGS_CRYPTO_ATTR_DEFAULT   (&ALP_SETTINGS_CRYPTO_ATTR_DEFAULT_STRUCT)
 

crypto attributes - default settings

#define ALP_SETTINGS_CRYPTO_ATTR_NONE   (&ALP_SETTINGS_CRYPTO_ATTR_NONE_STRUCT)
 

crypto attributes - none (unencrypted)

#define ALP_SETTINGS_CRYPTO_ATTR_OFF   (&ALP_SETTINGS_CRYPTO_ATTR_OFF_STRUCT)
 

crypto attributes - off (uncrypted, store directly)

#define ALP_SETTINGS_RPC
 

#define ALP_SETTINGS_VERSION   1
 

#define ALP_STATUS_SETTINGS_ARGUMENT_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000a0000)
 

#define ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000b0000)
 

#define ALP_STATUS_SETTINGS_ENTRY_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00080000)
 

#define ALP_STATUS_SETTINGS_ENTRY_ITERATOR_AT_END   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00040000)
 

#define ALP_STATUS_SETTINGS_ENTRY_ITERATOR_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00050000)
 

#define ALP_STATUS_SETTINGS_ERROR   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00010000)
 

#define ALP_STATUS_SETTINGS_INCORRECT_TYPE   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00070000)
 

#define ALP_STATUS_SETTINGS_KEY_EXISTS   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000d0000)
 

#define ALP_STATUS_SETTINGS_KEY_NOT_FOUND   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00020000)
 

#define ALP_STATUS_SETTINGS_PERMISSION_DENIED   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000c0000)
 

#define ALP_STATUS_SETTINGS_STORAGE_FULL   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00200000)
 

#define ALP_STATUS_SETTINGS_VALUE_INVALID   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00090000)
 

#define ALP_STATUS_SETTINGS_VALUE_NOT_DIR   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00060000)
 

#define ALP_STATUS_SETTINGS_VALUE_NOT_FOUND   ((alp_status_t) ALP_CLASS_SETTINGS | 0x00030000)
 

#define ALP_STATUS_SETTINGS_VERSION_MISMATCH   ((alp_status_t) ALP_CLASS_SETTINGS | 0x000e0000)
 

#define ALP_STATUS_SETTINGS_VS_BLOB_EXPORT_BAD   (ALP_CLASS_SETTINGS | 0x00150000 )
 

#define ALP_STATUS_SETTINGS_VS_BLOB_HDR_BAD   (ALP_CLASS_SETTINGS | 0x00160000 )
 

#define ALP_STATUS_SETTINGS_VS_BLOB_KEY_BAD   (ALP_CLASS_SETTINGS | 0x00170000 )
 

#define ALP_STATUS_SETTINGS_VS_BLOB_MAC_BAD   (ALP_CLASS_SETTINGS | 0x00130000 )
 

#define ALP_STATUS_SETTINGS_VS_BLOB_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00140000 )
 

#define ALP_STATUS_SETTINGS_VS_DATA_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00190000 )
 

#define ALP_STATUS_SETTINGS_VS_ENC_UNDEFINED   (ALP_CLASS_SETTINGS | 0x00110000 )
 

#define ALP_STATUS_SETTINGS_VS_INPUT_PARAM_BAD   (ALP_CLASS_SETTINGS | 0x000f0000 )
 

#define ALP_STATUS_SETTINGS_VS_MAC_UNDEFINED   (ALP_CLASS_SETTINGS | 0x00120000 )
 

#define ALP_STATUS_SETTINGS_VS_MASTER_BAD   (ALP_CLASS_SETTINGS | 0x001C0000 )
 

#define ALP_STATUS_SETTINGS_VS_OPENSSL_BAD   (ALP_CLASS_SETTINGS | 0x001B0000 )
 

#define ALP_STATUS_SETTINGS_VS_OUTPUT_PARAM_BAD   (ALP_CLASS_SETTINGS | 0x00100000 )
 

#define ALP_STATUS_SETTINGS_VS_PAYLOAD_SIZE_BAD   (ALP_CLASS_SETTINGS | 0x00180000)
 

#define ALP_STATUS_SETTINGS_VS_RAND_BAD   (ALP_CLASS_SETTINGS | 0x001A0000 )
 

#define SETTINGS_APP_ID   "com.access.sys.settings"
 

#define SETTINGS_CHANNEL_NAME   "alp settings"
 

#define SETTINGS_TIMEOUT   500000
 

#define SETTINGS_VALUE_INITIALIZER   { ALP_SETTINGS_TYPE_INVALID, { 0 } }
 


Typedef Documentation

typedef struct _AlpSettingsContext AlpSettingsContext
 

Opaque type for representing a preference service instance.

typedef struct _AlpSettingsCryptoAttributes AlpSettingsCryptoAttributes
 

A type representing Crypto Attributes.

typedef struct _AlpSettingsEntry AlpSettingsEntry
 

A type representing a key and preference value pair; must be initialized to 0 before use.

See also:
alp_settings_entry_alloc

alp_settings_entry_free

typedef struct _AlpSettingsEntryIterator AlpSettingsEntryIterator
 

The iterator for traversing a dir tree key value.

typedef struct _AlpSettingsValue AlpSettingsValue
 

A type representing a preference value; must be initialized to 0 before use.

See also:
alp_settings_value_alloc

alp_settings_value_free


Enumeration Type Documentation

enum AlpSettingsFilters
 

Enumerator:
ALP_SETTINGS_FILTER_NONE 
ALP_SETTINGS_FILTER_DIR 
ALP_SETTINGS_FILTER_NORMAL 
ALP_SETTINGS_FILTER_DEFAULT 
ALP_SETTINGS_FILTER_ALL 

enum AlpSettingsValueType
 

Enums for types of preference values.

Enumerator:
ALP_SETTINGS_TYPE_INVALID 
ALP_SETTINGS_TYPE_STRING 
ALP_SETTINGS_TYPE_INT 
ALP_SETTINGS_TYPE_FLOAT 
ALP_SETTINGS_TYPE_BOOL 
ALP_SETTINGS_TYPE_LIST 
ALP_SETTINGS_TYPE_DIR 
ALP_SETTINGS_TYPE_BLOB 


Function Documentation

ALP_SETTINGS_RPC alp_status_t alp_settings_begin_transaction AlpSettingsContext context  ) 
 

Begins a transaction in which all changes will occur in one shot automatically.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_cancel_transaction AlpSettingsContext context  ) 
 

Cancels a transaction which has accumulated a serious of previous write commands.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_close AlpSettingsContext context  ) 
 

Frees the reference to the preference service.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_ERROR on failure

ALP_SETTINGS_RPC alp_status_t alp_settings_complete_transaction AlpSettingsContext context  ) 
 

Commits a transaction which has accumulated a serious of previous write commands.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_delete AlpSettingsContext context,
const char *  key
 

Deletes the current key setting, and reverts the key value to default if there is one.

Parameters:
[in] context referencing the current preference service
[in] key the key string
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_delete_tree AlpSettingsContext context,
const char *  key
 

Deletes the all keys (subtree) below a given key as well as that key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_delete_tree_keeping_defaults AlpSettingsContext context,
const char *  key
 

Deletes the all keys (subtree) below a given key as well as that key, except keeping default keys intact.

Parameters:
[in] context referencing the current preference service
[in] key the key string
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

AlpSettingsEntry* alp_settings_entry_alloc void   ) 
 

Allocate and return a new entry structure. Entry is initialized to 0.

Returns:
the pointer to a newly allocated entry object or NULL on failure
See also:
AlpSettingsEntry

_AlpSettingsEntry

void alp_settings_entry_free AlpSettingsEntry e  ) 
 

Deallocates a previously allocated entry object.

Parameters:
[in] e the pointer to the entry object to be freed - must not be NULL.

alp_status_t alp_settings_entry_get_key_value const AlpSettingsEntry entry,
char *  key,
unsigned int  key_size,
AlpSettingsValue value
 

Returns the key and the value of the key of an value entry.

Parameters:
[in] entry the preference entry
[in] key the string buffer to receive the key string; can be NULL in that case the key is not returned
[in] key_size the size of the buffer key
[out] value the value of the key; can be NULL in that case the value is not returned
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ENTRY_INVALID if the iterator is invalid (not properly initialized with alp_settings_findkeys_start)

ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL if the supplied buffer is too small

void alp_settings_entry_list_free GList *  list  ) 
 

Deallocates a list of entry objects; the list is used to represent a list of key-value entries.

Parameters:
[in] list the pointer to the list of entry objects to be freed

alp_status_t alp_settings_entry_set_key_value AlpSettingsEntry entry,
const char *  key,
const AlpSettingsValue value
 

Sets the key and the value of the key of an value entry; old resources are freed, if exist.

Parameters:
[in] entry the preference entry
[in] key the key string to be set
[in] value the value of the key to be set
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ENTRY_INVALID if an entry cannot be successfully set (for example, if the key or the value parameters are invalid

const char* alp_settings_errmsg alp_status_t  error  ) 
 

Return a string describing a Settings error code.

Parameters:
[in] error an error code
Returns:
a static string which must not be freed

alp_status_t alp_settings_findkeys_end AlpSettingsEntryIterator iterator  ) 
 

Completes the traversal represented by the iterator; the associated resources are freed.

Parameters:
[in] iterator the iterator which represents a directory traversal, must have been created by a previous call to alp_settings_findkeys_start()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if iterator is NULL

ALP_STATUS_SETTINGS_ITERATOR_INVALID if the iterator is invalid (not properly initialized with alp_settings_findkeys_start)

alp_status_t alp_settings_findkeys_get_key AlpSettingsEntryIterator iterator,
char *  key,
unsigned int  key_size
 

Returns the key of the key pointed by an iterator separately.

Parameters:
[in] iterator the iterator
[in] key the string buffer to receive the key string
[out] key_size the size of the buffer key
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if iterator is NULL

ALP_STATUS_SETTINGS_ITERATOR_INVALID if the iterator is invalid (not properly initialized with alp_settings_findkeys_start)

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_findkeys_next AlpSettingsEntryIterator iterator  ) 
 

Advances the iterator to the next key in the list.

Parameters:
[in,out] iterator the iterator which represents a directory traversal
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if iterator is NULL

ALP_STATUS_SETTINGS_ITERATOR_AT_END if the iterator is already at the end of the list

ALP_STATUS_SETTINGS_ITERATOR_INVALID if the iterator is invalid (not properly initialized with alp_settings_findkeys_start)

ALP_SETTINGS_RPC alp_status_t alp_settings_findkeys_start AlpSettingsContext context,
const char *  dir_path,
AlpSettingsEntryIterator **  iterator
 

Begin the traversal of the value of a key which is a list of subkeys.

Parameters:
[in] context referencing the current preference service
[in] dir_path the key whose value is a list of keys (a directory) to be traversed
[out] iterator an "iterator" object created by this function for later traversal operations; to be freed when findkeys_end() is called
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if dir_path key not found

ALP_STATUS_SETTINGS_VALUE_NOT_DIR if the dir_path key is not a directory

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get AlpSettingsContext context,
const char *  key,
AlpSettingsValue value
 

Get the current value of a key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] value the value for the key if the key exists
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_cwd AlpSettingsContext context,
char *  buf,
size_t  buf_size
 

Get the current "directory" in the key space then following key paths which are not absolute are treated as relative to the "directory".

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[out] buf the buffer to contain the "current directory" on output
[in] buf_size the size of the buffer pointed to by the buffer parameter
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL if provided buffer is too small

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_gid AlpSettingsContext context,
gid_t *  gid
 

Get the default gid used when creating new keys.

Parameters:
[in] context referencing the current preference service
[out] gid to hold the value of the mode
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_mode AlpSettingsContext context,
mode_t *  mode
 

Get the permission used when creating new keys.

Parameters:
[in] context referencing the current preference service
[out] mode to hold the value of the mode
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_default_uid AlpSettingsContext context,
uid_t *  uid
 

Get the default gid used when creating new keys.

Parameters:
[in] context referencing the current preference service
[out] uid to hold the value of the uid
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_gid AlpSettingsContext context,
const char *  key,
gid_t *  id
 

Get the group id of an existing key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] id to hold the group id of the key
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_key_blob_value AlpSettingsContext context,
const char *  key,
char *  value,
int  buffer_size,
int *  value_size
 

Get a Blob key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[out] value the pointer to the buffer to receive the Blob value
[in] buffer_size the size of the buffer
[out] value_size the actual size of the Blob returned to the caller
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if a parameter value is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a Blob

ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_key_bool_value AlpSettingsContext context,
const char *  key,
gboolean *  value
 

Get a boolean key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[out] value the value variable to receive the value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if a parameter value is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a bool

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_key_float_value AlpSettingsContext context,
const char *  key,
double *  value
 

Get a float key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[out] value the value variable to receive the float value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if a parameter value is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a float

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_key_int_value AlpSettingsContext context,
const char *  key,
int *  value
 

Get an integer key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[out] value the value variable to receive the value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if a parameter value is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not an integer

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_get_key_string_value AlpSettingsContext context,
const char *  key,
char *  value,
unsigned int  value_size
 

Get a string key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[out] value the value object to receive the value
[in] value_size the size of the value buffer
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if a parameter value is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a string

ALP_STATUS_SETTINGS_BUFFER_TOO_SMALL if value buffer is too short

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_mode AlpSettingsContext context,
const char *  key,
mode_t *  mode
 

Get the permission on an existing key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] mode to hold the permission bits of the key
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_multiple_by_glob AlpSettingsContext context,
const char *  key_glob,
GList **  entries
 

Reads many keys at a time, specified via the key_glob pattern on keys. The key entries returned will contained the value of the key if it exists, otherwise it will contain the value of the associated default key. If neither a key nor any associated default exist matching the key_glob pattern, then an empty list will be return. An entry will never be returned with a default key name.

Parameters:
[in] context referencing the current preference service
[in] key_glob the key GLOB pattern
[out] entries a GList of AlpSettingsEntry which fits the key pattern and can be read by this client, which can be a null list no if keys match the pattern and can be read. This list should be freed with alp_settings_entry_list_free().
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if no keys match key_glob

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

See also:
AlpSettingsEntry

alp_settings_get_multiple_by_glob_full()

alp_settings_entry_list_free()

Example
      alp_status_t err;
      GList *preferences = NULL;
      GList *item;
   
      err = alp_settings_get_multiple_by_glob (context, "/alp/foo/*/prefs/*", &preferences);
      for (item = preferences; item; item = g_list_next (item)) {
          AlpSettingsEntry *entry = (AlpSettingsEntry *) item->data;
           /* do something with entry */
      }
      alp_settings_entry_list_free (preferences);

ALP_SETTINGS_RPC alp_status_t alp_settings_get_multiple_by_glob_full AlpSettingsContext context,
const char *  key_glob,
const uint32_t  filters,
GList **  entries
 

Reads many keys at a time, as specified via the key_glob pattern on keys and filters arguments. This function differs from most of the other get API functions in that it treats normal keys (i.e. one that is not a directory key nor have a .default suffix in the key name) and default keys the same way. Hence, a normal key will only be included in the returned list (assuming it isn't being filtered out) if it exists. Additionally, default keys will now be included in the returned list (also assuming they aren't being filtered out).

Parameters:
[in] context referencing the current preference service
[in] filters specifies which kind of keys will be filtered out
[in] key_glob the key GLOB pattern
[out] entries a GList of AlpSettingsEntry which contains the key value pairs of the keys that match the key pattern and which weren't excluded by the specified filters. If no keys matched the key_glob, the list will be set to NULL. The list should be freed with alp_settings_entry_list_free().
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if no keys match key_glob

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL.

See also:
AlpSettingsEntry

AlpSettingsFilters

alp_settings_get_multiple_by_glob()

alp_settings_entry_list_free()

ALP_SETTINGS_RPC alp_status_t alp_settings_get_type AlpSettingsContext context,
const char *  key,
AlpSettingsValueType type
 

Get the type of the value of a key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] type the type of the value for the key if the key exists
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_uid AlpSettingsContext context,
const char *  key,
uid_t *  id
 

Get the current user id of a key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] id to hold the current uid
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_get_value_size AlpSettingsContext context,
const char *  key,
size_t *  size
 

Get the type of the value of a key.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[out] size the size of the value for the key if the key exists
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_import_from_file AlpSettingsContext context,
const char *  file
 

Install a set of preferences from an XML file en masse.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] file the XML file name
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_init void   ) 
 

Initialize the Settings system.

Returns:
ALP_STATUS_OK on success

ALP_STATUS_ERROR on failure

ALP_SETTINGS_RPC alp_status_t alp_settings_list_keys AlpSettingsContext context,
const gchar *  pattern,
AlpSettingsEntryIterator **  iterator
 

Return a list of keys matching the specified glob pattern.

Parameters:
[in] context referencing the current preference service
[in] pattern the glob pattern for the keys to be retrieved
[out] iterator an "iterator" object created by this function for later traversal operations; to be freed when findkeys_end() is called
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if no key fitting the pattern not found

ALP_STATUS_SETTINGS_VALUE_NOT_DIR if the dir_path key is not a directory

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_open AlpSettingsContext **  context  ) 
 

Obtain the preference service.

Parameters:
[out] context on successful return, a reference to the preference service, which is created by the Setting API and will be freed upon alp_settings_close()
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_ERROR on failure

ALP_SETTINGS_RPC alp_status_t alp_settings_set AlpSettingsContext context,
const char *  key,
const AlpSettingsValue value
 

Set the value of a key; a new key is created if the key does not exist and the old value is overwritten if the key already exists.

Parameters:
[in] context referencing the current preference service
[in] key the key string
[in] value the new value for the key to be set
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_STATUS_SETTINGS_ERROR on failure

alp_status_t alp_settings_set_crypto_attributes AlpSettingsContext context,
const AlpSettingsCryptoAttributes crypto_attributes
 

Sets crypto attributes for current context.

Parameters:
[in] context a reference to the settings service
[in] crypto_attributes crypto attributes to be used for context
Returns:
ALP_STATUS_OK on success

alp_status_t alp_settings_set_cwd AlpSettingsContext context,
const char *  cwd
 

Set the current "directory" in the key space then following key paths which are not absolute will be treated as relative to the "directory".

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] cwd the new "current directory"
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_gid AlpSettingsContext context,
gid_t  gid
 

Set the gid used when creating new keys.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] gid the new access permission
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_mode AlpSettingsContext context,
mode_t  mode
 

Set the permission used when creating new keys.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] mode the new access permission
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_default_uid AlpSettingsContext context,
uid_t  uid
 

Set the uid used when creating new keys; this API only can be used by root; every other uid results in PERMISSION_DENIED error.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] uid the new access permission
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_gid AlpSettingsContext context,
const char *  key,
gid_t  id
 

Set the group id of an existing key.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key whose gid is to be set
[in] id the new gid
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_blob_value AlpSettingsContext context,
const char *  key,
const char *  value,
int  value_size
 

Set a float.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[in] value the address of the Blob
[in] value_size the size of the Blob
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_bool_value AlpSettingsContext context,
const char *  key,
gboolean  value
 

Set a boolean key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[in] value the boolean value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_directory AlpSettingsContext context,
const char *  key
 

Create a directory: this call fails if a key with the same name already exists.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_KEY_EXISTS if key exists already

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_float_value AlpSettingsContext context,
const char *  key,
double  value
 

Set a float.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[in] value the float value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_int_value AlpSettingsContext context,
const char *  key,
int  value
 

Set an integer key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[in] value the integer value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

alp_status_t alp_settings_set_key_string_value AlpSettingsContext context,
const char *  key,
const char *  value
 

Set a string key-value pair.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key string
[in] value the string value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ERROR if failure

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_mode AlpSettingsContext context,
const char *  key,
mode_t  mode
 

Set the permission on an existing key.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key whose access permission is to be set
[in] mode the new access permission
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_multiple AlpSettingsContext context,
GList *  entries
 

Writes many keys at a time.

Parameters:
[in] context referencing the current preference service
[in,out] entries a GList of key-value entries to be set; on return each entry contains the alp_status_t code of its individual key set results
Returns:
ALP_STATUS_OK on success (note the errors of indivudual keys are returned in the entry struct; the overall status will not reflect individual errors

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_SETTINGS_RPC alp_status_t alp_settings_set_notification_on_off AlpSettingsContext context,
int  on_off
 

Set the key change notification to be on or off.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] on_off turn the notification on (TRUE) or off (FALSE)
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

ALP_SETTINGS_RPC alp_status_t alp_settings_set_uid AlpSettingsContext context,
const char *  key,
uid_t  id
 

Set the user id on an existing key.

Parameters:
[in] context a reference to the preference service returned previously by alp_settings_open()
[in] key the key whose id is to be set
[in] id the new user id
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_ARGUMENT_INVALID if context is NULL

ALP_STATUS_SETTINGS_KEY_NOT_FOUND if key does not exist

ALP_STATUS_SETTINGS_PERMISSION_DENIED if no permission for operation

AlpSettingsValue* alp_settings_value_alloc void   ) 
 

Allocate a new value structure. Value is initialized to 0.

Returns:
the pointer to a newly allocated value object or NULL on failure

void alp_settings_value_clean AlpSettingsValue e  ) 
 

Deallocates resources used by a value object but not the value object itself.

Parameters:
[in] e the pointer to the value object to be cleaned

void alp_settings_value_free AlpSettingsValue e  ) 
 

Deallocates a previously allocated value object.

Parameters:
[in] e the pointer to the value object to be freed - must not be NULL.

alp_status_t alp_settings_value_get_bool AlpSettingsValue value,
gboolean *  b
 

Get the boolean preference value contained in an value object.

Parameters:
[in] value the value object
[out] b the pointer to a boolean to receive the boolean value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not an boolean

ALP_STATUS_SETTINGS_VALUE_INVALID if this value object contains no valid value data

alp_status_t alp_settings_value_get_float AlpSettingsValue value,
double *  f
 

Get the float preference value contained in an value object.

Parameters:
[in] value the value object
[out] f the float to receive the float value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a float

ALP_STATUS_SETTINGS_VALUE_INVALID if this value object contains no valid value data

alp_status_t alp_settings_value_get_int AlpSettingsValue value,
int *  i
 

Get the integer preference value contained in an value object.

Parameters:
[in] value the value object
[out] i the integer to receive the integral value
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not an integer

ALP_STATUS_SETTINGS_VALUE_INVALID if this value object contains no valid value data

alp_status_t alp_settings_value_get_list AlpSettingsValue value,
GList **  list
 

Get the dir (list) preference value contained in an value object.

Parameters:
[in] value the value object
[out] list the list object to receive the list data (a list of AlpSettingsEntry_t). A copy of the current list will be allocated and created. This list needs to be freed by the caller
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a dir/list

ALP_STATUS_SETTINGS_VALUE_INVALID if this value object contains no valid value data

alp_status_t alp_settings_value_get_string AlpSettingsValue value,
char *  string,
unsigned int  string_size
 

Get the string preference value contained in an value object.

Parameters:
[in] value the value object
[out] string the string buffer to receive the string value
[in] string_size the size of the string buffer
Returns:
ALP_STATUS_OK on success

ALP_STATUS_SETTINGS_INCORRECT_TYPE if the value is not a string

ALP_STATUS_SETTINGS_VALUE_INVALID if this value object contains no valid value data

void alp_settings_value_list_free GList *  l  ) 
 

Deallocates a list of value objects; the list is used to represent a list value.

Parameters:
[in] l the pointer to the list of value objects to be freed

alp_status_t alp_settings_value_set_bool AlpSettingsValue value,
gboolean  b
 

Create a bool preference value; the old value, if any, is freed.

Parameters:
[in,out] value the value to be set
[in] b the boolean to be set
Returns:
ALP_STATUS_OK on success

alp_status_t alp_settings_value_set_float AlpSettingsValue value,
double  f
 

Create a float preference value; the old value, if any, is freed.

Parameters:
[in,out] value the value to be set
[in] f the float to be set
Returns:
ALP_STATUS_OK on success

alp_status_t alp_settings_value_set_int AlpSettingsValue value,
int  i
 

Create an integer preference value; the old value, if any, is freed.

Parameters:
[in,out] value the value to be set
[in] i to integer to be set
Returns:
ALP_STATUS_OK on success

alp_status_t alp_settings_value_set_list AlpSettingsValue value,
const GList *  list
 

Set a list (dir) preference value; the old value, if any, is freed.

Parameters:
[in,out] value the value to be set
[in] list the directory or list of to be set; the list should contain AlpSettingsEntry_t's
Returns:
ALP_STATUS_OK on success

alp_status_t alp_settings_value_set_string AlpSettingsValue value,
const char *  string
 

Set a string preference value; the old value, if any, is freed.

Parameters:
[in,out] value the value to be set
[in] string the string to be set
Returns:
ALP_STATUS_OK on success


Generated on Wed Jul 30 07:06:44 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.