Removed findings after code review; removed memset for arrays, let the compiler do...
[profile/ivi/persistence-client-library.git] / include_protected / persistence_client_library_data_organization.h
1 #ifndef PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_H
2 #define PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_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_data_organization.h
16  * @ingroup        Persistence client library
17  * @author         Ingo Huerner
18  * @brief          Header of the persistence client library data organization.
19  * @see            
20  */
21
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #define  PERSIST_CLIENT_LIBRARY_DATA_ORGANIZATION_INTERFACE_VERSION   (0x01040000U)
28
29 #include "../include/persistence_client_library_error_def.h"
30 #include "../include/persistence_client_library_key.h"
31
32 #include <dlt/dlt.h>
33 #include <dlt/dlt_common.h>
34
35 #include <string.h>
36 #include <stdio.h>
37
38
39 /// constant definitions
40 enum _PersistenceConstantDef
41 {
42    ResIsNoFile          = 0,        /// flag to identify that resource a not file
43    ResIsFile            = 1,        /// flag to identify that resource a file
44    AccessNoLock         = 1,        /// flag to indicate that access is not locked
45
46    PCLnotInitialized    = 0,        /// 
47    PCLinitialized       = 1,        ///
48
49    FileClosed           = 0,
50    FileOpen             = 1,
51
52    NsmShutdownNormal       = 1,        /// lifecycle shutdown normal
53    NsmErrorStatus_OK       = 1,
54    NsmErrorStatus_Fail     = -1,
55
56    ChecksumBufSize         = 64,       /// max checksum size
57
58    DbusSubMatchSize        = 12,       /// max character sub match size
59    DbusMatchRuleSize       = 300,      /// max character size of the dbus match rule size
60
61    PrctKeySize             = 64,       /// persistence resource config table max key size
62    PrctValueSize           = 256,      /// persistence resource config table max value size
63    PrctDbTableSize         = 1024,     /// number of persistence resource config tables to store
64
65    RDRWBufferSize          = 1024,     /// write buffer size
66
67    DbKeySize               = 64,       /// database max key size
68    DbValueSize             = 16384,    /// database max value size
69    DbTableSize             = 1024,     /// database table size
70
71    PasMsg_Block            = 0x0001,   /// persistence administration service block access
72    PasMsg_Unblock          = 0x0002,   /// persistence administration service unblock access
73    PasMsg_WriteBack        = 0x0010,   /// persistence administration service write_back
74
75    PasErrorStatus_RespPend = 0x0001,   /// persistence administration service msg return status
76    PasErrorStatus_OK       = 0x0002,   /// persistence administration service msg return status
77    PasErrorStatus_FAIL     = 0x8000,   /// persistence administration service msg return status
78
79    CustLibMaxLen = 128,             /// max length of the custom library name and path
80    DbKeyMaxLen   = 128,             /// max database key length
81    DbResIDMaxLen = 128,             /// max database key length
82    DbPathMaxLen  = 128,             /// max database path length
83    MaxAppNameLen = 128,             /// max application name
84    MaxPersHandle = 256,             /// max number of parallel open persistence handles
85
86    MaxConfKeyLengthResp    = 32,    /// length of the config key responsible name
87    MaxConfKeyLengthCusName = 32,    /// length of the config key custom name
88    MaxRctLengthCustom_ID   = 64,    /// length of the customer ID
89
90    defaultMaxKeyValDataSize = 16384 /// default limit the key-value data size to 16kB
91 };
92
93
94
95 /// resource configuration table name
96 extern const char* gResTableCfg;
97
98 /// shared cached default database
99 extern const char* gSharedCachedDefault;
100 /// shared cached database
101 extern const char* gSharedCached;
102 /// shared write through default database
103 extern const char* gSharedWtDefault;
104 /// shared write through database
105 extern const char* gSharedWt;
106
107 /// local cached default database
108 extern const char* gLocalCachedDefault;
109 /// local cached default database
110 extern const char* gLocalCached;
111 /// local write through default database
112 extern const char* gLocalWtDefault;
113 /// local write through default database
114 extern const char* gLocalWt;
115
116
117 /// directory structure node name defintion
118 extern const char* gNode;
119 /// directory structure user name defintion
120 extern const char* gUser;
121 /// directory structure seat name defintion
122 extern const char* gSeat;
123
124
125 /// path prefix for local cached database: /Data/mnt_c/<appId>/<database_name>
126 extern const char* gLocalCachePath;
127 /// path prefix for local write through database /Data/mnt_wt/<appId>/<database_name>
128 extern const char* gLocalWtPath;
129 /// path prefix for shared cached database: /Data/mnt_c/Shared/Group/<group_no>/<database_name>
130 extern const char* gSharedCachePath;
131 /// path prefix for shared write through database: /Data/mnt_wt/Shared/Group/<group_no>/<database_name>
132 extern const char* gSharedWtPath;
133 /// path prefix for shared public cached database: /Data/mnt_c/Shared/Public//<database_name>
134 extern const char* gSharedPublicCachePath;
135 /// path prefix for shared public write through database: /Data/mnt_wt/Shared/Public/<database_name>
136 extern const char* gSharedPublicWtPath;
137
138 /// path prefix for local cached files: /Data/mnt_c/<appId>/<user>/>userno>/<seat>/>seatno>/<resource>
139 extern const char* gLocalCacheFilePath;
140
141 /// application id
142 extern char gAppId[MaxAppNameLen];
143
144 /// max key value data size
145 extern int gMaxKeyValDataSize;
146
147 /// the DLT context
148 extern DltContext gDLTContext;
149
150 /// flag to indicate if client library has been initialized
151 extern unsigned int gPclInitialized;
152
153
154 /**
155  * @brief definition of change callback function
156  *
157  * @param pclNotification_s callback notification structure
158  */
159 extern int(* gChangeNotifyCallback)(pclNotification_s * notifyStruct);
160
161
162 #ifdef __cplusplus
163 }
164 #endif
165
166 #endif /* PERSISTENCY_CLIENT_LIBRARY_DATA_ORGANIZATION_H */
167