summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIngo Huerner <ingo.huerner@xse.de>2013-04-18 11:48:29 +0200
committerIngo Huerner <ingo.huerner@xse.de>2013-04-18 11:48:29 +0200
commit20075d4a4ab86720f0c11dca55726847db61898f (patch)
treec68fbf9c96de5259193cd86e672908100751804b /include
parent515004b1f75c8e2be7101732110c5b50ce9920f6 (diff)
downloadpersistence-client-library-20075d4a4ab86720f0c11dca55726847db61898f.tar.gz
Added reason to notification messages; started with backup file list implementation
Diffstat (limited to 'include')
-rw-r--r--include/persistence_client_library_error_def.h4
-rw-r--r--include/persistence_client_library_key.h28
2 files changed, 26 insertions, 6 deletions
diff --git a/include/persistence_client_library_error_def.h b/include/persistence_client_library_error_def.h
index 3cb5616..458af90 100644
--- a/include/persistence_client_library_error_def.h
+++ b/include/persistence_client_library_error_def.h
@@ -83,6 +83,10 @@ extern "C" {
#define EPERS_DB_KEY_SIZE (-28)
/// db value size is to long
#define EPERS_DB_VALUE_SIZE (-29)
+/// resource is not a key
+#define EPERS_RES_NO_KEY (-30)
+/// chnage notification signal could ne be sent
+#define EPERS_NOTIFY_SIG (-30)
/**
diff --git a/include/persistence_client_library_key.h b/include/persistence_client_library_key.h
index 56c5c3c..0afd071 100644
--- a/include/persistence_client_library_key.h
+++ b/include/persistence_client_library_key.h
@@ -32,7 +32,7 @@ extern "C" {
#endif
-#define PERSIST_KEYVALUEAPI_INTERFACE_VERSION (0x04000000U)
+#define PERSIST_KEYVALUEAPI_INTERFACE_VERSION (0x04100000U)
/**
* status returned in notification structure
@@ -53,16 +53,31 @@ typedef enum _pclNotifyStatus_e
*/
typedef struct _pclNotification_s
{
- pclNotifyStatus_e pclKeyNotify_Status;
- unsigned int ldbid;
- const char * resource_id;
- unsigned int user_no;
- unsigned int seat_no;
+ pclNotifyStatus_e pclKeyNotify_Status; /// notification status
+ unsigned int ldbid; /// logical db id
+ const char * resource_id; /// resource id
+ unsigned int user_no; /// user id
+ unsigned int seat_no; /// seat id
} pclNotification_s;
+enum pclShutdownTypeNotification
+{
+ NSM_SHUTDOWN_TYPE_FAST = 2, /// Client registered for fast lifecycle shutdown
+ NSM_SHUTDOWN_TYPE_NORMAL = 1 /// Client registered for normal lifecycle shutdown
+};
+
+
+/// defiinition of the change callback
typedef int(* pclChangeNotifyCallback_t)(pclNotification_s * notifyStruct);
+/// library constructor
+void pclLibraryConstructor(void) __attribute__((constructor));
+
+/// library deconstructor
+void pclLibraryDestructor(void) __attribute__((destructor));
+
+
/**
* @brief delete persistent data
*
@@ -195,6 +210,7 @@ int pclKeyReadData(unsigned int ldbid, const char* resource_id, unsigned int use
* @param callback notification callback
*
* @return positive value: registration OK; On error a negative value will be returned with th follwoing error codes:
+ * EPERS_RES_NO_KEY EPERS_NOKEYDATA EPERS_NOPRCTABLE
*/
int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, pclChangeNotifyCallback_t callback);