include/hiker/settings.h File Reference

#include <glib.h>
#include <hiker/config.h>
#include <hiker/sysclass.h>
#include <hiker/types.h>
#include <sys/types.h>

Go to the source code of this file.

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_H_   1
#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_SETTINGS_H_   1
 


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

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