diff options
author | Ingo Huerner <ingo.huerner@xse.de> | 2014-04-16 15:31:59 +0200 |
---|---|---|
committer | Ingo Huerner <ingo.huerner@xse.de> | 2014-04-16 15:31:59 +0200 |
commit | 7a40679af6e3c6e1093f49139d92081f619228a9 (patch) | |
tree | 80b7c1ab36889c0a98f11edf84e1855a322773af /include | |
parent | ec56747849e789c554e3707fc5b8b27bb780ca89 (diff) | |
download | persistence-client-library-7a40679af6e3c6e1093f49139d92081f619228a9.tar.gz |
Added pclLifecycleSet function
Diffstat (limited to 'include')
-rw-r--r-- | include/persistence_client_library.h | 32 | ||||
-rw-r--r-- | include/persistence_client_library_error_def.h | 34 |
2 files changed, 47 insertions, 19 deletions
diff --git a/include/persistence_client_library.h b/include/persistence_client_library.h index 4370158..29bbcb1 100644 --- a/include/persistence_client_library.h +++ b/include/persistence_client_library.h @@ -49,10 +49,12 @@ extern "C" { * \{ */ +#define PCL_SHUTDOWN 1 /// trigger shutdown +#define PCL_SHUTDOWN_CANEL 0 // cancel shutdown -#define PCL_SHUTDOWN_TYPE_FAST 2 /// Client registered for fast lifecycle shutdown -#define PCL_SHUTDOWN_TYPE_NORMAL 1 /// Client registered for normal lifecycle shutdown -#define PCL_SHUTDOWN_TYPE_NONE 0 /// Client does not register to lifecycle shutdown +#define PCL_SHUTDOWN_TYPE_FAST 2 /// Client registered for fast lifecycle shutdown +#define PCL_SHUTDOWN_TYPE_NORMAL 1 /// Client registered for normal lifecycle shutdown +#define PCL_SHUTDOWN_TYPE_NONE 0 /// Client does not register to lifecycle shutdown /** @@ -65,7 +67,7 @@ extern "C" { * @param shutdownMode shutdown mode ::PCL_SHUTDOWN_TYPE_FAST or ::PCL_SHUTDOWN_TYPE_NORMAL * * @return positive value: success; - * On error a negative value will be returned with th following error codes: + * On error a negative value will be returned with the following error codes: * ::EPERS_NOT_INITIALIZED, ::EPERS_INIT_DBUS_MAINLOOP, * ::EPERS_REGISTER_LIFECYCLE, ::EPERS_REGISTER_ADMIN */ @@ -83,6 +85,28 @@ int pclInitLibrary(const char* appname, int shutdownMode); */ int pclDeinitLibrary(void); + + + +/** + * @brief pclLifecycleSet client library + * This function can be called if to flush and write back the data form cache to memory device. + * The function is only available if PCL_SHUTDOWN_TYPE_NONE has been used in pclInitLibrary. + * + * @attention This function is currently N O T part of the GENIVI compliance specification + * @attention In order to prevent misuse of this function the cancel shutdown request + * can only be called 3 times per lifecycle. + * + * @parm PCL_SHUTDOWN for write back data when shutdown is requested, + * and PCL_SHUTDOWN_CANEL when shutdown cancel request has been received. + * + * @return positive value: success; + * On error a negative value will be returned with the following error codes: + * ::EPERS_COMMON, :.EPERS_MAX_CANCEL_SHUTDOWN, ::EPERS_SHTDWN_NO_PERMIT + */ +int pclLifecycleSet(int shutdown); + + /** \} */ #ifdef __cplusplus diff --git a/include/persistence_client_library_error_def.h b/include/persistence_client_library_error_def.h index 04bbf0f..d8de109 100644 --- a/include/persistence_client_library_error_def.h +++ b/include/persistence_client_library_error_def.h @@ -51,17 +51,17 @@ extern "C" { #define EPERS_OPENFILE (-10) /// invalid buffer or key #define EPERS_DESER_BUFORKEY (-11) -/// can't allocat memory for deserialization of keyvalue +/// can't allocate memory for deserialization of key/value #define EPERS_DESER_ALLOCMEM (-12) -/// no ploicy avaliable in data to serialize +/// no ploicy available in data to serialize #define EPERS_DESER_POLICY (-13) -/// no store type avaliable in data to serialize +/// no store type available in data to serialize #define EPERS_DESER_STORE (-14) -/// no permission avaliable in data to serialize +/// no permission available in data to serialize #define EPERS_DESER_PERM (-15) -/// no max size avaliable in data to serialize +/// no max size available in data to serialize #define EPERS_DESER_MAXSIZE (-16) -/// no responsibility avaliable in data to serialize +/// no responsibility available in data to serialize #define EPERS_DESER_RESP (-17) /// out of array bounds #define EPERS_OUTOFBOUNDS (-18) @@ -71,7 +71,7 @@ extern "C" { #define EPERS_CONFIGNOTAVAILABLE (-20) /// can't stat config file #define EPERS_CONFIGNOSTAT (-21) -/// plugin functin not found +/// plugin function not found #define EPERS_NOPLUGINFCNT (-22) /// dlopen error #define EPERS_DLOPENERROR (-23) @@ -79,7 +79,7 @@ extern "C" { #define EPERS_NOPLUGINFUNCT (-24) /// file remove error #define EPERS_FILEREMOVE (-25) -/// err code to signalize last entry in DB +/// err code to signalizes last entry in DB #define EPERS_LAST_ENTRY_IN_DB (-26) /// internal database error #define EPERS_DB_ERROR_INTERNAL (-27) @@ -93,20 +93,24 @@ extern "C" { #define EPERS_NOTIFY_SIG (-31) /// client library has not been initialized #define EPERS_NOT_INITIALIZED (-32) -// max buffer size +/// max buffer size #define EPERS_MAX_BUFF_SIZE (-33) -// failed to setup dbus mainloop +/// failed to setup dbus mainloop #define EPERS_DBUS_MAINLOOP (-34) -// failed register lifecycle dbus +/// failed register lifecycle dbus #define EPERS_REGISTER_LIFECYCLE (-35) -// failed register admin service dbus +/// failed register admin service dbus #define EPERS_REGISTER_ADMIN (-36) -// registration on this key is not allowed +/// registration on this key is not allowed #define EPERS_NOTIFY_NOT_ALLOWED (-37) -// the requested resource is not a file +/// the requested resource is not a file #define EPERS_RESOURCE_NO_FILE (-38) -// write to requested resource failed, read onyl resource +/// write to requested resource failed, read only resource #define EPERS_RESOURCE_READ_ONLY (-39) +/// max numbers of cancel shutdown exceeded +#define EPERS_SHTDWN_MAX_CANCEL (-40) +/// not permitted to use this function +#define EPERS_SHTDWN_NO_PERMIT (-42) #ifdef __cplusplus } |