diff options
author | Ingo Huerner <ingo.huerner@xse.de> | 2013-04-08 23:49:35 +0200 |
---|---|---|
committer | Ingo Huerner <ingo.huerner@xse.de> | 2013-04-08 23:49:35 +0200 |
commit | cc01613b747e0ec2fbdad19b4ae3e97ea4d2fd14 (patch) | |
tree | 687eb2004f15438b55c08a63e180adc3a6fddee9 /include_protected | |
parent | 9f0a5460f1d7b62b4588dcd1538f3ae8f4802e41 (diff) | |
download | persistence-client-library-cc01613b747e0ec2fbdad19b4ae3e97ea4d2fd14.tar.gz |
Added backup file and checksum creation for files
Diffstat (limited to 'include_protected')
3 files changed, 20 insertions, 4 deletions
diff --git a/include_protected/persistence_client_library_data_organization.h b/include_protected/persistence_client_library_data_organization.h index 74a1aeb..3ed3a11 100644 --- a/include_protected/persistence_client_library_data_organization.h +++ b/include_protected/persistence_client_library_data_organization.h @@ -48,6 +48,8 @@ enum _PersistenceConstantDef NsmErrorStatus_OK = 1, NsmErrorStatus_Fail = -1, + ChecksumBufSize = 64, + PrctKeySize = 64, /// persistence resource config table max key size PrctValueSize = 256, /// persistence resource config table max value size PrctDbTableSize = 1024, /// number of persistence resource config tables to store @@ -131,7 +133,7 @@ extern char gAppId[MaxAppNameLen]; extern int gMaxKeyValDataSize; -extern int(* gChangeNotifyCallback)(PersistenceNotification_s * notifyStruct); +extern int(* gChangeNotifyCallback)(pclNotification_s * notifyStruct); #ifdef __cplusplus diff --git a/include_protected/persistence_client_library_db_access.h b/include_protected/persistence_client_library_db_access.h index 1958b0a..a105ac2 100644 --- a/include_protected/persistence_client_library_db_access.h +++ b/include_protected/persistence_client_library_db_access.h @@ -118,7 +118,7 @@ void pers_db_close_all(); * @return 0 of registration was successfull; -1 if registration failes */ int persistence_reg_notify_on_change(char* dbPath, char* key, unsigned int ldbid, unsigned int user_no, unsigned int seat_no, - changeNotifyCallback_t callback); + pclChangeNotifyCallback_t callback); diff --git a/include_protected/persistence_client_library_rc_table.h b/include_protected/persistence_client_library_rc_table.h index 054d23c..813638f 100644 --- a/include_protected/persistence_client_library_rc_table.h +++ b/include_protected/persistence_client_library_rc_table.h @@ -23,7 +23,9 @@ extern "C" { #endif -#define PERSIST_DATA_RC_TABLE_INTERFACE_VERSION (0x02000000U) +#include <fcntl.h> // needed for file open flags + +#define PERSIST_DATA_RC_TABLE_INTERFACE_VERSION (0x03000000U) #include "persistence_client_library_data_organization.h" @@ -77,13 +79,25 @@ typedef struct _PersistenceDbContext_s } PersistenceDbContext_s; +typedef enum PersistencePermission_e_ +{ + PersistencePermission_ReadWrite = O_RDWR, + PersistencePermission_ReadOnly = O_RDONLY, + PersistencePermission_WriteOnly = O_WRONLY, + + /** insert new entries here ... */ + PersistencePermission_LastEntry /**< last entry */ +} PersistencePermission_e; + + + /// structure used to manage the persistence configuration for a key typedef struct _PersistenceConfigurationKey_s { PersistencePolicy_e policy; /**< policy */ PersistenceStorage_e storage; /**< definition of storage to use */ PersistenceResourceType_e type; /**< type of the resource - since 4.0.0.0*/ - unsigned int permission; /**< access right, corresponds to UNIX */ + PersistencePermission_e permission; /**< file access flags*/ unsigned int max_size; /**< max size expected for the key */ char reponsible[MaxConfKeyLengthResp]; /**< name of responsible application */ char custom_name[MaxConfKeyLengthCusName]; /**< name of the customer plugin */ |