Created new sub-library wehere common datat will be exported to
authorIngo Huerner <ingo.huerner@xse.de>
Thu, 13 Dec 2012 11:29:17 +0000 (12:29 +0100)
committerIngo Huerner <ingo.huerner@xse.de>
Thu, 13 Dec 2012 11:29:17 +0000 (12:29 +0100)
12 files changed:
include_protected/persistence_client_library_common_data.h [moved from include_protected/persistence_client_library.h with 98% similarity]
include_protected/persistence_client_library_db_access.h
src/Makefile.am
src/persistence_client_library.c
src/persistence_client_library_common_data.c [new file with mode: 0644]
src/persistence_client_library_custom_loader.c
src/persistence_client_library_file.c
src/persistence_client_library_handle.h
src/persistence_client_library_key.c
src/persistence_client_library_lc_interface.c
src/persistence_client_library_pas_interface.c
src/persistence_client_library_prct_access.h

 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>
index e9cf3a7..f5dceaf 100644 (file)
@@ -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"
 
 
 
index 92ac187..f5b16a4 100644 (file)
@@ -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 \
index 3ce740c..b5e3c0b 100644 (file)
@@ -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 (file)
index 0000000..ba029b8
--- /dev/null
@@ -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;
+
+
+
+
+
index dea47ec..0b4dc6e 100644 (file)
@@ -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>
index 2dcaeb0..52f4bcb 100644 (file)
@@ -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"
index 4d1a234..4cdb8e4 100644 (file)
@@ -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
index 05084dd..c31caf3 100644 (file)
@@ -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
index 1b0fbe4..714c867 100644 (file)
@@ -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"
index dd0ad7c..9175317 100644 (file)
@@ -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>
index 201e995..02bab52 100644 (file)
@@ -20,7 +20,7 @@
  * @see
  */
 
-#include "../include_protected/persistence_client_library.h"
+#include "../include_protected/persistence_client_library_common_data.h"
 #include <itzam.h>
 
 /**