Changed file and key-value API according GENIVI naming conventions
[profile/ivi/persistence-client-library.git] / src / persistence_client_library_handle.h
1 #ifndef PERSISTENCE_CLIENT_LIBRARY_HANDLE_H
2 #define PERSISTENCE_CLIENT_LIBRARY_HANDLE_H
3
4 /******************************************************************************
5  * Project         Persistency
6  * (c) copyright   2012
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_handle.h
16  * @ingroup        Persistence client library
17  * @author         Ingo Huerner
18  * @brief          Header of the persistence client library handle.
19  *                 Library provides an API to access persistent data
20  * @see            
21  */
22
23 #include "../include_protected/persistence_client_library_data_organization.h"
24 #include "../include_protected/persistence_client_library_rc_table.h"
25
26 /// handle structure definition
27 typedef struct _PersistenceHandle_s
28 {
29    PersistenceInfo_s info;    /// persistence info
30    char dbPath[DbPathMaxLen]; /// path to the database
31    char dbKey[DbKeyMaxLen];   /// database key
32 }
33 PersistenceHandle_s;
34
35
36 /// persistence handle array
37 extern PersistenceHandle_s gHandleArray[MaxPersHandle];
38
39
40 /// open file descriptor handle array
41 extern int gOpenFdArray[MaxPersHandle];
42
43
44 /**
45  * @brief get persistence handle
46  *
47  * @return a new handle or 0 if an error occured
48  */
49 int get_persistence_handle_idx();
50
51
52 /**
53  * @brief close persistence handle
54  *
55  * @param the handle to close
56  */
57 void set_persistence_handle_close_idx(int handle);
58
59
60
61
62 #endif /* PERSISTENCY_CLIENT_LIBRARY_HANDLE_H */
63