1 #ifndef PERSISTENCE_CLIENT_LIBRARY_CUSTOM_H
2 #define PERSISTENCE_CLIENT_LIBRARY_CUSTOM_H
4 /****************************************************
6 * Created on: 09-Jul-2012 11:38:03
7 * Implementation of the Interface PersCustom
8 * Original author: ihuerner, G.Sagnes
10 * \file persistence_client_custom.h
11 * \brief Implementation of the Interface PersCustom
14 * - SW-Subsystem: EG-SI
15 * - SW-Domain: Persistence
16 * - Interface Visibility: Protected
19 * Date Author Version Description
20 * 2013.06.26 ihuerner 1.5.0.0 added description of parameters
21 * 2013.01.06 ihuerner 1.4.0.0 plugin_handle_open and plugin_set_data changed from char* to const char*
22 * 2012.11.22 gsagnes 1.3.0.0 add the handle_get_size, correct the type to int
23 * 2012.10.16 gsagnes 1.2.0.0 add get_size, create_backup, restore_backup
24 * 2012.10.04 gsagnes 1.1.0.0 add deinitialisation functionality (call during shutdown)
25 * 2012.07.14 ihuerner 1.0.0.0 Initial version of the interface
28 ****************************************************/
30 /** \ingroup GEN_PERS_CLIENTLIB_INTERFACE API document
35 The lower significant byte is equal 0 for released version only
37 #define PERSIST_CUSTOMER_INTERFACE_VERSION (0x01050000U)
\r
40 * <b>Plugin interface:</b>
41 * All plugins in a specual location will be loaded, and according
42 * to the plugin name functions will created.
44 * function name: plugin_open
45 * Loaded plugin name: hwi
46 * Generated function: hwi_plugin_open
50 * @brief create backup
52 * @param backup_id Name of the backup / identifier
54 * @return positive value: backup success (size of backup, bytes); negative value: error
56 int plugin_create_backup(const char* backup_id);
59 * @brief deinitialize plugin (during shutdown)
61 * @return positive value: init success; negative value: error
68 * @param path the path to the data to delete
70 * @return positive value: delete success; negative value: error
72 int plugin_delete_data(const char* path);
75 * @brief get backup name
77 * @param backup_id Name of the backup / identifier
78 * @param size size of the buffer to return the identifier
80 * @return positive value: success, length of identifier; negative value: error
82 int plugin_get_backup(char* backup_id, int size);
85 * @brief gets the size of persistent data in bytes
87 * @param path the path to the data
89 * @return positive value: the size; negative value: error code
91 int plugin_get_size(const char* path);
96 * @param path the path to the resource to get
97 * @param buffer the buffer to store data
98 * @param size the number of bytes to get data
100 * @return positive value: size data read in bytes; negative value: error
102 int plugin_get_data(const char* path, char* buffer, int size);
105 * @brief close the given handle
107 * @param handle the handle to close
109 * @return positive value: successfully closed; negative value: error
111 int plugin_handle_close(int handle);
116 * @param handle the handle returned from open
117 * @param buffer the buffer to store data
118 * @param size the number of bytes to get data
120 * @return positive value: size data read in bytes; negative value: error
122 int plugin_handle_get_data(int handle, char* buffer, int size);
125 * @brief open a resource
127 * @param path the path to the resource to open
128 * @param flag open flags
129 * @param mode the open mode
131 * @return positive value: handle; negative value: error
133 int plugin_handle_open(const char* path, int flag, int mode);
138 * @param handle the handle given by open
139 * @param buffer the data to write
140 * @param size the number of bytes to write
142 * @return positive size data set; negative value: error
144 int plugin_handle_set_data(int handle, char* buffer, int size);
147 * @brief initialize plugin
149 * @return positive value: init success; negative value: error
154 * @brief restore backup
156 * @param backup_id Name of the backup / identifier
158 * @return positive value: backup success (size of backup, bytes); negative value: error
160 int plugin_restore_backup(const char* backup_id);
165 * @param path the path to the resource to set
166 * @param buffer the data to write
167 * @param size the number of bytes to write
169 * @return positive size data set; negative value: error
171 int plugin_set_data(const char* path, char* buffer, int size);
174 * @brief typdef of callback function prototype
176 * @param int pass a statusId to the function
177 * @param void* pass an argument to the function
179 typedef int (*plugin_callback_t) (int, void*);
182 * @brief registercallback for status notifications
184 * @param pFunct the callback
186 * @return positive value: register success; negative value error
188 int plugin_get_status_notification_clbk(plugin_callback_t pFunct);
193 * @param handle the handle given by open
195 * @return positive value: the size; negative value: error code
197 int plugin_handle_get_size(int handle);
199 #endif /* PERSISTENCE_CLIENT_LIBRARY_CUSTOM_H */
200 /** \} */ /* End of INTERFACE */