From 236796526d94f802508d31f6ea234bf0fb8c1719 Mon Sep 17 00:00:00 2001 From: Ingo Huerner Date: Fri, 4 Apr 2014 16:58:18 +0200 Subject: Removed itzam, and switched to commom library; Known issues: delete key test fails, DLT warnings --- src/persistence_client_library_data_organization.h | 262 +++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 src/persistence_client_library_data_organization.h (limited to 'src/persistence_client_library_data_organization.h') diff --git a/src/persistence_client_library_data_organization.h b/src/persistence_client_library_data_organization.h new file mode 100644 index 0000000..21075b4 --- /dev/null +++ b/src/persistence_client_library_data_organization.h @@ -0,0 +1,262 @@ +#ifndef PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_H +#define PERSISTENCE_CLIENT_LIBRARY_DATA_ORGANIZATION_H + +/****************************************************************************** + * Project Persistency + * (c) copyright 2012 + * Company XS Embedded GmbH + *****************************************************************************/ +/****************************************************************************** + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed + * with this file, You can obtain one at http://mozilla.org/MPL/2.0/. +******************************************************************************/ + /** + * @file persistence_client_library_data_organization.h + * @ingroup Persistence client library + * @author Ingo Huerner + * @brief Header of the persistence client library data organization. + * @see + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +#define PERSIST_CLIENT_LIBRARY_DATA_ORGANIZATION_INTERFACE_VERSION (0x03000000U) + +#include "../include/persistence_client_library_error_def.h" +#include "../include/persistence_client_library_key.h" + +#include + +#include +#include + +#include +#include + + + +/// structure used to manage database context +typedef struct _PersistenceDbContext_s +{ + unsigned int ldbid; + unsigned int user_no; + unsigned int seat_no; +} PersistenceDbContext_s; + +/// persistence information +typedef struct _PersistenceInfo_s +{ + PersistenceDbContext_s context; /**< database context*/ + PersistenceConfigurationKey_s configKey; /**< prct configuration key*/ + +} PersistenceInfo_s; + + +/** storages to manage the data */ +typedef enum PersDefaultType_e_ +{ + PersDefaultType_Configurable = 0, /**< get the data from configurable defaults */ + PersDefaultType_Factory, /**< get the data from factory defaults */ + + /** insert new entries here ... */ + PersDefaultType_LastEntry /**< last entry */ + +} PersDefaultType_e; + +/** storages to manage the data */ +typedef enum PersGetDefault_e_ +{ + PersGetDefault_Data = 0, /**< get the data from configurable defaults */ + PersGetDefault_Size, /**< get the data from factory defaults */ + + /** insert new entries here ... */ + PersGetDefault_LastEntry /**< last entry */ + +} PersGetDefault_e; + +/// enumerator used to identify the policy to manage the data +typedef enum _PersNotifyRegPolicy_e +{ + Notify_register = 0, /**< register to change notifications*/ + Notify_unregister = 1, /**< unregister for change notifications */ + Notify_lastEntry, /**/ +extern const char* gLocalCachePath; +/// path prefix for local write through database /Data/mnt_wt// +extern const char* gLocalWtPath; +/// path prefix for shared cached database: /Data/mnt_c/Shared/Group// +extern const char* gSharedCachePath; +/// path prefix for shared write through database: /Data/mnt_wt/Shared/Group// +extern const char* gSharedWtPath; +/// path prefix for shared public cached database: /Data/mnt_c/Shared/Public// +extern const char* gSharedPublicCachePath; +/// path prefix for shared public write through database: /Data/mnt_wt/Shared/Public/ +extern const char* gSharedPublicWtPath; + +/// path prefix for local cached database: /Data/mnt_c// +extern const char* gLocalCachePathKey; +/// path prefix for local write through database /Data/mnt_wt// +extern const char* gLocalWtPathKey; +/// path prefix for shared cached database: /Data/mnt_c/Shared/Group// +extern const char* gSharedCachePathKey; +/// path prefix for shared write through database: /Data/mnt_wt/Shared/Group// +extern const char* gSharedWtPathKey; +/// path prefix for shared public cached database: /Data/mnt_c/Shared/Public// +extern const char* gSharedPublicCachePathKey; +/// path prefix for shared public write through database: /Data/mnt_wt/Shared/Public/ +extern const char* gSharedPublicWtPathKey; + +/// path prefix for local cached files: /Data/mnt_c///>userno>//>seatno>/ +extern const char* gLocalCacheFilePath; + +/// application id +extern char gAppId[MaxAppNameLen]; + +/// max key value data size +extern int gMaxKeyValDataSize; + +/// the DLT context +extern DltContext gPclDLTContext; + +/// flag to indicate if client library has been initialized +extern unsigned int gPclInitialized; + + +/// change signal string +extern const char* gChangeSignal; +/// delete signal string +extern const char* gDeleteSignal; +/// create signal string +extern const char* gCreateSignal; + + +/** + * Global notification variables, will be used to pass + * the notification information into the mainloop. + */ +/// notification key string +extern char gNotifykey[DbKeyMaxLen]; +/// notification lbid +extern unsigned int gNotifyLdbid; +/// notification user number +extern unsigned int gNotifyUserNo; +/// notification seat number +extern unsigned int gNotifySeatNo; +/// notification reason (created, changed, deleted) +extern pclNotifyStatus_e gNotifyReason; +/// notification policy (register or unregister) +extern PersNotifyRegPolicy_e gNotifyPolicy; + + +// dbus timeout (5 seconds) +extern int gTimeoutMs; + +// dbus pending return value +extern int gDbusPendingRvalue; + + +/** + * @brief definition of change callback function + * + * @param pclNotification_s callback notification structure + */ +extern int(* gChangeNotifyCallback)(pclNotification_s * notifyStruct); + + +#ifdef __cplusplus +} +#endif + +#endif /* PERSISTENCY_CLIENT_LIBRARY_DATA_ORGANIZATION_H */ + -- cgit v1.2.1