diff options
-rw-r--r-- | src/Makefile.am.in | 82 | ||||
-rwxr-xr-x | src/gen-makefile-am.sh | 42 | ||||
-rwxr-xr-x | src/platform_adapters/linux/platform_DLL.cpp | 2 | ||||
-rwxr-xr-x | src/sysync/dataobjtype.cpp | 3 | ||||
-rwxr-xr-x | src/sysync/engineentry.h | 144 | ||||
-rw-r--r-- | src/sysync/syncsession.cpp | 1 | ||||
-rw-r--r-- | src/sysync_SDK/Sources/UI_util.cpp | 54 | ||||
-rw-r--r-- | src/sysync_SDK/Sources/UI_util.h | 6 | ||||
-rw-r--r-- | src/sysync_SDK/Sources/enginemodulebridge.cpp | 5 | ||||
-rw-r--r-- | src/sysync_SDK/Sources/enginemodulebridge.h | 1 | ||||
-rwxr-xr-x | src/sysync_SDK/Sources/sync_dbapidef.h | 3 |
11 files changed, 219 insertions, 124 deletions
diff --git a/src/Makefile.am.in b/src/Makefile.am.in index 7ff58aa..4681fa7 100644 --- a/src/Makefile.am.in +++ b/src/Makefile.am.in @@ -9,26 +9,43 @@ $(srcdir)/Makefile.am: $(srcdir)/Makefile.am.in $(srcdir)/gen-makefile-am.sh cd $(srcdir) && sh ./gen-makefile-am.sh +# versioning for *all* libs +# +# CURRENT - most recent interface version +# REVISION - minor version number of that interface implementation +# AGE - number of previous interface versions supported in addition +# to the current one +# +# When adding to the interface, increment CURRENT and AGE and reset +# REVISION to zero. When breaking the interface in a backwards +# incompatible way, increment CURRENT and reset AGE and REVISION to +# zero. When fixing something without interface change, increment +# REVISION. +ENGINE_CURRENT = 2 +ENGINE_REVISION = 0 +ENGINE_AGE = 2 + CLEANFILES = EXTRA_DIST = -lib_LTLIBRARIES = libsmltk.la libsynthesis.la libsynthesissdk.la +lib_LTLIBRARIES = libsmltk.la libsynthesis.la libsynthesisserver.la libsynthesissdk.la nobase_include_HEADERS = @LIBSYNTHESISSDK_HEADERS@ synthesis/target_options.h # Configuration header files are searched in this order: # - Targets/ReleasedProducts/autotools: files only used when compiling with autotools -# - Targets/ReleasedProducts/[clientEngine_opensource_linux|SDK]: files also used with Synthesis Linux makefile +# - Targets/ReleasedProducts/[clientEngine_opensource_linux|serverEngine_opensource_linux|SDK]: files also used with Synthesis Linux makefile # # Always included first via -include: # - config.h: configure result (top directory) -# - Targets/ReleasedProducts/clientEngine_opensource_linux/clientengine_demo_x86_linux_prefix.h +# - Targets/ReleasedProducts/clientEngine_opensource_linux/clientengine_demo_x86_linux_prefix.h resp. Targets/ReleasedProducts/serverEngine_opensource_linux/serverengine_opensource_linux_prefix.h # # Included as needed: # - define.h: hard-coded SyncML Toolkit config (from search path above) -libsynthesis_la_SOURCES = @LIBSYNTHESIS_SOURCES@ +libsynthesis_la_SOURCES = @LIBSYNTHESIS_SOURCES@ \ + $(XMLPARSE_SOURCES) libsynthesis_la_CPPFLAGS = -I$(srcdir)/sysync_SDK/Sources -LIBSYNTHESIS_CFLAGS = \ +libsynthesis_la_CFLAGS = \ -include $(top_builddir)/config.h \ -include $(srcdir)/Targets/ReleasedProducts/clientEngine_opensource_linux/clientengine_demo_x86_linux_prefix.h \ -I$(srcdir)/Targets/ReleasedProducts/clientEngine_autotools/ \ @@ -51,13 +68,33 @@ LIBSYNTHESIS_CFLAGS = \ -I$(srcdir)/DB_interfaces/odbc_db/ \ -I$(srcdir)/DB_interfaces/api_db/ \ -I$(srcdir)/sysync_SDK/Sources/ \ - $(PCRE_CFLAGS) $(SQLITE3_CFLAGS) $(ZLIB_CFLAGS) $(XMLPARSE_CFLAGS) $(LIBICAL_CFLAGS) $(LIBECAL_CFLAGS) -libsynthesis_la_CFLAGS = $(LIBSYNTHESIS_CFLAGS) -libsynthesis_la_CXXFLAGS = $(LIBSYNTHESIS_CFLAGS) + $(PCRE_CFLAGS) \ + $(SQLITE3_CFLAGS) \ + $(ZLIB_CFLAGS) \ + $(XMLPARSE_CFLAGS) \ + $(XMLPARSE_CFLAGS_BUILTIN) \ + $(LIBICAL_CFLAGS) \ + $(LIBECAL_CFLAGS) +libsynthesis_la_CXXFLAGS = $(libsynthesis_la_CFLAGS) libsynthesis_la_LIBADD = $(PCRE_LIBS) $(SQLITE3_LIBS) $(XMLPARSE_LIBS) $(LIBICAL_LIBS) $(LIBECAL_LIBS) libsmltk.la +libsynthesis_la_LDFLAGS = -version-info $(ENGINE_CURRENT):$(ENGINE_REVISION):$(ENGINE_AGE) \ + -Wl,--version-script=$(srcdir)/synthesis-linker.map +libsynthesis_la_DEPENDENCIES = $(srcdir)/synthesis-linker.map libsmltk.la + + +libsynthesisserver_la_SOURCES = @LIBSYNTHESISSERVER_SOURCES@ \ + $(XMLPARSE_SOURCES) +libsynthesisserver_la_CPPFLAGS = $(libsynthesis_la_CPPFLAGS) +libsynthesisserver_la_CFLAGS = $(subst clientEngine,serverEngine, \ + $(subst clientengine_demo_x86_linux_prefix.h,serverengine_opensource_linux_prefix.h, $(libsynthesis_la_CFLAGS))) +libsynthesisserver_la_CXXFLAGS = $(libsynthesisserver_la_CFLAGS) +libsynthesisserver_la_LIBADD = $(libsynthesis_la_LIBADD) +libsynthesisserver_la_LDFLAGS = $(libsynthesis_la_LDFLAGS) +libsynthesisserver_la_DEPENDENCIES = $(libsynthesis_la_DEPENDENCIES) + if COND_XMLPARSE -LIBSYNTHESIS_CFLAGS += -I$(srcdir)/expat -I$(srcdir)/expat/xmltok -I$(srcdir)/expat/xmlparse -libsynthesis_la_SOURCES += \ +XMLPARSE_CFLAGS_BUILTIN = -I$(srcdir)/expat -I$(srcdir)/expat/xmltok -I$(srcdir)/expat/xmlparse +XMLPARSE_SOURCES = \ expat/xmlparse/xmlparse.c \ expat/xmlparse/xmlparse.h \ expat/xmltok/ascii.h \ @@ -77,28 +114,9 @@ EXTRA_DIST += \ expat/xmltok/xmltok_ns.c else # add path to xmlparse.h which includes the system's xmltok/xmlparse.h -LIBSYNTHESIS_CFLAGS += -I$(srcdir)/Targets/ReleasedProducts/clientEngine_autotools/systemxml +XMLPARSE_CFLAGS_BUILTIN = -I$(srcdir)/Targets/ReleasedProducts/clientEngine_autotools/systemxml endif -# versioning: -# CURRENT - most recent interface version -# REVISION - minor version number of that interface implementation -# AGE - number of previous interface versions supported in addition -# to the current one -# -# When adding to the interface, increment CURRENT and AGE and reset -# REVISION to zero. When breaking the interface in a backwards -# incompatible way, increment CURRENT and reset AGE and REVISION to -# zero. When fixing something without interface change, increment -# REVISION. -ENGINE_CURRENT = 2 -ENGINE_REVISION = 0 -ENGINE_AGE = 2 -libsynthesis_la_LDFLAGS = -version-info $(ENGINE_CURRENT):$(ENGINE_REVISION):$(ENGINE_AGE) \ - -Wl,--version-script=$(srcdir)/synthesis-linker.map -libsynthesis_la_DEPENDENCIES = $(srcdir)/synthesis-linker.map libsmltk.la - -libsynthesissdk_la_LIBADD = libsynthesis.la libsynthesissdk_la_LDFLAGS = -static libsynthesissdk_la_SOURCES = @LIBSYNTHESISSDK_HEADERS@ if COND_STATIC @@ -131,8 +149,8 @@ synthesis/target_options.h: $(srcdir)/Targets/ReleasedProducts/SDK/target_option # libsmltk: compiled just like libsynthesis libsmltk_la_SOURCES = @LIBSMLTK_SOURCES@ -libsmltk_la_CFLAGS = $(LIBSYNTHESIS_CFLAGS) -libsmltk_la_CXXFLAGS = $(LIBSYNTHESIS_CFLAGS) +libsmltk_la_CFLAGS = $(libsynthesis_la_CFLAGS) +libsmltk_la_CXXFLAGS = $(libsmltk_la_CFLAGS) # versioning: same as of engine! changes in libsmltk are not tracked separately. libsmltk_la_LDFLAGS = -version-info $(ENGINE_CURRENT):$(ENGINE_REVISION):$(ENGINE_AGE) \ diff --git a/src/gen-makefile-am.sh b/src/gen-makefile-am.sh index b94270f..a39dce3 100755 --- a/src/gen-makefile-am.sh +++ b/src/gen-makefile-am.sh @@ -4,11 +4,45 @@ # automake. This is necessary because automake cannot build a list # of source files dynamically. -# find expression for files which are in sysync_SDK/Sources but only -# need to be compiled into libsynthesissdk.a -SDK_FILES='-name admindata.cpp -o -name admindata.h -o -name blobs.cpp -o -name blobs.h -o -name dbitem.cpp -o -name dbitem.h -o -name enginemodulebridge.cpp -o -name enginemodulebridge.h -o -name stringutil.cpp -o -name stringutil.h -o -name target_options.h -o -name timeutil.cpp -o -name timeutil.h -o -name UI_util.cpp -o -name UI_util.h' +# directories which contain sources for the sync engine +ENGINE_SOURCES="sysync DB_interfaces sysync_SDK/Sources Transport_interfaces/engine platform_adapters" -sed -e "s;@LIBSYNTHESIS_SOURCES@;`find sysync DB_interfaces sysync_SDK/Sources Transport_interfaces/engine platform_adapters syncapps/clientEngine_custom \( -name '*.cpp' -o -name '*.[ch]' \) \! \( ${SDK_FILES} -o -name clientprovisioning_inc.cpp -o -name \*_tables_inc.cpp -o -name syncserver.cpp -o -name syncsessiondispatch.cpp \) -printf '%p '`;" \ +# files needed exclusively for libsynthesissdk.a +SDK_FILES="-false `sed -e 's/^/-o -name /' <<EOF +enginemodulebridge.cpp +enginemodulebridge.h +stringutil.cpp +stringutil.h +target_options.h +timeutil.cpp +timeutil.h +UI_util.cpp +UI_util.h +EOF`" + +# files needed exclusively for the client engine +CLIENT_FILES="-false `sed -e 's/^/-o -name /' <<EOF +binfile.cpp +binfileimplds.cpp +binfileimplclient.cpp +binfilebase.cpp +engineclientbase.cpp +syncclient.cpp +syncclientbase.cpp +EOF`" + +# files needed exclusively for the server engine +SERVER_FILES="-false `sed -e 's/^/-o -name /' <<EOF +admindata.cpp +admindata.h +blobs.cpp +blobs.h +enginesessiondispatch.cpp +syncserver.cpp +EOF`" + +sed -e "s;@LIBSYNTHESIS_SOURCES@;`find ${ENGINE_SOURCES} syncapps/clientEngine_custom \( -name '*.cpp' -o -name '*.[ch]' \) \! \( ${SDK_FILES} -o ${SERVER_FILES} -o -name clientprovisioning_inc.cpp -o -name \*_tables_inc.cpp -o -name syncsessiondispatch.cpp \) -printf '%p '`;" \ + -e "s;@LIBSYNTHESISSERVER_SOURCES@;`find ${ENGINE_SOURCES} sysync_SDK/DB_Interfaces/text_db syncapps/serverEngine_custom \( -name '*.cpp' -o -name '*.[ch]' \) \! \( ${SDK_FILES} -o ${CLIENT_FILES} -o -name clientprovisioning_inc.cpp -o -name \*_tables_inc.cpp -o -name syncsessiondispatch.cpp \) -printf '%p '`;" \ -e "s;@LIBSYNTHESISSDK_SOURCES_BOTH@;`find sysync_SDK/Sources \( -name '*.cpp' -o -name '*.c' \) -printf '%p '`;" \ -e "s;@LIBSYNTHESISSDK_SOURCES_SDK_ONLY@;`find sysync_SDK/Sources \( -name '*.cpp' -o -name '*.c' \) -a \( ${SDK_FILES} \) -printf '%p '`;" \ -e "s;@LIBSMLTK_SOURCES@;`find syncml_tk \( -name '*.cpp' -o -name '*.[ch]' \) \! \( -wholename syncml_tk/src/sml/\*/palm/\* -o -wholename syncml_tk/src/sml/\*/win/\* \) -printf '%p '`;" \ diff --git a/src/platform_adapters/linux/platform_DLL.cpp b/src/platform_adapters/linux/platform_DLL.cpp index 3f5bb63..ebc80a0 100755 --- a/src/platform_adapters/linux/platform_DLL.cpp +++ b/src/platform_adapters/linux/platform_DLL.cpp @@ -63,6 +63,8 @@ public: string aName= aDLLName; do { + aDLL = dlopen(aName.c_str(), RTLD_LAZY); if (!dlerror()) break; + aName+= DSuff; aDLL = dlopen(aName.c_str(), RTLD_LAZY); if (!dlerror()) break; diff --git a/src/sysync/dataobjtype.cpp b/src/sysync/dataobjtype.cpp index 1deafa5..1273901 100755 --- a/src/sysync/dataobjtype.cpp +++ b/src/sysync/dataobjtype.cpp @@ -22,6 +22,7 @@ using namespace sysync; +namespace sysync { const char* BeginCDATA= "<![CDATA["; const char* EndCDATA= "]]>"; @@ -966,7 +967,7 @@ bool TDataObjType::copyCTCapInfoFrom(TSyncItemType &aSourceItem) } // TDataObjType::copyCTCapInfoFrom - +} // namespace sysync /* end of TDataObjType implementation */ // eof diff --git a/src/sysync/engineentry.h b/src/sysync/engineentry.h index 8d79b77..5802a12 100755 --- a/src/sysync/engineentry.h +++ b/src/sysync/engineentry.h @@ -24,89 +24,89 @@ using namespace std; namespace sysync { -ENGINE_ENTRY void DebugDB ( void* aCB, cAppCharP aParams ) ENTRY_ATTR; -ENGINE_ENTRY void DebugExotic ( void* aCB, cAppCharP aParams ) ENTRY_ATTR; -ENGINE_ENTRY void DebugBlock ( void* aCB, cAppCharP aTag, - cAppCharP aDesc, - cAppCharP aAttrText ) ENTRY_ATTR; -ENGINE_ENTRY void DebugEndBlock ( void* aCB, cAppCharP aTag ) ENTRY_ATTR; -ENGINE_ENTRY void DebugEndThread ( void* aCB ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DebugDB ( void* aCB, cAppCharP aParams ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DebugExotic ( void* aCB, cAppCharP aParams ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DebugBlock ( void* aCB, cAppCharP aTag, + cAppCharP aDesc, + cAppCharP aAttrText ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DebugEndBlock ( void* aCB, cAppCharP aTag ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DebugEndThread ( void* aCB ) ENTRY_ATTR; // ---------------------------------------------------------------------------------------- -ENGINE_ENTRY TSyError SetStringMode ( void* aCB, uInt16 aCharSet, - uInt16 aLineEndMode, bool aBigEndian ) ENTRY_ATTR; -ENGINE_ENTRY TSyError InitEngineXML ( void* aCB, cAppCharP aConfigXML ) ENTRY_ATTR; -ENGINE_ENTRY TSyError InitEngineFile ( void* aCB, cAppCharP aConfigFilePath ) ENTRY_ATTR; -ENGINE_ENTRY TSyError InitEngineCB ( void* aCB, TXMLConfigReadFunc aReaderFunc, void* aContext ) ENTRY_ATTR; - - -ENGINE_ENTRY TSyError OpenSession ( void* aCB, SessionH *aSessionH, uInt32 aSelector, - cAppCharP aSessionName ) ENTRY_ATTR; -ENGINE_ENTRY TSyError OpenSessionKey ( void* aCB, SessionH aSessionH, - KeyH *aKeyH, uInt16 aMode ) ENTRY_ATTR; -ENGINE_ENTRY TSyError SessionStep ( void* aCB, SessionH aSessionH, uInt16 *aStepCmd, - TEngineProgressInfo *aInfoP ) ENTRY_ATTR; -ENGINE_ENTRY TSyError GetSyncMLBuffer ( void* aCB, SessionH aSessionH, bool aForSend, - appPointer *aBuffer, memSize *aBufSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError RetSyncMLBuffer ( void* aCB, SessionH aSessionH, bool aForSend, - memSize aRetSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError ReadSyncMLBuffer ( void* aCB, SessionH aSessionH, - appPointer aBuffer, memSize aBufSize, - memSize *aValSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError WriteSyncMLBuffer( void* aCB, SessionH aSessionH, - appPointer aBuffer, memSize aValSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError CloseSession ( void* aCB, SessionH aSessionH ) ENTRY_ATTR; - - -ENGINE_ENTRY TSyError OpenKeyByPath ( void* aCB, KeyH *aKeyH, - KeyH aParentKeyH, cAppCharP aPath, uInt16 aMode ) ENTRY_ATTR; -ENGINE_ENTRY TSyError OpenSubkey ( void* aCB, KeyH *aKeyH, - KeyH aParentKeyH, sInt32 aID, uInt16 aMode ) ENTRY_ATTR; -ENGINE_ENTRY TSyError DeleteSubkey ( void* aCB, KeyH aParentKeyH, sInt32 aID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError GetKeyID ( void* aCB, KeyH aKeyH, sInt32 *aID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError SetTextMode ( void* aCB, KeyH aKeyH, uInt16 aCharSet, - uInt16 aLineEndMode, bool aBigEndian ) ENTRY_ATTR; -ENGINE_ENTRY TSyError SetTimeMode ( void* aCB, KeyH aKeyH, uInt16 aTimeMode ) ENTRY_ATTR; -ENGINE_ENTRY TSyError CloseKey ( void* aCB, KeyH aKeyH ) ENTRY_ATTR; - -ENGINE_ENTRY TSyError GetValue ( void* aCB, KeyH aKeyH, cAppCharP aValName, uInt16 aValType, - appPointer aBuffer, memSize aBufSize, memSize *aValSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError GetValueByID ( void* aCB, KeyH aKeyH, sInt32 aID, sInt32 arrIndex, - uInt16 aValType, - appPointer aBuffer, memSize aBufSize, memSize *aValSize ) ENTRY_ATTR; -ENGINE_ENTRY sInt32 GetValueID ( void* aCB, KeyH aKeyH, cAppCharP aName ) ENTRY_ATTR; -ENGINE_ENTRY TSyError SetValue ( void* aCB, KeyH aKeyH, cAppCharP aValName, uInt16 aValType, - cAppPointer aBuffer, memSize aValSize ) ENTRY_ATTR; -ENGINE_ENTRY TSyError SetValueByID ( void* aCB, KeyH aKeyH, sInt32 aID, sInt32 arrIndex, - uInt16 aValType, - cAppPointer aBuffer, memSize aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SetStringMode ( void* aCB, uInt16 aCharSet, + uInt16 aLineEndMode, bool aBigEndian ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError InitEngineXML ( void* aCB, cAppCharP aConfigXML ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError InitEngineFile ( void* aCB, cAppCharP aConfigFilePath ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError InitEngineCB ( void* aCB, TXMLConfigReadFunc aReaderFunc, void* aContext ) ENTRY_ATTR; + + +ENGINE_ENTRY_CXX TSyError OpenSession ( void* aCB, SessionH *aSessionH, uInt32 aSelector, + cAppCharP aSessionName ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError OpenSessionKey ( void* aCB, SessionH aSessionH, + KeyH *aKeyH, uInt16 aMode ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SessionStep ( void* aCB, SessionH aSessionH, uInt16 *aStepCmd, + TEngineProgressInfo *aInfoP ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError GetSyncMLBuffer ( void* aCB, SessionH aSessionH, bool aForSend, + appPointer *aBuffer, memSize *aBufSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError RetSyncMLBuffer ( void* aCB, SessionH aSessionH, bool aForSend, + memSize aRetSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError ReadSyncMLBuffer ( void* aCB, SessionH aSessionH, + appPointer aBuffer, memSize aBufSize, + memSize *aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError WriteSyncMLBuffer( void* aCB, SessionH aSessionH, + appPointer aBuffer, memSize aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError CloseSession ( void* aCB, SessionH aSessionH ) ENTRY_ATTR; + + +ENGINE_ENTRY_CXX TSyError OpenKeyByPath ( void* aCB, KeyH *aKeyH, + KeyH aParentKeyH, cAppCharP aPath, uInt16 aMode ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError OpenSubkey ( void* aCB, KeyH *aKeyH, + KeyH aParentKeyH, sInt32 aID, uInt16 aMode ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError DeleteSubkey ( void* aCB, KeyH aParentKeyH, sInt32 aID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError GetKeyID ( void* aCB, KeyH aKeyH, sInt32 *aID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SetTextMode ( void* aCB, KeyH aKeyH, uInt16 aCharSet, + uInt16 aLineEndMode, bool aBigEndian ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SetTimeMode ( void* aCB, KeyH aKeyH, uInt16 aTimeMode ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError CloseKey ( void* aCB, KeyH aKeyH ) ENTRY_ATTR; + +ENGINE_ENTRY_CXX TSyError GetValue ( void* aCB, KeyH aKeyH, cAppCharP aValName, uInt16 aValType, + appPointer aBuffer, memSize aBufSize, memSize *aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError GetValueByID ( void* aCB, KeyH aKeyH, sInt32 aID, sInt32 arrIndex, + uInt16 aValType, + appPointer aBuffer, memSize aBufSize, memSize *aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX sInt32 GetValueID ( void* aCB, KeyH aKeyH, cAppCharP aName ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SetValue ( void* aCB, KeyH aKeyH, cAppCharP aValName, uInt16 aValType, + cAppPointer aBuffer, memSize aValSize ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError SetValueByID ( void* aCB, KeyH aKeyH, sInt32 aID, sInt32 arrIndex, + uInt16 aValType, + cAppPointer aBuffer, memSize aValSize ) ENTRY_ATTR; // ---- tunnel -------------------------------------------------------------------------------------------------------- -ENGINE_ENTRY TSyError StartDataRead ( CContext ac, cAppCharP lastToken, cAppCharP resumeToken ) ENTRY_ATTR; -ENGINE_ENTRY TSyError ReadNextItem ( CContext ac, ItemID aID, appCharP *aItemData, - sInt32 *aStatus, bool aFirst ) ENTRY_ATTR; -ENGINE_ENTRY TSyError ReadItem ( CContext ac, cItemID aID, appCharP *aItemData ) ENTRY_ATTR; -ENGINE_ENTRY TSyError EndDataRead ( CContext ac ) ENTRY_ATTR; -ENGINE_ENTRY TSyError StartDataWrite ( CContext ac ) ENTRY_ATTR; -ENGINE_ENTRY TSyError InsertItem ( CContext ac, cAppCharP aItemData, ItemID aID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError UpdateItem ( CContext ac, cAppCharP aItemData, cItemID aID, ItemID updID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError MoveItem ( CContext ac, cItemID aID, cAppCharP newParID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError DeleteItem ( CContext ac, cItemID aID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError EndDataWrite ( CContext ac, bool success, appCharP *newToken ) ENTRY_ATTR; -ENGINE_ENTRY void DisposeObj ( CContext ac, void* memory ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError StartDataRead ( CContext ac, cAppCharP lastToken, cAppCharP resumeToken ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError ReadNextItem ( CContext ac, ItemID aID, appCharP *aItemData, + sInt32 *aStatus, bool aFirst ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError ReadItem ( CContext ac, cItemID aID, appCharP *aItemData ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError EndDataRead ( CContext ac ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError StartDataWrite ( CContext ac ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError InsertItem ( CContext ac, cAppCharP aItemData, ItemID aID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError UpdateItem ( CContext ac, cAppCharP aItemData, cItemID aID, ItemID updID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError MoveItem ( CContext ac, cItemID aID, cAppCharP newParID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError DeleteItem ( CContext ac, cItemID aID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError EndDataWrite ( CContext ac, bool success, appCharP *newToken ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void DisposeObj ( CContext ac, void* memory ) ENTRY_ATTR; // ---- asKey ---- -ENGINE_ENTRY TSyError ReadNextItemAsKey( CContext ac, ItemID aID, KeyH aItemKey, - sInt32 *aStatus, bool aFirst ) ENTRY_ATTR; -ENGINE_ENTRY TSyError ReadItemAsKey ( CContext ac, cItemID aID, KeyH aItemKey ) ENTRY_ATTR; -ENGINE_ENTRY TSyError InsertItemAsKey ( CContext ac, KeyH aItemKey, ItemID aID ) ENTRY_ATTR; -ENGINE_ENTRY TSyError UpdateItemAsKey ( CContext ac, KeyH aItemKey, cItemID aID, ItemID updID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError ReadNextItemAsKey( CContext ac, ItemID aID, KeyH aItemKey, + sInt32 *aStatus, bool aFirst ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError ReadItemAsKey ( CContext ac, cItemID aID, KeyH aItemKey ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError InsertItemAsKey ( CContext ac, KeyH aItemKey, ItemID aID ) ENTRY_ATTR; +ENGINE_ENTRY_CXX TSyError UpdateItemAsKey ( CContext ac, KeyH aItemKey, cItemID aID, ItemID updID ) ENTRY_ATTR; // ---------------------------------------------------------------------------------------- -ENGINE_ENTRY void CB_Connect( void* aCB ) ENTRY_ATTR; +ENGINE_ENTRY_CXX void CB_Connect( void* aCB ) ENTRY_ATTR; // engine local helper, used e.g. from PluginDS/Agent void CB_Connect_KeyAccess ( void* aCB ); diff --git a/src/sysync/syncsession.cpp b/src/sysync/syncsession.cpp index 24218ed..690dca1 100644 --- a/src/sysync/syncsession.cpp +++ b/src/sysync/syncsession.cpp @@ -902,6 +902,7 @@ TSyncSession::TSyncSession( TP_START(fTPInfo,TP_general); DEBUGPRINTFX(DBG_EXOTIC,("TSyncSession::TSyncSession: Profiling initialized")); // set fields + fEncoding = SML_UNDEF; fLocalAbortReason = true; // unless set otherwise fAbortReasonStatus = 0; fSessionIsBusy = false; // not busy by default diff --git a/src/sysync_SDK/Sources/UI_util.cpp b/src/sysync_SDK/Sources/UI_util.cpp index 8adad13..550f336 100644 --- a/src/sysync_SDK/Sources/UI_util.cpp +++ b/src/sysync_SDK/Sources/UI_util.cpp @@ -96,7 +96,8 @@ static bool IsLib( cAppCharP name ) // Connect SyncML engine -TSyError UI_Connect( UI_Call_In &aCI, appPointer &aDLL, cAppCharP aEngineName, +TSyError UI_Connect( UI_Call_In &aCI, appPointer &aDLL, bool &aIsServer, + cAppCharP aEngineName, CVersion aPrgVersion, uInt16 aDebugFlags ) { @@ -115,6 +116,7 @@ TSyError UI_Connect( UI_Call_In &aCI, appPointer &aDLL, cAppCharP aEngineName, uInt16 aDebugFlags ); GetCEProc fConnectEngine= NULL; + aIsServer = false; do { aCI = NULL; // no such structure available at the beginning aDLL= NULL; @@ -129,19 +131,37 @@ TSyError UI_Connect( UI_Call_In &aCI, appPointer &aDLL, cAppCharP aEngineName, } // if if (IsLib( name.c_str() )) { - #ifdef DBAPI_LINKED + if (name == "[]") { +#ifdef DBAPI_LINKED fConnectEngine= SYSYNC_EXTERNAL(ConnectEngine); - #endif +#endif + } else if (name == "[server:]") { + aIsServer=true; +#ifdef DBAPI_SRV_LINKED + fConnectEngine= SySync_srv_ConnectEngine; +#endif + } break; } // if - name+= DLL_Suffix; - err= ConnectDLL( name.c_str(), aDLL ); // try with suffix first + + cAppCharP prefix = "server:"; + size_t prefixlen = strlen(prefix); + if (name.size() > prefixlen && + !name.compare(0, prefixlen, prefix)) { + // ignore prefix and if we find the lib, look for different entry points + aIsServer=true; + name = name.substr(prefixlen); + SyFName= "SySync_srv_ConnectEngine"; + FName= "srv_ConnectEngine"; + } + + err= ConnectDLL( name.c_str(), aDLL ); // try with name directly if (dbg) printf( "modu='%s' err=%d\n", name.c_str(), err ); if (err) { - name= aEngineName; - err= ConnectDLL( name.c_str(), aDLL ); // then try directly + name+= DLL_Suffix; + err= ConnectDLL( name.c_str(), aDLL ); // try with suffix next } // if if (dbg) printf( "modu='%s' err=%d\n", name.c_str(), err ); @@ -171,7 +191,7 @@ TSyError UI_Connect( UI_Call_In &aCI, appPointer &aDLL, cAppCharP aEngineName, } // UI_Connect -TSyError UI_Disconnect( UI_Call_In aCI, appPointer aDLL ) +TSyError UI_Disconnect( UI_Call_In aCI, appPointer aDLL, bool aIsServer ) { // Always search for BOTH names, independently of environment cAppCharP SyFName= "SySync_DisconnectEngine"; @@ -184,13 +204,24 @@ TSyError UI_Disconnect( UI_Call_In aCI, appPointer aDLL ) do { if (aDLL==NULL) { - #ifdef DBAPI_LINKED + if (aIsServer) { +#ifdef DBAPI_LINKED fDisconnectEngine= SYSYNC_EXTERNAL(DisconnectEngine); - #endif +#endif + } else { +#ifdef DBAPI_SRV_LINKED + fDisconnectEngine= SySync_srv_DisconnectEngine; +#endif + } break; } // if + if (aIsServer) { + SyFName = "SySync_srv_DisconnectEngine"; + FName = "srv_DisconnectEngine"; + } + cAppCharP fN= SyFName; err= DLL_Func( aDLL, fN, fFunc ); fDisconnectEngine= (GetDEProc)fFunc; @@ -226,7 +257,8 @@ TSyError UI_CreateContext( CContext &uContext, cAppCharP aEngineName, { TSyError err; UIContext* uc= new UIContext; - err= UI_Connect( uc->uCI, uc->uDLL, aEngineName, aPrgVersion, aDebugFlags ); + bool isServer; + err= UI_Connect( uc->uCI, uc->uDLL, isServer, aEngineName, aPrgVersion, aDebugFlags ); uc->uName= aEngineName; DEBUG_DB ( uc->uCI, MyMod,"UI_CreateContext", "'%s'", uc->uName.c_str() ); uContext= (CContext)uc; diff --git a/src/sysync_SDK/Sources/UI_util.h b/src/sysync_SDK/Sources/UI_util.h index f55aea7..82ea4b1 100644 --- a/src/sysync_SDK/Sources/UI_util.h +++ b/src/sysync_SDK/Sources/UI_util.h @@ -31,11 +31,13 @@ UIContext* UiC( CContext uContext ); /* Function definitions */ TSyError UI_Connect ( UI_Call_In &aCI, - appPointer &aDLL, cAppCharP aEngineName, + appPointer &aDLL, + bool &aIsServer, cAppCharP aEngineName, CVersion aPrgVersion, uInt16 aDebugFlags ); TSyError UI_Disconnect ( UI_Call_In aCI, - appPointer aDLL ); + appPointer aDLL, + bool aIsServer ); TSyError UI_CreateContext( CContext &uContext, cAppCharP aEngineName, diff --git a/src/sysync_SDK/Sources/enginemodulebridge.cpp b/src/sysync_SDK/Sources/enginemodulebridge.cpp index 379d3c8..eeaa0de 100644 --- a/src/sysync_SDK/Sources/enginemodulebridge.cpp +++ b/src/sysync_SDK/Sources/enginemodulebridge.cpp @@ -28,6 +28,7 @@ namespace sysync { // -------------------------------------------------------------- TEngineModuleBridge::TEngineModuleBridge() { fDLL= NULL; + fIsServer= false; } // constructor @@ -40,7 +41,7 @@ TEngineModuleBridge::~TEngineModuleBridge() { // -------------------------------------------------------------- TSyError TEngineModuleBridge::Init() { - TSyError err= UI_Connect( fCI, fDLL, fEngineName.c_str(), fPrgVersion, fDebugFlags ); + TSyError err= UI_Connect( fCI, fDLL, fIsServer, fEngineName.c_str(), fPrgVersion, fDebugFlags ); return err; } // Init @@ -48,7 +49,7 @@ TSyError TEngineModuleBridge::Init() TSyError TEngineModuleBridge::Term() { TSyError err= LOCERR_OK; - if (fCI) { err= UI_Disconnect( fCI, fDLL ); fCI= NULL; } + if (fCI) { err= UI_Disconnect( fCI, fDLL, fIsServer ); fCI= NULL; } return err; } // Term diff --git a/src/sysync_SDK/Sources/enginemodulebridge.h b/src/sysync_SDK/Sources/enginemodulebridge.h index 7d133d3..58c232d 100644 --- a/src/sysync_SDK/Sources/enginemodulebridge.h +++ b/src/sysync_SDK/Sources/enginemodulebridge.h @@ -31,6 +31,7 @@ class TEngineModuleBridge : public TEngineModuleBase virtual ~TEngineModuleBridge(); appPointer fDLL; + bool fIsServer; virtual TSyError Init(); virtual TSyError Term(); diff --git a/src/sysync_SDK/Sources/sync_dbapidef.h b/src/sysync_SDK/Sources/sync_dbapidef.h index f880276..46fae1e 100755 --- a/src/sysync_SDK/Sources/sync_dbapidef.h +++ b/src/sysync_SDK/Sources/sync_dbapidef.h @@ -46,6 +46,7 @@ #if defined MACOSX #define ENGINE_ENTRY ENTRY_C + #define ENGINE_ENTRY_CXX #ifdef __GNUC__ #define ENTRY_ATTR __attribute__((visibility("default"))) @@ -56,9 +57,11 @@ /* Visual Studio 2005 requires a specific entry point definition */ /* This definition is empty for all other platforms */ #define ENGINE_ENTRY ENTRY_C _declspec(dllexport) + #define ENGINE_ENTRY_CXX ENGINE_ENTRY #define ENTRY_ATTR #else #define ENGINE_ENTRY ENTRY_C + #define ENGINE_ENTRY_CXX #define ENTRY_ATTR #endif |