Changed file and key-value API according GENIVI naming conventions
[profile/ivi/persistence-client-library.git] / include / persistence_client_library_key.h
index 61550cc..fc75498 100644 (file)
@@ -7,23 +7,9 @@
  * Company         XS Embedded GmbH
  *****************************************************************************/
 /******************************************************************************
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-   DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-   TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
-   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * This Source Code Form is subject to the terms of the
+ * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
+ * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ******************************************************************************/
  /**
  * @file           persistence_client_library_key.h
  *                 Library provides an API to access persistent data
  * @see            
  */
+/** \ingroup SSW_PERS */
+/** \defgroup SSW_PERS_KEYVALUE Client: Key-value access
+ *  \{
+ */
+/** \defgroup SSW_PERS_KEYVALUE_INTERFACE API document
+ *  \{
+ */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
-#define        PERSIST_KEYVALUEAPI_INTERFACE_VERSION   (0x01000000U)
+#define        PERSIST_KEYVALUEAPI_INTERFACE_VERSION   (0x03000000U)
 
 
 
@@ -51,9 +44,10 @@ extern "C" {
  * @param user_no  the user ID
  * @param seat_no  the seat number (seat 0 to 3)
  *
- * @return positive value: success; negative value: error code
+ * @return positive value: success; On error a negative value will be returned with th follwoing error codes:
+ * EPERS_LOCKFS
  */
-int key_delete(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no);
+int pclKeyDelete(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no);
 
 
 
@@ -65,18 +59,20 @@ int key_delete(unsigned char ldbid, char* resource_id, unsigned char user_no, un
  * @param user_no  the user ID
  * @param seat_no  the seat number (seat 0 to 3)
  *
- * @return positive value: the size; negative value: error code
+ * @return positive value: the size; On error a negative value will be returned with th follwoing error codes:
+ * EPERS_LOCKFS, EPERS_BADPOL, EPERS_NOKEY, EPERS_NOKEYDATA or EPERS_NOPRCTABLE
  */
-int key_get_size(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no);
+int pclKeyGetSize(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no);
 
 /**
  * @brief close the access to a key-value identified by key handle
  *
  * @param key_handle key value handle return by key_handle_open()
  *
- * @return positive value: success; negative value: error code
+ * @return positive value: success; On error a negative value will be returned with th follwoing error codes:
+ * EPERS_LOCKFS
  */
-int key_handle_close(int key_handle);
+int pclKeyHandleClose(int key_handle);
 
 
 
@@ -85,9 +81,9 @@ int key_handle_close(int key_handle);
  *
  * @param key_handle key value handle return by key_handle_open()
  *
- * @return positive value: the size; negative value: error code
+ * @return positive value: the size; On error a negative value will be returned with th follwoing error codes:
  */
-int key_handle_get_size(int key_handle);
+int pclKeyHandleGetSize(int key_handle);
 
 
 
@@ -99,9 +95,10 @@ int key_handle_get_size(int key_handle);
  * @param user_no  the user ID
  * @param seat_no  the seat number (seat 0 to 3)
  *
- * @return positive value: the key handle to access the value; negative value: Error code
+ * @return positive value: the key handle to access the value;
+ * On error a negative value will be returned with th follwoing error codes:
  */
-int key_handle_open(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no);
+int pclKeyHandleOpen(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no);
 
 
 
@@ -112,9 +109,10 @@ int key_handle_open(unsigned char ldbid, char* resource_id, unsigned char user_n
  * @param buffer the buffer for persistent data
  * @param buffer_size size of buffer for reading
  *
- * @return positive value: the bytes read; negative value: error code
+ * @return positive value: the bytes read; On error a negative value will be returned with th follwoing error codes:
+ *
  */
-int key_handle_read_data(int key_handle, unsigned char* buffer, unsigned long buffer_size);
+int pclKeyHandleReadData(int key_handle, unsigned char* buffer, int buffer_size);
 
 
 
@@ -123,9 +121,9 @@ int key_handle_read_data(int key_handle, unsigned char* buffer, unsigned long bu
  *
  * @param key_handle key value handle return by key_handle_open()
  *
- * @return positive value: registration OK; negative value: error code
+ * @return positive value: registration OK; On error a negative value will be returned with th follwoing error codes:
  */
-int key_handle_register_notify_on_change(int key_handle);
+int pclKeyHandleRegisterNotifyOnChange(int key_handle);
 
 
 
@@ -137,9 +135,9 @@ int key_handle_register_notify_on_change(int key_handle);
  * @param buffer_size the number of bytes to write (default max size is set to 16kB)
  *                    use environment variable PERS_MAX_KEY_VAL_DATA_SIZE to modify default size in bytes
  *
- * @return positive value: the bytes written; negative value: error code
+ * @return positive value: the bytes written; On error a negative value will be returned with th follwoing error codes:
  */
-int key_handle_write_data(int key_handle, unsigned char* buffer, unsigned long buffer_size);
+int pclKeyHandleWriteData(int key_handle, unsigned char* buffer, int buffer_size);
 
 
 
@@ -153,9 +151,9 @@ int key_handle_write_data(int key_handle, unsigned char* buffer, unsigned long b
  * @param buffer the buffer to read the persistent data
  * @param buffer_size size of buffer for reading
  *
- * @return positive value: the bytes read; negative value: error code
+ * @return positive value: the bytes read; On error a negative value will be returned with th follwoing error codes:
  */
-int key_read_data(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no, unsigned char* buffer, unsigned long buffer_size);
+int pclKeyReadData(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, unsigned char* buffer, int buffer_size);
 
 
 
@@ -167,9 +165,9 @@ int key_read_data(unsigned char ldbid, char* resource_id, unsigned char user_no,
  * @param user_no  the user ID
  * @param seat_no  the seat number (seat 0 to 3)
  *
- * @return positive value: registration OK; negative value: error code
+ * @return positive value: registration OK; On error a negative value will be returned with th follwoing error codes:
  */
-int key_register_notify_on_change(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no);
+int pclKeyRegisterNotifyOnChange(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no);
 
 
 
@@ -184,15 +182,17 @@ int key_register_notify_on_change(unsigned char ldbid, char* resource_id, unsign
  * @param buffer_size the number of bytes to write (default max size is set to 16kB)
  *                    use environment variable PERS_MAX_KEY_VAL_DATA_SIZE to modify default size in bytes
  *
- * @return positive value: the bytes written; negative value: error code
+ * @return positive value: the bytes written; On error a negative value will be returned with th follwoing error codes:
  */
-int key_write_data(unsigned char ldbid, char* resource_id, unsigned char user_no, unsigned char seat_no, unsigned char* buffer, unsigned long buffer_size);
+int pclKeyWriteData(unsigned int ldbid, const char* resource_id, unsigned int user_no, unsigned int seat_no, unsigned char* buffer, int buffer_size);
 
 
 #ifdef __cplusplus
 }
 #endif
 
+/** \} */ /* End of API */
+/** \} */ /* End of MODULE */
 
 #endif /* PERSISTENCY_CLIENT_LIBRARY_KEY_H */