summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include_protected/persistence_client_library_common_data.h (renamed from include_protected/persistence_client_library.h)3
-rw-r--r--include_protected/persistence_client_library_db_access.h2
-rw-r--r--src/Makefile.am14
-rw-r--r--src/persistence_client_library.c55
-rw-r--r--src/persistence_client_library_common_data.c82
-rw-r--r--src/persistence_client_library_custom_loader.c2
-rw-r--r--src/persistence_client_library_file.c2
-rw-r--r--src/persistence_client_library_handle.h2
-rw-r--r--src/persistence_client_library_key.c2
-rw-r--r--src/persistence_client_library_lc_interface.c2
-rw-r--r--src/persistence_client_library_pas_interface.c2
-rw-r--r--src/persistence_client_library_prct_access.h2
12 files changed, 101 insertions, 69 deletions
diff --git a/include_protected/persistence_client_library.h b/include_protected/persistence_client_library_common_data.h
index 7d00175..03fea61 100644
--- a/include_protected/persistence_client_library.h
+++ b/include_protected/persistence_client_library_common_data.h
@@ -25,10 +25,9 @@
extern "C" {
#endif
-#define PERSIST_CLIENT_LIBRARY_INTERFACE_VERSION (0x01000000U)
+#define PERSIST_CLIENT_LIBRARY_COMMON_DATA_INTERFACE_VERSION (0x01000000U)
#include "../include/persistence_client_library_error_def.h"
-#include "crc32.h"
#include <string.h>
#include <stdio.h>
diff --git a/include_protected/persistence_client_library_db_access.h b/include_protected/persistence_client_library_db_access.h
index e9cf3a7..f5dceaf 100644
--- a/include_protected/persistence_client_library_db_access.h
+++ b/include_protected/persistence_client_library_db_access.h
@@ -27,7 +27,7 @@ extern "C" {
#define PERSIST_DATA_ACCESS_INTERFACE_VERSION (0x03000000U)
-#include "persistence_client_library.h"
+#include "persistence_client_library_common_data.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index 92ac187..f5b16a4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,10 +2,10 @@ AUTOMAKE_OPTIONS = foreign
if DEBUG
-AM_CFLAGS = $(DEPS_CFLAGS) -g -I../include \
+AM_CFLAGS = $(DEPS_CFLAGS) -g -I../include \
-Idbus-1.0
else
-AM_CFLAGS = $(DEPS_CFLAGS) -I../include \
+AM_CFLAGS = $(DEPS_CFLAGS) -I../include \
-Idbus-1.0
endif
@@ -15,11 +15,17 @@ include_HEADERS = ../include/persistence_client_library_key.h \
../include/persistence_client_library_error_def.h
-lib_LTLIBRARIES = libpersistence_client_library.la
+lib_LTLIBRARIES = libpersistence_client_library_common_data.la libpersistence_client_library.la
-libpersistence_client_library_la_LIBADD = $(DEPS_LIBS) -ldl
+libpersistence_client_library_common_data_la_SOURCES = \
+ persistence_client_library_common_data.c
+
+
+
+libpersistence_client_library_la_LIBADD = $(DEPS_LIBS) -ldl -lpersistence_client_library_common_data
+
libpersistence_client_library_la_SOURCES = \
persistence_client_library.c \
persistence_client_library_key.c \
diff --git a/src/persistence_client_library.c b/src/persistence_client_library.c
index 3ce740c..b5e3c0b 100644
--- a/src/persistence_client_library.c
+++ b/src/persistence_client_library.c
@@ -18,8 +18,6 @@
*/
-#include "../include_protected/persistence_client_library.h"
-
#include "persistence_client_library_lc_interface.h"
#include "persistence_client_library_pas_interface.h"
#include "persistence_client_library_dbus_service.h"
@@ -43,59 +41,6 @@ extern char* __progname;
/// debug log and trace (DLT) setup
DLT_DECLARE_CONTEXT(persClientLibCtx);
-const char* gResTableCfg = "/resource-table-cfg.itz";
-
-
-/// shared cached default database
-const char* gSharedCachedDefault = "/cached-default.itz";
-/// shared cached database
-const char* gSharedCached = "/cached.itz";
-/// shared write through default database
-const char* gSharedWtDefault = "/wt-default.itz";
-/// shared write through database
-const char* gSharedWt = "/wt.itz";
-
-
-/// local cached default database
-const char* gLocalCachedDefault = "cached-default.itz";
-/// local cached default database
-const char* gLocalCached = "/cached.itz";
-/// local write through default database
-const char* gLocalWtDefault = "wt-default.itz";
-/// local write through default database
-const char* gLocalWt = "/wt.itz";
-
-
-
-/// directory structure node name defintion
-const char* gNode = "/node";
-/// directory structure user name defintion
-const char* gUser = "/user/";
-/// directory structure seat name defintion
-const char* gSeat = "/seat/";
-
-
-/// path prefic for local cached database: /Data/mnt_c/<appId>/<database_name>
-const char* gLocalCachePath = "/Data/mnt-c/%s%s";
-/// path prefic for local write through database /Data/mnt_wt/<appId>/<database_name>
-const char* gLocalWtPath = "/Data/mnt-wt/%s%s";
-/// path prefic for shared cached database: /Data/mnt_c/Shared/Group/<group_no>/<database_name>
-const char* gSharedCachePath = "/Data/mnt-c/%s/Shared_Group_%x%s";
-/// path prefic for shared write through database: /Data/mnt_wt/Shared/Group/<group_no>/<database_name>
-const char* gSharedWtPath = "/Data/mnt-wt/%s/Shared_Group_%x%s";
-
-/// path prefic for shared public cached database: /Data/mnt_c/Shared/Public//<database_name>
-const char* gSharedPublicCachePath = "/Data/mnt-c/%s/Shared_Public%s";
-
-/// path prefic for shared public write through database: /Data/mnt_wt/Shared/Public/<database_name>
-const char* gSharedPublicWtPath = "/Data/mnt-wt/%s/Shared_Public%s";
-
-
-/// application id
-char gAppId[MaxAppNameLen];
-
-/// max key value data size [default 16kB]
-int gMaxKeyValDataSize = defaultMaxKeyValDataSize;
/// library constructor
diff --git a/src/persistence_client_library_common_data.c b/src/persistence_client_library_common_data.c
new file mode 100644
index 0000000..ba029b8
--- /dev/null
+++ b/src/persistence_client_library_common_data.c
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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_access_ll.c
+ * @ingroup Persistence client library
+ * @author Ingo Huerner
+ * @brief Implementation of persistence database low level access
+ * @see
+ */
+
+#include "../include_protected/persistence_client_library_common_data.h"
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+const char* gResTableCfg = "/resource-table-cfg.itz";
+
+
+/// shared cached default database
+const char* gSharedCachedDefault = "/cached-default.itz";
+/// shared cached database
+const char* gSharedCached = "/cached.itz";
+/// shared write through default database
+const char* gSharedWtDefault = "/wt-default.itz";
+/// shared write through database
+const char* gSharedWt = "/wt.itz";
+
+
+/// local cached default database
+const char* gLocalCachedDefault = "cached-default.itz";
+/// local cached default database
+const char* gLocalCached = "/cached.itz";
+/// local write through default database
+const char* gLocalWtDefault = "wt-default.itz";
+/// local write through default database
+const char* gLocalWt = "/wt.itz";
+
+
+
+/// directory structure node name defintion
+const char* gNode = "/node";
+/// directory structure user name defintion
+const char* gUser = "/user/";
+/// directory structure seat name defintion
+const char* gSeat = "/seat/";
+
+
+/// path prefic for local cached database: /Data/mnt_c/<appId>/<database_name>
+const char* gLocalCachePath = "/Data/mnt-c/%s%s";
+/// path prefic for local write through database /Data/mnt_wt/<appId>/<database_name>
+const char* gLocalWtPath = "/Data/mnt-wt/%s%s";
+/// path prefic for shared cached database: /Data/mnt_c/Shared/Group/<group_no>/<database_name>
+const char* gSharedCachePath = "/Data/mnt-c/%s/Shared_Group_%x%s";
+/// path prefic for shared write through database: /Data/mnt_wt/Shared/Group/<group_no>/<database_name>
+const char* gSharedWtPath = "/Data/mnt-wt/%s/Shared_Group_%x%s";
+
+/// path prefic for shared public cached database: /Data/mnt_c/Shared/Public//<database_name>
+const char* gSharedPublicCachePath = "/Data/mnt-c/%s/Shared_Public%s";
+
+/// path prefic for shared public write through database: /Data/mnt_wt/Shared/Public/<database_name>
+const char* gSharedPublicWtPath = "/Data/mnt-wt/%s/Shared_Public%s";
+
+
+/// application id
+char gAppId[MaxAppNameLen];
+
+/// max key value data size [default 16kB]
+int gMaxKeyValDataSize = defaultMaxKeyValDataSize;
+
+
+
+
+
diff --git a/src/persistence_client_library_custom_loader.c b/src/persistence_client_library_custom_loader.c
index dea47ec..0b4dc6e 100644
--- a/src/persistence_client_library_custom_loader.c
+++ b/src/persistence_client_library_custom_loader.c
@@ -17,7 +17,7 @@
*/
#include "persistence_client_library_custom_loader.h"
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
#include <stdio.h>
#include <errno.h>
diff --git a/src/persistence_client_library_file.c b/src/persistence_client_library_file.c
index 2dcaeb0..52f4bcb 100644
--- a/src/persistence_client_library_file.c
+++ b/src/persistence_client_library_file.c
@@ -18,7 +18,7 @@
*/
#include "persistence_client_library_file.h"
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
#include "../include_protected/persistence_client_library_db_access.h"
#include "persistence_client_library_pas_interface.h"
diff --git a/src/persistence_client_library_handle.h b/src/persistence_client_library_handle.h
index 4d1a234..4cdb8e4 100644
--- a/src/persistence_client_library_handle.h
+++ b/src/persistence_client_library_handle.h
@@ -20,7 +20,7 @@
* @see
*/
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
/// handle structure definition
typedef struct _PersistenceHandle_s
diff --git a/src/persistence_client_library_key.c b/src/persistence_client_library_key.c
index 05084dd..c31caf3 100644
--- a/src/persistence_client_library_key.c
+++ b/src/persistence_client_library_key.c
@@ -20,6 +20,7 @@
#include "persistence_client_library_key.h"
#include "../include_protected/persistence_client_library_db_access.h"
+#include "../include_protected/crc32.h"
#include "persistence_client_library_handle.h"
#include "persistence_client_library_pas_interface.h"
@@ -27,7 +28,6 @@
#include "persistence_client_library_custom_loader.h"
-
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// function with handle
diff --git a/src/persistence_client_library_lc_interface.c b/src/persistence_client_library_lc_interface.c
index 1b0fbe4..714c867 100644
--- a/src/persistence_client_library_lc_interface.c
+++ b/src/persistence_client_library_lc_interface.c
@@ -19,7 +19,7 @@
#include "persistence_client_library_lc_interface.h"
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
#include "../include_protected/persistence_client_library_db_access.h"
#include "persistence_client_library_handle.h"
diff --git a/src/persistence_client_library_pas_interface.c b/src/persistence_client_library_pas_interface.c
index dd0ad7c..9175317 100644
--- a/src/persistence_client_library_pas_interface.c
+++ b/src/persistence_client_library_pas_interface.c
@@ -20,7 +20,7 @@
#include "persistence_client_library_pas_interface.h"
#include "persistence_client_library_dbus_service.h"
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
#include <errno.h>
#include <unistd.h>
diff --git a/src/persistence_client_library_prct_access.h b/src/persistence_client_library_prct_access.h
index 201e995..02bab52 100644
--- a/src/persistence_client_library_prct_access.h
+++ b/src/persistence_client_library_prct_access.h
@@ -20,7 +20,7 @@
* @see
*/
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
#include <itzam.h>
/**