summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIngo Huerner <ingo.huerner@xse.de>2013-11-04 15:29:56 +0100
committerIngo Huerner <ingo.huerner@xse.de>2013-11-04 15:29:56 +0100
commitacdf21cadc3a942b47f154c1964151f6a1883ddc (patch)
treef11614a607ea861e19d674ad3c72181ca7a60603 /include
parent24366f50a55cfdad1390e3fbc205c2802f4c34c9 (diff)
downloadpersistence-client-library-acdf21cadc3a942b47f154c1964151f6a1883ddc.tar.gz
Added notifications for custom keys; added creat path function
Diffstat (limited to 'include')
-rw-r--r--include/persistence_client_library_error_def.h2
-rw-r--r--include/persistence_client_library_file.h31
-rw-r--r--include/persistence_client_library_key.h14
3 files changed, 40 insertions, 7 deletions
diff --git a/include/persistence_client_library_error_def.h b/include/persistence_client_library_error_def.h
index fd9f403..f23c6da 100644
--- a/include/persistence_client_library_error_def.h
+++ b/include/persistence_client_library_error_def.h
@@ -101,6 +101,8 @@ extern "C" {
#define EPERS_REGISTER_LIFECYCLE (-35)
// failed register admin service dbus
#define EPERS_REGISTER_ADMIN (-36)
+// registration on this key is not allowed
+#define EPERS_NOTIFY_NOT_ALLOWED (-37)
#ifdef __cplusplus
diff --git a/include/persistence_client_library_file.h b/include/persistence_client_library_file.h
index b1aa70a..8ffd48b 100644
--- a/include/persistence_client_library_file.h
+++ b/include/persistence_client_library_file.h
@@ -172,6 +172,37 @@ int pclFileUnmapData(void* address, long size);
*/
int pclFileWriteData(int fd, const void * buffer, int buffer_size);
+
+
+/**
+ * @brief create a path to a file
+ *
+ * @param ldbid logical database ID
+ * @param resource_id the resource ID
+ * @param user_no the user ID; user_no=0 can not be used as user-ID beacause ‘0’ is defined as System/node
+ * @param seat_no the seat number
+ * @param path the path to the file
+ * @param size the size of the path
+ *
+ * @return positive value on success, which must be used when pclFileReleasePath will be called
+ * On error a negative value will be returned with th follwoing error codes:
+ * EPERS_LOCKFS or EPERS_COMMON
+ */
+int pclFileCreatePath(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, char** path, unsigned int* size);
+
+
+/**
+ * @brief release a file path
+ *
+ * @param pathHandle the path to the file
+ * @param path the path
+ *
+ * @return positive value: success;
+ * On error a negative value will be returned with th follwoing error codes:
+ * EPERS_LOCKFS or EPERS_COMMON
+ */
+int pclFileReleasePath(int pathPandle, char* path);
+
/** \} */
#ifdef __cplusplus
diff --git a/include/persistence_client_library_key.h b/include/persistence_client_library_key.h
index 8474f32..42bfd98 100644
--- a/include/persistence_client_library_key.h
+++ b/include/persistence_client_library_key.h
@@ -103,7 +103,7 @@ typedef int(* pclChangeNotifyCallback_t)(pclNotification_s * notifyStruct);
* @param seat_no the seat number
*
* @return positive value: success; On error a negative value will be returned with the following error codes:
- * ::EPERS_LOCKFS
+ * ::EPERS_LOCKFS ::EPERS_NOTIFY_SIG
*/
int pclKeyDelete(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no);
@@ -183,7 +183,7 @@ int pclKeyHandleReadData(int key_handle, unsigned char* buffer, int buffer_size)
* @param callback notification callback
*
* @return positive value: registration OK; On error a negative value will be returned with the following error codes:
- * ::EPERS_LOCKFS
+ * ::EPERS_LOCKFS ::EPERS_MAXHANDLE ::EPERS_NOTIFY_NOT_ALLOWED
*/
int pclKeyHandleRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback_t callback);
@@ -194,7 +194,7 @@ int pclKeyHandleRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback_t
* @param callback notification callback
*
* @return positive value: registration OK; On error a negative value will be returned with the following error codes:
- * ::EPERS_LOCKFS
+ * ::EPERS_LOCKFS ::EPERS_MAXHANDLE ::EPERS_NOTIFY_NOT_ALLOWED
*/
int pclKeyHandleUnRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback_t callback);
@@ -207,7 +207,7 @@ int pclKeyHandleUnRegisterNotifyOnChange(int key_handle, pclChangeNotifyCallback
* use environment variable PERS_MAX_KEY_VAL_DATA_SIZE to modify default size in bytes
*
* @return positive value: the bytes written; On error a negative value will be returned with the following error codes:
- * ::EPERS_LOCKFS ::EPERS_MAX_BUFF_SIZE
+ * ::EPERS_LOCKFS ::EPERS_MAX_BUFF_SIZE ::EPERS_NOTIFY_SIG
*/
int pclKeyHandleWriteData(int key_handle, unsigned char* buffer, int buffer_size);
@@ -240,7 +240,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 the following error codes:
- * ::EPERS_RES_NO_KEY ::EPERS_NOKEYDATA ::EPERS_NOPRCTABLE
+ * ::EPERS_RES_NO_KEY ::EPERS_NOKEYDATA ::EPERS_NOPRCTABLE ::EPERS_NOTIFY_NOT_ALLOWED
*/
int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, pclChangeNotifyCallback_t callback);
@@ -256,7 +256,7 @@ int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, un
* @param callback notification callback
*
* @return positive value: registration OK; On error a negative value will be returned with the following error codes:
- * ::EPERS_RES_NO_KEY ::EPERS_NOKEYDATA ::EPERS_NOPRCTABLE
+ * ::EPERS_RES_NO_KEY ::EPERS_NOKEYDATA ::EPERS_NOPRCTABLE ::EPERS_NOTIFY_NOT_ALLOWED
*/
int pclKeyUnRegisterNotifyOnChange( unsigned int ldbid, const char * resource_id, unsigned int user_no, unsigned int seat_no, pclChangeNotifyCallback_t callback);
@@ -272,7 +272,7 @@ int pclKeyUnRegisterNotifyOnChange( unsigned int ldbid, const char * resource_
* use environment variable PERS_MAX_KEY_VAL_DATA_SIZE to modify default size in bytes
*
* @return positive value: the bytes written; On error a negative value will be returned with the following error codes:
- * ::EPERS_LOCKFS
+ * ::EPERS_LOCKFS ::EPERS_NOTIFY_NOT_ALLOWED
*/
int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, unsigned char* buffer, int buffer_size);