1 #ifndef PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_H
2 #define PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_H
4 /******************************************************************************
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 ******************************************************************************/
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.
27 #define PERSIST_CLIENT_LIBRARY_DATA_ORGANIZATION_INTERFACE_VERSION (0x02000000U)
29 #include "../include/persistence_client_library_error_def.h"
30 #include "../include/persistence_client_library_key.h"
33 #include <dlt/dlt_common.h>
39 /// enumerator used to identify the policy to manage the data
40 typedef enum _PersNotifyRegPolicy_e
42 Notify_register = 0, /**< register to change notifications*/
43 Notify_unregister = 1, /**< unregister for change notifications */
44 Notify_lastEntry, /**<last entry */
45 } PersNotifyRegPolicy_e;
48 /// constant definitions
49 enum _PersistenceConstantDef
51 ResIsNoFile = 0, /// flag to identify that resource a not file
52 ResIsFile = 1, /// flag to identify that resource a file
53 AccessNoLock = 1, /// flag to indicate that access is not locked
55 PCLnotInitialized = 0, ///
56 PCLinitialized = 1, ///
61 NsmShutdownNormal = 1, /// lifecycle shutdown normal
62 NsmErrorStatus_OK = 1,
63 NsmErrorStatus_Fail = -1,
65 ChecksumBufSize = 64, /// max checksum size
67 DbusSubMatchSize = 12, /// max character sub match size
68 DbusMatchRuleSize = 300, /// max character size of the dbus match rule size
70 PrctKeySize = 64, /// persistence resource config table max key size
71 PrctValueSize = 256, /// persistence resource config table max value size
72 PrctDbTableSize = 1024, /// number of persistence resource config tables to store
74 RDRWBufferSize = 1024, /// write buffer size
76 DbKeySize = 64, /// database max key size
77 DbValueSize = 16384, /// database max value size
78 DbTableSize = 1024, /// database table size
80 PasMsg_Block = 0x0001, /// persistence administration service block access
81 PasMsg_Unblock = 0x0002, /// persistence administration service unblock access
82 PasMsg_WriteBack = 0x0010, /// persistence administration service write_back
84 PasErrorStatus_RespPend = 0x0001, /// persistence administration service msg return status
85 PasErrorStatus_OK = 0x0002, /// persistence administration service msg return status
86 PasErrorStatus_FAIL = 0x8000, /// persistence administration service msg return status
88 CustLibMaxLen = 128, /// max length of the custom library name and path
89 DbKeyMaxLen = 128, /// max database key length
90 DbResIDMaxLen = 128, /// max database key length
91 DbPathMaxLen = 128, /// max database path length
92 MaxAppNameLen = 128, /// max application name
93 MaxPersHandle = 256, /// max number of parallel open persistence handles
95 MaxConfKeyLengthResp = 32, /// length of the config key responsible name
96 MaxConfKeyLengthCusName = 32, /// length of the config key custom name
97 MaxRctLengthCustom_ID = 64, /// length of the customer ID
99 defaultMaxKeyValDataSize = 16384 /// default limit the key-value data size to 16kB
104 /// resource configuration table name
105 extern const char* gResTableCfg;
107 /// configurable default database name
108 extern const char* gConfigDefault;
110 /// default database name
111 extern const char* gDefault;
114 /// shared cached database
115 extern const char* gCached;
117 /// write through database name
118 extern const char* gWt;
121 /// directory structure node name defintion
122 extern const char* gNode;
123 /// directory structure user name defintion
124 extern const char* gUser;
125 /// directory structure seat name defintion
126 extern const char* gSeat;
129 /// path prefix for local cached database: /Data/mnt_c/<appId>/<database_name>
130 extern const char* gLocalCachePath;
131 /// path prefix for local write through database /Data/mnt_wt/<appId>/<database_name>
132 extern const char* gLocalWtPath;
133 /// path prefix for shared cached database: /Data/mnt_c/Shared/Group/<group_no>/<database_name>
134 extern const char* gSharedCachePath;
135 /// path prefix for shared write through database: /Data/mnt_wt/Shared/Group/<group_no>/<database_name>
136 extern const char* gSharedWtPath;
137 /// path prefix for shared public cached database: /Data/mnt_c/Shared/Public//<database_name>
138 extern const char* gSharedPublicCachePath;
139 /// path prefix for shared public write through database: /Data/mnt_wt/Shared/Public/<database_name>
140 extern const char* gSharedPublicWtPath;
142 /// path prefix for local cached database: /Data/mnt_c/<appId>/<database_name>
143 extern const char* gLocalCachePathKey;
144 /// path prefix for local write through database /Data/mnt_wt/<appId>/<database_name>
145 extern const char* gLocalWtPathKey;
146 /// path prefix for shared cached database: /Data/mnt_c/Shared/Group/<group_no>/<database_name>
147 extern const char* gSharedCachePathKey;
148 /// path prefix for shared write through database: /Data/mnt_wt/Shared/Group/<group_no>/<database_name>
149 extern const char* gSharedWtPathKey;
150 /// path prefix for shared public cached database: /Data/mnt_c/Shared/Public//<database_name>
151 extern const char* gSharedPublicCachePathKey;
152 /// path prefix for shared public write through database: /Data/mnt_wt/Shared/Public/<database_name>
153 extern const char* gSharedPublicWtPathKey;
155 /// path prefix for local cached files: /Data/mnt_c/<appId>/<user>/>userno>/<seat>/>seatno>/<resource>
156 extern const char* gLocalCacheFilePath;
159 extern char gAppId[MaxAppNameLen];
161 /// max key value data size
162 extern int gMaxKeyValDataSize;
165 extern DltContext gDLTContext;
167 /// flag to indicate if client library has been initialized
168 extern unsigned int gPclInitialized;
171 /// change signal string
172 extern const char* gChangeSignal;
173 /// delete signal string
174 extern const char* gDeleteSignal;
175 /// create signal string
176 extern const char* gCreateSignal;
179 extern char gSendNotifykey[DbKeyMaxLen];
180 extern unsigned int gSendNotifyLdbid;
181 extern unsigned int gSendNotifyUserNo;
182 extern unsigned int gSendNotifySeatNo;
183 extern pclNotifyStatus_e gSendNotifyReason;
185 extern char gRegNotifykey[DbKeyMaxLen];
186 extern unsigned int gRegNotifyLdbid;
187 extern unsigned int gRegNotifyUserNo;
188 extern unsigned int gRegNotifySeatNo;
189 extern PersNotifyRegPolicy_e gRegNotifyPolicy;
192 extern int gTimeoutMs;
194 // dbus pending return value
195 extern int gDbusPendingRvalue;
199 * @brief definition of change callback function
201 * @param pclNotification_s callback notification structure
203 extern int(* gChangeNotifyCallback)(pclNotification_s * notifyStruct);
210 #endif /* PERSISTENCY_CLIENT_LIBRARY_DATA_ORGANIZATION_H */