Adjusted library version information; added define for non shutdown notifications...
[profile/ivi/persistence-client-library.git] / include / persistence_client_library.h
1 #ifndef PERSISTENCY_CLIENT_LIBRARY_H
2 #define PERSISTENCY_CLIENT_LIBRARY_H
3
4 /******************************************************************************
5  * Project         Persistency
6  * (c) copyright   2011
7  * Company         XS Embedded GmbH
8  *****************************************************************************/
9 /******************************************************************************
10  * This Source Code Form is subject to the terms of the
11  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
12  * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
13 ******************************************************************************/
14  /**
15  * \file           persistence_client_library.h
16  * \ingroup        Persistence client library
17  * \author         Ingo Huerner (XSe) / Guy Sagnes (Continental)
18  * \brief          Header of the persistence client library.
19  *                 Library provides an API to access persistent data
20  * \par change history
21  * Date     Author          Version
22  * 25/06/13 Ingo Hürner     1.0.0 - Rework of Init functions
23  * 04/11/13 Ingo Hürner     2.0.0 - Added define for shutdown type none
24  *
25  */
26 /** \ingroup GEN_PERS */
27 /** \defgroup PERS_CLIENT Client: initialisation access
28  *  \{
29  */
30 /** \defgroup PERS_CLIENT_INTERFACE API document
31  *  \{
32  */
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /** \defgroup PCL_DEFINES_API Defines, Struct, Enum
39  * \{
40  */
41
42 #define  PERSIST_API_INTERFACE_VERSION   (0x01030000U)
43
44 /** \} */
45
46
47 /** \defgroup PCL_OVERALL functions for Library Initialisation
48  * The following functions have to be called to allow intialisation of the internal interfaces.
49  * \{
50  */
51
52
53 #define PCL_SHUTDOWN_TYPE_FAST   2      /// Client registered for fast lifecycle shutdown
54 #define PCL_SHUTDOWN_TYPE_NORMAL 1      /// Client registered for normal lifecycle shutdown
55 #define PCL_SHUTDOWN_TYPE_NONE   0      /// Client does not register to lifecycle shutdown
56
57
58 /**
59  * @brief initalize client library.
60  *        This function will be called by the process using the PCL during startup phase.
61  *
62  * @attention This function is currently  N O T  part of the GENIVI compliance specification
63  *
64  * @param appname application name, the name must be a unique name in the system
65  * @param shutdownMode shutdown mode ::PCL_SHUTDOWN_TYPE_FAST or ::PCL_SHUTDOWN_TYPE_NORMAL
66  *
67  * @return positive value: success;
68  *   On error a negative value will be returned with th follwoing error codes:
69  *   ::EPERS_LOCKFS, ::EPERS_NOT_INITIALIZED, ::EPERS_INIT_DBUS_MAINLOOP,
70  */
71 int pclInitLibrary(const char* appname, int shutdownMode);
72
73
74 /**
75  * @brief deinitialize client library
76  *        This function will be called during the shutdown phase of the process which uses the PCL.
77  *
78  * @attention This function is currently  N O T  part of the GENIVI compliance specification
79  *
80  * @return positive value: success;
81  *   On error a negative value will be returned with th follwoing error codes: ::EPERS_LOCKFS
82  */
83 int pclDeinitLibrary(void);
84
85 /** \} */
86
87 #ifdef __cplusplus
88 }
89 #endif
90
91 /** \} */ /* End of API */
92 /** \} */ /* End of MODULE */
93
94
95 #endif /* PERSISTENCY_CLIENT_LIBRARY_H */