From: <fir...@us...> - 2015-01-06 00:17:05
|
Revision: 60473 http://sourceforge.net/p/firebird/code/60473 Author: firebirds Date: 2015-01-06 00:16:56 +0000 (Tue, 06 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-05 16:08:21 UTC (rev 60472) +++ firebird/trunk/ChangeLog 2015-01-06 00:16:56 UTC (rev 60473) @@ -1,3 +1,10 @@ + 2015-01-05 16:08 dimitr + M src/remote/client/interface.cpp + M src/remote/parse_proto.h + M src/remote/parser.cpp + M src/remote/protocol.cpp +Slightly refactored the BLR parser routines to avoid crazy error reporting and protect against NULL pointer dereference. The error handling still sucks, but it was the case before me ;-) + 2014-12-30 15:18 alexpeshkoff M src/common/IntlParametersBlock.cpp M src/common/IntlParametersBlock.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-05 16:08:21 UTC (rev 60472) +++ firebird/trunk/src/jrd/build_no.h 2015-01-06 00:16:56 UTC (rev 60473) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31529 + FORMAL BUILD NUMBER:31530 */ -#define PRODUCT_VER_STRING "3.0.0.31529" -#define FILE_VER_STRING "WI-T3.0.0.31529" -#define LICENSE_VER_STRING "WI-T3.0.0.31529" -#define FILE_VER_NUMBER 3, 0, 0, 31529 +#define PRODUCT_VER_STRING "3.0.0.31530" +#define FILE_VER_STRING "WI-T3.0.0.31530" +#define LICENSE_VER_STRING "WI-T3.0.0.31530" +#define FILE_VER_NUMBER 3, 0, 0, 31530 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31529" +#define FB_BUILD_NO "31530" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-05 16:08:21 UTC (rev 60472) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-06 00:16:56 UTC (rev 60473) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31529 +BuildNum=31530 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-07 00:13:38
|
Revision: 60476 http://sourceforge.net/p/firebird/code/60476 Author: firebirds Date: 2015-01-07 00:13:30 +0000 (Wed, 07 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-06 22:40:20 UTC (rev 60475) +++ firebird/trunk/ChangeLog 2015-01-07 00:13:30 UTC (rev 60476) @@ -1,3 +1,11 @@ + 2015-01-06 22:40 asfernandes + M src/dsql/StmtNodes.cpp +Fixed problem with subfunction parameters related to CORE-4572. + + 2015-01-06 22:40 asfernandes + M src/dsql/DdlNodes.epp +Fixed problem introduced by fix of CORE-4280. + 2015-01-05 16:08 dimitr M src/remote/client/interface.cpp M src/remote/parse_proto.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-06 22:40:20 UTC (rev 60475) +++ firebird/trunk/src/jrd/build_no.h 2015-01-07 00:13:30 UTC (rev 60476) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31530 + FORMAL BUILD NUMBER:31532 */ -#define PRODUCT_VER_STRING "3.0.0.31530" -#define FILE_VER_STRING "WI-T3.0.0.31530" -#define LICENSE_VER_STRING "WI-T3.0.0.31530" -#define FILE_VER_NUMBER 3, 0, 0, 31530 +#define PRODUCT_VER_STRING "3.0.0.31532" +#define FILE_VER_STRING "WI-T3.0.0.31532" +#define LICENSE_VER_STRING "WI-T3.0.0.31532" +#define FILE_VER_NUMBER 3, 0, 0, 31532 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31530" +#define FB_BUILD_NO "31532" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-06 22:40:20 UTC (rev 60475) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-07 00:13:30 UTC (rev 60476) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31530 +BuildNum=31532 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-09 00:13:35
|
Revision: 60479 http://sourceforge.net/p/firebird/code/60479 Author: firebirds Date: 2015-01-09 00:13:27 +0000 (Fri, 09 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-08 14:14:53 UTC (rev 60478) +++ firebird/trunk/ChangeLog 2015-01-09 00:13:27 UTC (rev 60479) @@ -1,3 +1,25 @@ + 2015-01-08 14:14 alexpeshkoff + M doc/README.services_extension +Doc for CORE-4662: Make services API pass SQL role to server. + + 2015-01-08 14:03 alexpeshkoff + M src/alice/alice.cpp + M src/alice/alice.h + M src/alice/aliceswi.h + M src/alice/exe.cpp + M src/alice/tdr.cpp + M src/burp/restore.epp + M src/jrd/svc.cpp + M src/jrd/svc.h + M src/msgs/facilities2.sql + M src/msgs/messages2.sql + M src/utilities/fbsvcmgr/fbsvcmgr.cpp + M src/utilities/gstat/dba.epp + M src/utilities/gstat/dbaswi.h + M src/utilities/nbackup/nbackup.cpp + M src/utilities/nbackup/nbkswi.h +Fixed CORE-4662: Make services API pass SQL role to server. Also added switch -role to some utilities that missed it. + 2015-01-06 22:40 asfernandes M src/dsql/StmtNodes.cpp Fixed problem with subfunction parameters related to CORE-4572. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-08 14:14:53 UTC (rev 60478) +++ firebird/trunk/src/jrd/build_no.h 2015-01-09 00:13:27 UTC (rev 60479) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31532 + FORMAL BUILD NUMBER:31534 */ -#define PRODUCT_VER_STRING "3.0.0.31532" -#define FILE_VER_STRING "WI-T3.0.0.31532" -#define LICENSE_VER_STRING "WI-T3.0.0.31532" -#define FILE_VER_NUMBER 3, 0, 0, 31532 +#define PRODUCT_VER_STRING "3.0.0.31534" +#define FILE_VER_STRING "WI-T3.0.0.31534" +#define LICENSE_VER_STRING "WI-T3.0.0.31534" +#define FILE_VER_NUMBER 3, 0, 0, 31534 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31532" +#define FB_BUILD_NO "31534" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-08 14:14:53 UTC (rev 60478) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-09 00:13:27 UTC (rev 60479) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31532 +BuildNum=31534 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2015-01-12 00:21:53
|
Revision: 60485 http://sourceforge.net/p/firebird/code/60485 Author: asfernandes Date: 2015-01-12 00:21:38 +0000 (Mon, 12 Jan 2015) Log Message: ----------- Make the API usable with different type of IStatus classes, throwing (what class?) or not throwing. Builtin are CheckStatusWrapper (no throw) and ThrowStatusWrapper (throws FbException). Modified Paths: -------------- firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp firebird/trunk/examples/dbcrypt/DbCrypt.cpp firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/auth/AuthDbg.cpp firebird/trunk/src/auth/AuthDbg.h firebird/trunk/src/auth/SecureRemotePassword/Message.h firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp firebird/trunk/src/auth/trusted/AuthSspi.cpp firebird/trunk/src/auth/trusted/AuthSspi.h firebird/trunk/src/common/Auth.cpp firebird/trunk/src/common/Auth.h firebird/trunk/src/common/MsgMetadata.cpp firebird/trunk/src/common/MsgMetadata.h firebird/trunk/src/common/StatusHolder.h firebird/trunk/src/common/call_service.cpp firebird/trunk/src/common/classes/GetPlugins.h firebird/trunk/src/common/classes/ImplementHelper.cpp firebird/trunk/src/common/classes/ImplementHelper.h firebird/trunk/src/common/classes/TempFile.cpp firebird/trunk/src/common/classes/TempFile.h firebird/trunk/src/common/config/config.cpp firebird/trunk/src/common/config/config.h firebird/trunk/src/common/isc_sync.cpp firebird/trunk/src/common/security.cpp firebird/trunk/src/common/security.h firebird/trunk/src/common/utils_proto.h firebird/trunk/src/dsql/DdlNodes.epp firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp firebird/trunk/src/gpre/obj_cxx.cpp firebird/trunk/src/include/firebird/FirebirdInterface.idl firebird/trunk/src/include/firebird/IdlFbInterfaces.h firebird/trunk/src/include/firebird/Interface.h firebird/trunk/src/include/firebird/Message.h firebird/trunk/src/include/firebird/UdrCppEngine.h firebird/trunk/src/include/firebird/UdrEngine.h firebird/trunk/src/isql/isql.epp firebird/trunk/src/isql/show.epp firebird/trunk/src/jrd/Attachment.h firebird/trunk/src/jrd/Database.h firebird/trunk/src/jrd/EngineInterface.h firebird/trunk/src/jrd/ExtEngineManager.cpp firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/jrd/UserManagement.cpp firebird/trunk/src/jrd/extds/InternalDS.cpp firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/jrd.h firebird/trunk/src/jrd/trace/TraceConfigStorage.h firebird/trunk/src/jrd/trace/TraceObjects.cpp firebird/trunk/src/jrd/trace/TraceObjects.h firebird/trunk/src/plugins/crypt/arc4/Arc4.cpp firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/remote.cpp firebird/trunk/src/remote/remote.h firebird/trunk/src/remote/server/server.cpp firebird/trunk/src/utilities/gsec/gsec.cpp firebird/trunk/src/utilities/ntrace/PluginLogWriter.h firebird/trunk/src/utilities/ntrace/TracePluginImpl.h firebird/trunk/src/utilities/ntrace/traceplugin.cpp firebird/trunk/src/yvalve/DistributedTransaction.cpp firebird/trunk/src/yvalve/MasterImplementation.cpp firebird/trunk/src/yvalve/MasterImplementation.h firebird/trunk/src/yvalve/PluginManager.cpp firebird/trunk/src/yvalve/PluginManager.h firebird/trunk/src/yvalve/YObjects.h firebird/trunk/src/yvalve/alt.cpp firebird/trunk/src/yvalve/perf.cpp firebird/trunk/src/yvalve/prepa_proto.h firebird/trunk/src/yvalve/preparse.cpp firebird/trunk/src/yvalve/utl.cpp firebird/trunk/src/yvalve/why.cpp Modified: firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp =================================================================== --- firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -44,7 +44,7 @@ IMaster* master = NULL; IPluginManager* pluginManager = NULL; -class PluginModule : public Api::IPluginModuleImpl<PluginModule> +class PluginModule : public IPluginModuleImpl<PluginModule, CheckStatusWrapper> { public: PluginModule() @@ -82,7 +82,7 @@ PluginModule module; -class CryptKeyHolder : public Api::IKeyHolderPluginImpl<CryptKeyHolder> +class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWrapper> { public: explicit CryptKeyHolder(IPluginConfig* cnf) throw() @@ -97,8 +97,8 @@ } // IKeyHolderPlugin implementation - int keyCallback(IStatus* status, ICryptKeyCallback* callback); - ICryptKeyCallback* keyHandle(IStatus* status, const char* keyName); + int keyCallback(CheckStatusWrapper* status, ICryptKeyCallback* callback); + ICryptKeyCallback* keyHandle(CheckStatusWrapper* status, const char* keyName); int release() { @@ -136,7 +136,7 @@ } private: - class CallbackInterface : public Api::ICryptKeyCallbackImpl<CallbackInterface> + class CallbackInterface : public ICryptKeyCallbackImpl<CallbackInterface, CheckStatusWrapper> { public: explicit CallbackInterface(CryptKeyHolder* p) @@ -175,10 +175,10 @@ AtomicCounter refCounter; IReferenceCounted* owner; - void noKeyError(IStatus* status); + void noKeyError(CheckStatusWrapper* status); }; -void CryptKeyHolder::noKeyError(IStatus* status) +void CryptKeyHolder::noKeyError(CheckStatusWrapper* status) { ISC_STATUS_ARRAY vector; vector[0] = isc_arg_gds; @@ -189,7 +189,7 @@ status->setErrors(vector); } -int CryptKeyHolder::keyCallback(IStatus* status, ICryptKeyCallback* callback) +int CryptKeyHolder::keyCallback(CheckStatusWrapper* status, ICryptKeyCallback* callback) { status->init(); @@ -225,7 +225,7 @@ return 1; } -ICryptKeyCallback* CryptKeyHolder::keyHandle(IStatus* status, const char* keyName) +ICryptKeyCallback* CryptKeyHolder::keyHandle(CheckStatusWrapper* status, const char* keyName) { if (strcmp(keyName, "sample") != 0) { @@ -235,7 +235,7 @@ return &callbackInterface; } -class Factory : public Api::IPluginFactoryImpl<Factory> +class Factory : public IPluginFactoryImpl<Factory, CheckStatusWrapper> { public: IPluginModule* getModule() @@ -243,7 +243,7 @@ return &module; } - IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter) + IPluginBase* createPlugin(CheckStatusWrapper* status, IPluginConfig* factoryParameter) { try { Modified: firebird/trunk/examples/dbcrypt/DbCrypt.cpp =================================================================== --- firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -41,7 +41,7 @@ IMaster* master = NULL; IPluginManager* pluginManager = NULL; -class PluginModule : public Api::IPluginModuleImpl<PluginModule> +class PluginModule : public IPluginModuleImpl<PluginModule, CheckStatusWrapper> { public: PluginModule() @@ -79,7 +79,7 @@ PluginModule module; -class DbCrypt : public Api::IDbCryptPluginImpl<DbCrypt> +class DbCrypt : public IDbCryptPluginImpl<DbCrypt, CheckStatusWrapper> { public: explicit DbCrypt(IPluginConfig* cnf) throw() @@ -94,9 +94,9 @@ } // ICryptPlugin implementation - void encrypt(IStatus* status, unsigned int length, const void* from, void* to); - void decrypt(IStatus* status, unsigned int length, const void* from, void* to); - void setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources); + void encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to); + void decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to); + void setKey(CheckStatusWrapper* status, unsigned int length, IKeyHolderPlugin** sources); int release() { @@ -135,10 +135,10 @@ AtomicCounter refCounter; IReferenceCounted* owner; - void noKeyError(IStatus* status); + void noKeyError(CheckStatusWrapper* status); }; -void DbCrypt::noKeyError(IStatus* status) +void DbCrypt::noKeyError(CheckStatusWrapper* status) { ISC_STATUS_ARRAY vector; vector[0] = isc_arg_gds; @@ -149,7 +149,7 @@ status->setErrors(vector); } -void DbCrypt::encrypt(IStatus* status, unsigned int length, const void* from, void* to) +void DbCrypt::encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to) { status->init(); @@ -168,7 +168,7 @@ } } -void DbCrypt::decrypt(IStatus* status, unsigned int length, const void* from, void* to) +void DbCrypt::decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to) { status->init(); @@ -187,7 +187,7 @@ } } -void DbCrypt::setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources) +void DbCrypt::setKey(CheckStatusWrapper* status, unsigned int length, IKeyHolderPlugin** sources) { status->init(); @@ -243,7 +243,7 @@ noKeyError(status); } -class Factory : public Api::IPluginFactoryImpl<Factory> +class Factory : public IPluginFactoryImpl<Factory, CheckStatusWrapper> { public: IPluginModule* getModule() @@ -251,7 +251,7 @@ return &module; } - IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter) + IPluginBase* createPlugin(CheckStatusWrapper* status, IPluginConfig* factoryParameter) { try { Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -21,7 +21,6 @@ */ #include "ibase.h" -#include "firebird.h" //// FIXME: #include "firebird/UdrCppEngine.h" #include <assert.h> #include <stdio.h> @@ -216,14 +215,14 @@ delete [] s; ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(context); + isc_db_handle dbHandle = getIscDbHandle(status, context); ISC_ULONG counter = 0; - StatusException::checkStatus(isc_wait_for_event( - statusVector, &dbHandle, eveLen, eveBuffer, eveResult), statusVector); + FbException::check(isc_wait_for_event( + statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); isc_event_counts(&counter, eveLen, eveBuffer, eveResult); - StatusException::checkStatus(isc_wait_for_event( - statusVector, &dbHandle, eveLen, eveBuffer, eveResult), statusVector); + FbException::check(isc_wait_for_event( + statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); isc_event_counts(&counter, eveLen, eveBuffer, eveResult); isc_free((char*) eveBuffer); @@ -251,11 +250,10 @@ // , inCount(0) { // Get input metadata. - AutoRelease<IMessageMetadata> inMetadata(StatusException::check(status, - metadata->getInputMetadata(status))); + AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); // Get count of input parameters. - inCount = StatusException::check(status, inMetadata->getCount(status)); + inCount = inMetadata->getCount(status); inNullOffsets.reset(new unsigned[inCount]); inOffsets.reset(new unsigned[inCount]); @@ -263,21 +261,20 @@ for (unsigned i = 0; i < inCount; ++i) { // Get null offset of the i-th input parameter. - inNullOffsets[i] = StatusException::check(status, inMetadata->getNullOffset(status, i)); + inNullOffsets[i] = inMetadata->getNullOffset(status, i); // Get the offset of the i-th input parameter. - inOffsets[i] = StatusException::check(status, inMetadata->getOffset(status, i)); + inOffsets[i] = inMetadata->getOffset(status, i); } // Get output metadata. - AutoRelease<IMessageMetadata> outMetadata(StatusException::check(status, - metadata->getOutputMetadata(status))); + AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); // Get null offset of the return value. - outNullOffset = StatusException::check(status, outMetadata->getNullOffset(status, 0)); + outNullOffset = outMetadata->getNullOffset(status, 0); // Get offset of the return value. - outOffset = StatusException::check(status, outMetadata->getOffset(status, 0)); + outOffset = outMetadata->getOffset(status, 0); } // This function requires the INTEGER parameters and return value, otherwise it will crash. @@ -333,17 +330,15 @@ // Get offsets once per procedure. FB_UDR_CONSTRUCTOR { - AutoRelease<IMessageMetadata> inMetadata(StatusException::check(status, - metadata->getInputMetadata(status))); + AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); - inOffsetStart = StatusException::check(status, inMetadata->getOffset(status, 0)); - inOffsetEnd = StatusException::check(status, inMetadata->getOffset(status, 1)); + inOffsetStart = inMetadata->getOffset(status, 0); + inOffsetEnd = inMetadata->getOffset(status, 1); - AutoRelease<IMessageMetadata> outMetadata(StatusException::check(status, - metadata->getOutputMetadata(status))); + AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); - outNullOffset = StatusException::check(status, outMetadata->getNullOffset(status, 0)); - outOffset = StatusException::check(status, outMetadata->getOffset(status, 0)); + outNullOffset = outMetadata->getNullOffset(status, 0); + outOffset = outMetadata->getOffset(status, 0); } /*** Procedure destructor. @@ -542,24 +537,23 @@ // Without FieldsMessage definition, messages will be byte-based. FB_UDR_CONSTRUCTOR - , triggerMetadata(StatusException::check(status, metadata->getTriggerMetadata(status))) + , triggerMetadata(metadata->getTriggerMetadata(status)) { ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(context); - isc_tr_handle trHandle = getIscTrHandle(context); + isc_db_handle dbHandle = getIscDbHandle(status, context); + isc_tr_handle trHandle = getIscTrHandle(status, context); isc_stmt_handle stmtHandle = 0; - StatusException::checkStatus(isc_dsql_allocate_statement( - statusVector, &dbHandle, &stmtHandle), statusVector); - StatusException::checkStatus(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, + FbException::check(isc_dsql_allocate_statement( + statusVector, &dbHandle, &stmtHandle), status, statusVector); + FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, "select data_source from replicate_config where name = ?", - SQL_DIALECT_CURRENT, NULL), statusVector); + SQL_DIALECT_CURRENT, NULL), status, statusVector); - const char* table = StatusException::check(status, metadata->getTriggerTable(status)); + const char* table = metadata->getTriggerTable(status); // Skip the first exclamation point, separating the module name and entry point. - const char* info = StatusException::check(status, - strchr(metadata->getEntryPoint(status), '!')); + const char* info = strchr(metadata->getEntryPoint(status), '!'); // Skip the second exclamation point, separating the entry point and the misc info (config). if (info) @@ -573,8 +567,8 @@ XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); inSqlDa->version = SQLDA_VERSION1; inSqlDa->sqln = 1; - StatusException::checkStatus(isc_dsql_describe_bind(statusVector, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa), statusVector); + FbException::check(isc_dsql_describe_bind(statusVector, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); @@ -582,20 +576,20 @@ XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); outSqlDa->version = SQLDA_VERSION1; outSqlDa->sqln = 1; - StatusException::checkStatus(isc_dsql_describe(statusVector, &stmtHandle, - SQL_DIALECT_CURRENT, outSqlDa), statusVector); + FbException::check(isc_dsql_describe(statusVector, &stmtHandle, + SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; - StatusException::checkStatus(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), statusVector); - StatusException::checkStatus(isc_dsql_free_statement( - statusVector, &stmtHandle, DSQL_unprepare), statusVector); + FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); + FbException::check(isc_dsql_free_statement( + statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); delete [] inSqlDa->sqlvar[0].sqldata; delete [] reinterpret_cast<char*>(inSqlDa); - unsigned count = StatusException::check(status, triggerMetadata->getCount(status)); + unsigned count = triggerMetadata->getCount(status); char buffer[65536]; strcpy(buffer, "execute block (\n"); @@ -605,7 +599,7 @@ if (i > 0) strcat(buffer, ",\n"); - const char* name = StatusException::check(status, triggerMetadata->getField(status, i)); + const char* name = triggerMetadata->getField(status, i); strcat(buffer, " p"); sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, table, name); @@ -625,7 +619,7 @@ if (i > 0) strcat(buffer, ", "); - const char* name = StatusException::check(status, triggerMetadata->getField(status, i)); + const char* name = triggerMetadata->getField(status, i); strcat(buffer, "\""); strcat(buffer, name); @@ -655,11 +649,10 @@ strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); strcat(buffer, "';\nend"); - IAttachment* attachment = StatusException::check(status, context->getAttachment(status)); - ITransaction* transaction = StatusException::check(status, context->getTransaction(status)); + IAttachment* attachment = context->getAttachment(status); + ITransaction* transaction = context->getTransaction(status); - stmt.reset(StatusException::check(status, - attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0))); + stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); delete [] outSqlDa->sqlvar[0].sqldata; delete [] reinterpret_cast<char*>(outSqlDa); @@ -673,11 +666,10 @@ FB_UDR_EXECUTE_TRIGGER { - ITransaction* transaction = StatusException::check(status, context->getTransaction(status)); + ITransaction* transaction = context->getTransaction(status); // This will not work if the table has computed fields. stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); - StatusException::check(status->getErrors()); } AutoRelease<IMessageMetadata> triggerMetadata; @@ -696,24 +688,23 @@ ); FB_UDR_CONSTRUCTOR - , triggerMetadata(StatusException::check(status, metadata->getTriggerMetadata(status))) + , triggerMetadata(metadata->getTriggerMetadata(status)) { ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(context); - isc_tr_handle trHandle = getIscTrHandle(context); + isc_db_handle dbHandle = getIscDbHandle(status, context); + isc_tr_handle trHandle = getIscTrHandle(status, context); isc_stmt_handle stmtHandle = 0; - StatusException::checkStatus(isc_dsql_allocate_statement( - statusVector, &dbHandle, &stmtHandle), statusVector); - StatusException::checkStatus(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, + FbException::check(isc_dsql_allocate_statement( + statusVector, &dbHandle, &stmtHandle), status, statusVector); + FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, "select data_source from replicate_config where name = ?", - SQL_DIALECT_CURRENT, NULL), statusVector); + SQL_DIALECT_CURRENT, NULL), status, statusVector); - const char* table = StatusException::check(status, metadata->getTriggerTable(status)); + const char* table = metadata->getTriggerTable(status); // Skip the first exclamation point, separating the module name and entry point. - const char* info = StatusException::check(status, - strchr(metadata->getEntryPoint(status), '!')); + const char* info = strchr(metadata->getEntryPoint(status), '!'); // Skip the second exclamation point, separating the entry point and the misc info (config). if (info) @@ -727,8 +718,8 @@ XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); inSqlDa->version = SQLDA_VERSION1; inSqlDa->sqln = 1; - StatusException::checkStatus(isc_dsql_describe_bind( - statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), statusVector); + FbException::check(isc_dsql_describe_bind( + statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); @@ -736,15 +727,15 @@ XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); outSqlDa->version = SQLDA_VERSION1; outSqlDa->sqln = 1; - StatusException::checkStatus(isc_dsql_describe( - statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), statusVector); + FbException::check(isc_dsql_describe( + statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; - StatusException::checkStatus(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), statusVector); - StatusException::checkStatus(isc_dsql_free_statement( - statusVector, &stmtHandle, DSQL_unprepare), statusVector); + FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); + FbException::check(isc_dsql_free_statement( + statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); delete [] inSqlDa->sqlvar[0].sqldata; delete [] reinterpret_cast<char*>(inSqlDa); @@ -765,11 +756,10 @@ strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); strcat(buffer, "';\nend"); - IAttachment* attachment = StatusException::check(status, context->getAttachment(status)); - ITransaction* transaction = StatusException::check(status, context->getTransaction(status)); + IAttachment* attachment = context->getAttachment(status); + ITransaction* transaction = context->getTransaction(status); - stmt.reset(StatusException::check(status, - attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0))); + stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); delete [] outSqlDa->sqlvar[0].sqldata; delete [] reinterpret_cast<char*>(outSqlDa); @@ -783,10 +773,9 @@ FB_UDR_EXECUTE_TRIGGER { - ITransaction* transaction = StatusException::check(status, context->getTransaction(status)); + ITransaction* transaction = context->getTransaction(status); stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); - StatusException::check(status->getErrors()); } AutoRelease<IMessageMetadata> triggerMetadata; Modified: firebird/trunk/src/auth/AuthDbg.cpp =================================================================== --- firebird/trunk/src/auth/AuthDbg.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/AuthDbg.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -61,7 +61,7 @@ check(&s); } -int DebugServer::authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sb, +int DebugServer::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sb, Firebird::IWriter* writerInterface) { try @@ -136,7 +136,7 @@ : str(getPool()) { } -int DebugClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb) +int DebugClient::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* cb) { try { Modified: firebird/trunk/src/auth/AuthDbg.h =================================================================== --- firebird/trunk/src/auth/AuthDbg.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/AuthDbg.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -46,12 +46,12 @@ // The idea of debug plugin is to send some data from server to client, // modify them on client and return result (which becomes login name) to the server -class DebugServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IServerImpl<DebugServer> > +class DebugServer FB_FINAL : public Firebird::StdPlugin<Firebird::IServerImpl<DebugServer, Firebird::CheckStatusWrapper> > { public: explicit DebugServer(Firebird::IPluginConfig*); - int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, + int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface); int release(); @@ -60,12 +60,12 @@ Firebird::RefPtr<Firebird::IConfig> config; }; -class DebugClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IClientImpl<DebugClient> > +class DebugClient FB_FINAL : public Firebird::StdPlugin<Firebird::IClientImpl<DebugClient, Firebird::CheckStatusWrapper> > { public: DebugClient(Firebird::IPluginConfig*); - int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock); + int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* sBlock); int release(); private: Modified: firebird/trunk/src/auth/SecureRemotePassword/Message.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/Message.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecureRemotePassword/Message.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -55,15 +55,18 @@ { public: Message(Firebird::IMessageMetadata* aMeta = NULL) - : metadata(NULL), buffer(NULL), builder(NULL), - fieldCount(0), fieldList(NULL) - { #ifdef INTERNAL_FIREBIRD - s = &st; + : s(&st), #else - s = fb_get_master_interface()->getStatus(); + : s(fb_get_master_interface()->getStatus()), #endif - + metadata(NULL), + buffer(NULL), + builder(NULL), + fieldCount(0), + fieldList(NULL), + statusWrapper(s) + { try { if (aMeta) @@ -80,8 +83,8 @@ #else fb_get_master_interface()-> #endif - getMetadataBuilder(s, 0); - check(s); + getMetadataBuilder(&statusWrapper, 0); + check(&statusWrapper); builder = bld; builder->addRef(); } @@ -123,8 +126,8 @@ { if (metadata) { - unsigned l = metadata->getCount(s); - check(s); + unsigned l = metadata->getCount(&statusWrapper); + check(&statusWrapper); if (fieldCount >= l) { #ifdef INTERNAL_FIREBIRD @@ -135,10 +138,10 @@ #endif } - t = metadata->getType(s, fieldCount); - check(s); - sz = metadata->getLength(s, fieldCount); - check(s); + t = metadata->getType(&statusWrapper, fieldCount); + check(&statusWrapper); + sz = metadata->getLength(&statusWrapper, fieldCount); + check(&statusWrapper); if (!checkType<T>(t, sz)) { #ifdef INTERNAL_FIREBIRD @@ -152,16 +155,16 @@ { fb_assert(builder); - unsigned f = builder->addField(s); - check(s); + unsigned f = builder->addField(&statusWrapper); + check(&statusWrapper); fb_assert(f == fieldCount); t = getType<T>(sz); - builder->setType(s, f, t); - check(s); - builder->setLength(s, f, sz); - check(s); + builder->setType(&statusWrapper, f, t); + check(&statusWrapper); + builder->setLength(&statusWrapper, f, sz); + check(&statusWrapper); lnk->next = fieldList; fieldList = lnk; @@ -177,10 +180,10 @@ #ifdef INTERNAL_FIREBIRD Firebird::status_exception::raise(status); #else - char s[100]; + char msg[100]; const ISC_STATUS* st = status->getErrors(); - fb_interpret(s, sizeof(s), &st); - fatalErrorHandler(s); + fb_interpret(msg, sizeof(msg), &st); + fatalErrorHandler(msg); #endif } } @@ -193,8 +196,8 @@ if (!metadata) { fb_assert(builder); - Firebird::IMessageMetadata* aMeta = builder->getMetadata(s); - check(s); + Firebird::IMessageMetadata* aMeta = builder->getMetadata(&statusWrapper); + check(&statusWrapper); metadata = aMeta; metadata->addRef(); builder->release(); @@ -230,8 +233,8 @@ private: void createBuffer(Firebird::IMessageMetadata* aMeta) { - unsigned l = aMeta->getMessageLength(s); - check(s); + unsigned l = aMeta->getMessageLength(&statusWrapper); + check(&statusWrapper); buffer = new unsigned char[l]; } @@ -239,14 +242,17 @@ Firebird::IStatus* s; private: -#ifdef INTERNAL_FIREBIRD - Firebird::LocalStatus st; -#endif Firebird::IMessageMetadata* metadata; unsigned char* buffer; Firebird::IMetadataBuilder* builder; unsigned fieldCount; FieldLink* fieldList; +#ifdef INTERNAL_FIREBIRD + Firebird::LocalStatus st; +#endif + +public: + Firebird::CheckStatusWrapper statusWrapper; }; @@ -360,12 +366,12 @@ void setPointers(const unsigned char* buf) { - unsigned tmp = msg->getMetadata()->getOffset(msg->s, ind); - Message::check(msg->s); + unsigned tmp = msg->getMetadata()->getOffset(&msg->statusWrapper, ind); + Message::check(&msg->statusWrapper); ptr = (T*) (buf + tmp); - tmp = msg->getMetadata()->getNullOffset(msg->s, ind); - Message::check(msg->s); + tmp = msg->getMetadata()->getNullOffset(&msg->statusWrapper, ind); + Message::check(&msg->statusWrapper); null.linkMessage((short*) (buf + tmp)); } Modified: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -34,7 +34,7 @@ namespace Auth { -class SrpClient FB_FINAL : public StdPlugin<Api::IClientImpl<SrpClient> > +class SrpClient FB_FINAL : public StdPlugin<IClientImpl<SrpClient, CheckStatusWrapper> > { public: explicit SrpClient(IPluginConfig*) @@ -43,7 +43,7 @@ { } // IClient implementation - int authenticate(IStatus*, IClientBlock* cb); + int authenticate(CheckStatusWrapper*, IClientBlock* cb); int release(); private: @@ -52,7 +52,7 @@ UCharBuffer sessionKey; }; -int SrpClient::authenticate(IStatus* status, IClientBlock* cb) +int SrpClient::authenticate(CheckStatusWrapper* status, IClientBlock* cb) { try { Modified: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -60,15 +60,16 @@ namespace Auth { -class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IManagementImpl<SrpManagement> > +class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::IManagementImpl<SrpManagement, Firebird::CheckStatusWrapper> > { public: explicit SrpManagement(Firebird::IPluginConfig* par) : upCount(0), delCount(0) { Firebird::LocalStatus s; - config.assignRefNoIncr(par->getFirebirdConf(&s)); - check(&s); + Firebird::CheckStatusWrapper statusWrapper(&s); + config.assignRefNoIncr(par->getFirebirdConf(&statusWrapper)); + check(&statusWrapper); } private: @@ -100,24 +101,25 @@ }; Firebird::LocalStatus s; - Firebird::ITransaction* ddlTran(att->startTransaction(&s, 0, NULL)); + Firebird::CheckStatusWrapper statusWrapper(&s); + Firebird::ITransaction* ddlTran(att->startTransaction(&statusWrapper, 0, NULL)); try { for (const char** sql = script; *sql; ++sql) { - att->execute(&s, ddlTran, 0, *sql, SQL_DIALECT_V6, NULL, NULL, NULL, NULL); - check(&s); + att->execute(&statusWrapper, ddlTran, 0, *sql, SQL_DIALECT_V6, NULL, NULL, NULL, NULL); + check(&statusWrapper); } - ddlTran->commit(&s); - check(&s); + ddlTran->commit(&statusWrapper); + check(&statusWrapper); } catch (const Firebird::Exception&) { if (ddlTran) { - ddlTran->rollback(&s); + ddlTran->rollback(&statusWrapper); } throw; } @@ -142,6 +144,7 @@ } Firebird::LocalStatus s; + Firebird::CheckStatusWrapper statusWrapper(&s); Firebird::string userName(user->userName()->get()); prepareName(userName, '"'); @@ -157,13 +160,13 @@ userName2.c_str(), ADMIN_ROLE); Message out; Field<Varying> grantor(out, MAX_SQL_IDENTIFIER_SIZE); - Firebird::IResultSet* curs = att->openCursor(&s, tra, selGrantor.length(), + Firebird::IResultSet* curs = att->openCursor(&statusWrapper, tra, selGrantor.length(), selGrantor.c_str(), SQL_DIALECT_V6, NULL, NULL, out.getMetadata(), NULL); - check(&s); + check(&statusWrapper); - bool hasGrant = curs->fetchNext(&s, out.getBuffer()) == Firebird::IStatus::FB_OK; - curs->close(&s); - check(&s); + bool hasGrant = curs->fetchNext(&statusWrapper, out.getBuffer()) == Firebird::IStatus::FB_OK; + curs->close(&statusWrapper); + check(&statusWrapper); if (hasGrant) { @@ -187,13 +190,14 @@ sql.printf("GRANT %s TO \"%s\"", ADMIN_ROLE, userName.c_str()); } - att->execute(&s, tra, sql.length(), sql.c_str(), SQL_DIALECT_V6, NULL, NULL, NULL, NULL); - check(&s); + att->execute(&statusWrapper, tra, sql.length(), sql.c_str(), + SQL_DIALECT_V6, NULL, NULL, NULL, NULL); + check(&statusWrapper); } public: // IManagement implementation - void start(Firebird::IStatus* status, Firebird::ILogonInfo* logonInfo) + void start(Firebird::CheckStatusWrapper* status, Firebird::ILogonInfo* logonInfo) { try { @@ -263,7 +267,7 @@ } } - int execute(Firebird::IStatus* status, Firebird::IUser* user, Firebird::IListUsers* callback) + int execute(Firebird::CheckStatusWrapper* status, Firebird::IUser* user, Firebird::IListUsers* callback) { try { @@ -608,7 +612,7 @@ return 0; } - void commit(Firebird::IStatus* status) + void commit(Firebird::CheckStatusWrapper* status) { if (tra) { @@ -620,7 +624,7 @@ } } - void rollback(Firebird::IStatus* status) + void rollback(Firebird::CheckStatusWrapper* status) { if (tra) { @@ -637,10 +641,11 @@ if (--refCounter == 0) { Firebird::LocalStatus status; - rollback(&status); + Firebird::CheckStatusWrapper statusWrapper(&status); + rollback(&statusWrapper); if (att) { - att->detach(&status); + att->detach(&statusWrapper); if (!(status.getStatus() & Firebird::IStatus::FB_HAS_ERRORS)) { att = NULL; @@ -671,7 +676,7 @@ RemotePassword server; int upCount, delCount; - bool checkCount(Firebird::IStatus* status, int* count, UCHAR item) + bool checkCount(Firebird::CheckStatusWrapper* status, int* count, UCHAR item) { unsigned char buffer[100]; att->getInfo(status, 1, &item, sizeof(buffer), buffer); @@ -688,7 +693,7 @@ return newCount == oldCount + 1; } - static void check(Firebird::IStatus* status) + static void check(Firebird::CheckStatusWrapper* status) { if (status->getStatus() & Firebird::IStatus::FB_HAS_ERRORS) { @@ -721,7 +726,7 @@ } } - void setField(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from) + void setField(Firebird::CheckStatusWrapper* st, Blob& to, Firebird::ICharUserField* from) { if (from->entered()) { @@ -784,7 +789,7 @@ } } - void assignField(Firebird::IStatus* st, Firebird::AutoPtr<Blob>& field, Firebird::ICharUserField* name) + void assignField(Firebird::CheckStatusWrapper* st, Firebird::AutoPtr<Blob>& field, Firebird::ICharUserField* name) { if (field.hasData()) { @@ -804,57 +809,60 @@ static void listField(Firebird::ICharUserField* to, Varfield& from) { Firebird::LocalStatus st; - to->setEntered(&st, from.null ? 0 : 1); - check(&st); + Firebird::CheckStatusWrapper statusWrapper(&st); + to->setEntered(&statusWrapper, from.null ? 0 : 1); + check(&statusWrapper); if (!from.null) { - to->set(&st, from); - check(&st); + to->set(&statusWrapper, from); + check(&statusWrapper); } } static void listField(Firebird::IIntUserField* to, Boolean& from) { Firebird::LocalStatus st; - to->setEntered(&st, from.null ? 0 : 1); - check(&st); + Firebird::CheckStatusWrapper statusWrapper(&st); + to->setEntered(&statusWrapper, from.null ? 0 : 1); + check(&statusWrapper); if (!from.null) { - to->set(&st, from); - check(&st); + to->set(&statusWrapper, from); + check(&statusWrapper); } } void listField(Firebird::ICharUserField* to, Blob& from) { Firebird::LocalStatus st; - to->setEntered(&st, from.null ? 0 : 1); - check(&st); + Firebird::CheckStatusWrapper statusWrapper(&st); + to->setEntered(&statusWrapper, from.null ? 0 : 1); + check(&statusWrapper); if (!from.null) { Firebird::string s; Firebird::IBlob* blob = NULL; try { - blob = att->openBlob(&st, tra, &from, 0, NULL); - check(&st); + blob = att->openBlob(&statusWrapper, tra, &from, 0, NULL); + check(&statusWrapper); char segbuf[256]; unsigned len; for (;;) { - int cc = blob->getSegment(&st, sizeof(segbuf), segbuf, &len); - check(&st); + int cc = blob->getSegment(&statusWrapper, sizeof(segbuf), segbuf, &len); + check(&statusWrapper); if (cc == Firebird::IStatus::FB_EOF) break; s.append(segbuf, len); } - blob->close(&st); - check(&st); + blob->close(&statusWrapper); + check(&statusWrapper); - to->set(&st, s.c_str()); - check(&st); + to->set(&statusWrapper, s.c_str()); + check(&statusWrapper); } catch (const Firebird::Exception&) { @@ -865,7 +873,7 @@ } } - void blobWrite(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from) + void blobWrite(Firebird::CheckStatusWrapper* st, Blob& to, Firebird::ICharUserField* from) { to.null = FB_FALSE; const char* ptr = from->get(); Modified: firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -48,7 +48,7 @@ namespace Auth { -class SrpServer FB_FINAL : public StdPlugin<Api::IServerImpl<SrpServer> > +class SrpServer FB_FINAL : public StdPlugin<IServerImpl<SrpServer, CheckStatusWrapper> > { public: explicit SrpServer(IPluginConfig* par) @@ -63,7 +63,7 @@ } // IServer implementation - int authenticate(IStatus* status, IServerBlock* sBlock, IWriter* writerInterface); + int authenticate(CheckStatusWrapper* status, IServerBlock* sBlock, IWriter* writerInterface); int release(); private: @@ -78,7 +78,7 @@ const char* secDbName; }; -int SrpServer::authenticate(IStatus* status, IServerBlock* sb, IWriter* writerInterface) +int SrpServer::authenticate(CheckStatusWrapper* status, IServerBlock* sb, IWriter* writerInterface) { try { Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -35,7 +35,7 @@ namespace Auth { -int SecurityDatabaseClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb) +int SecurityDatabaseClient::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* cb) { // fprintf(stderr, "Clnt: Legacy: lgn=%s pswd=%s\n", cb->getLogin(), cb->getPassword()); if (!(cb->getLogin() && cb->getPassword())) Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -35,7 +35,7 @@ // Required to stop analyzing rest of plugins before first roundtrip to server // if legacy login is present in DPB -class SecurityDatabaseClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IClientImpl<SecurityDatabaseClient> > +class SecurityDatabaseClient FB_FINAL : public Firebird::StdPlugin<Firebird::IClientImpl<SecurityDatabaseClient, Firebird::CheckStatusWrapper> > { public: explicit SecurityDatabaseClient(Firebird::IPluginConfig*) @@ -43,7 +43,7 @@ } // IClient implementation - int authenticate(Firebird::IStatus*, Firebird::IClientBlock* data); + int authenticate(Firebird::CheckStatusWrapper*, Firebird::IClientBlock* data); int release(); }; Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2015-01-12 00:21:38 UTC (rev 60485) @@ -107,11 +107,12 @@ : database(0), transaction(0) { Firebird::LocalStatus s; - config.assignRefNoIncr(par->getFirebirdConf(&s)); + Firebird::CheckStatusWrapper statusWrapper(&s); + config.assignRefNoIncr(par->getFirebirdConf(&statusWrapper)); check(&s); } -void SecurityDatabaseManagement::start(Firebird::IStatus* st, Firebird::ILogonInfo* logonInfo) +void SecurityDatabaseManagement::start(Firebird::CheckStatusWrapper* st, Firebird::ILogonInfo* logonInfo) { try { @@ -165,7 +166,7 @@ } } -void SecurityDatabaseManagement::commit(Firebird::IStatus* st) +void SecurityDatabaseManagement::commit(Firebird::CheckStatusWrapper* st) { try { @@ -186,7 +187,7 @@ } } -void SecurityDatabaseManagement::rollback(Firebird::IStatus* st) +void SecurityDatabaseManagement::rollback(Firebird::CheckStatusWrapper* st) { try { @@ -232,7 +233,7 @@ strncpy(to, from, len); } -int SecurityDatabaseManagement::execute(Firebird::IStatus* st, Firebird::IUser* user, Firebird::IListUsers* callback) +int SecurityDatabaseManagement::execute(Firebird::CheckStatusWrapper* st, Firebird::IUser* user, Firebird::IListUsers* callback) { /************************************* * @@ -552,7 +553,9 @@ if (!user->userName()->entered()) { Firebird::LocalStatus s2; - Firebird::IStatus* s = st; + Firebird::CheckStatusWrapper statusWrapper2(&s2); + Firebird::CheckStatusWrapper* s = st; + FOR (TRANSACTION_HANDLE transaction REQUEST_HANDLE request) U IN PLG$VIEW_USERS try { @@ -620,7 +623,7 @@ catch(const Firebird::Exception& ex) { ex.stuffException(s); - s = &s2; + s = &statusWrapper2; } END_FOR ON_ERROR @@ -634,7 +637,9 @@ { Firebird::string attr, a1, a2, a3; Firebird::LocalStatus s2; - Firebird::IStatus* s = st; + Firebird::CheckStatusWrapper statusWrapper2(&s2); + Firebird::CheckStatusWrapper* s = st; + FOR (TRANSACTION_HANDLE transaction REQUEST_HANDLE request) U IN PLG$VIEW_USERS WITH U.PLG$USER_NAME EQ user->userName()->get() @@ -700,7 +705,7 @@ catch(const Firebird::Exception& ex) { ex.stuffException(s); - s = &s2; + s = &statusWrapper2; } END_FOR ON_ERROR Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -33,16 +33,16 @@ namespace Auth { -class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IManagementImpl<SecurityDatabaseManagement> > +class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<Firebird::IManagementImpl<SecurityDatabaseManagement, Firebird::CheckStatusWrapper> > { public: explicit SecurityDatabaseManagement(Firebird::IPluginConfig* par); // IManagement implementation - void start(Firebird::IStatus* status, Firebird::ILogonInfo* logonInfo); - int execute(Firebird::IStatus* status, Firebird::IUser* user, Firebird::IListUsers* callback); - void commit(Firebird::IStatus* status); - void rollback(Firebird::IStatus* status); + void start(Firebird::CheckStatusWrapper* status, Firebird::ILogonInfo* logonInfo); + int execute(Firebird::CheckStatusWrapper* status, Firebird::IUser* user, Firebird::IListUsers* callback); + void commit(Firebird::CheckStatusWrapper* status); + void rollback(Firebird::CheckStatusWrapper* status); int release(); Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -123,7 +123,7 @@ namespace Auth { -class SecurityDatabaseServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IServerImpl<SecurityDatabaseServer> > +class SecurityDatabaseServer FB_FINAL : public StdPlugin<IServerImpl<SecurityDatabaseServer, CheckStatusWrapper> > { public: explicit SecurityDatabaseServer(Firebird::IPluginConfig* p) @@ -131,14 +131,14 @@ { } // IServer implementation - int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface); + int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface); int release(); private: Firebird::RefPtr<Firebird::IPluginConfig> iParameter; }; -class SecurityDatabase FB_FINAL : public Firebird::RefCntIface<Firebird::Api::ITimerImpl<SecurityDatabase> > +class SecurityDatabase FB_FINAL : public RefCntIface<ITimerImpl<SecurityDatabase, CheckStatusWrapper> > { public: int verify(IWriter* authBlock, IServerBlock* sBlock); @@ -472,7 +472,7 @@ const static unsigned int INIT_KEY = ((~0) - 1); static unsigned int secDbKey = INIT_KEY; -int SecurityDatabaseServer::authenticate(Firebird::IStatus* status, IServerBlock* sBlock, +int SecurityDatabaseServer::authenticate(Firebird::CheckStatusWrapper* status, IServerBlock* sBlock, IWriter* writerInterface) { status->init(); Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp =================================================================== --- firebird/trunk/src/auth/trusted/AuthSspi.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/trusted/AuthSspi.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -342,7 +342,7 @@ : sspiData(getPool()) { } -int WinSspiServer::authenticate(Firebird::IStatus* status, +int WinSspiServer::authenticate(Firebird::CheckStatusWrapper* status, IServerBlock* sBlock, IWriter* writerInterface) { @@ -398,7 +398,7 @@ return 1; } -int WinSspiClient::authenticate(Firebird::IStatus* status, +int WinSspiClient::authenticate(Firebird::CheckStatusWrapper* status, IClientBlock* cBlock) { try Modified: firebird/trunk/src/auth/trusted/AuthSspi.h =================================================================== --- firebird/trunk/src/auth/trusted/AuthSspi.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/auth/trusted/AuthSspi.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -100,11 +100,11 @@ bool getLogin(Firebird::string& login, bool& wh); }; -class WinSspiServer : public Firebird::StdPlugin<Firebird::Api::IServerImpl<WinSspiServer> > +class WinSspiServer : public Firebird::StdPlugin<Firebird::IServerImpl<WinSspiServer, Firebird::CheckStatusWrapper> > { public: // IServer implementation - int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface); + int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface); int release(); WinSspiServer(Firebird::IPluginConfig*); @@ -114,11 +114,11 @@ AuthSspi sspi; }; -class WinSspiClient : public Firebird::StdPlugin<Firebird::Api::IClientImpl<WinSspiClient> > +class WinSspiClient : public Firebird::StdPlugin<Firebird::IClientImpl<WinSspiClient, Firebird::CheckStatusWrapper> > { public: // IClient implementation - int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock); + int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* sBlock); int release(); WinSspiClient(Firebird::IPluginConfig*); Modified: firebird/trunk/src/common/Auth.cpp =================================================================== --- firebird/trunk/src/common/Auth.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/common/Auth.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -60,7 +60,7 @@ sequence = 0; } -void WriterImplementation::add(Firebird::IStatus* st, const char* name) +void WriterImplementation::add(Firebird::CheckStatusWrapper* st, const char* name) { try { @@ -98,7 +98,7 @@ result.insertBytes(sequence++, current.getBuffer(), current.getBufferLength()); } -void WriterImplementation::setType(Firebird::IStatus* st, const char* value) +void WriterImplementation::setType(Firebird::CheckStatusWrapper* st, const char* value) { try { @@ -111,7 +111,7 @@ } } -void WriterImplementation::setDb(Firebird::IStatus* st, const char* value) +void WriterImplementation::setDb(Firebird::CheckStatusWrapper* st, const char* value) { try { Modified: firebird/trunk/src/common/Auth.h =================================================================== --- firebird/trunk/src/common/Auth.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/common/Auth.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -39,7 +39,7 @@ namespace Auth { -class WriterImplementation : public Firebird::AutoIface<Firebird::Api::IWriterImpl<WriterImplementation> > +class WriterImplementation : public Firebird::AutoIface<Firebird::IWriterImpl<WriterImplementation, Firebird::CheckStatusWrapper> > { public: WriterImplementation(); @@ -49,9 +49,9 @@ // IWriter implementation void reset(); - void add(Firebird::IStatus* st, const char* name); - void setType(Firebird::IStatus* st, const char* value); - void setDb(Firebird::IStatus* st, const char* value); + void add(Firebird::CheckStatusWrapper* st, const char* name); + void setType(Firebird::CheckStatusWrapper* st, const char* value); + void setDb(Firebird::CheckStatusWrapper* st, const char* value); private: Firebird::ClumpletWriter current, result; Modified: firebird/trunk/src/common/MsgMetadata.cpp =================================================================== --- firebird/trunk/src/common/MsgMetadata.cpp 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/common/MsgMetadata.cpp 2015-01-12 00:21:38 UTC (rev 60485) @@ -55,7 +55,7 @@ return 0; } -void MetadataBuilder::setType(IStatus* status, unsigned index, unsigned type) +void MetadataBuilder::setType(CheckStatusWrapper* status, unsigned index, unsigned type) { try { @@ -81,7 +81,7 @@ } } -void MetadataBuilder::setSubType(IStatus* status, unsigned index, int subType) +void MetadataBuilder::setSubType(CheckStatusWrapper* status, unsigned index, int subType) { try { @@ -96,7 +96,7 @@ } } -void MetadataBuilder::setLength(IStatus* status, unsigned index, unsigned length) +void MetadataBuilder::setLength(CheckStatusWrapper* status, unsigned index, unsigned length) { try { @@ -114,7 +114,7 @@ } } -void MetadataBuilder::setCharSet(IStatus* status, unsigned index, unsigned charSet) +void MetadataBuilder::setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet) { try { @@ -129,7 +129,7 @@ } } -void MetadataBuilder::setScale(IStatus* status, unsigned index, unsigned scale) +void MetadataBuilder::setScale(CheckStatusWrapper* status, unsigned index, unsigned scale) { try { @@ -144,7 +144,7 @@ } } -void MetadataBuilder::truncate(IStatus* status, unsigned count) +void MetadataBuilder::truncate(CheckStatusWrapper* status, unsigned count) { try { @@ -161,7 +161,7 @@ } } -void MetadataBuilder::remove(IStatus* status, unsigned index) +void MetadataBuilder::remove(CheckStatusWrapper* status, unsigned index) { try { @@ -177,7 +177,7 @@ } } -void MetadataBuilder::moveNameToIndex(IStatus* status, const char* name, unsigned index) +void MetadataBuilder::moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index) { try { @@ -206,7 +206,7 @@ } } -unsigned MetadataBuilder::addField(IStatus* status) +unsigned MetadataBuilder::addField(CheckStatusWrapper* status) { try { @@ -224,7 +224,7 @@ } } -IMessageMetadata* MetadataBuilder::getMetadata(IStatus* status) +IMessageMetadata* MetadataBuilder::getMetadata(CheckStatusWrapper* status) { try { @@ -311,7 +311,7 @@ } -IMetadataBuilder* MsgMetadata::getBuilder(IStatus* status) +IMetadataBuilder* MsgMetadata::getBuilder(CheckStatusWrapper* status) { try { Modified: firebird/trunk/src/common/MsgMetadata.h =================================================================== --- firebird/trunk/src/common/MsgMetadata.h 2015-01-12 00:21:07 UTC (rev 60484) +++ firebird/trunk/src/common/MsgMetadata.h 2015-01-12 00:21:38 UTC (rev 60485) @@ -38,7 +38,7 @@ class StatementMetadata; class MetadataFromBlr; -class MsgMetadata : public RefCntIface<Api::IMessageMetadataImpl<MsgMetadata> > +class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckStatusWrapper> > { friend class MetadataBuilder; friend class StatementMetadata; @@ -140,12 +140,12 @@ // IMessageMetadata implementation int release(); - unsigned getCount(IStatus* /*status*/) + unsigned getCount(CheckStatusWrapper* /*status*/) { return (unsigned) items.getCount(); } - const char* getField(IStatus* status, unsigned index) + const char* getField(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].field.c_str(); @@ -154,7 +154,7 @@ return NULL; } - const char* getRelation(IStatus* status, unsigned index) + const char* getRelation(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].relation.c_str(); @@ -163,7 +163,7 @@ return NULL; } - const char* getOwner(IStatus* status, unsigned index) + const char* getOwner(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].owner.c_str(); @@ -172,7 +172,7 @@ return NULL; } - const char* getAlias(IStatus* status, unsigned index) + const char* getAlias(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].alias.c_str(); @@ -181,7 +181,7 @@ return NULL; } - unsigned getType(IStatus* status, unsigned index) + unsigned getType(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].type; @@ -190,7 +190,7 @@ return 0; } - FB_BOOLEAN isNullable(IStatus* status, unsigned index) + FB_BOOLEAN isNullable(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].nullable; @@ -199,7 +199,7 @@ return false; } - int getSubType(IStatus* status, unsigned index) + int getSubType(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].subType; @@ -208,7 +208,7 @@ return 0; } - unsigned getLength(IStatus* status, unsigned index) + unsigned getLength(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].length; @@ -217,7 +217,7 @@ return 0; } - int getScale(IStatus* status, unsigned index) + int getScale(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].scale; @@ -226,7 +226,7 @@ return 0; } - unsigned getCharSet(IStatus* status, unsigned index) + unsigned getCharSet(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].charSet; @@ -235,7 +235,7 @@ return 0; } - unsigned getOffset(IStatus* status, unsigned index) + unsigned getOffset(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].offset; @@ -244,7 +244,7 @@ return 0; } - unsigned getNullOffset(IStatus* status, unsigned index) + unsigned getNullOffset(CheckStatusWrapper* status, unsigned index) { if (index < items.getCount()) return items[index].nullInd; @@ -253,9 +253,9 @@ return 0; } - IMetadataBuilder* getBuilder(IStatus* status); + IMetadataBuilder* getBuilder(CheckStatusWrapper* status); - unsigned getMessageLength(IStatus* /*status*/) + unsigned getMessageLength(CheckStatusWrapper* /*status*/) { return length; } @@ -265,7 +265,7 @@ unsigned makeOffsets(); private: - void raiseIndexError(IStatus* status, unsigned index, const char* method) const + void raiseIndexError(CheckStatusWrapper* status, unsigned index, const char* method) const { (Arg::Gds(isc_invalid_index_val) << Arg::Num(index) << (string("IMessageMetadata::") + method)).copyTo(status); @@ -278,7 +278,7 @@ unsigned length; }; -//class AttMetadata : public Api::IMessageMetadataBaseImpl<AttMetadata, MsgMetadata> +//class AttMetadata : public IMessageMetadataBaseImpl<AttMetadata, CheckStatusWrapper, MsgMetadata> class AttMetadata : public MsgMetadata { public: @@ -292,7 +292,7 @@ RefPtr<RefCounted> attachment; }; -class MetadataBuilder FB_FINAL : public RefCntIface<Api::IMetadataBuilderImpl<MetadataBuilder> > +class MetadataBuilder FB_FINAL : public RefCntIface<IMetadataBuilderImpl<MetadataBuilder, CheckStatusWrapper> > { public: explicit MetadataBuilder(const MsgMetadata* from); @@ -301,16 +301,16 @@ int release(); // IMetadataBuilder implementation - void setType(IStatus* status, unsigned index, unsigned type); - void setSubType(IStatus* status, unsigned index, int subType); - void setLength(IStatus* status, unsigned index, unsigned length); - void setCharSet(IStatus* status, unsigned index, unsigned charSet); - void setScale(IStatus* status, unsigned index, unsigned scale); - void truncate(IStatus* status, unsigned count); - void remove(IStatus* status, unsigned index); - void moveNameToIndex(IStatus* status, const char* name, unsigned index); - unsigned addField(IStatus* status); - IMessageMetadata* getMetadata(IStatus* status); + void setType(CheckStatusWrapper* status, unsigned index, unsigned type); + void setSubType(CheckStatusWrapper* status, unsigned index, int subType); + void setLength(CheckStatusWrapper* status, unsigned index, unsigned length); + void setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet); + void setScale(CheckStatusWrapper* status, unsigned index, unsigned scale); + void truncate(CheckStatusWrapper* status, unsigned count); + void remove(CheckStatusWrapper* status, unsigned index); + void moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index); + unsigned addField(CheckStatusWrapper* status); + IMessageMetadata* getMetadata(CheckStatusWrappe... [truncated message content] |
From: <fir...@us...> - 2015-01-13 00:21:19
|
Revision: 60489 http://sourceforge.net/p/firebird/code/60489 Author: firebirds Date: 2015-01-13 00:21:11 +0000 (Tue, 13 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-12 14:56:55 UTC (rev 60488) +++ firebird/trunk/ChangeLog 2015-01-13 00:21:11 UTC (rev 60489) @@ -1,3 +1,117 @@ + 2015-01-12 14:56 asfernandes + M src/include/firebird/FirebirdInterface.idl + M src/include/firebird/IdlFbInterfaces.h + M src/jrd/CryptoManager.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h +Remove IMaster::same from the API. + + 2015-01-12 11:28 dimitr + M src/jrd/Optimizer.cpp +Fixed CORE-4665: Wrong result when use "where <field_C> STARTING WITH <:value> ORDER BY <field_N>' and field_C is leading part of compound index key: { field_C, field_N }. + + 2015-01-12 08:16 hvlad + M src/jrd/extds/InternalDS.cpp +Fixed build error + + 2015-01-12 00:21 asfernandes + M examples/dbcrypt/CryptKeyHolder.cpp + M examples/dbcrypt/DbCrypt.cpp + M examples/udr/UdrCppExample.cpp + M src/auth/AuthDbg.cpp + M src/auth/AuthDbg.h + M src/auth/SecureRemotePassword/Message.h + M src/auth/SecureRemotePassword/client/SrpClient.cpp + M src/auth/SecureRemotePassword/manage/SrpManagement.cpp + M src/auth/SecureRemotePassword/server/SrpServer.cpp + M src/auth/SecurityDatabase/LegacyClient.cpp + M src/auth/SecurityDatabase/LegacyClient.h + M src/auth/SecurityDatabase/LegacyManagement.epp + M src/auth/SecurityDatabase/LegacyManagement.h + M src/auth/SecurityDatabase/LegacyServer.cpp + M src/auth/trusted/AuthSspi.cpp + M src/auth/trusted/AuthSspi.h + M src/common/Auth.cpp + M src/common/Auth.h + M src/common/MsgMetadata.cpp + M src/common/MsgMetadata.h + M src/common/StatusHolder.h + M src/common/call_service.cpp + M src/common/classes/GetPlugins.h + M src/common/classes/ImplementHelper.cpp + M src/common/classes/ImplementHelper.h + M src/common/classes/TempFile.cpp + M src/common/classes/TempFile.h + M src/common/config/config.cpp + M src/common/config/config.h + M src/common/isc_sync.cpp + M src/common/security.cpp + M src/common/security.h + M src/common/utils_proto.h + M src/dsql/DdlNodes.epp + M src/gpre/boot/gpre_meta_boot.cpp + M src/gpre/obj_cxx.cpp + M src/include/firebird/FirebirdInterface.idl + M src/include/firebird/IdlFbInterfaces.h + M src/include/firebird/Interface.h + M src/include/firebird/Message.h + M src/include/firebird/UdrCppEngine.h + M src/include/firebird/UdrEngine.h + M src/isql/isql.epp + M src/isql/show.epp + M src/jrd/Attachment.h + M src/jrd/Database.h + M src/jrd/EngineInterface.h + M src/jrd/ExtEngineManager.cpp + M src/jrd/ExtEngineManager.h + M src/jrd/UserManagement.cpp + M src/jrd/extds/InternalDS.cpp + M src/jrd/jrd.cpp + M src/jrd/jrd.h + M src/jrd/trace/TraceConfigStorage.h + M src/jrd/trace/TraceObjects.cpp + M src/jrd/trace/TraceObjects.h + M src/plugins/crypt/arc4/Arc4.cpp + M src/plugins/udr_engine/UdrEngine.cpp + M src/remote/client/interface.cpp + M src/remote/inet.cpp + M src/remote/remote.cpp + M src/remote/remote.h + M src/remote/server/server.cpp + M src/utilities/gsec/gsec.cpp + M src/utilities/ntrace/PluginLogWriter.h + M src/utilities/ntrace/TracePluginImpl.h + M src/utilities/ntrace/traceplugin.cpp + M src/yvalve/DistributedTransaction.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/PluginManager.cpp + M src/yvalve/PluginManager.h + M src/yvalve/YObjects.h + M src/yvalve/alt.cpp + M src/yvalve/perf.cpp + M src/yvalve/prepa_proto.h + M src/yvalve/preparse.cpp + M src/yvalve/utl.cpp + M src/yvalve/why.cpp +Make the API usable with different type of IStatus classes, throwing (what class?) or not throwing. Builtin are CheckStatusWrapper (no throw) and ThrowStatusWrapper (throws FbException). + + 2015-01-12 00:21 asfernandes + M src/jrd/vio.cpp +Correction. + + 2015-01-12 00:04 asfernandes + M src/gpre/cmp.cpp + M src/gpre/languages/cob.cpp + M src/jrd/UserManagement.cpp + M src/jrd/vio.cpp + M src/remote/parser.cpp +Misc. + + 2015-01-12 00:03 asfernandes + M src/common/IntlParametersBlock.cpp +Correction. + 2015-01-08 14:14 alexpeshkoff M doc/README.services_extension Doc for CORE-4662: Make services API pass SQL role to server. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-12 14:56:55 UTC (rev 60488) +++ firebird/trunk/src/jrd/build_no.h 2015-01-13 00:21:11 UTC (rev 60489) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31534 + FORMAL BUILD NUMBER:31541 */ -#define PRODUCT_VER_STRING "3.0.0.31534" -#define FILE_VER_STRING "WI-T3.0.0.31534" -#define LICENSE_VER_STRING "WI-T3.0.0.31534" -#define FILE_VER_NUMBER 3, 0, 0, 31534 +#define PRODUCT_VER_STRING "3.0.0.31541" +#define FILE_VER_STRING "WI-T3.0.0.31541" +#define LICENSE_VER_STRING "WI-T3.0.0.31541" +#define FILE_VER_NUMBER 3, 0, 0, 31541 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31534" +#define FB_BUILD_NO "31541" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-12 14:56:55 UTC (rev 60488) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-13 00:21:11 UTC (rev 60489) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31534 +BuildNum=31541 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2015-01-13 14:43:27
|
Revision: 60492 http://sourceforge.net/p/firebird/code/60492 Author: asfernandes Date: 2015-01-13 14:43:24 +0000 (Tue, 13 Jan 2015) Log Message: ----------- Make UDR StatusType customizable. Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/include/firebird/UdrCppEngine.h firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-13 12:53:48 UTC (rev 60491) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-13 14:43:24 UTC (rev 60492) @@ -20,6 +20,8 @@ * Contributor(s): ______________________________________. */ +#define FB_UDR_STATUS_TYPE ::Firebird::ThrowStatusWrapper + #include "ibase.h" #include "firebird/UdrCppEngine.h" #include <assert.h> Modified: firebird/trunk/src/include/firebird/UdrCppEngine.h =================================================================== --- firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-13 12:53:48 UTC (rev 60491) +++ firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-13 14:43:24 UTC (rev 60492) @@ -23,6 +23,10 @@ #ifndef FIREBIRD_UDR_CPP_ENGINE #define FIREBIRD_UDR_CPP_ENGINE +#ifndef FB_UDR_STATUS_TYPE +#error FB_UDR_STATUS_TYPE must be defined with the Status class before UdrCppEngine.h inclusion. +#endif + #include "./UdrEngine.h" #include "./Message.h" #ifndef JRD_IBASE_H @@ -32,7 +36,6 @@ #include <string.h> -//// TODO: Make StatusType customizable. namespace Firebird { namespace Udr @@ -45,9 +48,9 @@ { \ class Impl; \ \ - static ::Firebird::Udr::FunctionFactoryImpl<Impl> factory(#name); \ + static ::Firebird::Udr::FunctionFactoryImpl<Impl, FB_UDR_STATUS_TYPE> factory(#name); \ \ - class Impl : public ::Firebird::Udr::Function<Impl> \ + class Impl : public ::Firebird::Udr::Function<Impl, FB_UDR_STATUS_TYPE> \ { \ public: \ FB__UDR_COMMON_IMPL @@ -57,13 +60,13 @@ } #define FB_UDR_EXECUTE_FUNCTION \ - void execute(::Firebird::ThrowStatusWrapper* status, ::Firebird::IExternalContext* context, \ + void execute(FB_UDR_STATUS_TYPE* status, ::Firebird::IExternalContext* context, \ void* in, void* out) \ { \ internalExecute(status, context, (InMessage::Type*) in, (OutMessage::Type*) out); \ } \ \ - void internalExecute(::Firebird::ThrowStatusWrapper* status, ::Firebird::IExternalContext* context, \ + void internalExecute(FB_UDR_STATUS_TYPE* status, ::Firebird::IExternalContext* context, \ InMessage::Type* in, OutMessage::Type* out) @@ -72,9 +75,9 @@ { \ class Impl; \ \ - static ::Firebird::Udr::ProcedureFactoryImpl<Impl> factory(#name); \ + static ::Firebird::Udr::ProcedureFactoryImpl<Impl, FB_UDR_STATUS_TYPE> factory(#name); \ \ - class Impl : public ::Firebird::Udr::Procedure<Impl> \ + class Impl : public ::Firebird::Udr::Procedure<Impl, FB_UDR_STATUS_TYPE> \ { \ public: \ FB__UDR_COMMON_IMPL @@ -85,27 +88,27 @@ } #define FB_UDR_EXECUTE_PROCEDURE \ - ::Firebird::IExternalResultSet* open(::Firebird::ThrowStatusWrapper* status, \ + ::Firebird::IExternalResultSet* open(FB_UDR_STATUS_TYPE* status, \ ::Firebird::IExternalContext* context, void* in, void* out) \ { \ return new ResultSet(status, context, this, (InMessage::Type*) in, (OutMessage::Type*) out); \ } \ \ - class ResultSet : public ::Firebird::Udr::ResultSet<ResultSet, Impl, InMessage, OutMessage> \ + class ResultSet : public ::Firebird::Udr::ResultSet<ResultSet, Impl, InMessage, OutMessage, FB_UDR_STATUS_TYPE> \ { \ public: \ - ResultSet(::Firebird::ThrowStatusWrapper* status, ::Firebird::IExternalContext* context, \ + ResultSet(FB_UDR_STATUS_TYPE* status, ::Firebird::IExternalContext* context, \ Impl* const procedure, InMessage::Type* const in, OutMessage::Type* const out) \ - : ::Firebird::Udr::ResultSet<ResultSet, Impl, InMessage, OutMessage>( \ + : ::Firebird::Udr::ResultSet<ResultSet, Impl, InMessage, OutMessage, FB_UDR_STATUS_TYPE>( \ context, procedure, in, out) #define FB_UDR_FETCH_PROCEDURE \ - FB_BOOLEAN fetch(::Firebird::ThrowStatusWrapper* status) \ + FB_BOOLEAN fetch(FB_UDR_STATUS_TYPE* status) \ { \ return (FB_BOOLEAN) internalFetch(status); \ } \ \ - bool internalFetch(::Firebird::ThrowStatusWrapper* status) + bool internalFetch(FB_UDR_STATUS_TYPE* status) #define FB_UDR_BEGIN_TRIGGER(name) \ @@ -113,9 +116,9 @@ { \ class Impl; \ \ - static ::Firebird::Udr::TriggerFactoryImpl<Impl> factory(#name); \ + static ::Firebird::Udr::TriggerFactoryImpl<Impl, FB_UDR_STATUS_TYPE> factory(#name); \ \ - class Impl : public ::Firebird::Udr::Trigger<Impl> \ + class Impl : public ::Firebird::Udr::Trigger<Impl, FB_UDR_STATUS_TYPE> \ { \ public: \ FB__UDR_COMMON_IMPL @@ -125,20 +128,20 @@ } #define FB_UDR_EXECUTE_TRIGGER \ - void execute(::Firebird::ThrowStatusWrapper* status, ::Firebird::IExternalContext* context, \ + void execute(FB_UDR_STATUS_TYPE* status, ::Firebird::IExternalContext* context, \ unsigned int action, void* oldFields, void* newFields) \ { \ internalExecute(status, context, action, \ (FieldsMessage::Type*) oldFields, (FieldsMessage::Type*) newFields); \ } \ \ - void internalExecute(::Firebird::ThrowStatusWrapper* status, ::Firebird::IExternalContext* context, \ + void internalExecute(FB_UDR_STATUS_TYPE* status, ::Firebird::IExternalContext* context, \ unsigned int action, \ FieldsMessage::Type* oldFields, FieldsMessage::Type* newFields) #define FB_UDR_CONSTRUCTOR \ - Impl(::Firebird::ThrowStatusWrapper* const status, ::Firebird::IExternalContext* const context, \ + Impl(FB_UDR_STATUS_TYPE* const status, ::Firebird::IExternalContext* const context, \ ::Firebird::IRoutineMetadata* const metadata__) \ : master(context->getMaster()), \ metadata(metadata__) @@ -162,11 +165,11 @@ struct name \ { \ typedef unsigned char Type; \ - static void setup(::Firebird::ThrowStatusWrapper*, ::Firebird::IMetadataBuilder*) {} \ + static void setup(FB_UDR_STATUS_TYPE*, ::Firebird::IMetadataBuilder*) {} \ } -template <typename T> class Procedure; +template <typename T, typename StatusType> class Procedure; class Helper @@ -218,8 +221,8 @@ }; -template <typename This, typename Procedure, typename InMessage, typename OutMessage> -class ResultSet : public IExternalResultSetImpl<This, ThrowStatusWrapper>, public Helper +template <typename This, typename Procedure, typename InMessage, typename OutMessage, typename StatusType> +class ResultSet : public IExternalResultSetImpl<This, StatusType>, public Helper { public: ResultSet(IExternalContext* aContext, Procedure* aProcedure, @@ -245,8 +248,8 @@ }; -template <typename This> -class Function : public IExternalFunctionImpl<This, ThrowStatusWrapper>, public Helper +template <typename This, typename StatusType> +class Function : public IExternalFunctionImpl<This, StatusType>, public Helper { public: FB__UDR_COMMON_TYPE(InMessage); @@ -257,15 +260,15 @@ delete static_cast<This*>(this); } - void getCharSet(ThrowStatusWrapper* /*status*/, IExternalContext* /*context*/, + void getCharSet(StatusType* /*status*/, IExternalContext* /*context*/, char* /*name*/, unsigned /*nameSize*/) { } }; -template <typename This> -class Procedure : public IExternalProcedureImpl<This, ThrowStatusWrapper>, public Helper +template <typename This, typename StatusType> +class Procedure : public IExternalProcedureImpl<This, StatusType>, public Helper { public: FB__UDR_COMMON_TYPE(InMessage); @@ -276,15 +279,15 @@ delete static_cast<This*>(this); } - void getCharSet(ThrowStatusWrapper* /*status*/, IExternalContext* /*context*/, + void getCharSet(StatusType* /*status*/, IExternalContext* /*context*/, char* /*name*/, unsigned /*nameSize*/) { } }; -template <typename This> -class Trigger : public IExternalTriggerImpl<This, ThrowStatusWrapper>, public Helper +template <typename This, typename StatusType> +class Trigger : public IExternalTriggerImpl<This, StatusType>, public Helper { public: FB__UDR_COMMON_TYPE(FieldsMessage); @@ -294,15 +297,15 @@ delete static_cast<This*>(this); } - void getCharSet(ThrowStatusWrapper* /*status*/, IExternalContext* /*context*/, + void getCharSet(StatusType* /*status*/, IExternalContext* /*context*/, char* /*name*/, unsigned /*nameSize*/) { } }; -template <typename T> class FunctionFactoryImpl : - public IUdrFunctionFactoryImpl<FunctionFactoryImpl<T>, ThrowStatusWrapper> +template <typename T, typename StatusType> class FunctionFactoryImpl : + public IUdrFunctionFactoryImpl<FunctionFactoryImpl<T, StatusType>, StatusType> { public: explicit FunctionFactoryImpl(const char* name) @@ -310,14 +313,14 @@ fbUdrRegFunction(name, this); } - void setup(ThrowStatusWrapper* status, IExternalContext* /*context*/, + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* in, IMetadataBuilder* out) { T::InMessage::setup(status, in); T::OutMessage::setup(status, out); } - IExternalFunction* newItem(ThrowStatusWrapper* status, IExternalContext* context, + IExternalFunction* newItem(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata) { return new T(status, context, metadata); @@ -325,8 +328,8 @@ }; -template <typename T> class ProcedureFactoryImpl : - public IUdrProcedureFactoryImpl<ProcedureFactoryImpl<T>, ThrowStatusWrapper> +template <typename T, typename StatusType> class ProcedureFactoryImpl : + public IUdrProcedureFactoryImpl<ProcedureFactoryImpl<T, StatusType>, StatusType> { public: explicit ProcedureFactoryImpl(const char* name) @@ -334,14 +337,14 @@ fbUdrRegProcedure(name, this); } - void setup(ThrowStatusWrapper* status, IExternalContext* /*context*/, + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* in, IMetadataBuilder* out) { T::InMessage::setup(status, in); T::OutMessage::setup(status, out); } - IExternalProcedure* newItem(ThrowStatusWrapper* status, IExternalContext* context, + IExternalProcedure* newItem(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata) { return new T(status, context, metadata); @@ -349,8 +352,8 @@ }; -template <typename T> class TriggerFactoryImpl : - public IUdrTriggerFactoryImpl<TriggerFactoryImpl<T>, ThrowStatusWrapper> +template <typename T, typename StatusType> class TriggerFactoryImpl : + public IUdrTriggerFactoryImpl<TriggerFactoryImpl<T, StatusType>, StatusType> { public: explicit TriggerFactoryImpl(const char* name) @@ -358,13 +361,13 @@ fbUdrRegTrigger(name, this); } - void setup(ThrowStatusWrapper* status, IExternalContext* /*context*/, + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* fields) { T::FieldsMessage::setup(status, fields); } - IExternalTrigger* newItem(ThrowStatusWrapper* status, IExternalContext* context, + IExternalTrigger* newItem(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata) { return new T(status, context, metadata); Modified: firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp =================================================================== --- firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2015-01-13 12:53:48 UTC (rev 60491) +++ firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2015-01-13 14:43:24 UTC (rev 60492) @@ -23,7 +23,6 @@ #include "firebird.h" #include "../jrd/ibase.h" #include "firebird/UdrEngine.h" -#include "firebird/UdrCppEngine.h" #include "firebird/Interface.h" #include "../common/classes/alloc.h" #include "../common/classes/array.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-14 00:14:10
|
Revision: 60493 http://sourceforge.net/p/firebird/code/60493 Author: firebirds Date: 2015-01-14 00:14:02 +0000 (Wed, 14 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-13 14:43:24 UTC (rev 60492) +++ firebird/trunk/ChangeLog 2015-01-14 00:14:02 UTC (rev 60493) @@ -1,3 +1,15 @@ + 2015-01-13 14:43 asfernandes + M examples/udr/UdrCppExample.cpp + M src/include/firebird/UdrCppEngine.h + M src/plugins/udr_engine/UdrEngine.cpp +Make UDR StatusType customizable. + + 2015-01-13 11:24 hvlad + M src/common/security.cpp + M src/common/security.h + M src/jrd/UserManagement.cpp +By Alex - fix for bug CORE-4659 : Error "Missing security context for .....\SECURITY3.FDB" + 2015-01-12 14:56 asfernandes M src/include/firebird/FirebirdInterface.idl M src/include/firebird/IdlFbInterfaces.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-13 14:43:24 UTC (rev 60492) +++ firebird/trunk/src/jrd/build_no.h 2015-01-14 00:14:02 UTC (rev 60493) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31541 + FORMAL BUILD NUMBER:31543 */ -#define PRODUCT_VER_STRING "3.0.0.31541" -#define FILE_VER_STRING "WI-T3.0.0.31541" -#define LICENSE_VER_STRING "WI-T3.0.0.31541" -#define FILE_VER_NUMBER 3, 0, 0, 31541 +#define PRODUCT_VER_STRING "3.0.0.31543" +#define FILE_VER_STRING "WI-T3.0.0.31543" +#define LICENSE_VER_STRING "WI-T3.0.0.31543" +#define FILE_VER_NUMBER 3, 0, 0, 31543 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31541" +#define FB_BUILD_NO "31543" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-13 14:43:24 UTC (rev 60492) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-14 00:14:02 UTC (rev 60493) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31541 +BuildNum=31543 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-15 00:13:53
|
Revision: 60497 http://sourceforge.net/p/firebird/code/60497 Author: firebirds Date: 2015-01-15 00:13:46 +0000 (Thu, 15 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-14 14:43:07 UTC (rev 60496) +++ firebird/trunk/ChangeLog 2015-01-15 00:13:46 UTC (rev 60497) @@ -1,3 +1,28 @@ + 2015-01-14 14:43 asfernandes + M src/include/firebird/FirebirdInterface.idl +Correction. + + 2015-01-14 14:38 asfernandes + M src/yvalve/MasterImplementation.cpp + M src/yvalve/utl.cpp + M src/yvalve/why.cpp +Misc. + + 2015-01-14 14:21 asfernandes + M src/common/classes/ImplementHelper.h + M src/gpre/boot/gpre_meta_boot.cpp + M src/include/firebird/FirebirdInterface.idl + M src/include/firebird/IdlFbInterfaces.h + M src/isql/isql.epp + M src/isql/show.epp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/YObjects.h + M src/yvalve/perf.cpp + M src/yvalve/utl.cpp + M src/yvalve/why.cpp +Renamed "Utl" API to "Util". + 2015-01-13 14:43 asfernandes M examples/udr/UdrCppExample.cpp M src/include/firebird/UdrCppEngine.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-14 14:43:07 UTC (rev 60496) +++ firebird/trunk/src/jrd/build_no.h 2015-01-15 00:13:46 UTC (rev 60497) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31543 + FORMAL BUILD NUMBER:31546 */ -#define PRODUCT_VER_STRING "3.0.0.31543" -#define FILE_VER_STRING "WI-T3.0.0.31543" -#define LICENSE_VER_STRING "WI-T3.0.0.31543" -#define FILE_VER_NUMBER 3, 0, 0, 31543 +#define PRODUCT_VER_STRING "3.0.0.31546" +#define FILE_VER_STRING "WI-T3.0.0.31546" +#define LICENSE_VER_STRING "WI-T3.0.0.31546" +#define FILE_VER_NUMBER 3, 0, 0, 31546 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31543" +#define FB_BUILD_NO "31546" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-14 14:43:07 UTC (rev 60496) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-15 00:13:46 UTC (rev 60497) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31543 +BuildNum=31546 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-16 00:14:47
|
Revision: 60505 http://sourceforge.net/p/firebird/code/60505 Author: firebirds Date: 2015-01-16 00:14:39 +0000 (Fri, 16 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-15 21:20:14 UTC (rev 60504) +++ firebird/trunk/ChangeLog 2015-01-16 00:14:39 UTC (rev 60505) @@ -1,3 +1,63 @@ + 2015-01-15 14:55 asfernandes + M src/include/firebird/FirebirdInterface.idl + M src/include/firebird/IdlFbInterfaces.h + M src/include/firebird/Message.h + M src/yvalve/YObjects.h + M src/yvalve/utl.cpp +Added encode/decode date/time methods to IUtil interface. + + 2015-01-15 01:17 asfernandes + M src/auth/AuthDbg.h + M src/auth/SecurityDatabase/LegacyClient.h + M src/auth/SecurityDatabase/LegacyManagement.epp + M src/auth/SecurityDatabase/LegacyManagement.h + M src/auth/SecurityDatabase/LegacyServer.cpp + M src/auth/trusted/AuthSspi.h + M src/common/Auth.h + M src/common/MsgMetadata.h + M src/common/classes/ImplementHelper.h + M src/common/classes/TempFile.h + M src/common/config/config.h + M src/common/isc_sync.cpp + M src/common/security.h + M src/dsql/DdlNodes.epp + M src/include/firebird/UdrEngine.h + M src/isql/show.epp + M src/jrd/Database.h + M src/jrd/EngineInterface.h + M src/jrd/ExtEngineManager.h + M src/jrd/extds/InternalDS.cpp + M src/jrd/jrd.cpp + M src/jrd/trace/TraceConfigStorage.h + M src/jrd/trace/TraceObjects.cpp + M src/jrd/trace/TraceObjects.h + M src/plugins/udr_engine/UdrEngine.cpp + M src/remote/remote.h + M src/utilities/gsec/gsec.cpp + M src/utilities/ntrace/PluginLogWriter.h + M src/utilities/ntrace/TracePluginImpl.h + M src/utilities/ntrace/traceplugin.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/PluginManager.cpp + M src/yvalve/YObjects.h + M src/yvalve/perf.cpp + M src/yvalve/why.cpp +Misc. + + 2015-01-15 01:16 asfernandes + M src/remote/inet.cpp +Warning. + + 2015-01-15 01:16 asfernandes + M src/include/firebird/Interface.h +Implement FbException copying. + + 2015-01-15 01:16 asfernandes + M examples/dbcrypt/CryptKeyHolder.cpp + M examples/dbcrypt/DbCrypt.cpp +Remove old hacks. + 2015-01-14 14:43 asfernandes M src/include/firebird/FirebirdInterface.idl Correction. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-15 21:20:14 UTC (rev 60504) +++ firebird/trunk/src/jrd/build_no.h 2015-01-16 00:14:39 UTC (rev 60505) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31546 + FORMAL BUILD NUMBER:31551 */ -#define PRODUCT_VER_STRING "3.0.0.31546" -#define FILE_VER_STRING "WI-T3.0.0.31546" -#define LICENSE_VER_STRING "WI-T3.0.0.31546" -#define FILE_VER_NUMBER 3, 0, 0, 31546 +#define PRODUCT_VER_STRING "3.0.0.31551" +#define FILE_VER_STRING "WI-T3.0.0.31551" +#define LICENSE_VER_STRING "WI-T3.0.0.31551" +#define FILE_VER_NUMBER 3, 0, 0, 31551 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31546" +#define FB_BUILD_NO "31551" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-15 21:20:14 UTC (rev 60504) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-16 00:14:39 UTC (rev 60505) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31546 +BuildNum=31551 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-17 00:15:51
|
Revision: 60512 http://sourceforge.net/p/firebird/code/60512 Author: firebirds Date: 2015-01-17 00:15:43 +0000 (Sat, 17 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-16 17:53:38 UTC (rev 60511) +++ firebird/trunk/ChangeLog 2015-01-17 00:15:43 UTC (rev 60512) @@ -1,3 +1,26 @@ + 2015-01-16 17:53 alexpeshkoff + M src/auth/SecureRemotePassword/client/SrpClient.cpp + M src/auth/SecureRemotePassword/server/SrpServer.cpp + M src/include/firebird/FirebirdInterface.idl + M src/include/firebird/IdlFbInterfaces.h + M src/include/firebird/Interface.h + M src/plugins/crypt/arc4/Arc4.cpp + M src/remote/client/interface.cpp + M src/remote/remote.cpp + M src/remote/remote.h + M src/remote/server/server.cpp + M src/yvalve/DistributedTransaction.cpp + A src/yvalve/DistributedTransaction.h + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/why.cpp +Avoid use of plain structures, missing in previous FB versions, in public API + + 2015-01-16 15:12 asfernandes + M src/include/firebird/Interface.h + M src/include/firebird/Message.h +Adjustments after fix and test of fbstuff repository. + 2015-01-15 14:55 asfernandes M src/include/firebird/FirebirdInterface.idl M src/include/firebird/IdlFbInterfaces.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-16 17:53:38 UTC (rev 60511) +++ firebird/trunk/src/jrd/build_no.h 2015-01-17 00:15:43 UTC (rev 60512) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31551 + FORMAL BUILD NUMBER:31553 */ -#define PRODUCT_VER_STRING "3.0.0.31551" -#define FILE_VER_STRING "WI-T3.0.0.31551" -#define LICENSE_VER_STRING "WI-T3.0.0.31551" -#define FILE_VER_NUMBER 3, 0, 0, 31551 +#define PRODUCT_VER_STRING "3.0.0.31553" +#define FILE_VER_STRING "WI-T3.0.0.31553" +#define LICENSE_VER_STRING "WI-T3.0.0.31553" +#define FILE_VER_NUMBER 3, 0, 0, 31553 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31551" +#define FB_BUILD_NO "31553" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-16 17:53:38 UTC (rev 60511) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-17 00:15:43 UTC (rev 60512) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31551 +BuildNum=31553 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-18 00:16:54
|
Revision: 60516 http://sourceforge.net/p/firebird/code/60516 Author: firebirds Date: 2015-01-18 00:16:51 +0000 (Sun, 18 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-17 18:49:32 UTC (rev 60515) +++ firebird/trunk/ChangeLog 2015-01-18 00:16:51 UTC (rev 60516) @@ -1,3 +1,7 @@ + 2015-01-17 18:05 dimitr + M src/jrd/jrd.h +Fixed CORE-4668: Select from mon$table_stats doesn`t work on SC and CS. + 2015-01-16 17:53 alexpeshkoff M src/auth/SecureRemotePassword/client/SrpClient.cpp M src/auth/SecureRemotePassword/server/SrpServer.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-17 18:49:32 UTC (rev 60515) +++ firebird/trunk/src/jrd/build_no.h 2015-01-18 00:16:51 UTC (rev 60516) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31553 + FORMAL BUILD NUMBER:31554 */ -#define PRODUCT_VER_STRING "3.0.0.31553" -#define FILE_VER_STRING "WI-T3.0.0.31553" -#define LICENSE_VER_STRING "WI-T3.0.0.31553" -#define FILE_VER_NUMBER 3, 0, 0, 31553 +#define PRODUCT_VER_STRING "3.0.0.31554" +#define FILE_VER_STRING "WI-T3.0.0.31554" +#define LICENSE_VER_STRING "WI-T3.0.0.31554" +#define FILE_VER_NUMBER 3, 0, 0, 31554 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31553" +#define FB_BUILD_NO "31554" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-17 18:49:32 UTC (rev 60515) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-18 00:16:51 UTC (rev 60516) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31553 +BuildNum=31554 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2015-01-18 14:53:08
|
Revision: 60523 http://sourceforge.net/p/firebird/code/60523 Author: asfernandes Date: 2015-01-18 14:53:06 +0000 (Sun, 18 Jan 2015) Log Message: ----------- Fixed problem of local templates being not allowed in pre-C++-11 code. Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/include/firebird/Message.h firebird/trunk/src/include/firebird/UdrCppEngine.h Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-18 14:53:06 UTC (rev 60523) @@ -196,11 +196,11 @@ engine udr; ***/ FB_UDR_BEGIN_FUNCTION(wait_event) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_VARCHAR(31 * 4), name) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, result) ); @@ -391,12 +391,12 @@ engine udr; ***/ FB_UDR_BEGIN_PROCEDURE(gen_rows2) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_INTEGER, start) (FB_INTEGER, end) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, result) ); @@ -431,11 +431,11 @@ // metadata object. // n3 and n4 are on the ResultSet scope, i.e., each procedure execution have they own instances. FB_UDR_BEGIN_PROCEDURE(inc) - FB_MESSAGE(InMessage, + FB_UDR_MESSAGE(InMessage, (FB_INTEGER, count) ); - FB_MESSAGE(OutMessage, + FB_UDR_MESSAGE(OutMessage, (FB_INTEGER, n0) (FB_INTEGER, n1) (FB_INTEGER, n2) @@ -682,7 +682,7 @@ FB_UDR_BEGIN_TRIGGER(replicate_persons) // Order of fields does not need to match the fields order in the table, but it should match // the order of fields in the SQL command constructed in the initialization. - FB_TRIGGER_MESSAGE(FieldsMessage, + FB_UDR_TRIGGER_MESSAGE(FieldsMessage, (FB_INTEGER, id, "ID") (FB_BLOB, info, "INFO") ///(FB_VARCHAR(60 * 4), address, "ADDRESS") Modified: firebird/trunk/src/include/firebird/Message.h =================================================================== --- firebird/trunk/src/include/firebird/Message.h 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/src/include/firebird/Message.h 2015-01-18 14:53:06 UTC (rev 60523) @@ -29,16 +29,16 @@ #include <assert.h> #include <string.h> -#define FB_MESSAGE(name, fields) \ - FB__MESSAGE_I(name, 2, FB_BOOST_PP_CAT(FB__MESSAGE_X fields, 0), ) +#define FB_MESSAGE(name, statusType, fields) \ + FB__MESSAGE_I(name, statusType, 2, FB_BOOST_PP_CAT(FB__MESSAGE_X fields, 0), ) #define FB__MESSAGE_X(x, y) ((x, y)) FB__MESSAGE_Y #define FB__MESSAGE_Y(x, y) ((x, y)) FB__MESSAGE_X #define FB__MESSAGE_X0 #define FB__MESSAGE_Y0 -#define FB_TRIGGER_MESSAGE(name, fields) \ - FB__MESSAGE_I(name, 3, FB_BOOST_PP_CAT(FB_TRIGGER_MESSAGE_X fields, 0), \ +#define FB_TRIGGER_MESSAGE(name, statusType, fields) \ + FB__MESSAGE_I(name, statusType, 3, FB_BOOST_PP_CAT(FB_TRIGGER_MESSAGE_X fields, 0), \ FB_TRIGGER_MESSAGE_MOVE_NAMES(name, fields)) #define FB_TRIGGER_MESSAGE_X(x, y, z) ((x, y, z)) FB_TRIGGER_MESSAGE_Y @@ -46,7 +46,7 @@ #define FB_TRIGGER_MESSAGE_X0 #define FB_TRIGGER_MESSAGE_Y0 -#define FB__MESSAGE_I(name, size, fields, moveNames) \ +#define FB__MESSAGE_I(name, statusType, size, fields, moveNames) \ struct name \ { \ struct Type \ @@ -54,17 +54,15 @@ FB_BOOST_PP_SEQ_FOR_EACH_I(FB__MESSAGE_FIELD, size, fields) \ }; \ \ - template <typename StatusType> \ - static void setup(StatusType* status, ::Firebird::IMetadataBuilder* builder) \ + static void setup(statusType* status, ::Firebird::IMetadataBuilder* builder) \ { \ unsigned index = 0; \ moveNames \ FB_BOOST_PP_SEQ_FOR_EACH_I(FB__MESSAGE_META, size, fields) \ } \ \ - template <typename StatusType> \ - name(StatusType* status, ::Firebird::IMaster* master) \ - : desc(master, status, FB_BOOST_PP_SEQ_SIZE(fields), &setup<StatusType>) \ + name(statusType* status, ::Firebird::IMaster* master) \ + : desc(master, status, FB_BOOST_PP_SEQ_SIZE(fields), setup) \ { \ } \ \ Modified: firebird/trunk/src/include/firebird/UdrCppEngine.h =================================================================== --- firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-18 14:52:50 UTC (rev 60522) +++ firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-18 14:53:06 UTC (rev 60523) @@ -150,6 +150,13 @@ ~Impl() +#define FB_UDR_MESSAGE(name, fields) \ + FB_MESSAGE(name, FB_UDR_STATUS_TYPE, fields) + +#define FB_UDR_TRIGGER_MESSAGE(name, fields) \ + FB_TRIGGER_MESSAGE(name, FB_UDR_STATUS_TYPE, fields) + + #define FB__UDR_COMMON_IMPL \ Impl(const void* const, ::Firebird::IExternalContext* const context, \ ::Firebird::IRoutineMetadata* const aMetadata) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-19 00:14:59
|
Revision: 60525 http://sourceforge.net/p/firebird/code/60525 Author: firebirds Date: 2015-01-19 00:14:49 +0000 (Mon, 19 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-18 16:46:24 UTC (rev 60524) +++ firebird/trunk/ChangeLog 2015-01-19 00:14:49 UTC (rev 60525) @@ -1,3 +1,18 @@ + 2015-01-18 14:53 asfernandes + M examples/udr/UdrCppExample.cpp + M src/include/firebird/Message.h + M src/include/firebird/UdrCppEngine.h +Fixed problem of local templates being not allowed in pre-C++-11 code. + + 2015-01-18 14:52 asfernandes + A src/include/iberror.h +Add iberror.h in the place so that external code may point to the development tree include files. + + 2015-01-18 09:05 dimitr + M src/jrd/btr.cpp + M src/jrd/err_proto.h +Better diagnostics. + 2015-01-17 18:05 dimitr M src/jrd/jrd.h Fixed CORE-4668: Select from mon$table_stats doesn`t work on SC and CS. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-18 16:46:24 UTC (rev 60524) +++ firebird/trunk/src/jrd/build_no.h 2015-01-19 00:14:49 UTC (rev 60525) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31554 + FORMAL BUILD NUMBER:31557 */ -#define PRODUCT_VER_STRING "3.0.0.31554" -#define FILE_VER_STRING "WI-T3.0.0.31554" -#define LICENSE_VER_STRING "WI-T3.0.0.31554" -#define FILE_VER_NUMBER 3, 0, 0, 31554 +#define PRODUCT_VER_STRING "3.0.0.31557" +#define FILE_VER_STRING "WI-T3.0.0.31557" +#define LICENSE_VER_STRING "WI-T3.0.0.31557" +#define FILE_VER_NUMBER 3, 0, 0, 31557 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31554" +#define FB_BUILD_NO "31557" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-18 16:46:24 UTC (rev 60524) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-19 00:14:49 UTC (rev 60525) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31554 +BuildNum=31557 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-21 11:11:14
|
Revision: 60531 http://sourceforge.net/p/firebird/code/60531 Author: egorpugin Date: 2015-01-21 11:11:04 +0000 (Wed, 21 Jan 2015) Log Message: ----------- [build] [cmake] Prepare sources for CMake building. Add clang preprocessor defs, ARM architecture defs, some Android-related defs. Add 'qsort_r' function search to configure.ac. Modified Paths: -------------- firebird/trunk/configure.ac firebird/trunk/src/common/common.h firebird/trunk/src/common/isc_sync.cpp firebird/trunk/src/jrd/license.h firebird/trunk/src/jrd/recsrc/HashJoin.cpp firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/protocol.h firebird/trunk/src/remote/remote_def.h firebird/trunk/src/utilities/ntrace/PluginLogWriter.cpp Modified: firebird/trunk/configure.ac =================================================================== --- firebird/trunk/configure.ac 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/configure.ac 2015-01-21 11:11:04 UTC (rev 60531) @@ -854,6 +854,7 @@ AC_CHECK_FUNCS(semtimedop) AC_CHECK_FUNCS(fegetenv) AC_CHECK_FUNCS(strerror_r) +AC_CHECK_FUNCS(qsort_r) case $host in *-darwin*) ac_cv_func_fdatasync=no Modified: firebird/trunk/src/common/common.h =================================================================== --- firebird/trunk/src/common/common.h 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/common/common.h 2015-01-21 11:11:04 UTC (rev 60531) @@ -220,6 +220,9 @@ #define UNIX #define FB_OS OsDarwin +#ifdef ARM +#define FB_CPU CpuArm +#endif /* ARM */ #ifdef __ppc__ #define powerpc #define FB_CPU CpuPowerPc Modified: firebird/trunk/src/common/isc_sync.cpp =================================================================== --- firebird/trunk/src/common/isc_sync.cpp 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/common/isc_sync.cpp 2015-01-21 11:11:04 UTC (rev 60531) @@ -112,12 +112,14 @@ #include <sys/param.h> #endif +#ifndef WIN_NT #ifndef HAVE_GETPAGESIZE static size_t getpagesize() { return PAGESIZE; } #endif +#endif //#define DEBUG_IPC #ifdef DEBUG_IPC Modified: firebird/trunk/src/jrd/license.h =================================================================== --- firebird/trunk/src/jrd/license.h 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/jrd/license.h 2015-01-21 11:11:04 UTC (rev 60531) @@ -125,6 +125,9 @@ #if defined(__ppc__) || defined(__ppc64__) #define FB_PLATFORM "UP" // Darwin/PowerPC #endif +#if defined(ARM) +#define FB_PLATFORM "UA" +#endif #endif // DARWIN #ifndef FB_VERSION Modified: firebird/trunk/src/jrd/recsrc/HashJoin.cpp =================================================================== --- firebird/trunk/src/jrd/recsrc/HashJoin.cpp 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/jrd/recsrc/HashJoin.cpp 2015-01-21 11:11:04 UTC (rev 60531) @@ -65,7 +65,11 @@ void qsort_ctx(void* base, size_t count, size_t width, qsort_compare_callback compare, void* arg) { #if defined(LINUX) +#ifdef HAVE_QSORT_R qsort_r(base, count, width, compare, arg); +#else +#undef USE_QSORT_CTX +#endif #elif defined(WIN_NT) struct qsort_ctx_data tmp = {arg, compare}; qsort_s(base, count, width, &qsort_ctx_arg_swap, &tmp); Modified: firebird/trunk/src/remote/inet.cpp =================================================================== --- firebird/trunk/src/remote/inet.cpp 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/remote/inet.cpp 2015-01-21 11:11:04 UTC (rev 60531) @@ -799,7 +799,7 @@ gai_hints.ai_family = ((packet || host.hasData() || !ipv6) ? AF_UNSPEC : AF_INET6); gai_hints.ai_socktype = SOCK_STREAM; -#ifndef WIN_NT +#if !defined(WIN_NT) && !defined(__clang__) gai_hints.ai_protocol = SOL_TCP; #else gai_hints.ai_protocol = IPPROTO_TCP; Modified: firebird/trunk/src/remote/protocol.h =================================================================== --- firebird/trunk/src/remote/protocol.h 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/remote/protocol.h 2015-01-21 11:11:04 UTC (rev 60531) @@ -95,7 +95,8 @@ arch_winnt_64 = 40, arch_darwin_x64 = 41, arch_darwin_ppc64 = 42, - arch_max = 43 // Keep this at the end + arch_arm = 43, + arch_max = 44 // Keep this at the end }; // Protocol Types Modified: firebird/trunk/src/remote/remote_def.h =================================================================== --- firebird/trunk/src/remote/remote_def.h 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/remote/remote_def.h 2015-01-21 11:11:04 UTC (rev 60531) @@ -70,6 +70,8 @@ const P_ARCH ARCHITECTURE = arch_darwin_x64; #elif defined(DARWINPPC64) const P_ARCH ARCHITECTURE = arch_darwin_ppc64; +#elif defined(ARM) +const P_ARCH ARCHITECTURE = arch_arm; #endif Modified: firebird/trunk/src/utilities/ntrace/PluginLogWriter.cpp =================================================================== --- firebird/trunk/src/utilities/ntrace/PluginLogWriter.cpp 2015-01-21 09:18:18 UTC (rev 60530) +++ firebird/trunk/src/utilities/ntrace/PluginLogWriter.cpp 2015-01-21 11:11:04 UTC (rev 60531) @@ -28,6 +28,13 @@ #include "PluginLogWriter.h" #include "../common/classes/init.h" +#ifndef S_IREAD +#define S_IREAD S_IRUSR +#endif +#ifndef S_IWRITE +#define S_IWRITE S_IWUSR +#endif + using namespace Firebird; // seems to only be Solaris 9 that doesn't have strerror_r, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-21 11:21:53
|
Revision: 60532 http://sourceforge.net/p/firebird/code/60532 Author: egorpugin Date: 2015-01-21 11:21:51 +0000 (Wed, 21 Jan 2015) Log Message: ----------- [build] [cmake] Initial CMake build system commit. Added Paths: ----------- firebird/trunk/CMakeLists.txt firebird/trunk/builds/cmake/ firebird/trunk/builds/cmake/BuildFunctions.cmake firebird/trunk/builds/cmake/Configure.cmake firebird/trunk/builds/cmake/SourceGroups.cmake firebird/trunk/examples/CMakeLists.txt firebird/trunk/src/CMakeLists.txt firebird/trunk/src/gpre/CMakeLists.txt firebird/trunk/src/include/gen/autoconfig.h.in firebird/trunk/src/remote/CMakeLists.txt firebird/trunk/src/utilities/CMakeLists.txt Added: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt (rev 0) +++ firebird/trunk/CMakeLists.txt 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,262 @@ +# +# firebird (trunk) +# + +############################################################################### +# +# cmake settings +# +############################################################################### + +cmake_minimum_required(VERSION 2.8.8) + +# In-source builds are not possible and so disabled. +if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR + "CMake generation for firebird is not possible within the source directory!" + "\n Remove the CMakeCache.txt file and try again from another folder, e.g.:" + "\n " + "\n rm CMakeCache.txt" + "\n mkdir build" + "\n cd build" + "\n cmake .." + ) +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/builds/cmake) + +if (NATIVE_BUILD_DIR) + get_filename_component(NATIVE_BUILD_DIR ${NATIVE_BUILD_DIR} ABSOLUTE) +else() + set(NATIVE_BUILD_DIR ${CMAKE_BINARY_DIR}) +endif() + +# Use solution folders. +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake Targets") + +############################################################################### +# +# project settings +# +############################################################################### + +project("firebird" C CXX) + +####################################### + +set(output_dir ${CMAKE_BINARY_DIR}/${PROJECT_NAME}) + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${output_dir}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}) + +if (MSVC OR XCODE) + set(output_dir ${output_dir}/$<CONFIG>) +endif() + +if (XCODE) + foreach(conf ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${conf} conf2) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${conf2} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${conf}/bin) + endforeach() +elseif (UNIX) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${output_dir}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}/bin) +endif() + +############################################################################### +# +# configure +# +############################################################################### + +include(Configure) + +if (FREEBSD) + # temporary + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) +endif() + +set(FB_PREFIX ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}) +set(FB_IPC_NAME "FirebirdIPI") +set(FB_LOGFILENAME "firebird.log") +set(FB_PIPE_NAME "interbas") +set(FB_SERVICE_NAME "gds_db") +set(FB_SERVICE_PORT 3050) + +if (WIN32) + set(FB_PREFIX "c:\\\\Program Files\\\\Firebird\\\\") + set(FB_IPC_NAME "FIREBIRD") +endif() + +set(AUTOCONFIG_SRC ${CMAKE_SOURCE_DIR}/src/include/gen/autoconfig.h.in) +set(AUTOCONFIG ${CMAKE_BINARY_DIR}/src/include/gen/autoconfig.h) +configure_file(${AUTOCONFIG_SRC} ${AUTOCONFIG} @ONLY) + +############################################################################### +# +# compiler & linker +# +############################################################################### + +add_definitions(-DDEV_BUILD) + +if (WIN32) + set(OS_DIR win32) + set(VERSION_RC ${CMAKE_SOURCE_DIR}/src/jrd/version.rc) + + if (MSVC) + set(disable_msvc_warnings "/wd4996") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP ${disable_msvc_warnings}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP ${disable_msvc_warnings}") + endif(MSVC) + + set(LIB_Ws2_32 Ws2_32) + set(LIB_comctl32 comctl32) + set(LIB_mpr mpr) + set(LIB_version version) +endif(WIN32) + +if (MINGW) + add_definitions(-D_WIN32_WINNT=0x0600) +endif() + +if (UNIX) + set(OS_DIR posix) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + + if (NOT CMAKE_CROSSCOMPILING) + set(LIB_readline readline) + endif() + if (NOT FREEBSD) + set(LIB_dl dl) + endif() +endif() + +if (CLANG OR IOS) + set(LIB_iconv iconv) +endif() + +if (FREEBSD) + include_directories(/usr/local/include) + link_directories(/usr/local/lib) +endif() + +if (APPLE) + set(OS_DIR darwin) + + include_directories(/opt/local/include) + if (NOT CMAKE_CROSSCOMPILING) + link_directories(/opt/local/lib) + endif() + + find_library(LIB_CoreFoundation CoreFoundation) +elseif (UNIX) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") +endif() + +############################################################################### +# +# pre build +# +############################################################################### + +if (WIN32) + # icu + set(ICU_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/icu/icu.exe -y) + #message("Extracting pre-built ICU") + execute_process(COMMAND ${ICU_EXTRACT}) + + # zlib + set(ZLIB_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/zlib/zlib.exe -y) + #message("Extracting pre-built zlib") + execute_process(COMMAND ${ZLIB_EXTRACT}) +endif() + +if (UNIX) + file(GLOB vers_src "${CMAKE_SOURCE_DIR}/builds/posix/*.vers") + foreach(f ${vers_src}) + get_filename_component(name ${f} NAME) + set(name ${CMAKE_BINARY_DIR}/builds/posix/${name}) + + if (AIX) + file(WRITE ${name} "#!\n") + elseif (LINUX) + file(WRITE ${name} "{\nglobal:\n") + endif() + + file(STRINGS ${f} strings) + foreach(s ${strings}) + string(REGEX REPLACE "#.*$" "" s "${s}") + string(STRIP "${s}" s) + if (NOT "${s}" STREQUAL "") + if (AIX) + file(APPEND ${name} "\t${s}\n") + elseif (APPLE) + file(APPEND ${name} "\t_${s}\n") + elseif (HPUX) + file(APPEND ${name} "+e ${s}\n") + else() + file(APPEND ${name} "\t${s};\n") + endif() + endif() + endforeach() + + if (LINUX) + file(APPEND ${name} "local:\n\t*;\n};\n") + endif() + endforeach() +endif() + + +############################################################################### +# +# build +# +############################################################################### + +include(BuildFunctions) + +crosscompile_prebuild_steps() + +include_directories("extern/libtommath") +include_directories("extern/icu/include") +include_directories("extern/zlib") + +include_directories("src/include") +include_directories("src/include/gen") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/include") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/include/gen") + +######################################## +# EXECUTABLE btyacc +######################################## + +file(GLOB btyacc_src "extern/btyacc/*.c" "extern/btyacc/*.h") + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (btyacc ${btyacc_src}) +project_group (btyacc Extern) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# LIBRARY btyacc +######################################## + +file(GLOB libtommath_src "extern/libtommath/*.c" "extern/libtommath/*.h") + +add_library (libtommath ${libtommath_src}) +project_group (libtommath Extern) + +######################################## + +add_subdirectory("examples") +add_subdirectory("src") + +############################################################################### + Property changes on: firebird/trunk/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/builds/cmake/BuildFunctions.cmake =================================================================== --- firebird/trunk/builds/cmake/BuildFunctions.cmake (rev 0) +++ firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,255 @@ +############################################################################### +# +# macros and functions +# +############################################################################### + +####################################### +# FUNCTION set_output_directory +####################################### +function(set_output_directory target dir) + set(out ${output_dir}) + if (MSVC OR XCODE) # multiconfiguration builds + set(out ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + endif() + if ("${ARGV2}" STREQUAL "FORCE") + if (MSVC OR XCODE) + set(out ${dir}) + set(dir) + else() + set(out .) + endif() + endif() + if (MSVC OR XCODE) + foreach(conf ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${conf} conf2) + set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${conf2} ${out}/${conf}/${dir}) + set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${conf2} ${out}/${conf}/${dir}) + endforeach() + else() # single configuration + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${out}/${dir}) + set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${out}/${dir}) + set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${out}/${dir}) + endif() +endfunction(set_output_directory) + +####################################### +# FUNCTION set_output_directory_unix +####################################### +function(set_output_directory_unix target dir) + if (UNIX) + set_output_directory(${target} ${dir} ${ARGN}) + endif() +endfunction(set_output_directory_unix) + +####################################### +# FUNCTION set_exported_symbols +####################################### +if (WIN32) + function(set_exported_symbols target filename) + set(def_file ${filename}.def) + if ("${filename}" STREQUAL "empty") + set(def_file) + elseif("${filename}" STREQUAL "fbplugin") + set(def_file "plugin.def") + endif() + if (NOT "${def_file}" STREQUAL "") + if (MSVC) + set_target_properties(${target} PROPERTIES LINK_FLAGS "/DEF:\"${CMAKE_SOURCE_DIR}/builds/win32/defs/${def_file}\"") + endif() + if (MINGW) + #set_target_properties(${target} PROPERTIES LINK_FLAGS "-Wl,${CMAKE_SOURCE_DIR}/builds/win32/defs/${def_file}") + endif() + endif() + endfunction(set_exported_symbols) +endif() + +if (UNIX) + function(set_exported_symbols target filename) + set(def_file ${filename}.vers) + if ("${filename}" STREQUAL "ib_udf") + set(def_file) + endif() + if (NOT "${def_file}" STREQUAL "") + set(wl_option "--version-script") + if (APPLE) + set(wl_option "-exported_symbols_list") + endif() + set_target_properties(${target} PROPERTIES LINK_FLAGS -Wl,${wl_option},${CMAKE_BINARY_DIR}/builds/posix/${def_file}) + endif() + endfunction(set_exported_symbols) +endif(UNIX) + + +####################################### +# FUNCTION epp_process +####################################### +function(epp_process type files) + set(epp_suffix ".${type}.cpp") + + foreach(F ${${files}}) + set(in ${CMAKE_CURRENT_SOURCE_DIR}/${F}) + set(out ${CMAKE_CURRENT_BINARY_DIR}/${F}${epp_suffix}) + + get_filename_component(dir ${out} PATH) + + if ("${type}" STREQUAL "boot") + add_custom_command( + OUTPUT ${out} + DEPENDS gpre_boot ${in} + COMMENT "Calling GPRE boot for ${F}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND ${ARGN} ${in} ${out} + ) + elseif ("${type}" STREQUAL "master") + get_filename_component(file ${out} NAME) + set(dir ${dir}/${file}.d) + add_custom_command( + OUTPUT ${out} + DEPENDS ${in} databases + COMMENT "Calling GPRE master for ${F}" + COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} + COMMAND ${CMAKE_COMMAND} -E copy_if_different metadata.fdb ${dir}/yachts.lnk + COMMAND ${CMAKE_COMMAND} -E copy_if_different security.fdb ${dir}/security.fdb + COMMAND ${CMAKE_COMMAND} -E copy_if_different msg.fdb ${dir}/msg.fdb + COMMAND ${CMAKE_COMMAND} -E copy_if_different help.fdb ${dir}/help.fdb + COMMAND ${ARGN} -b ${dir}/ ${in} ${out} + ) + endif() + endforeach() +endfunction(epp_process) + +####################################### +# FUNCTION add_epp_suffix +####################################### +function(add_epp_suffix files suffix) + foreach(F ${${files}}) + list(APPEND ${files}_${suffix} ${CMAKE_CURRENT_SOURCE_DIR}/${F}) + list(APPEND ${files}_${suffix} ${GENERATED_DIR}/${F}.${suffix}.cpp) + endforeach() + set_source_files_properties(${${files}_${suffix}} PROPERTIES GENERATED TRUE) + set(${files}_${suffix} ${${files}_${suffix}} PARENT_SCOPE) +endfunction(add_epp_suffix) + +####################################### +# FUNCTION set_win32 +####################################### +function(set_win32 var) + if (WIN32) + set(${var} ${ARGN} PARENT_SCOPE) + endif() +endfunction(set_win32) + +####################################### +# FUNCTION set_unix +####################################### +function(set_unix var) + if (UNIX) + set(${var} ${ARGN} PARENT_SCOPE) + endif() +endfunction(set_unix) + +####################################### +# FUNCTION set_apple +####################################### +function(set_apple var) + if (APPLE) + set(${var} ${ARGN} PARENT_SCOPE) + endif() +endfunction(set_apple) + +####################################### +# FUNCTION add_src_win32 +####################################### +function(add_src_win32 var) + if (WIN32) + set(${var} ${${var}} ${ARGN} PARENT_SCOPE) + endif() +endfunction(add_src_win32) + +####################################### +# FUNCTION add_src_unix +####################################### +function(add_src_unix var) + if (UNIX) + set(${var} ${${var}} ${ARGN} PARENT_SCOPE) + endif() +endfunction(add_src_unix) + +####################################### +# FUNCTION add_src_unix_not_apple +####################################### +function(add_src_unix_not_apple var) + if (UNIX AND NOT APPLE) + set(${var} ${${var}} ${ARGN} PARENT_SCOPE) + endif() +endfunction(add_src_unix_not_apple) + +####################################### +# FUNCTION add_src_apple +####################################### +function(add_src_apple var) + if (APPLE) + set(${var} ${${var}} ${ARGN} PARENT_SCOPE) + endif() +endfunction(add_src_apple) + +####################################### +# FUNCTION copy_and_rename_lib +####################################### +function(copy_and_rename_lib target name) + set(name2 $<TARGET_FILE_DIR:${target}>/${CMAKE_SHARED_LIBRARY_PREFIX}${name}${CMAKE_SHARED_LIBRARY_SUFFIX}) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${target}> ${name2} + ) +endfunction(copy_and_rename_lib) + +####################################### +# FUNCTION project_group +####################################### +function(project_group target name) + set_target_properties(${target} PROPERTIES FOLDER ${name}) +endfunction(project_group) + +####################################### +# FUNCTION set_generated_directory +####################################### +function(set_generated_directory) + if (NOT CMAKE_CROSSCOMPILING) + set(GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) + else() + string(REPLACE "${CMAKE_BINARY_DIR}" "${NATIVE_BUILD_DIR}" GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR}) + set(GENERATED_DIR ${GENERATED_DIR} PARENT_SCOPE) + endif() +endfunction(set_generated_directory) + +####################################### +# FUNCTION add_dependencies_cc (cross compile) +####################################### +function(add_dependencies_cc target) + if (NOT CMAKE_CROSSCOMPILING) + add_dependencies(${target} ${ARGN}) + endif() +endfunction(add_dependencies_cc) + +####################################### +# FUNCTION add_dependencies_unix_cc (cross compile) +####################################### +function(add_dependencies_unix_cc target) + if (UNIX) + add_dependencies_cc(${target} ${ARGN}) + endif() +endfunction(add_dependencies_unix_cc) + +####################################### +# FUNCTION crosscompile_prebuild_steps +####################################### +function(crosscompile_prebuild_steps) + if (CMAKE_CROSSCOMPILING) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${NATIVE_BUILD_DIR}/src/include/gen/parse.h ${CMAKE_BINARY_DIR}/src/include/gen/parse.h) + endif() +endfunction(crosscompile_prebuild_steps) + +############################################################################### Property changes on: firebird/trunk/builds/cmake/BuildFunctions.cmake ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/builds/cmake/Configure.cmake =================================================================== --- firebird/trunk/builds/cmake/Configure.cmake (rev 0) +++ firebird/trunk/builds/cmake/Configure.cmake 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,330 @@ +############################################################################### +# +# configure +# +############################################################################### + +####################################### +# FUNCTION check_includes +####################################### +function(check_includes files) + foreach(F ${${files}}) + set(name ${F}) + string(REPLACE "." "_" name ${name}) + string(REPLACE "/" "_" name ${name}) + string(TOUPPER ${name} name) + check_include_files(${F} HAVE_${name}) + #message("/* Define to 1 if you have the <${F}> header file. */") + #message("#cmakedefine HAVE_${name} 1") + #message("") + endforeach() +endfunction(check_includes) + +####################################### +# FUNCTION check_functions +####################################### +function(check_functions functions) + foreach(F ${${functions}}) + set(name ${F}) + string(TOUPPER ${name} name) + check_function_exists(${F} HAVE_${name}) + #message("/* Define to 1 if you have the `${F}' function. */") + #message("#cmakedefine HAVE_${name} 1") + #message("") + endforeach() +endfunction(check_functions) + +####################################### +# FUNCTION check_type_alignment +####################################### +function(check_type_alignment type var) + if (NOT DEFINED ${var}) + check_c_source_runs("main(){struct s{char a;${type} b;};exit((int)&((struct s*)0)->b);}" ${var}) + #message("-- Performing Test ${var} - It's still OK.") + message("-- Performing Test ${var} - Success") + set(${var} ${${var}_EXITCODE} CACHE STRING "${type} alignment" FORCE) + endif() +endfunction(check_type_alignment) + +####################################### + +include(CheckCSourceCompiles) +include(CheckCSourceRuns) +include(CheckCXXSourceCompiles) +include(CheckCXXSourceRuns) +include(CheckFunctionExists) +include(CheckIncludeFiles) +include(CheckLibraryExists) +include(CheckPrototypeDefinition) +include(CheckStructHasMember) +include(CheckSymbolExists) +include(CheckTypeSize) +include(TestBigEndian) + +if (ANDROID) + set(LINUX 1) +endif() + +if (IOS) + set(CMAKE_SYSTEM_PROCESSOR “arm”) # armv7 ? + add_definitions(-D__arm__) +endif() + +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + set(CLANG 1) +endif() + +set(ENABLE_BINRELOC 1) + +string(TOUPPER ${CMAKE_SYSTEM_NAME} CMAKE_SYSTEM_NAME_UPPER) +set(${CMAKE_SYSTEM_NAME_UPPER} 1) + +string(TOUPPER ${CMAKE_SYSTEM_PROCESSOR} CMAKE_SYSTEM_PROCESSOR_UPPER) +string(FIND ${CMAKE_SYSTEM_PROCESSOR} "arm" ARM) +if (NOT ${ARM} EQUAL -1) + set(ARM 1) +else() + set(ARM) +endif() +if (${CMAKE_SYSTEM_PROCESSOR_UPPER} STREQUAL "X86_64" OR + ${CMAKE_SYSTEM_PROCESSOR_UPPER} STREQUAL "AMD64") + set(AMD64 1) + set(I386 1) +endif() +set(${CMAKE_SYSTEM_PROCESSOR_UPPER} 1) + +set(SHRLIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) +string(REPLACE "." "" SHRLIB_EXT ${SHRLIB_EXT}) + +set(CASE_SENSITIVITY "true") +set(SUPPORT_RAW_DEVICES 1) + +set(include_files_list + aio.h + assert.h + atomic.h + atomic_ops.h + crypt.h + ctype.h + dirent.h + dlfcn.h + editline.h + errno.h + fcntl.h + float.h + grp.h + iconv.h + io.h + inttypes.h + langinfo.h + libio.h + linux/falloc.h + limits.h + locale.h + math.h + memory.h + mntent.h + mnttab.h + ndir.h + netconfig.h + netinet/in.h + poll.h + pthread.h + pwd.h + rpc/rpc.h + rpc/xdr.h + semaphore.h + setjmp.h + signal.h + socket.h + stdarg.h + stdint.h + stdlib.h + string.h + strings.h + sys/dir.h + sys/file.h + sys/ioctl.h + sys/ipc.h + sys/mntent.h + sys/mnttab.h + sys/mount.h + sys/ndir.h + sys/param.h + sys/resource.h + sys/sem.h + sys/select.h + sys/siginfo.h + sys/signal.h + sys/socket.h + sys/sockio.h + sys/stat.h + sys/syscall.h + sys/time.h + sys/timeb.h + sys/types.h + sys/uio.h + sys/wait.h + termio.h + termios.h + unistd.h + varargs.h + vfork.h + winsock2.h + zlib.h +) +check_includes(include_files_list) + +#if test "$EDITLINE_FLG" = "Y"; then +# AC_HEADER_DIRENT +# AC_DEFINE(HAVE_EDITLINE_H, 1, [Define this if editline is in use]) +#fi + +set(functions_list + AO_compare_and_swap_full + clock_gettime + dirname + fallocate + fchmod + fsync + flock + fork + getpagesize + getcwd getwd + gettimeofday + gmtime_r + initgroups + localtime_r + mkstemp + mmap + nanosleep + poll + posix_fadvise + pread pwrite + pthread_cancel + pthread_keycreate pthread_key_create + pthread_mutexattr_setprotocol + pthread_mutexattr_setrobust_np + pthread_mutex_consistent_np + pthread_rwlockattr_setkind_np + qsort_r + setitimer + semtimedop + setpgid + setpgrp + setmntent getmntent + setrlimit getrlimit + sigaction + sigset + snprintf vsnprintf + strcasecmp stricmp + strncasecmp strnicmp + strdup + strerror_r + swab _swab + tcgetattr + time times + vfork +) +check_functions(functions_list) + +check_cxx_source_compiles("#include <unistd.h>\nmain(){fdatasync(0);}" HAVE_FDATASYNC) + +check_library_exists(dl dladdr "${CMAKE_LIBRARY_PREFIX}" HAVE_DLADDR) +check_library_exists(m fegetenv "${CMAKE_LIBRARY_PREFIX}" HAVE_FEGETENV) +check_library_exists(m llrint "${CMAKE_LIBRARY_PREFIX}" HAVE_LLRINT) +check_library_exists(pthread sem_init "${CMAKE_LIBRARY_PREFIX}" HAVE_SEM_INIT) +check_library_exists(pthread sem_timedwait "${CMAKE_LIBRARY_PREFIX}" HAVE_SEM_TIMEDWAIT) + +check_type_size(caddr_t HAVE_CADDR_T) +check_c_source_compiles("#include <sys/sem.h>\nmain(){union semun s;return 0;}" HAVE_SEMUN) +set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h sys/types.h) +check_type_size(socklen_t HAVE_SOCKLEN_T) +set(CMAKE_EXTRA_INCLUDE_FILES) + +check_type_size(long SIZEOF_LONG) +check_type_size(size_t SIZEOF_SIZE_T) +check_type_size("void *" SIZEOF_VOID_P) + +check_type_size(gid_t HAVE_GID_T) +check_type_size(off_t HAVE_OFF_T) +check_type_size(pid_t HAVE_PID_T) +check_type_size(size_t HAVE_SIZE_T) +check_type_size(uid_t HAVE_UID_T) + +if (${HAVE_OFF_T} AND ${HAVE_OFF_T} EQUAL 8) + set(_FILE_OFFSET_BITS 64) +endif() + +test_big_endian(WORDS_BIGENDIAN) +check_symbol_exists(INFINITY math.h HAVE_INFINITY) +check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY) + +set(CMAKE_EXTRA_INCLUDE_FILES Windows.h) +check_type_size("char[MAX_PATH]" MAXPATHLEN) +set(CMAKE_EXTRA_INCLUDE_FILES) + +set(TIMEZONE_TYPE "struct timezone") +if (APPLE OR MINGW) + set(TIMEZONE_TYPE "void") +endif() +check_prototype_definition( + gettimeofday + "int gettimeofday(struct timeval *tv, ${TIMEZONE_TYPE} *tz)" + 0 + "sys/time.h" + GETTIMEOFDAY_RETURNS_TIMEZONE +) + +check_prototype_definition( + getmntent + "int getmntent(FILE *file, struct mnttab *mptr)" + 0 + mntent.h + GETMNTENT_TAKES_TWO_ARGUMENTS +) + +check_struct_has_member("struct dirent" d_type dirent.h HAVE_STRUCT_DIRENT_D_TYPE) + +check_c_source_compiles("#include <unistd.h>\nmain(){getpgrp();}" GETPGRP_VOID) +check_c_source_compiles("#include <unistd.h>\nmain(){setpgrp();}" SETPGRP_VOID) + +check_c_source_compiles("__thread int a = 42;main(){a = a + 1;}" HAVE___THREAD) +check_c_source_compiles("#include <sys/time.h>\n#include <time.h>\nmain(){}" TIME_WITH_SYS_TIME) + +set(CMAKE_REQUIRED_LIBRARIES pthread) +check_c_source_compiles("#include <semaphore.h>\nmain(){sem_t s;sem_init(&s,0,0);}" WORKING_SEM_INIT) +set(CMAKE_REQUIRED_LIBRARIES) + +if (EXISTS "/proc/self/exe") + set(HAVE__PROC_SELF_EXE 1) +endif() + +####################################### + +if (NOT CMAKE_CROSSCOMPILING) + check_type_alignment(long FB_ALIGNMENT) + check_type_alignment(double FB_DOUBLE_ALIGN) +else() # CMAKE_CROSSCOMPILING + set(FB_ALIGNMENT 8) + set(FB_DOUBLE_ALIGN 8) + if (ANDROID) + set(HAVE__PROC_SELF_EXE 1) + endif() +endif() + +####################################### + +if (WIN32) + set(ENABLE_BINRELOC 0) + set(SUPPORT_RAW_DEVICES 0) + set(WIN_NT 1) + set(CASE_SENSITIVITY "false") +endif(WIN32) + +if (APPLE) + set(ENABLE_BINRELOC 0) + set(CASE_SENSITIVITY "false") +endif() + +############################################################################### Property changes on: firebird/trunk/builds/cmake/Configure.cmake ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/builds/cmake/SourceGroups.cmake =================================================================== --- firebird/trunk/builds/cmake/SourceGroups.cmake (rev 0) +++ firebird/trunk/builds/cmake/SourceGroups.cmake 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,54 @@ +#include(SourceGroups) + +set(SSRC ${CMAKE_SOURCE_DIR}/src) +set(BSRC ${CMAKE_BINARY_DIR}/src) + +set(EPP_TXT "GPRE files") +set(GEN_TXT "GPRE cpp") + +set(_CPP ".*\\.cpp") +set(CPP "${_CPP}$") +set(_EPP ".*\\.(e|epp)") +set(EPP "${_EPP}$") +set(GEN "${_EPP}\\.(boot|master)\\.cpp$") + +source_group("${EPP_TXT}" "${EPP}") +source_group("${GEN_TXT}" "${GEN}") +source_group("Resource files" ".*\\.(rc|ico)") + +source_group("ALICE files" "${SSRC}/alice/${CPP}") +source_group("ALICE files\\${EPP_TXT}" "${SSRC}/alice/${EPP}") +source_group("ALICE files\\${GEN_TXT}" "${BSRC}/alice/${GEN}") +#source_group("AUTH files" "${SSRC}/auth/.*\\.(cpp|h)") +source_group("AUTH files" "${SSRC}/auth/${CPP}") +source_group("BURP files" "${SSRC}/burp/${CPP}") +source_group("BURP files\\${EPP_TXT}" "${SSRC}/burp/${EPP}") +source_group("BURP files\\${GEN_TXT}" "${BSRC}/burp/${GEN}") +source_group("common" "${SSRC}/common/${CPP}") +source_group("classes" "${SSRC}/common/classes/${CPP}") +source_group("config" "${SSRC}/common/config/${CPP}") +source_group("DSQL" "(${SSRC}|${BSRC})/dsql/.*\\.(cpp|y|ske)") +source_group("DSQL\\${EPP_TXT}" "${SSRC}/dsql/${EPP}") +source_group("DSQL\\${GEN_TXT}" "${BSRC}/dsql/${GEN}") +source_group("EXTLIB files" "${SSRC}/extlib/${CPP}") +source_group("Languages" "${SSRC}/gpre/languages/${CPP}") +#source_group("FBRMCLIB files" FILES ${SSRC}/gpre/languages/fbrmclib.cpp) gpre_boot, fbrmclib +source_group("GPRE files\\${EPP_TXT}" "${SSRC}/gpre/std/${EPP}") +source_group("GPRE files\\${GEN_TXT}" "${BSRC}/gpre/std/${GEN}") +source_group("INTL files" "${SSRC}/intl/${CPP}") +source_group("GUARD files" "${SSRC}/iscguard/${CPP}") +source_group("ISQL files" "${SSRC}/isql/${CPP}") +source_group("ISQL files\\${EPP_TXT}" "${SSRC}/isql/${EPP}") +source_group("ISQL files\\${GEN_TXT}" "${BSRC}/isql/${GEN}") +source_group("JRD files" "${SSRC}/jrd/${CPP}") +source_group("JRD files\\Data Access" "${SSRC}/jrd/recsrc/${CPP}") +source_group("JRD files\\EXTDS" "${SSRC}/jrd/extds/${CPP}") +source_group("JRD files\\${EPP_TXT}" "${SSRC}/jrd/${EPP}") +source_group("JRD files\\${GEN_TXT}" "${BSRC}/jrd/${GEN}") +source_group("JRD files\\Trace" "${SSRC}/jrd/trace/${CPP}") +source_group("Lock" "${SSRC}/lock/${CPP}") +source_group("REMOTE files" "${SSRC}/remote/${CPP}") +source_group("QLI files" "${SSRC}/qli/${CPP}") +source_group("QLI files\\${EPP_TXT}" "${SSRC}/qli/${EPP}") +source_group("QLI files\\${GEN_TXT}" "${BSRC}/qli/${GEN}") +source_group("UTILITIES files" "${SSRC}/utilities/${CPP}") Property changes on: firebird/trunk/builds/cmake/SourceGroups.cmake ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/examples/CMakeLists.txt =================================================================== --- firebird/trunk/examples/CMakeLists.txt (rev 0) +++ firebird/trunk/examples/CMakeLists.txt 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,99 @@ +include(SourceGroups) + +############################################################################### +# +# examples +# +############################################################################### + +######################################## +# EXECUTABLE empbuild +######################################## + +if (NOT CMAKE_CROSSCOMPILING) + +add_custom_command( + OUTPUT empbuild.fdb + DEPENDS + isql + ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbld.sql + COMMAND ${CMAKE_COMMAND} -E remove empbuild.fdb + COMMAND isql -q -i ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbld.sql +) +add_custom_command( + OUTPUT empbuild.c + DEPENDS + gpre + messages + ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e + empbuild.fdb + COMMENT "Calling GPRE for empbuild.e" + COMMAND gpre -r -m -n -z ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e empbuild.c +) + +add_executable (empbuild empbuild.c ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) +target_link_libraries (empbuild yvalve) +set_output_directory (empbuild empbuild FORCE) +add_dependencies (empbuild gfix engine12) +project_group (empbuild Examples) + +file(GLOB files + "${CMAKE_CURRENT_SOURCE_DIR}/empbuild/*.sql" + "${CMAKE_CURRENT_SOURCE_DIR}/empbuild/*.inp" +) +foreach(F ${files}) + get_filename_component(name ${F} NAME) + add_custom_command(TARGET empbuild POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${F} ${name}) +endforeach() + +set_unix (CMD PATH=${output_dir}/bin) +set_apple(CMD DYLD_LIBRARY_PATH=${output_dir}/plugins:${output_dir}/lib ${CMD}) + +if (WIN32) + add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} + COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb + COMMAND set PATH=%PATH%\;${output_dir} + COMMAND ${CMD} $<TARGET_FILE:empbuild> employe2.fdb + ) +else() + add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} + COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb + COMMAND ${CMD} $<TARGET_FILE:empbuild> employe2.fdb + ) +endif() +add_custom_target (employee_db DEPENDS employe2.fdb SOURCES ${files}) +project_group (employee_db Examples) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + +######################################## +# SHARED LIBRARY udrcpp_example +######################################## + +add_library (udrcpp_example SHARED udr/UdrCppExample.cpp) +target_link_libraries (udrcpp_example udr_engine) +set_output_directory (udrcpp_example plugins/udr) +project_group (udrcpp_example Examples) + + +######################################## +# SHARED LIBRARY dbcrypt_example +######################################## + +add_library (dbcrypt_example SHARED dbcrypt/DbCrypt.cpp) +set_target_properties (dbcrypt_example PROPERTIES OUTPUT_NAME DbCrypt_example) +set_output_directory (dbcrypt_example plugins) +project_group (dbcrypt_example Examples) + + +######################################## +# SHARED LIBRARY cryptkeyholder_example +######################################## + +add_library (cryptkeyholder_example SHARED dbcrypt/CryptKeyHolder.cpp) +set_target_properties (cryptkeyholder_example PROPERTIES OUTPUT_NAME CryptKeyHolder_example) +set_output_directory (cryptkeyholder_example plugins) +project_group (cryptkeyholder_example Examples) + +############################################################################### Property changes on: firebird/trunk/examples/CMakeLists.txt ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt (rev 0) +++ firebird/trunk/src/CMakeLists.txt 2015-01-21 11:21:51 UTC (rev 60532) @@ -0,0 +1,989 @@ +# +# firebird (trunk) +# +# This file has following organization: +# 1. preprocess +# 2. custom build steps (file generators) +# 3. libraries +# 4. shared libraries +# 5. executables +# 6. subdirectories +# 7. copy other files to output dir (docs, includes, ...) +# + +include(SourceGroups) + +set_generated_directory() + +################################################################################ +# +# PREPROCESS +# +################################################################################ + +######################################## +# PREPROCESS epp boot and master files +######################################## + +set(epp_boot_internal_files + burp/backup.epp + burp/restore.epp + burp/OdsDetection.epp + utilities/gstat/dba.epp +) +set(epp_boot_ocxx_files + isql/extract.epp + isql/isql.epp + isql/show.epp +) +set(epp_boot_files + alice/alice_meta.epp + gpre/std/gpre_meta.epp + utilities/stats.epp + yvalve/array.epp + yvalve/blob.epp +) +set(epp_boot_gds_files + dsql/metd.epp + dsql/DdlNodes.epp + dsql/PackageNodes.epp + jrd/dfw.epp + jrd/dpm.epp + jrd/dyn_util.epp + jrd/fun.epp + jrd/grant.epp + jrd/ini.epp + jrd/met.epp + jrd/pcmet.epp + jrd/scl.epp + jrd/Function.epp +) +set(epp_master_files + auth/SecurityDatabase/LegacyManagement.epp + msgs/build_file.epp + misc/codes.epp + qli/help.epp + qli/meta.epp + qli/proc.epp + qli/show.epp +) + +if (NOT CMAKE_CROSSCOMPILING) + +epp_process(boot epp_boot_internal_files gpre_boot -lang_internal -n -m) +epp_process(boot epp_boot_ocxx_files gpre_boot -lang_internal -n -ids -ocxx) +epp_process(boot epp_boot_files gpre_boot -n -m) +epp_process(boot epp_boot_gds_files gpre_boot -n -ids -gds_cxx) + +epp_process(master epp_boot_internal_files boot_gpre -n -m) +epp_process(master epp_boot_ocxx_files boot_gpre -n -ids -ocxx) +epp_process(master epp_boot_files boot_gpre -n -m) +epp_process(master epp_boot_gds_files boot_gpre -n -ids -gds_cxx) +epp_process(master epp_master_files boot_gpre -n -m) + + +################################################################################ +# +# CUSTOM BUILD STEPS +# +################################################################################ + +######################################## +# BUILD STEP databases +######################################## + +set(databases_src + ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/facilities2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/history2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/locales.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/messages2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/sqlstates.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/symbols2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/system_errors2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.de_DE2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.fr_FR2.sql +) +add_custom_command( + OUTPUT security.fdb + DEPENDS + boot_isql + ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql + VERBATIM + # + COMMAND ${CMAKE_COMMAND} -E remove security3.fdb + COMMAND ${CMAKE_COMMAND} -E echo "create database 'security3.fdb';" > create_db.sql + COMMAND boot_isql -q -i create_db.sql + COMMAND boot_isql -q security3.fdb -i ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql + COMMAND ${CMAKE_COMMAND} -E copy_if_different security3.fdb security.fdb +) +add_custom_command( + OUTPUT metadata.fdb + DEPENDS + boot_gbak + ${CMAKE_SOURCE_DIR}/builds/misc/metadata.gbak + # + COMMAND ${CMAKE_COMMAND} -E remove metadata.fdb + COMMAND boot_gbak -r ${CMAKE_SOURCE_DIR}/builds/misc/metadata.gbak metadata.fdb +) +set(isql_exec_msg boot_isql -q msg.fdb -i ${CMAKE_CURRENT_SOURCE_DIR}/msgs) +add_custom_command( + OUTPUT msg.fdb + VERBATIM + DEPENDS + boot_isql + metadata.fdb + security.fdb + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/facilities2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/history2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/locales.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/messages2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/sqlstates.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/symbols2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/system_errors2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.de_DE2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.fr_FR2.sql + # + COMMAND ${CMAKE_COMMAND} -E remove msg.fdb + COMMAND ${CMAKE_COMMAND} -E echo "create database 'msg.fdb';" > create_db.sql + COMMAND boot_isql -q -i create_db.sql + COMMAND ${isql_exec_msg}/msg.sql + # + COMMAND echo loading facilities + COMMAND ${isql_exec_msg}/facilities2.sql + COMMAND echo loading sql states + COMMAND ${isql_exec_msg}/sqlstates.sql + COMMAND echo loading locales + COMMAND ${isql_exec_msg}/locales.sql + COMMAND echo loading history + COMMAND ${isql_exec_msg}/history2.sql + COMMAND echo loading messages + COMMAND ${isql_exec_msg}/messages2.sql + COMMAND echo loading symbols + COMMAND ${isql_exec_msg}/symbols2.sql + COMMAND echo loading system errors + COMMAND ${isql_exec_msg}/system_errors2.sql + COMMAND echo loading French translation + COMMAND ${isql_exec_msg}/transmsgs.fr_FR2.sql + COMMAND echo loading German translation + COMMAND ${isql_exec_msg}/transmsgs.de_DE2.sql +) +add_custom_command( + OUTPUT help.fdb + DEPENDS + boot_gbak + metadata.fdb + ${CMAKE_SOURCE_DIR}/builds/misc/help.gbak + # + COMMAND ${CMAKE_COMMAND} -E remove help.fdb + COMMAND boot_gbak -r ${CMAKE_SOURCE_DIR}/builds/misc/help.gbak help.fdb +) +add_custom_target(databases + DEPENDS + boot_engine12 + msg.fdb + help.fdb + SOURCES + ${databases_src} +) +project_group(databases "Custom build steps") + + +######################################## +# BUILD STEP messages +######################################## + +add_custom_command( + OUTPUT firebird.msg + DEPENDS build_msg codes + # + COMMAND ${CMAKE_COMMAND} -E remove firebird.msg + COMMAND build_msg -D msg.fdb -P ./ -F firebird.msg -L all + COMMAND build_msg -D msg.fdb -P ./ -F firebird.msg +) +add_custom_target(messages DEPENDS firebird.msg) +project_group(messages "Custom build steps") +add_custom_command( + TARGET messages + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different firebird.msg ${output_dir}/firebird.msg +) + + +######################################## +# BUILD_STEP parse +######################################## + +set(parse_src + ${CMAKE_CURRENT_SOURCE_DIR}/dsql/parse.y + ${CMAKE_CURRENT_SOURCE_DIR}/dsql/btyacc_fb.ske +) +add_custom_command( + OUTPUT y_tab.h y_tab.c + DEPENDS + btyacc + ${parse_src} + COMMAND sed -n "/%type .*/p" ${CMAKE_CURRENT_SOURCE_DIR}/dsql/parse.y > types.y + COMMAND sed "s/%type .*//" ${CMAKE_CURRENT_SOURCE_DIR}/dsql/parse.y > y.y + COMMAND btyacc -l -d -S ${CMAKE_CURRENT_SOURCE_DIR}/dsql/btyacc_fb.ske y.y + COMMAND ${CMAKE_COMMAND} -E copy_if_different y_tab.h include/gen/parse.h + COMMAND ${CMAKE_COMMAND} -E copy_if_different y_tab.c dsql/parse.cpp + COMMENT "Generating parse.cpp, parse.h" + VERBATIM +) +add_custom_target(parse + DEPENDS y_tab.h y_tab.c + SOURCES ${parse_src} +) +project_group(parse "Custom build steps") +set_source_files_properties(dsql/parse.cpp include/gen/parse.h PROPERTIES GENERATED TRUE) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +################################################################################ +# +# LIBRARIES +# +################################################################################ + +############################################################################### +# LIBRARY boot_alice +############################################################################### + +file(GLOB alice_src "alice/*.cpp" "alice/*.h") + +set(alice_generated_src + alice/alice_meta.epp +) +add_epp_suffix(alice_generated_src boot) +add_epp_suffix(alice_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_library (boot_alice ${alice_src} ${alice_generated_src_boot}) +project_group (boot_alice Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +############################################################################### +# LIBRARY alice +############################################################################### + +add_library (alice ${alice_src} ${alice_generated_src_master}) + + +############################################################################### +# LIBRARY boot_burp +############################################################################### + +file(GLOB burp_src "burp/*.cpp" "burp/*.h") + +set(burp_generated_src + burp/backup.epp + burp/OdsDetection.epp + burp/restore.epp +) +add_epp_suffix(burp_generated_src boot) +add_epp_suffix(burp_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_library (boot_burp ${burp_src} ${burp_generated_src_boot}) +project_group (boot_burp Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +############################################################################### +# LIBRARY burp +############################################################################### + +add_library (burp ${burp_src} ${burp_generated_src_master}) + + +############################################################################### +# LIBRARY common +############################################################################### + +file(GLOB common_src "common/*.cpp" "common/classes/*.cpp" "common/config/*.cpp" "common/os/${OS_DIR}/*.cpp") +file(GLOB_RECURSE common_include "common/*.h") + +if (APPLE) + file(GLOB common_os_src "common/os/posix/*.cpp") + list(REMOVE_ITEM common_os_src ${CMAKE_CURRENT_BINARY_DIR}/common/os/posix/mod_loader.cpp) +endif() + +add_library(common ${common_src} ${common_os_src} ${common_include}) + + +################################################################################ +# +# SHARED LIBRARIES +# +################################################################################ + +######################################## +# SHARED LIBRARY boot_yvalve +######################################## + +file(GLOB yvalve_src "yvalve/*.cpp" "yvalve/config/os/${OS_DIR}/*.c*") +file(GLOB_RECURSE yvalve_include "yvalve/*.h") + +set(yvalve_src ${yvalve_src} + auth/SecureRemotePassword/client/SrpClient.cpp + auth/SecurityDatabase/LegacyClient.cpp + plugins/crypt/arc4/Arc4.cpp + remote/client/BlrFromMessage.cpp + remote/client/interface.cpp +) +add_src_win32(yvalve_src + jrd/os/win32/ibinitdll.cpp +) +set(yvalve_generated_src + yvalve/array.epp + yvalve/blob.epp +) +add_epp_suffix(yvalve_generated_src boot) +add_epp_suffix(yvalve_generated_src master) + +add_library (yvalve_common OBJECT ${yvalve_src} ${yvalve_include}) +add_dependencies_cc (yvalve_common parse) + +if (NOT CMAKE_CROSSCOMPILING) + +add_library (boot_yvalve SHARED $<TARGET_OBJECTS:yvalve_common> ${yvalve_generated_src_boot} ${VERSION_RC}) +target_link_libraries (boot_yvalve remote common libtommath ${LIB_Ws2_32} ${LIB_mpr} ${LIB_readline} ${LIB_dl} ${LIB_iconv} ${LIB_CoreFoundation}) +set_exported_symbols (boot_yvalve firebird) +set_output_directory_unix (boot_yvalve lib) +project_group (boot_yvalve Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# SHARED LIBRARY yvalve +######################################## + +add_library (yvalve SHARED $<TARGET_OBJECTS:yvalve_common> ${yvalve_generated_src_master} ${VERSION_RC}) +target_link_libraries (yvalve remote common libtommath ${LIB_Ws2_32} ${LIB_mpr} ${LIB_readline} ${LIB_dl} ${LIB_iconv} ${LIB_CoreFoundation}) +set_exported_symbols (yvalve firebird) +set_output_directory_unix (yvalve lib) +set_target_properties (yvalve PROPERTIES OUTPUT_NAME fbclient) + + +######################################## +# SHARED LIBRARY boot_engine12 +######################################## + +file(GLOB engine12_src + "dsql/*.cpp" + "jrd/*.cpp" + "jrd/extds/*.cpp" + "jrd/recsrc/*.cpp" + "jrd/trace/*.cpp" + "jrd/os/${OS_DIR}/*.cpp" +) +set(engine12_src ${engine12_src} + lock/lock.cpp + utilities/gsec/gsec.cpp + utilities/gstat/ppg.cpp + utilities/nbackup/nbackup.cpp + # parse + ${GENERATED_DIR}/dsql/parse.cpp +) +add_src_apple(engine12_src + jrd/os/posix/unix.cpp +) +set(engine12_generated_src + dsql/DdlNodes.epp + dsql/metd.epp + dsql/PackageNodes.epp + jrd/dfw.epp + jrd/dpm.epp + jrd/dyn_util.epp + jrd/fun.epp + jrd/Function.epp + jrd/grant.epp + jrd/ini.epp + jrd/met.epp + jrd/pcmet.epp + jrd/scl.epp + utilities/gstat/dba.epp +) +add_epp_suffix(engine12_generated_src boot) +add_epp_suffix(engine12_generated_src master) + +file(GLOB_RECURSE engine12_include "dsql/*.h" "jrd/*.h" include/gen/iberror.h) + +add_library (engine12_common ${engine12_src} ${engine12_include}) +add_dependencies_cc (engine12_common parse) + +if (NOT CMAKE_CROSSCOMPILING) + +add_library (boot_engine12 SHARED ${engine12_generated_src_boot} ${parse_src} ${VERSION_RC}) +target_link_libraries (boot_engine12 engine12_common boot_alice boot_burp common boot_yvalve) +set_output_directory (boot_engine12 plugins) +set_exported_symbols (boot_engine12 fbplugin) +copy_and_rename_lib (boot_engine12 Engine12) +project_group (boot_engine12 Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# SHARED LIBRARY engine12 +######################################## + +add_library (engine12 SHARED ${engine12_generated_src_master} ${parse_src} ${VERSION_RC}) +target_link_libraries (engine12 engine12_common alice burp common yvalve) +add_dependencies_cc (engine12 messages) # possible build during build_msg or codes run +set_target_properties (engine12 PROPERTIES OUTPUT_NAME Engine12) +set_output_directory (engine12 plugins) +set_exported_symbols (engine12 fbplugin) + + +############################################################################### +# SHARED LIBRARY intl +############################################################################### + +file(GLOB intl_src "intl/*.cpp" "intl/*.h") + +add_library (intl SHARED ${intl_src} ${VERSION_RC}) +target_link_libraries (intl common yvalve) +set_target_properties (intl PROPERTIES OUTPUT_NAME fbintl) +set_output_directory (intl intl) + + +######################################## +# SHARED LIBRARY ib_util +######################################## + +add_library (ib_util SHARED extlib/ib_util.cpp extlib/ib_util.h ${VERSION_RC}) +set_exported_symbols (ib_util ib_util) +set_output_directory_unix (ib_util lib) + + +######################################## +# SHARED LIBRARY ib_udf +######################################## + +add_library (ib_udf SHARED extlib/ib_udf.cpp extlib/ib_udf.h ${VERSION_RC}) +target_link_libraries (ib_udf ib_util) +set_target_properties (ib_udf PROPERTIES PREFIX "") +set_exported_symbols (ib_udf ib_udf) +set_output_directory (ib_udf UDF) + + +######################################## +# SHARED LIBRARY legacy_usermanager +######################################## + +set(legacy_usermanager_generated_src + auth/SecurityDatabase/LegacyManagement.epp +) +add_epp_suffix(legacy_usermanager_generated_src master) + +add_library (legacy_usermanager SHARED ${legacy_usermanager_generated_src_master} auth/SecurityDatabase/LegacyManagement.h ${VERSION_RC}) +target_link_libraries (legacy_usermanager common yvalve) +set_target_properties (legacy_usermanager PROPERTIES OUTPUT_NAME Legacy_UserManager) +set_output_directory (legacy_usermanager plugins) +set_exported_symbols (legacy_usermanager fbplugin) + + +######################################## +# SHARED LIBRARY udr_engine +######################################## + +set(udr_engine_src + plugins/udr_engine/UdrEngine.cpp +) +add_library (udr_engine SHARED ${udr_engine_src} ${VERSION_RC}) +target_link_libraries (udr_engine common yvalve) +set_output_directory (udr_engine plugins) +set_exported_symbols (udr_engine udr_engine) + + +######################################## +# SHARED LIBRARY fbudf +######################################## + +set(fbudf_src + extlib/fbudf/fbudf.cpp + extlib/fbudf/stdafx.cpp + + extlib/fbudf/fbudf.txt + extlib/fbudf/fbudf.sql + + jrd/ibase.h +) +file(GLOB fbudf_include "extlib/fbudf/*.h") + +add_library (fbudf SHARED ${fbudf_src} ${fbudf_include} ${VERSION_RC}) +target_link_libraries (fbudf common yvalve) +set_target_properties (fbudf PROPERTIES PREFIX "") +set_output_directory (fbudf UDF) + + +######################################## +# SHARED LIBRARY srp +######################################## + +add_library (srp SHARED auth/SecureRemotePassword/manage/SrpManagement.cpp ${VERSION_RC}) +target_link_libraries (srp common yvalve) +set_target_properties (srp PROPERTIES OUTPUT_NAME Srp) +set_output_directory (srp plugins) +set_exported_symbols (srp fbplugin) + + +######################################## +# SHARED LIBRARY legacy_auth +######################################## + +add_library (legacy_auth SHARED auth/SecurityDatabase/LegacyServer.cpp ${VERSION_RC}) +target_link_libraries (legacy_auth common yvalve) +set_target_properties (legacy_auth PROPERTIES OUTPUT_NAME Legacy_Auth) +set_output_directory (legacy_auth plugins) +set_exported_symbols (legacy_auth fbplugin) + + +################################################################################ +# +# EXECUTABLES +# +################################################################################ + +######################################## +# EXECUTABLE gpre_boot +######################################## + +set(gpre_boot_src + gpre/boot/gpre_meta_boot.cpp + yvalve/gds.cpp +) + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (gpre_boot ${gpre_boot_src} ${VERSION_RC}) +target_link_libraries (gpre_boot gpre_common common ${LIB_Ws2_32}) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# EXECUTABLE boot_gpre +######################################## + +set(gpre_generated_src + gpre/std/gpre_meta.epp +) +add_epp_suffix(gpre_generated_src boot) +add_epp_suffix(gpre_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (boot_gpre ${gpre_generated_src_boot} ${VERSION_RC}) +target_link_libraries (boot_gpre gpre_common common boot_yvalve) +project_group (boot_gpre Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# EXECUTABLE gpre +######################################## + +add_executable (gpre ${gpre_generated_src_master} ${VERSION_RC}) +target_link_libraries (gpre gpre_common common yvalve) + + +######################################## +# EXECUTABLE build_msg +######################################## + +set(build_msg_generated_src + msgs/build_file.epp +) +add_epp_suffix(build_msg_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (build_msg ${build_msg_generated_src_master} ${VERSION_RC}) +target_link_libraries (build_msg common yvalve) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# EXECUTABLE codes +######################################## + +set(codes_generated_src + misc/codes.epp +) +add_epp_suffix(codes_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (codes ${codes_generated_src_master} ${VERSION_RC}) +target_link_libraries (codes yvalve) +add_custom_command( + TARGET codes + POST_BUILD + COMMAND codes ${CMAKE_CURRENT_SOURCE_DIR}/include/gen ${CMAKE_SOURCE_DIR}/lang_helpers +) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +######################################## +# EXECUTABLE gstat +######################################## + +set(gstat_src + jrd/btn.cpp + jrd/ods.cpp + utilities/gstat/main/gstatMain.cpp + utilities/gstat/ppg.cpp +) +set(gstat_generated_src + utilities/gstat/dba.epp +) +add_epp_suffix(gstat_generated_src master) + +add_executable (gstat ${gstat_src} ${gstat_generated_src_master} ${VERSION_RC}) +target_link_libraries (gstat common yvalve) + + +######################################## +# EXECUTABLE fb_lock_print +######################################## + +add_executable (fb_lock_print lock/print.cpp ${VERSION_RC}) +target_link_libraries (fb_lock_print common yvalve) + + +######################################## +# EXECUTABLE fbguard +######################################## + +add_src_win32(fbguard_src + iscguard/cntl_guard.cpp + iscguard/iscguard.cpp + remote/server/os/win32/chop.cpp + + iscguard/iscguard.rc +) +add_src_unix(fbguard_src + utilities/guard/guard.cpp + utilities/guard/util.cpp +) + +add_executable (fbguard WIN32 ${fbguard_src}) +target_link_libraries (fbguard common yvalve ${LIB_comctl32} ${LIB_version}) + + +######################################## +# EXECUTABLE fbtracemgr +######################################## + +set(fbtracemgr_src + jrd/trace/TraceCmdLine.cpp + utilities/fbtracemgr/traceMgrMain.cpp +) + +add_executable (fbtracemgr ${fbtracemgr_src} ${VERSION_RC}) +target_link_libraries (fbtracemgr common yvalve) + + +############################################################################### +# EXECUTABLE gfix +############################################################################### + +add_executable (gfix alice/main/aliceMain.cpp ${VERSION_RC}) +target_link_libraries (gfix alice common yvalve) + + +############################################################################### +# EXECUTABLE boot_gbak +############################################################################### + +file(GLOB gbak_include "burp/*.h") + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (boot_gbak burp/main/burpMain.cpp ${gbak_include} ${VERSION_RC}) +target_link_libraries (boot_gbak boot_burp common boot_yvalve) +project_group (boot_gbak Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + + +############################################################################### +# EXECUTABLE gbak +############################################################################### + +add_executable (gbak burp/main/burpMain.cpp ${gbak_include} ${VERSION_RC}) +target_link_libraries (gbak burp yvalve common) + + +############################################################################### +# EXECUTABLE gsplit +############################################################################### + +add_executable (gsplit burp/split/spit.cpp burp/split/spit.h ${VERSION_RC}) +target_link_libraries (gsplit burp common yvalve) + + +############################################################################### +# EXECUTABLE boot_isql +############################################################################### + +file(GLOB isql_src "isql/*.cpp" "isql/*.h") + +set(isql_generated_src + isql/extract.epp + isql/isql.epp + isql/show.epp +) +add_epp_suffix(isql_generated_src boot) +add_epp_suffix(isql_generated_src master) + +if (NOT CMAKE_CROSSCOMPILING) + +add_executable (boot_isql ${isql_src} ${isql_generated_src_boot} ${VERSION_RC}) +target_link_libraries (boot_isql common boot_yvalve) +project_group (boot_isql Boot) + +endif() # if (NOT CMAKE_CROSSCOMPILING) + +if (WIN32) + add_custom_command( + TARGET boot_isql + POST_BUILD + # remove + COMMAND ${CMAKE_COMMAND} -E remove ${output_dir}/icudt52l.dat ${output_dir}/icudt52l_empty.dat + # + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/extern/icu/icudt52l.dat ${output_dir}/icudt52l.dat + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/extern/icu/icudt52l_empty.dat ${output_dir}/icudt52l_empty.dat + ) + + string(FIND ${CMAKE_EXE_LINKER_FLAGS} "/machine:x64" arch) + if (NOT ${arch} EQUAL -1) + set(arch "x64") + else() + set(arch "Win32") + endif() + add_custom_command( + TARGET boot_isql + POST_BUILD + # icu + # remove + COMMAND ${CMAKE_COMMAND} -E remove ${output_dir}/icudt52.dll ${output_dir}/icuin52.dll ${output_dir}/icuuc52.dll + # + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/extern/icu/${arch}/Release/bin/icudt52.dll ${output_dir}/icudt52.dll + ... [truncated message content] |
From: <fir...@us...> - 2015-01-24 00:13:32
|
Revision: 60539 http://sourceforge.net/p/firebird/code/60539 Author: firebirds Date: 2015-01-24 00:13:28 +0000 (Sat, 24 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-22 15:06:54 UTC (rev 60538) +++ firebird/trunk/ChangeLog 2015-01-24 00:13:28 UTC (rev 60539) @@ -1,3 +1,76 @@ + 2015-01-22 12:50 alexpeshkoff + M src/common/isc_file.cpp +Fixed static area corruption in ISC_expand_nfs, should fix CORE-4644: Get both "335545060 : Missing security context " and "335544344 : I/O error during "open" operation" for existing database under heavy concurrent DML + + 2015-01-22 10:35 hvlad + M src/common/isc_s_proto.h + M src/jrd/Mapping.cpp + M src/jrd/Monitoring.cpp + M src/jrd/Monitoring.h + M src/jrd/event.cpp + M src/jrd/event.h + M src/jrd/trace/TraceConfigStorage.cpp + M src/jrd/trace/TraceConfigStorage.h + M src/jrd/trace/TraceLog.cpp + M src/jrd/trace/TraceLog.h + M src/lock/lock.cpp + M src/lock/lock_proto.h + M src/lock/print.cpp +Make shared memory header same size independent on OS. +Introduce shared memory header version. + + 2015-01-22 10:32 alexpeshkoff + M src/common/isc_file.cpp +Fixed CORE-4624: Firebird won't start under Docker + + 2015-01-22 10:23 alexpeshkoff + M src/include/firebird/Interface.h + M src/include/gen/msgs.h + M src/msgs/messages2.sql +Enhance diags + + 2015-01-21 11:21 egorpugin + A CMakeLists.txt + A builds/cmake + A builds/cmake/BuildFunctions.cmake + A builds/cmake/Configure.cmake + A builds/cmake/SourceGroups.cmake + A examples/CMakeLists.txt + A src/CMakeLists.txt + A src/gpre/CMakeLists.txt + A src/include/gen/autoconfig.h.in + A src/remote/CMakeLists.txt + A src/utilities/CMakeLists.txt +[build] [cmake] Initial CMake build system commit. + + 2015-01-21 11:11 egorpugin + M configure.ac + M src/common/common.h + M src/common/isc_sync.cpp + M src/jrd/license.h + M src/jrd/recsrc/HashJoin.cpp + M src/remote/inet.cpp + M src/remote/protocol.h + M src/remote/remote_def.h + M src/utilities/ntrace/PluginLogWriter.cpp +[build] [cmake] Prepare sources for CMake building. Add clang preprocessor defs, ARM architecture defs, some Android-related defs. Add 'qsort_r' function search to configure.ac. + + 2015-01-21 09:18 hvlad + M src/jrd/cch.cpp +Fixed my error at patch for CORE-4565. It was the reason of false "lock denied" errors. + + 2015-01-20 18:59 dimitr + M src/common/isc_f_proto.h + M src/common/isc_file.cpp + M src/remote/client/interface.cpp +1) Make xnet://db connection strings useful with forward slashes +2) Unified port numbers / protocol names syntax (thus allowing custom ports in inet://host/db connection strings) + + 2015-01-19 12:58 alexpeshkoff + M src/common/common.h + M src/include/firebird/Interface.h +Public header cleanup + 2015-01-18 14:53 asfernandes M examples/udr/UdrCppExample.cpp M src/include/firebird/Message.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-22 15:06:54 UTC (rev 60538) +++ firebird/trunk/src/jrd/build_no.h 2015-01-24 00:13:28 UTC (rev 60539) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31557 + FORMAL BUILD NUMBER:31566 */ -#define PRODUCT_VER_STRING "3.0.0.31557" -#define FILE_VER_STRING "WI-T3.0.0.31557" -#define LICENSE_VER_STRING "WI-T3.0.0.31557" -#define FILE_VER_NUMBER 3, 0, 0, 31557 +#define PRODUCT_VER_STRING "3.0.0.31566" +#define FILE_VER_STRING "WI-T3.0.0.31566" +#define LICENSE_VER_STRING "WI-T3.0.0.31566" +#define FILE_VER_NUMBER 3, 0, 0, 31566 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31557" +#define FB_BUILD_NO "31566" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-22 15:06:54 UTC (rev 60538) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-24 00:13:28 UTC (rev 60539) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31557 +BuildNum=31566 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2015-01-25 00:14:08
|
Revision: 60544 http://sourceforge.net/p/firebird/code/60544 Author: firebirds Date: 2015-01-25 00:14:05 +0000 (Sun, 25 Jan 2015) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2015-01-24 16:47:54 UTC (rev 60543) +++ firebird/trunk/ChangeLog 2015-01-25 00:14:05 UTC (rev 60544) @@ -1,3 +1,7 @@ + 2015-01-24 11:49 hvlad + M src/jrd/cch.cpp +Frontportred fix for bug CORE-2848 : "lock conversion denied" or "lock denied" error + 2015-01-22 12:50 alexpeshkoff M src/common/isc_file.cpp Fixed static area corruption in ISC_expand_nfs, should fix CORE-4644: Get both "335545060 : Missing security context " and "335544344 : I/O error during "open" operation" for existing database under heavy concurrent DML Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2015-01-24 16:47:54 UTC (rev 60543) +++ firebird/trunk/src/jrd/build_no.h 2015-01-25 00:14:05 UTC (rev 60544) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:31566 + FORMAL BUILD NUMBER:31567 */ -#define PRODUCT_VER_STRING "3.0.0.31566" -#define FILE_VER_STRING "WI-T3.0.0.31566" -#define LICENSE_VER_STRING "WI-T3.0.0.31566" -#define FILE_VER_NUMBER 3, 0, 0, 31566 +#define PRODUCT_VER_STRING "3.0.0.31567" +#define FILE_VER_STRING "WI-T3.0.0.31567" +#define LICENSE_VER_STRING "WI-T3.0.0.31567" +#define FILE_VER_NUMBER 3, 0, 0, 31567 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "31566" +#define FB_BUILD_NO "31567" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Beta 2" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2015-01-24 16:47:54 UTC (rev 60543) +++ firebird/trunk/src/misc/writeBuildNum.sh 2015-01-25 00:14:05 UTC (rev 60544) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=31566 +BuildNum=31567 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2015-01-25 20:27:56
|
Revision: 60551 http://sourceforge.net/p/firebird/code/60551 Author: asfernandes Date: 2015-01-25 20:27:46 +0000 (Sun, 25 Jan 2015) Log Message: ----------- Improvements to the UDR plugin. Modified Paths: -------------- firebird/trunk/builds/posix/Makefile.in.plugins_examples firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj firebird/trunk/builds/win32/msvc9/Firebird3_Examples.sln firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/include/firebird/FirebirdInterface.idl firebird/trunk/src/include/firebird/IdlFbInterfaces.h firebird/trunk/src/include/firebird/Interface.h firebird/trunk/src/include/firebird/UdrCppEngine.h firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp Removed Paths: ------------- firebird/trunk/src/include/firebird/UdrEngine.h Modified: firebird/trunk/builds/posix/Makefile.in.plugins_examples =================================================================== --- firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-25 20:27:46 UTC (rev 60551) @@ -67,7 +67,7 @@ $(FIREBIRD_LIBRARY_LINK) else $(LIB_LINK) $(LIB_LINK_OPTIONS) $(LIB_LINK_SONAME)udrcpp_example.$(SHRLIB_EXT) \ - $(LIB_PATH_OPTS) -o $@ $^ $(THR_LIBS) $(PLUGINS)/$(LIB_PREFIX)udr_engine.$(SHRLIB_EXT) \ + $(LIB_PATH_OPTS) -o $@ $^ $(THR_LIBS) \ $(FIREBIRD_LIBRARY_LINK) endif Modified: firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj 2015-01-25 20:27:46 UTC (rev 60551) @@ -207,13 +207,7 @@ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\src\jrd</AdditionalIncludeDirectories> </ResourceCompile> </ItemGroup> - <ItemGroup> - <ProjectReference Include="udr_engine.vcxproj"> - <Project>{20debf08-ef0a-4c94-adeb-fe9bba14588b}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> \ No newline at end of file +</Project> Modified: firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj 2015-01-25 20:27:46 UTC (rev 60551) @@ -211,13 +211,7 @@ <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\src\jrd</AdditionalIncludeDirectories> </ResourceCompile> </ItemGroup> - <ItemGroup> - <ProjectReference Include="udr_engine.vcxproj"> - <Project>{20debf08-ef0a-4c94-adeb-fe9bba14588b}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> - </ProjectReference> - </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> \ No newline at end of file +</Project> Modified: firebird/trunk/builds/win32/msvc9/Firebird3_Examples.sln =================================================================== --- firebird/trunk/builds/win32/msvc9/Firebird3_Examples.sln 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/builds/win32/msvc9/Firebird3_Examples.sln 2015-01-25 20:27:46 UTC (rev 60551) @@ -12,7 +12,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udrcpp_example", "udrcpp_example.vcproj", "{FF0FD8DF-1E5C-486E-B395-A620376A4633}" ProjectSection(ProjectDependencies) = postProject - {20DEBF08-EF0A-4C94-ADEB-FE9BBA14588B} = {20DEBF08-EF0A-4C94-ADEB-FE9BBA14588B} {4FE03933-98CD-4879-A135-FD9430087A6B} = {4FE03933-98CD-4879-A135-FD9430087A6B} EndProjectSection EndProject Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-25 20:27:46 UTC (rev 60551) @@ -783,3 +783,6 @@ AutoRelease<IMessageMetadata> triggerMetadata; AutoRelease<IStatement> stmt; FB_UDR_END_TRIGGER + + +FB_UDR_IMPLEMENT_ENTRY_POINT Modified: firebird/trunk/src/include/firebird/FirebirdInterface.idl =================================================================== --- firebird/trunk/src/include/firebird/FirebirdInterface.idl 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/include/firebird/FirebirdInterface.idl 2015-01-25 20:27:46 UTC (rev 60551) @@ -1216,23 +1216,32 @@ // UDR Factory interfaces. They should be singletons instances created by user's modules and // registered. When UDR engine is going to load a routine, it calls newItem. -interface UdrFunctionFactory : Versioned +interface UdrFunctionFactory : Disposable { void setup(Status status, ExternalContext context, RoutineMetadata metadata, MetadataBuilder inBuilder, MetadataBuilder outBuilder); ExternalFunction newItem(Status status, ExternalContext context, RoutineMetadata metadata); } -interface UdrProcedureFactory : Versioned +interface UdrProcedureFactory : Disposable { void setup(Status status, ExternalContext context, RoutineMetadata metadata, MetadataBuilder inBuilder, MetadataBuilder outBuilder); ExternalProcedure newItem(Status status, ExternalContext context, RoutineMetadata metadata); } -interface UdrTriggerFactory : Versioned +interface UdrTriggerFactory : Disposable { void setup(Status status, ExternalContext context, RoutineMetadata metadata, MetadataBuilder fieldsBuilder); ExternalTrigger newItem(Status status, ExternalContext context, RoutineMetadata metadata); } + +interface UdrPlugin : Versioned +{ + Master getMaster(); + + void registerFunction(Status status, const string name, UdrFunctionFactory factory); + void registerProcedure(Status status, const string name, UdrProcedureFactory factory); + void registerTrigger(Status status, const string name, UdrTriggerFactory factory); +} Modified: firebird/trunk/src/include/firebird/IdlFbInterfaces.h =================================================================== --- firebird/trunk/src/include/firebird/IdlFbInterfaces.h 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/include/firebird/IdlFbInterfaces.h 2015-01-25 20:27:46 UTC (rev 60551) @@ -3,6 +3,8 @@ #ifndef IDL_FB_INTERFACES_H #define IDL_FB_INTERFACES_H +#include <stdint.h> + #ifndef CLOOP_CARG #define CLOOP_CARG #endif @@ -106,6 +108,7 @@ class IUdrFunctionFactory; class IUdrProcedureFactory; class IUdrTriggerFactory; + class IUdrPlugin; // Interfaces declarations @@ -4401,10 +4404,10 @@ } }; - class IUdrFunctionFactory : public IVersioned + class IUdrFunctionFactory : public IDisposable { public: - struct VTable : public IVersioned::VTable + struct VTable : public IDisposable::VTable { void (CLOOP_CARG *setup)(IUdrFunctionFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* inBuilder, IMetadataBuilder* outBuilder) throw(); IExternalFunction* (CLOOP_CARG *newItem)(IUdrFunctionFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata) throw(); @@ -4412,7 +4415,7 @@ protected: IUdrFunctionFactory(DoNotInherit) - : IVersioned(DoNotInherit()) + : IDisposable(DoNotInherit()) { } @@ -4421,7 +4424,7 @@ } public: - static const unsigned VERSION = 2; + static const unsigned VERSION = 3; template <typename StatusType> void setup(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* inBuilder, IMetadataBuilder* outBuilder) { @@ -4437,10 +4440,10 @@ } }; - class IUdrProcedureFactory : public IVersioned + class IUdrProcedureFactory : public IDisposable { public: - struct VTable : public IVersioned::VTable + struct VTable : public IDisposable::VTable { void (CLOOP_CARG *setup)(IUdrProcedureFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* inBuilder, IMetadataBuilder* outBuilder) throw(); IExternalProcedure* (CLOOP_CARG *newItem)(IUdrProcedureFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata) throw(); @@ -4448,7 +4451,7 @@ protected: IUdrProcedureFactory(DoNotInherit) - : IVersioned(DoNotInherit()) + : IDisposable(DoNotInherit()) { } @@ -4457,7 +4460,7 @@ } public: - static const unsigned VERSION = 2; + static const unsigned VERSION = 3; template <typename StatusType> void setup(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* inBuilder, IMetadataBuilder* outBuilder) { @@ -4473,10 +4476,10 @@ } }; - class IUdrTriggerFactory : public IVersioned + class IUdrTriggerFactory : public IDisposable { public: - struct VTable : public IVersioned::VTable + struct VTable : public IDisposable::VTable { void (CLOOP_CARG *setup)(IUdrTriggerFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* fieldsBuilder) throw(); IExternalTrigger* (CLOOP_CARG *newItem)(IUdrTriggerFactory* self, IStatus* status, IExternalContext* context, IRoutineMetadata* metadata) throw(); @@ -4484,7 +4487,7 @@ protected: IUdrTriggerFactory(DoNotInherit) - : IVersioned(DoNotInherit()) + : IDisposable(DoNotInherit()) { } @@ -4493,7 +4496,7 @@ } public: - static const unsigned VERSION = 2; + static const unsigned VERSION = 3; template <typename StatusType> void setup(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* fieldsBuilder) { @@ -4509,6 +4512,55 @@ } }; + class IUdrPlugin : public IVersioned + { + public: + struct VTable : public IVersioned::VTable + { + IMaster* (CLOOP_CARG *getMaster)(IUdrPlugin* self) throw(); + void (CLOOP_CARG *registerFunction)(IUdrPlugin* self, IStatus* status, const char* name, IUdrFunctionFactory* factory) throw(); + void (CLOOP_CARG *registerProcedure)(IUdrPlugin* self, IStatus* status, const char* name, IUdrProcedureFactory* factory) throw(); + void (CLOOP_CARG *registerTrigger)(IUdrPlugin* self, IStatus* status, const char* name, IUdrTriggerFactory* factory) throw(); + }; + + protected: + IUdrPlugin(DoNotInherit) + : IVersioned(DoNotInherit()) + { + } + + ~IUdrPlugin() + { + } + + public: + static const unsigned VERSION = 2; + + IMaster* getMaster() + { + IMaster* ret = static_cast<VTable*>(this->cloopVTable)->getMaster(this); + return ret; + } + + template <typename StatusType> void registerFunction(StatusType* status, const char* name, IUdrFunctionFactory* factory) + { + static_cast<VTable*>(this->cloopVTable)->registerFunction(this, status, name, factory); + StatusType::checkException(status); + } + + template <typename StatusType> void registerProcedure(StatusType* status, const char* name, IUdrProcedureFactory* factory) + { + static_cast<VTable*>(this->cloopVTable)->registerProcedure(this, status, name, factory); + StatusType::checkException(status); + } + + template <typename StatusType> void registerTrigger(StatusType* status, const char* name, IUdrTriggerFactory* factory) + { + static_cast<VTable*>(this->cloopVTable)->registerTrigger(this, status, name, factory); + StatusType::checkException(status); + } + }; + // Interfaces implementations template <typename Name, typename StatusType, typename Base> @@ -14377,6 +14429,7 @@ VTableImpl() { this->version = Base::VERSION; + this->dispose = &Name::cloopdisposeDispatcher; this->setup = &Name::cloopsetupDispatcher; this->newItem = &Name::cloopnewItemDispatcher; } @@ -14413,9 +14466,21 @@ return static_cast<IExternalFunction*>(0); } } + + static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw() + { + try + { + static_cast<Name*>(self)->Name::dispose(); + } + catch (...) + { + StatusType::catchException(0); + } + } }; - template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUdrFunctionFactory> > > + template <typename Name, typename StatusType, typename Base = IDisposableImpl<Name, StatusType, Inherit<IVersionedImpl<Name, StatusType, Inherit<IUdrFunctionFactory> > > > > class IUdrFunctionFactoryImpl : public IUdrFunctionFactoryBaseImpl<Name, StatusType, Base> { protected: @@ -14445,6 +14510,7 @@ VTableImpl() { this->version = Base::VERSION; + this->dispose = &Name::cloopdisposeDispatcher; this->setup = &Name::cloopsetupDispatcher; this->newItem = &Name::cloopnewItemDispatcher; } @@ -14481,9 +14547,21 @@ return static_cast<IExternalProcedure*>(0); } } + + static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw() + { + try + { + static_cast<Name*>(self)->Name::dispose(); + } + catch (...) + { + StatusType::catchException(0); + } + } }; - template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUdrProcedureFactory> > > + template <typename Name, typename StatusType, typename Base = IDisposableImpl<Name, StatusType, Inherit<IVersionedImpl<Name, StatusType, Inherit<IUdrProcedureFactory> > > > > class IUdrProcedureFactoryImpl : public IUdrProcedureFactoryBaseImpl<Name, StatusType, Base> { protected: @@ -14513,6 +14591,7 @@ VTableImpl() { this->version = Base::VERSION; + this->dispose = &Name::cloopdisposeDispatcher; this->setup = &Name::cloopsetupDispatcher; this->newItem = &Name::cloopnewItemDispatcher; } @@ -14549,9 +14628,21 @@ return static_cast<IExternalTrigger*>(0); } } + + static void CLOOP_CARG cloopdisposeDispatcher(IDisposable* self) throw() + { + try + { + static_cast<Name*>(self)->Name::dispose(); + } + catch (...) + { + StatusType::catchException(0); + } + } }; - template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUdrTriggerFactory> > > + template <typename Name, typename StatusType, typename Base = IDisposableImpl<Name, StatusType, Inherit<IVersionedImpl<Name, StatusType, Inherit<IUdrTriggerFactory> > > > > class IUdrTriggerFactoryImpl : public IUdrTriggerFactoryBaseImpl<Name, StatusType, Base> { protected: @@ -14567,6 +14658,104 @@ virtual void setup(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata, IMetadataBuilder* fieldsBuilder) = 0; virtual IExternalTrigger* newItem(StatusType* status, IExternalContext* context, IRoutineMetadata* metadata) = 0; }; + + template <typename Name, typename StatusType, typename Base> + class IUdrPluginBaseImpl : public Base + { + public: + typedef IUdrPlugin Declaration; + + IUdrPluginBaseImpl(DoNotInherit = DoNotInherit()) + { + static struct VTableImpl : Base::VTable + { + VTableImpl() + { + this->version = Base::VERSION; + this->getMaster = &Name::cloopgetMasterDispatcher; + this->registerFunction = &Name::cloopregisterFunctionDispatcher; + this->registerProcedure = &Name::cloopregisterProcedureDispatcher; + this->registerTrigger = &Name::cloopregisterTriggerDispatcher; + } + } vTable; + + this->cloopVTable = &vTable; + } + + static IMaster* CLOOP_CARG cloopgetMasterDispatcher(IUdrPlugin* self) throw() + { + try + { + return static_cast<Name*>(self)->Name::getMaster(); + } + catch (...) + { + StatusType::catchException(0); + return static_cast<IMaster*>(0); + } + } + + static void CLOOP_CARG cloopregisterFunctionDispatcher(IUdrPlugin* self, IStatus* status, const char* name, IUdrFunctionFactory* factory) throw() + { + StatusType status2(status); + + try + { + static_cast<Name*>(self)->Name::registerFunction(&status2, name, factory); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG cloopregisterProcedureDispatcher(IUdrPlugin* self, IStatus* status, const char* name, IUdrProcedureFactory* factory) throw() + { + StatusType status2(status); + + try + { + static_cast<Name*>(self)->Name::registerProcedure(&status2, name, factory); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG cloopregisterTriggerDispatcher(IUdrPlugin* self, IStatus* status, const char* name, IUdrTriggerFactory* factory) throw() + { + StatusType status2(status); + + try + { + static_cast<Name*>(self)->Name::registerTrigger(&status2, name, factory); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + }; + + template <typename Name, typename StatusType, typename Base = IVersionedImpl<Name, StatusType, Inherit<IUdrPlugin> > > + class IUdrPluginImpl : public IUdrPluginBaseImpl<Name, StatusType, Base> + { + protected: + IUdrPluginImpl(DoNotInherit = DoNotInherit()) + { + } + + public: + virtual ~IUdrPluginImpl() + { + } + + virtual IMaster* getMaster() = 0; + virtual void registerFunction(StatusType* status, const char* name, IUdrFunctionFactory* factory) = 0; + virtual void registerProcedure(StatusType* status, const char* name, IUdrProcedureFactory* factory) = 0; + virtual void registerTrigger(StatusType* status, const char* name, IUdrTriggerFactory* factory) = 0; + }; }; Modified: firebird/trunk/src/include/firebird/Interface.h =================================================================== --- firebird/trunk/src/include/firebird/Interface.h 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/include/firebird/Interface.h 2015-01-25 20:27:46 UTC (rev 60551) @@ -239,5 +239,6 @@ } // namespace Firebird #define FB_PLUGIN_ENTRY_POINT firebird_plugin +#define FB_UDR_PLUGIN_ENTRY_POINT firebird_udr_plugin #endif // FB_INTERFACE_H Modified: firebird/trunk/src/include/firebird/UdrCppEngine.h =================================================================== --- firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/include/firebird/UdrCppEngine.h 2015-01-25 20:27:46 UTC (rev 60551) @@ -27,20 +27,51 @@ #error FB_UDR_STATUS_TYPE must be defined with the Status class before UdrCppEngine.h inclusion. #endif -#include "./UdrEngine.h" #include "./Message.h" -#ifndef JRD_IBASE_H -#include "ibase.h" -#include "iberror.h" -#endif #include <string.h> -namespace Firebird -{ - namespace Udr - { -//------------------------------------------------------------------------------ +#define FB_UDR_IMPLEMENT_ENTRY_POINT \ + namespace Firebird \ + { \ + namespace Udr \ + { \ + RegistrationNode<IUdrFunctionFactory>* regFunctions = NULL; \ + RegistrationNode<IUdrProcedureFactory>* regProcedures = NULL; \ + RegistrationNode<IUdrTriggerFactory>* regTriggers = NULL; \ + } \ + } \ + \ + extern "C" FB_BOOLEAN* FB_UDR_PLUGIN_ENTRY_POINT(IStatus* status, FB_BOOLEAN* theirUnloadFlag, \ + IUdrPlugin* udrPlugin) \ + { \ + ::Firebird::Udr::FactoryRegistration::finish(status, udrPlugin); \ + \ + class UnloadDetector \ + { \ + public: \ + UnloadDetector(FB_BOOLEAN* aTheirUnloadFlag, IUdrPlugin* aUdrPlugin) \ + : myUnloadFlag(FB_FALSE), \ + theirUnloadFlag(aTheirUnloadFlag), \ + udrPlugin(aUdrPlugin) \ + { \ + } \ + \ + ~UnloadDetector() \ + { \ + if (!myUnloadFlag) \ + *theirUnloadFlag = FB_TRUE; \ + } \ + \ + FB_BOOLEAN myUnloadFlag; \ + FB_BOOLEAN* theirUnloadFlag; \ + IUdrPlugin* udrPlugin; \ + }; \ + \ + static UnloadDetector unloadDetector(theirUnloadFlag, udrPlugin); \ + \ + return &unloadDetector.myUnloadFlag; \ + } #define FB_UDR_BEGIN_FUNCTION(name) \ @@ -176,6 +207,13 @@ } +namespace Firebird +{ + namespace Udr + { +//------------------------------------------------------------------------------ + + template <typename T, typename StatusType> class Procedure; @@ -311,15 +349,78 @@ }; +template <typename T> struct RegistrationNode +{ + const char* name; + T* factory; + RegistrationNode<T>* next; +}; + +extern RegistrationNode<IUdrFunctionFactory>* regFunctions; +extern RegistrationNode<IUdrProcedureFactory>* regProcedures; +extern RegistrationNode<IUdrTriggerFactory>* regTriggers; + +class FactoryRegistration +{ +public: + template <typename T> static void schedule(const char* name, T* factory, + RegistrationNode<T>** list) + { + RegistrationNode<T>* node = new RegistrationNode<T>(); + node->name = name; + node->factory = factory; + node->next = *list; + + *list = node; + } + + static void finish(IStatus* status, IUdrPlugin* plugin) + { + CheckStatusWrapper statusWrapper(status); + + if (!run(&statusWrapper, plugin, &IUdrPlugin::registerFunction, regFunctions)) + return; + + if (!run(&statusWrapper, plugin, &IUdrPlugin::registerProcedure, regProcedures)) + return; + + if (!run(&statusWrapper, plugin, &IUdrPlugin::registerTrigger, regTriggers)) + return; + } + +private: + template <typename T> + static bool run(CheckStatusWrapper* statusWrapper, IUdrPlugin* plugin, + void (IUdrPlugin::*routine)(CheckStatusWrapper* status, const char* name, T* factory), + RegistrationNode<T>* list) + { + for (RegistrationNode<T>* node = list; node; node = node->next) + { + (plugin->*routine)(statusWrapper, node->name, node->factory); + + if (statusWrapper->getStatus() & IStatus::FB_HAS_ERRORS) + return false; + } + + return true; + } +}; + + template <typename T, typename StatusType> class FunctionFactoryImpl : public IUdrFunctionFactoryImpl<FunctionFactoryImpl<T, StatusType>, StatusType> { public: explicit FunctionFactoryImpl(const char* name) { - fbUdrRegFunction(name, this); + FactoryRegistration::schedule<IUdrFunctionFactory>(name, this, ®Functions); } + void dispose() + { + // Do not delete this. The instances are statically allocated. + } + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* in, IMetadataBuilder* out) { @@ -341,9 +442,14 @@ public: explicit ProcedureFactoryImpl(const char* name) { - fbUdrRegProcedure(name, this); + FactoryRegistration::schedule<IUdrProcedureFactory>(name, this, ®Procedures); } + void dispose() + { + // Do not delete this. The instances are statically allocated. + } + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* in, IMetadataBuilder* out) { @@ -365,9 +471,14 @@ public: explicit TriggerFactoryImpl(const char* name) { - fbUdrRegTrigger(name, this); + FactoryRegistration::schedule<IUdrTriggerFactory>(name, this, ®Triggers); } + void dispose() + { + // Do not delete this. The instances are statically allocated. + } + void setup(StatusType* status, IExternalContext* /*context*/, IRoutineMetadata* /*metadata*/, IMetadataBuilder* fields) { Deleted: firebird/trunk/src/include/firebird/UdrEngine.h =================================================================== --- firebird/trunk/src/include/firebird/UdrEngine.h 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/include/firebird/UdrEngine.h 2015-01-25 20:27:46 UTC (rev 60551) @@ -1,52 +0,0 @@ -/* - * The contents of this file are subject to the Initial - * Developer's Public License Version 1.0 (the "License"); - * you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. - * - * Software distributed under the License is distributed AS IS, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. - * See the License for the specific language governing rights - * and limitations under the License. - * - * The Original Code was created by Adriano dos Santos Fernandes - * for the Firebird Open Source RDBMS project. - * - * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@uo...> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - */ - -#ifndef FIREBIRD_UDR_H -#define FIREBIRD_UDR_H - -#include "./Interface.h" - -#ifndef FB_EXPORTED -#if defined(DARWIN) -#define FB_EXPORTED __attribute__((visibility("default"))) -#else -#define FB_EXPORTED -#endif // OS choice (DARWIN) -#endif // FB_EXPORTED - - -namespace Firebird -{ -//------------------------------------------------------------------------------ - - -//// TODO: review -// Routine registration functions. -extern "C" void FB_EXPORTED fbUdrRegFunction(const char* name, IUdrFunctionFactory* factory); -extern "C" void FB_EXPORTED fbUdrRegProcedure(const char* name, IUdrProcedureFactory* factory); -extern "C" void FB_EXPORTED fbUdrRegTrigger(const char* name, IUdrTriggerFactory* factory); - - -//------------------------------------------------------------------------------ -} // namespace Firebird - -#endif // FIREBIRD_UDR_H Modified: firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp =================================================================== --- firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2015-01-25 20:27:18 UTC (rev 60550) +++ firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2015-01-25 20:27:46 UTC (rev 60551) @@ -22,7 +22,6 @@ #include "firebird.h" #include "../jrd/ibase.h" -#include "firebird/UdrEngine.h" #include "firebird/Interface.h" #include "../common/classes/alloc.h" #include "../common/classes/array.h" @@ -43,37 +42,9 @@ //------------------------------------------------------------------------------ -struct Node -{ - Node() - : name(*getDefaultMemoryPool()), - module(*getDefaultMemoryPool()) - { - } +class UdrPluginImpl; - string name; - PathName module; -}; -struct FunctionNode : public Node -{ - IUdrFunctionFactory* factory; - FunctionNode* next; -}; - -struct ProcedureNode : public Node -{ - IUdrProcedureFactory* factory; - ProcedureNode* next; -}; - -struct TriggerNode : public Node -{ - IUdrTriggerFactory* factory; - TriggerNode* next; -}; - - static GlobalPtr<ObjectsArray<PathName> > paths; class Engine : public StdPlugin<IExternalEngineImpl<Engine, ThrowStatusWrapper> > @@ -129,25 +100,21 @@ } public: - void loadModule(ThrowStatusWrapper* status, IRoutineMetadata* metadata, + UdrPluginImpl* loadModule(ThrowStatusWrapper* status, IRoutineMetadata* metadata, PathName* moduleName, string* entryPoint); template <typename NodeType, typename ObjType, typename SharedObjType> ObjType* getChild( - ThrowStatusWrapper* status, GenericMap<Pair<NonPooled<IExternalContext*, ObjType*> > >& children, - SharedObjType* sharedObj, IExternalContext* context, NodeType* nodes, + ThrowStatusWrapper* status, + GenericMap<Pair<NonPooled<IExternalContext*, ObjType*> > >& children, + SharedObjType* sharedObj, IExternalContext* context, SortedArray<SharedObjType*>& sharedObjs, const PathName& moduleName); template <typename ObjType> void deleteChildren( GenericMap<Pair<NonPooled<IExternalContext*, ObjType*> > >& children); - template <typename T> T* findNode(ThrowStatusWrapper* status, T* nodes, - const PathName& moduleName, const string& entryPoint); + template <typename T> T* findNode(ThrowStatusWrapper* status, + const GenericMap<Pair<Left<string, T*> > >& nodes, const string& entryPoint); -private: - template <typename T, typename T2> T2* getNode(ThrowStatusWrapper* status, T* nodes, - const PathName& moduleName, IExternalContext* context, IRoutineMetadata* metadata, - const string& entryPoint); - public: void open(ThrowStatusWrapper* status, IExternalContext* context, char* name, unsigned nameSize); void openAttachment(ThrowStatusWrapper* status, IExternalContext* context); @@ -172,11 +139,11 @@ }; -class ModulesMap : public GenericMap<Pair<Left<PathName, ModuleLoader::Module*> > > +class ModulesMap : public GenericMap<Pair<Left<PathName, UdrPluginImpl*> > > { public: explicit ModulesMap(MemoryPool& p) - : GenericMap<Pair<Left<PathName, ModuleLoader::Module*> > >(p) + : GenericMap<Pair<Left<PathName, UdrPluginImpl*> > >(p) { } @@ -190,15 +157,125 @@ static GlobalPtr<Mutex> modulesMutex; static GlobalPtr<ModulesMap> modules; -static InitInstance<PathName> loadingModule; -static FunctionNode* registeredFunctions = NULL; -static ProcedureNode* registeredProcedures = NULL; -static TriggerNode* registeredTriggers = NULL; - //-------------------------------------- +class UdrPluginImpl : public VersionedIface<IUdrPluginImpl<UdrPluginImpl, ThrowStatusWrapper> > +{ +public: + UdrPluginImpl(const PathName& aModuleName, ModuleLoader::Module* aModule) + : moduleName(*getDefaultMemoryPool(), aModuleName), + module(aModule), + myUnloadFlag(FB_FALSE), + theirUnloadFlag(NULL), + functionsMap(*getDefaultMemoryPool()), + proceduresMap(*getDefaultMemoryPool()), + triggersMap(*getDefaultMemoryPool()) + { + } + + ~UdrPluginImpl() + { + if (myUnloadFlag) + return; + + *theirUnloadFlag = FB_TRUE; + + { + GenericMap<Pair<Left<string, IUdrFunctionFactory*> > >::Accessor accessor(&functionsMap); + for (bool cont = accessor.getFirst(); cont; cont = accessor.getNext()) + accessor.current()->second->dispose(); + } + + { + GenericMap<Pair<Left<string, IUdrProcedureFactory*> > >::Accessor accessor(&proceduresMap); + for (bool cont = accessor.getFirst(); cont; cont = accessor.getNext()) + accessor.current()->second->dispose(); + } + + { + GenericMap<Pair<Left<string, IUdrTriggerFactory*> > >::Accessor accessor(&triggersMap); + for (bool cont = accessor.getFirst(); cont; cont = accessor.getNext()) + accessor.current()->second->dispose(); + } + + delete module; + } + +public: + IMaster* getMaster() + { + return MasterInterfacePtr(); + } + + void registerFunction(ThrowStatusWrapper* status, const char* name, + IUdrFunctionFactory* factory) + { + if (functionsMap.exist(name)) + { + static const ISC_STATUS statusVector[] = { + isc_arg_gds, isc_random, + isc_arg_string, (ISC_STATUS) "Duplicate UDR function", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) name, + isc_arg_end + }; + + throw FbException(status, statusVector); + } + + functionsMap.put(name, factory); + } + + void registerProcedure(ThrowStatusWrapper* status, const char* name, + IUdrProcedureFactory* factory) + { + if (proceduresMap.exist(name)) + { + static const ISC_STATUS statusVector[] = { + isc_arg_gds, isc_random, + isc_arg_string, (ISC_STATUS) "Duplicate UDR procedure", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) name, + isc_arg_end + }; + + throw FbException(status, statusVector); + } + + proceduresMap.put(name, factory); + } + + void registerTrigger(ThrowStatusWrapper* status, const char* name, + IUdrTriggerFactory* factory) + { + if (triggersMap.exist(name)) + { + static const ISC_STATUS statusVector[] = { + isc_arg_gds, isc_random, + isc_arg_string, (ISC_STATUS) "Duplicate UDR trigger", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) name, + isc_arg_end + }; + + throw FbException(status, statusVector); + } + + triggersMap.put(name, factory); + } + +private: + PathName moduleName; + ModuleLoader::Module* module; + +public: + FB_BOOLEAN myUnloadFlag; + FB_BOOLEAN* theirUnloadFlag; + GenericMap<Pair<Left<string, IUdrFunctionFactory*> > > functionsMap; + GenericMap<Pair<Left<string, IUdrProcedureFactory*> > > proceduresMap; + GenericMap<Pair<Left<string, IUdrTriggerFactory*> > > triggersMap; +}; + + class SharedFunction : public DisposeIface<IExternalFunctionImpl<SharedFunction, ThrowStatusWrapper> > { public: @@ -212,10 +289,12 @@ info(*getDefaultMemoryPool()), children(*getDefaultMemoryPool()) { - engine->loadModule(status, metadata, &moduleName, &entryPoint); - FunctionNode* node = engine->findNode<FunctionNode>( - status, registeredFunctions, moduleName, entryPoint); - node->factory->setup(status, context, metadata, inBuilder, outBuilder); + module = engine->loadModule(status, metadata, &moduleName, &entryPoint); + + IUdrFunctionFactory* factory = engine->findNode<IUdrFunctionFactory>( + status, module->functionsMap, entryPoint); + + factory->setup(status, context, metadata, inBuilder, outBuilder); } ~SharedFunction() @@ -235,8 +314,8 @@ { strncpy(name, context->getClientCharSet(), nameSize); - IExternalFunction* function = engine->getChild<FunctionNode, IExternalFunction>(status, - children, this, context, registeredFunctions, engine->functions, moduleName); + IExternalFunction* function = engine->getChild<IUdrFunctionFactory, IExternalFunction>( + status, children, this, context, engine->functions, moduleName); if (function) function->getCharSet(status, context, name, nameSize); @@ -244,8 +323,9 @@ void execute(ThrowStatusWrapper* status, IExternalContext* context, void* inMsg, void* outMsg) { - IExternalFunction* function = engine->getChild<FunctionNode, IExternalFunction>(status, - children, this, context, registeredFunctions, engine->functions, moduleName); + IExternalFunction* function = engine->getChild<IUdrFunctionFactory, IExternalFunction>( + status, children, this, context, engine->functions, moduleName); + if (function) function->execute(status, context, inMsg, outMsg); } @@ -257,6 +337,7 @@ string entryPoint; string info; GenericMap<Pair<NonPooled<IExternalContext*, IExternalFunction*> > > children; + UdrPluginImpl* module; }; @@ -276,10 +357,12 @@ info(*getDefaultMemoryPool()), children(*getDefaultMemoryPool()) { - engine->loadModule(status, metadata, &moduleName, &entryPoint); - ProcedureNode* node = engine->findNode<ProcedureNode>( - status, registeredProcedures, moduleName, entryPoint); - node->factory->setup(status, context, metadata, inBuilder, outBuilder); + module = engine->loadModule(status, metadata, &moduleName, &entryPoint); + + IUdrProcedureFactory* factory = engine->findNode<IUdrProcedureFactory>( + status, module->proceduresMap, entryPoint); + + factory->setup(status, context, metadata, inBuilder, outBuilder); } ~SharedProcedure() @@ -299,8 +382,8 @@ { strncpy(name, context->getClientCharSet(), nameSize); - IExternalProcedure* procedure = engine->getChild<ProcedureNode, IExternalProcedure>(status, - children, this, context, registeredProcedures, engine->procedures, moduleName); + IExternalProcedure* procedure = engine->getChild<IUdrProcedureFactory, IExternalProcedure>( + status, children, this, context, engine->procedures, moduleName); if (procedure) procedure->getCharSet(status, context, name, nameSize); @@ -309,8 +392,8 @@ IExternalResultSet* open(ThrowStatusWrapper* status, IExternalContext* context, void* inMsg, void* outMsg) { - IExternalProcedure* procedure = engine->getChild<ProcedureNode, IExternalProcedure>(status, - children, this, context, registeredProcedures, engine->procedures, moduleName); + IExternalProcedure* procedure = engine->getChild<IUdrProcedureFactory, IExternalProcedure>( + status, children, this, context, engine->procedures, moduleName); return procedure ? procedure->open(status, context, inMsg, outMsg) : NULL; } @@ -322,6 +405,7 @@ string entryPoint; string info; GenericMap<Pair<NonPooled<IExternalContext*, IExternalProcedure*> > > children; + UdrPluginImpl* module; }; @@ -340,12 +424,12 @@ info(*getDefaultMemoryPool()), children(*getDefaultMemoryPool()) { - engine->loadModule(status, metadata, &moduleName, &entryPoint); + module = engine->loadModule(status, metadata, &moduleName, &entryPoint); - TriggerNode* node = engine->findNode<TriggerNode>(status, - registeredTriggers, moduleName, entryPoint); + IUdrTriggerFactory* factory = engine->findNode<IUdrTriggerFactory>( + status, module->triggersMap, entryPoint); - node->factory->setup(status, context, metadata, fieldsBuilder); + factory->setup(status, context, metadata, fieldsBuilder); } ~SharedTrigger() @@ -365,8 +449,8 @@ { strncpy(name, context->getClientCharSet(), nameSize); - IExternalTrigger* trigger = engine->getChild<TriggerNode, IExternalTrigger>(status, - children, this, context, registeredTriggers, engine->triggers, moduleName); + IExternalTrigger* trigger = engine->getChild<IUdrTriggerFactory, IExternalTrigger>( + status, children, this, context, engine->triggers, moduleName); if (trigger) trigger->getCharSet(status, context, name, nameSize); @@ -375,8 +459,9 @@ void execute(ThrowStatusWrapper* status, IExternalContext* context, unsigned action, void* oldMsg, void* newMsg) { - IExternalTrigger* trigger = engine->getChild<TriggerNode, IExternalTrigger>(status, - children, this, context, registeredTriggers, engine->triggers, moduleName); + IExternalTrigger* trigger = engine->getChild<IUdrTriggerFactory, IExternalTrigger>( + status, children, this, context, engine->triggers, moduleName); + if (trigger) trigger->execute(status, context, action, oldMsg, newMsg); } @@ -388,68 +473,43 @@ string entryPoint; string info; GenericMap<Pair<NonPooled<IExternalContext*, IExternalTrigger*> > > children; + UdrPluginImpl* module; }; //-------------------------------------- -extern "C" void FB_EXPORTED fbUdrRegFunction(const char* name, IUdrFunctionFactory* factory) +template <typename FactoryType> GenericMap<Pair<Left<string, FactoryType*> > >& getFactoryMap( + UdrPluginImpl* udrPlugin) { - FunctionNode* node = new FunctionNode(); - node->name = name; - node->module = loadingModule(); - node->factory = factory; - node->next = registeredFunctions; - registeredFunctions = node; + fb_assert(false); } +template <> GenericMap<Pair<Left<string, IUdrFunctionFactory*> > >& getFactoryMap( + UdrPluginImpl* udrPlugin) +{ + return udrPlugin->functionsMap; +} -extern "C" void FB_EXPORTED fbUdrRegProcedure(const char* name, IUdrProcedureFactory* factory) +template <> GenericMap<Pair<Left<string, IUdrProcedureFactory*> > >& getFactoryMap( + UdrPluginImpl* udrPlugin) { - ProcedureNode* node = new ProcedureNode(); - node->name = name; - node->module = loadingModule(); - node->factory = factory; - node->next = registeredProcedures; - registeredProcedures = node; + return udrPlugin->proceduresMap; } - -extern "C" void FB_EXPORTED fbUdrRegTrigger(const char* name, IUdrTriggerFactory* factory) +template <> GenericMap<Pair<Left<string, IUdrTriggerFactory*> > >& getFactoryMap( + UdrPluginImpl* udrPlugin) { - TriggerNode* node = new TriggerNode(); - node->name = name; - node->module = loadingModule(); - node->factory = factory; - node->next = registeredTriggers; - registeredTriggers = node; + return udrPlugin->triggersMap; } +//-------------------------------------- + + ModulesMap::~ModulesMap() { - while (registeredFunctions) - { - FunctionNode* del = registeredFunctions; - registeredFunctions = registeredFunctions->next; - delete del; - } - - while (registeredProcedures) - { - ProcedureNode* del = registeredProcedures; - registeredProcedures = registeredProcedures->next; - delete del; - } - - while (registeredTriggers) - { - TriggerNode* del = registeredTriggers; - registeredTriggers = registeredTriggers->next; - delete del; - } - Accessor accessor(this); for (bool cont = accessor.getFirst(); cont; cont = accessor.getNext()) delete accessor.current()->second; @@ -459,7 +519,7 @@ //-------------------------------------- -void Engine::loadModule(ThrowStatusWrapper* status, IRoutineMetadata* metadata, +UdrPluginImpl* Engine::loadModule(ThrowStatusWrapper* status, IRoutineMetadata* metadata, PathName* moduleName, string* entryPoint) { const string str(metadata->getEntryPoint(status)); @@ -468,9 +528,9 @@ if (pos == string::npos) { static const ISC_STATUS statusVector[] = { - isc_arg_gds, - isc_random, + isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) "Invalid entry point", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) entryPoint.c_str(), isc_arg_end }; @@ -482,9 +542,9 @@ if (moduleName->find_first_of("/\\") != string::npos) { static const ISC_STATUS statusVector[] = { - isc_arg_gds, - isc_random, + isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) "Invalid module name", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) moduleName->c_str(), isc_arg_end }; @@ -498,10 +558,10 @@ MutexLockGuard guard(modulesMutex, FB_FUNCTION); - if (modules->exist(*moduleName)) - return; + UdrPluginImpl* ret; - loadingModule() = *moduleName; + if (modules->get(*moduleName, ret)) + return ret; for (ObjectsArray<PathName>::iterator i = paths->begin(); i != paths->end(); ++i) { @@ -512,27 +572,59 @@ if (module) { - modules->put(*moduleName, module); - break; + FB_BOOLEAN* (*entryPoint)(IStatus*, FB_BOOLEAN*, IUdrPlugin*); + + if (!module->findSymbol(STRINGIZE(FB_UDR_PLUGIN_ENTRY_POINT), entryPoint)) + { + static const ISC_STATUS statusVector[] = { + isc_arg_gds, isc_random, + isc_arg_string, (ISC_STATUS) "UDR plugin entry point not found", + isc_arg_end + }; + + throw FbException(status, statusVector); + } + + UdrPluginImpl* udrPlugin = new UdrPluginImpl(*moduleName, module); + udrPlugin->theirUnloadFlag = entryPoint(status, &udrPlugin->myUnloadFlag, udrPlugin); + + if (status->getStatus() & IStatus::FB_HAS_ERRORS) + { + delete udrPlugin; + ThrowStatusWrapper::checkException(status); + } + + modules->put(*moduleName, udrPlugin); + + return udrPlugin; } else { static const ISC_STATUS statusVector[] = { - isc_arg_gds, - isc_random, + isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) "Module not found", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) moduleName->c_str(), isc_arg_end }; throw FbException(status, statusVector); } } + + static const ISC_STATUS statusVector[] = { + isc_arg_gds, isc_random, + isc_arg_string, (ISC_STATUS) "No UDR module path was configured", + isc_arg_end + }; + + throw FbException(status, statusVector); } template <typename NodeType, typename ObjType, typename SharedObjType> ObjType* Engine::getChild( - ThrowStatusWrapper* status, GenericMap<Pair<NonPooled<IExternalContext*, ObjType*> > >& children, - SharedObjType* sharedObj, IExternalContext* context, NodeType* nodes, + ThrowStatusWrapper* status, + GenericMap<Pair<NonPooled<IExternalContext*, ObjType*> > >& children, SharedObjType* sharedObj, + IExternalContext* context, SortedArray<SharedObjType*>& sharedObjs, const PathName& moduleName) { MutexLockGuard guard(childrenMutex, FB_FUNCTION); @@ -543,9 +635,12 @@ ObjType* obj; if (!children.get(context, obj)) { - obj = getNode<NodeType, ObjType>(status, nodes, moduleName, context, sharedObj->metadata, - sharedObj->entryPoint); + GenericMap<Pair<Left<string, NodeType*> > >& nodes = getFactoryMap<NodeType>( + sharedObj->module); + NodeType* factory = findNode<NodeType>(status, nodes, sharedObj->entryPoint); + obj = factory->newItem(status, context, sharedObj->metadata); + if (obj) children.put(context, obj); } @@ -567,19 +662,18 @@ } -template <typename T> T* Engine::findNode(ThrowStatusWrapper* status, T* nodes, - const PathName& moduleName, const string& entryPoint) +template <typename T> T* Engine::findNode(ThrowStatusWrapper* status, + const GenericMap<Pair<Left<string, T*> > >& nodes, const string& entryPoint) { - for (T* node = nodes; node; node = node->next) - { - if (node->module == moduleName && entryPoint == node->name) - return node; - } + T* factory; + if (nodes.get(entryPoint, factory)) + return factory; + static const ISC_STATUS statusVector[] = { - isc_arg_gds, - isc_random, + isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) "Entry point not found", + //// TODO: isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) entryPoint.c_str(), isc_arg_end }; @@ -589,15 +683,6 @@ } -template <typename T, typename T2> T2* Engine::getNode(ThrowStatusWrapper* status, T* nodes, - const PathName& moduleName, IExternalContext* context, IRoutineMetadata* metadata, - const string& entryPoint) -{ - T* node = findNode<T>(status, nodes, moduleName, entryPoint); - return node->factory->newItem(status, context, metadata); -} - - void Engine::open(ThrowStatusWrapper* /*status*/, IExternalContext* /*context*/, char* name, unsigned nameSize) { strncpy(name, "UTF-8", nameSize); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-26 07:56:58
|
Revision: 60553 http://sourceforge.net/p/firebird/code/60553 Author: egorpugin Date: 2015-01-26 07:56:51 +0000 (Mon, 26 Jan 2015) Log Message: ----------- [build] [cmake] Fix build, typos. Move some projects to 'Boot' dir. Modified Paths: -------------- firebird/trunk/builds/cmake/Configure.cmake firebird/trunk/examples/CMakeLists.txt firebird/trunk/src/CMakeLists.txt Modified: firebird/trunk/builds/cmake/Configure.cmake =================================================================== --- firebird/trunk/builds/cmake/Configure.cmake 2015-01-25 22:24:41 UTC (rev 60552) +++ firebird/trunk/builds/cmake/Configure.cmake 2015-01-26 07:56:51 UTC (rev 60553) @@ -66,7 +66,7 @@ endif() if (IOS) - set(CMAKE_SYSTEM_PROCESSOR “arm”) # armv7 ? + set(CMAKE_SYSTEM_PROCESSOR "arm") # armv7 ? add_definitions(-D__arm__) endif() Modified: firebird/trunk/examples/CMakeLists.txt =================================================================== --- firebird/trunk/examples/CMakeLists.txt 2015-01-25 22:24:41 UTC (rev 60552) +++ firebird/trunk/examples/CMakeLists.txt 2015-01-26 07:56:51 UTC (rev 60553) @@ -34,7 +34,7 @@ add_executable (empbuild empbuild.c ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) target_link_libraries (empbuild yvalve) set_output_directory (empbuild empbuild FORCE) -add_dependencies (empbuild gfix engine12) +add_dependencies (empbuild gfix engine12 fbtrace) project_group (empbuild Examples) file(GLOB files Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-01-25 22:24:41 UTC (rev 60552) +++ firebird/trunk/src/CMakeLists.txt 2015-01-26 07:56:51 UTC (rev 60553) @@ -247,9 +247,9 @@ # ################################################################################ -############################################################################### +######################################## # LIBRARY boot_alice -############################################################################### +######################################## file(GLOB alice_src "alice/*.cpp" "alice/*.h") @@ -267,16 +267,16 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) -############################################################################### +######################################## # LIBRARY alice -############################################################################### +######################################## add_library (alice ${alice_src} ${alice_generated_src_master}) -############################################################################### +######################################## # LIBRARY boot_burp -############################################################################### +######################################## file(GLOB burp_src "burp/*.cpp" "burp/*.h") @@ -296,16 +296,16 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) -############################################################################### +######################################## # LIBRARY burp -############################################################################### +######################################## add_library (burp ${burp_src} ${burp_generated_src_master}) -############################################################################### +######################################## # LIBRARY common -############################################################################### +######################################## file(GLOB common_src "common/*.cpp" "common/classes/*.cpp" "common/config/*.cpp" "common/os/${OS_DIR}/*.cpp") file(GLOB_RECURSE common_include "common/*.h") @@ -502,7 +502,7 @@ add_library (udr_engine SHARED ${udr_engine_src} ${VERSION_RC}) target_link_libraries (udr_engine common yvalve) set_output_directory (udr_engine plugins) -set_exported_symbols (udr_engine udr_engine) +set_exported_symbols (udr_engine plugin) ######################################## @@ -567,6 +567,7 @@ add_executable (gpre_boot ${gpre_boot_src} ${VERSION_RC}) target_link_libraries (gpre_boot gpre_common common ${LIB_Ws2_32}) +project_group (gpre_boot Boot) endif() # if (NOT CMAKE_CROSSCOMPILING) @@ -611,6 +612,7 @@ add_executable (build_msg ${build_msg_generated_src_master} ${VERSION_RC}) target_link_libraries (build_msg common yvalve) +project_group (build_msg Boot) endif() # if (NOT CMAKE_CROSSCOMPILING) @@ -628,6 +630,7 @@ add_executable (codes ${codes_generated_src_master} ${VERSION_RC}) target_link_libraries (codes yvalve) +project_group (codes Boot) add_custom_command( TARGET codes POST_BUILD @@ -697,17 +700,17 @@ target_link_libraries (fbtracemgr common yvalve) -############################################################################### +######################################## # EXECUTABLE gfix -############################################################################### +######################################## add_executable (gfix alice/main/aliceMain.cpp ${VERSION_RC}) target_link_libraries (gfix alice common yvalve) -############################################################################### +######################################## # EXECUTABLE boot_gbak -############################################################################### +######################################## file(GLOB gbak_include "burp/*.h") @@ -720,25 +723,25 @@ endif() # if (NOT CMAKE_CROSSCOMPILING) -############################################################################### +######################################## # EXECUTABLE gbak -############################################################################### +######################################## add_executable (gbak burp/main/burpMain.cpp ${gbak_include} ${VERSION_RC}) target_link_libraries (gbak burp yvalve common) -############################################################################### +######################################## # EXECUTABLE gsplit -############################################################################### +######################################## add_executable (gsplit burp/split/spit.cpp burp/split/spit.h ${VERSION_RC}) target_link_libraries (gsplit burp common yvalve) -############################################################################### +######################################## # EXECUTABLE boot_isql -############################################################################### +######################################## file(GLOB isql_src "isql/*.cpp" "isql/*.h") @@ -792,17 +795,17 @@ endif() -############################################################################### +######################################## # EXECUTABLE isql -############################################################################### +######################################## add_executable (isql ${isql_src} ${isql_generated_src_master} ${VERSION_RC}) target_link_libraries (isql common yvalve) -############################################################################### +######################################## # EXECUTABLE qli -############################################################################### +######################################## file(GLOB qli_src "qli/*.cpp" "qli/*.h") set(qli_generated_src This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2015-01-26 14:53:05
|
Revision: 60559 http://sourceforge.net/p/firebird/code/60559 Author: asfernandes Date: 2015-01-26 14:52:54 +0000 (Mon, 26 Jan 2015) Log Message: ----------- Split the UDR examples in multiple files to demonstrate how it should be done. Modified Paths: -------------- firebird/trunk/builds/posix/Makefile.in.plugins_examples firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj.filters firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj.filters firebird/trunk/builds/win32/msvc8/udrcpp_example.vcproj firebird/trunk/builds/win32/msvc9/udrcpp_example.vcproj Added Paths: ----------- firebird/trunk/examples/udr/Functions.cpp firebird/trunk/examples/udr/Procedures.cpp firebird/trunk/examples/udr/Triggers.cpp firebird/trunk/examples/udr/UdrCppExample.h Removed Paths: ------------- firebird/trunk/examples/udr/UdrCppExample.cpp Modified: firebird/trunk/builds/posix/Makefile.in.plugins_examples =================================================================== --- firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-26 14:52:54 UTC (rev 60559) @@ -55,7 +55,10 @@ all: udrcpp_example dc_example kh_example -UDR_Objects = $(call makeObjects,../examples/udr,UdrCppExample.cpp) +UDR_Objects = $(call makeObjects,../examples/udr,Functions.cpp) \ + $(call makeObjects,../examples/udr,Procedures.cpp) \ + $(call makeObjects,../examples/udr,Triggers.cpp) + UDR_Plugin = $(PLUGINS)/udr/$(LIB_PREFIX)udrcpp_example.$(SHRLIB_EXT) AllObjects = $(UDR_Objects) Modified: firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj 2015-01-26 14:52:54 UTC (rev 60559) @@ -194,12 +194,15 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\..\examples\udr\UdrCppExample.cpp" /> + <ClCompile Include="..\..\..\examples\udr\Functions.cpp" /> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\..\src\includeFirebirdUdr.h" /> + <ClCompile Include="..\..\..\examples\udr\Procedures.cpp" /> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\examples\udr\Triggers.cpp" /> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\src\jrd\version.rc"> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\src\jrd</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\src\jrd</AdditionalIncludeDirectories> Modified: firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj.filters =================================================================== --- firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj.filters 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj.filters 2015-01-26 14:52:54 UTC (rev 60559) @@ -14,18 +14,23 @@ </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\..\examples\udr\UdrCppExample.cpp"> + <ClCompile Include="..\..\..\examples\udr\Functions.cpp"> <Filter>Source files</Filter> </ClCompile> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\..\src\includeFirebirdUdr.h"> - <Filter>Header files</Filter> - </ClInclude> + <ClCompile Include="..\..\..\examples\udr\Procedures.cpp"> + <Filter>Source files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\examples\udr\Triggers.cpp"> + <Filter>Source files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\src\jrd\version.rc"> <Filter>Resource files</Filter> </ResourceCompile> </ItemGroup> -</Project> \ No newline at end of file +</Project> Modified: firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj 2015-01-26 14:52:54 UTC (rev 60559) @@ -198,12 +198,15 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\..\..\examples\udr\UdrCppExample.cpp" /> + <ClCompile Include="..\..\..\examples\udr\Functions.cpp" /> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\..\src\includeFirebirdUdr.h" /> + <ClCompile Include="..\..\..\examples\udr\Procedures.cpp" /> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\examples\udr\Triggers.cpp" /> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\src\jrd\version.rc"> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\src\jrd</AdditionalIncludeDirectories> <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\src\jrd</AdditionalIncludeDirectories> Modified: firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj.filters =================================================================== --- firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj.filters 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc12/udrcpp_example.vcxproj.filters 2015-01-26 14:52:54 UTC (rev 60559) @@ -14,18 +14,23 @@ </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="..\..\..\examples\udr\UdrCppExample.cpp"> + <ClCompile Include="..\..\..\examples\udr\Functions.cpp"> <Filter>Source files</Filter> </ClCompile> </ItemGroup> <ItemGroup> - <ClInclude Include="..\..\..\src\includeFirebirdUdr.h"> - <Filter>Header files</Filter> - </ClInclude> + <ClCompile Include="..\..\..\examples\udr\Procedures.cpp"> + <Filter>Source files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> + <ClCompile Include="..\..\..\examples\udr\Triggers.cpp"> + <Filter>Source files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\src\jrd\version.rc"> <Filter>Resource files</Filter> </ResourceCompile> </ItemGroup> -</Project> \ No newline at end of file +</Project> Modified: firebird/trunk/builds/win32/msvc8/udrcpp_example.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc8/udrcpp_example.vcproj 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc8/udrcpp_example.vcproj 2015-01-26 14:52:54 UTC (rev 60559) @@ -330,18 +330,17 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > <File - RelativePath="..\..\..\examples\udr\UdrCppExample.cpp" + RelativePath="..\..\..\examples\udr\Functions.cpp" > </File> - </Filter> - <Filter - Name="Header files" - Filter="h;hpp;hxx;hm;inl" - > <File - RelativePath="..\..\..\src\includeFirebirdUdr.h" + RelativePath="..\..\..\examples\udr\Procedures.cpp" > </File> + <File + RelativePath="..\..\..\examples\udr\Triggers.cpp" + > + </File> </Filter> <Filter Name="Resource files" Modified: firebird/trunk/builds/win32/msvc9/udrcpp_example.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc9/udrcpp_example.vcproj 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/builds/win32/msvc9/udrcpp_example.vcproj 2015-01-26 14:52:54 UTC (rev 60559) @@ -327,18 +327,17 @@ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" > <File - RelativePath="..\..\..\examples\udr\UdrCppExample.cpp" + RelativePath="..\..\..\examples\udr\Functions.cpp" > </File> - </Filter> - <Filter - Name="Header files" - Filter="h;hpp;hxx;hm;inl" - > <File - RelativePath="..\..\..\src\includeFirebirdUdr.h" + RelativePath="..\..\..\examples\udr\Procedures.cpp" > </File> + <File + RelativePath="..\..\..\examples\udr\Triggers.cpp" + > + </File> </Filter> <Filter Name="Resource files" Added: firebird/trunk/examples/udr/Functions.cpp =================================================================== --- firebird/trunk/examples/udr/Functions.cpp (rev 0) +++ firebird/trunk/examples/udr/Functions.cpp 2015-01-26 14:52:54 UTC (rev 60559) @@ -0,0 +1,160 @@ +/* + * The contents of this file are subject to the Initial + * Developer's Public License Version 1.0 (the "License"); + * you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. + * + * Software distributed under the License is distributed AS IS, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights + * and limitations under the License. + * + * The Original Code was created by Adriano dos Santos Fernandes + * for the Firebird Open Source RDBMS project. + * + * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@gm...> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "UdrCppExample.h" + +using namespace Firebird; + + +//------------------------------------------------------------------------------ + + +/*** +create function wait_event ( + event_name varchar(31) character set utf8 not null +) returns integer not null + external name 'udrcpp_example!wait_event' + engine udr; +***/ +FB_UDR_BEGIN_FUNCTION(wait_event) + FB_UDR_MESSAGE(InMessage, + (FB_VARCHAR(31 * 4), name) + ); + + FB_UDR_MESSAGE(OutMessage, + (FB_INTEGER, result) + ); + + FB_UDR_EXECUTE_FUNCTION + { + char* s = new char[in->name.length + 1]; + memcpy(s, in->name.str, in->name.length); + s[in->name.length] = '\0'; + + unsigned char* eveBuffer; + unsigned char* eveResult; + int eveLen = isc_event_block(&eveBuffer, &eveResult, 1, s); + + delete [] s; + + ISC_STATUS_ARRAY statusVector = {0}; + isc_db_handle dbHandle = getIscDbHandle(status, context); + ISC_ULONG counter = 0; + + FbException::check(isc_wait_for_event( + statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); + isc_event_counts(&counter, eveLen, eveBuffer, eveResult); + FbException::check(isc_wait_for_event( + statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); + isc_event_counts(&counter, eveLen, eveBuffer, eveResult); + + isc_free((char*) eveBuffer); + isc_free((char*) eveResult); + + out->resultNull = FB_FALSE; + out->result = counter; + } +FB_UDR_END_FUNCTION + + +/*** +create function sum_args ( + n1 integer, + n2 integer, + n3 integer +) returns integer + external name 'udrcpp_example!sum_args' + engine udr; +***/ +FB_UDR_BEGIN_FUNCTION(sum_args) + // Without InMessage/OutMessage definitions, messages will be byte-based. + + FB_UDR_CONSTRUCTOR + // , inCount(0) + { + // Get input metadata. + AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); + + // Get count of input parameters. + inCount = inMetadata->getCount(status); + + inNullOffsets.reset(new unsigned[inCount]); + inOffsets.reset(new unsigned[inCount]); + + for (unsigned i = 0; i < inCount; ++i) + { + // Get null offset of the i-th input parameter. + inNullOffsets[i] = inMetadata->getNullOffset(status, i); + + // Get the offset of the i-th input parameter. + inOffsets[i] = inMetadata->getOffset(status, i); + } + + // Get output metadata. + AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); + + // Get null offset of the return value. + outNullOffset = outMetadata->getNullOffset(status, 0); + + // Get offset of the return value. + outOffset = outMetadata->getOffset(status, 0); + } + + // This function requires the INTEGER parameters and return value, otherwise it will crash. + // Metadata is inspected dynamically (in execute). This is not the fastest method. + FB_UDR_EXECUTE_FUNCTION + { + *(ISC_SHORT*) (out + outNullOffset) = FB_FALSE; + + // Get a reference to the return value. + ISC_LONG& ret = *(ISC_LONG*) (out + outOffset); + + // The return value is automatically initialized to 0. + ///ret = 0; + + for (unsigned i = 0; i < inCount; ++i) + { + // If the i-th input parameter is NULL, set the output to NULL and finish. + if (*(ISC_SHORT*) (in + inNullOffsets[i])) + { + *(ISC_SHORT*) (out + outNullOffset) = FB_TRUE; + return; + } + + // Read the i-th input parameter value and sum it in the referenced return value. + ret += *(ISC_LONG*) (in + inOffsets[i]); + } + } + + unsigned inCount; + AutoArrayDelete<unsigned> inNullOffsets; + AutoArrayDelete<unsigned> inOffsets; + unsigned outNullOffset; + unsigned outOffset; +FB_UDR_END_FUNCTION + + +//------------------------------------------------------------------------------ + + +// This should be used in only one of the UDR library files. +FB_UDR_IMPLEMENT_ENTRY_POINT Property changes on: firebird/trunk/examples/udr/Functions.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: firebird/trunk/examples/udr/Procedures.cpp =================================================================== --- firebird/trunk/examples/udr/Procedures.cpp (rev 0) +++ firebird/trunk/examples/udr/Procedures.cpp 2015-01-26 14:52:54 UTC (rev 60559) @@ -0,0 +1,212 @@ +/* + * The contents of this file are subject to the Initial + * Developer's Public License Version 1.0 (the "License"); + * you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. + * + * Software distributed under the License is distributed AS IS, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights + * and limitations under the License. + * + * The Original Code was created by Adriano dos Santos Fernandes + * for the Firebird Open Source RDBMS project. + * + * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@gm...> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "UdrCppExample.h" + +using namespace Firebird; + + +//------------------------------------------------------------------------------ + + +/*** +create procedure gen_rows ( + start_n integer not null, + end_n integer not null +) returns ( + n integer not null +) + external name 'udrcpp_example!gen_rows' + engine udr; +***/ +FB_UDR_BEGIN_PROCEDURE(gen_rows) + // Without InMessage/OutMessage definitions, messages will be byte-based. + + // Procedure variables. + unsigned inOffsetStart, inOffsetEnd, outNullOffset, outOffset; + + // Get offsets once per procedure. + FB_UDR_CONSTRUCTOR + { + AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); + + inOffsetStart = inMetadata->getOffset(status, 0); + inOffsetEnd = inMetadata->getOffset(status, 1); + + AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); + + outNullOffset = outMetadata->getNullOffset(status, 0); + outOffset = outMetadata->getOffset(status, 0); + } + + /*** Procedure destructor. + FB_UDR_DESTRUCTOR + { + } + ***/ + + FB_UDR_EXECUTE_PROCEDURE + { + counter = *(ISC_LONG*) (in + procedure->inOffsetStart); + end = *(ISC_LONG*) (in + procedure->inOffsetEnd); + + *(ISC_SHORT*) (out + procedure->outNullOffset) = FB_FALSE; + } + + // After procedure's execute definition, starts the result set definition. + + FB_UDR_FETCH_PROCEDURE + { + if (counter > end) + return false; + + *(ISC_LONG*) (out + procedure->outOffset) = counter++; + return true; + } + + /*** ResultSet destructor. + ~ResultSet() + { + } + ***/ + + // ResultSet variables. + ISC_LONG counter; + ISC_LONG end; +FB_UDR_END_PROCEDURE + + +/*** +create procedure gen_rows2 ( + start_n integer not null, + end_n integer not null +) returns ( + n integer not null +) + external name 'udrcpp_example!gen_rows2' + engine udr; +***/ +FB_UDR_BEGIN_PROCEDURE(gen_rows2) + FB_UDR_MESSAGE(InMessage, + (FB_INTEGER, start) + (FB_INTEGER, end) + ); + + FB_UDR_MESSAGE(OutMessage, + (FB_INTEGER, result) + ); + + FB_UDR_EXECUTE_PROCEDURE + { + out->resultNull = FB_FALSE; + out->result = in->start - 1; + } + + FB_UDR_FETCH_PROCEDURE + { + return out->result++ < in->end; + } +FB_UDR_END_PROCEDURE + + +/*** +create procedure inc ( + count_n integer not null +) returns ( + n0 integer not null, + n1 integer not null, + n2 integer not null, + n3 integer not null, + n4 integer not null +) + external name 'udrcpp_example!inc' + engine udr; +***/ +// This is a sample procedure demonstrating how the scopes of variables works. +// n1 and n2 are on the Procedure scope, i.e., they're shared for each execution of the same cached +// metadata object. +// n3 and n4 are on the ResultSet scope, i.e., each procedure execution have they own instances. +FB_UDR_BEGIN_PROCEDURE(inc) + FB_UDR_MESSAGE(InMessage, + (FB_INTEGER, count) + ); + + FB_UDR_MESSAGE(OutMessage, + (FB_INTEGER, n0) + (FB_INTEGER, n1) + (FB_INTEGER, n2) + (FB_INTEGER, n3) + (FB_INTEGER, n4) + ); + + ISC_LONG n1; + + // This is how a procedure (class) initializer is written. + // ResultSet variables are not accessible here. + // If there is nothing to initialize, it can be completelly suppressed. + FB_UDR_CONSTRUCTOR + , n1(0), + n2(0) + { + } + + ISC_LONG n2; + + // FB_UDR_EXECUTE_PROCEDURE starts the ResultSet scope. + FB_UDR_EXECUTE_PROCEDURE + // This is the ResultSet (class) initializer. + , n3(procedure->n1), // n3 will start with the next value for n1 of the last execution + n4(0) + { + out->n0Null = out->n1Null = out->n2Null = out->n3Null = out->n4Null = FB_FALSE; + + out->n0 = 0; + + // In the execute method, the procedure scope must be accessed using the 'procedure' pointer. + procedure->n1 = 0; + + // We don't touch n2 here, so it incremented counter will be kept after each execution. + + // The ResultSet scope must be accessed directly, i.e., they're member variables of the + // 'this' pointer. + ++n4; + } + + ISC_LONG n3; + + // FB_UDR_FETCH_PROCEDURE must be always after FB_UDR_EXECUTE_PROCEDURE. + FB_UDR_FETCH_PROCEDURE + { + if (out->n0++ <= in->count) + { + out->n1 = ++procedure->n1; + out->n2 = ++procedure->n2; + out->n3 = ++n3; + out->n4 = ++n4; + return true; + } + + return false; + } + + ISC_LONG n4; +FB_UDR_END_PROCEDURE Property changes on: firebird/trunk/examples/udr/Procedures.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Copied: firebird/trunk/examples/udr/Triggers.cpp (from rev 60555, firebird/trunk/examples/udr/UdrCppExample.cpp) =================================================================== --- firebird/trunk/examples/udr/Triggers.cpp (rev 0) +++ firebird/trunk/examples/udr/Triggers.cpp 2015-01-26 14:52:54 UTC (rev 60559) @@ -0,0 +1,316 @@ +/* + * The contents of this file are subject to the Initial + * Developer's Public License Version 1.0 (the "License"); + * you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. + * + * Software distributed under the License is distributed AS IS, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights + * and limitations under the License. + * + * The Original Code was created by Adriano dos Santos Fernandes + * for the Firebird Open Source RDBMS project. + * + * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@gm...> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "UdrCppExample.h" + +using namespace Firebird; + + +//------------------------------------------------------------------------------ + + +/*** +Sample usage: + +create database 'c:\temp\slave.fdb'; +create table persons ( + id integer not null, + name varchar(60) not null, + address varchar(60), + info blob sub_type text +); +commit; + +create database 'c:\temp\master.fdb'; +create table persons ( + id integer not null, + name varchar(60) not null, + address varchar(60), + info blob sub_type text +); + +create table replicate_config ( + name varchar(31) not null, + data_source varchar(255) not null +); + +insert into replicate_config (name, data_source) + values ('ds1', 'c:\temp\slave.fdb'); + +create trigger persons_replicate + after insert on persons + external name 'udrcpp_example!replicate!ds1' + engine udr; + +create trigger persons_replicate2 + after insert on persons + external name 'udrcpp_example!replicate_persons!ds1' + engine udr; +***/ +FB_UDR_BEGIN_TRIGGER(replicate) + // Without FieldsMessage definition, messages will be byte-based. + + FB_UDR_CONSTRUCTOR + , triggerMetadata(metadata->getTriggerMetadata(status)) + { + ISC_STATUS_ARRAY statusVector = {0}; + isc_db_handle dbHandle = getIscDbHandle(status, context); + isc_tr_handle trHandle = getIscTrHandle(status, context); + + isc_stmt_handle stmtHandle = 0; + FbException::check(isc_dsql_allocate_statement( + statusVector, &dbHandle, &stmtHandle), status, statusVector); + FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, + "select data_source from replicate_config where name = ?", + SQL_DIALECT_CURRENT, NULL), status, statusVector); + + const char* table = metadata->getTriggerTable(status); + + // Skip the first exclamation point, separating the module name and entry point. + const char* info = strchr(metadata->getEntryPoint(status), '!'); + + // Skip the second exclamation point, separating the entry point and the misc info (config). + if (info) + info = strchr(info + 1, '!'); + + if (info) + ++info; + else + info = ""; + + XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); + inSqlDa->version = SQLDA_VERSION1; + inSqlDa->sqln = 1; + FbException::check(isc_dsql_describe_bind(statusVector, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); + inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; + strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); + *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); + + XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); + outSqlDa->version = SQLDA_VERSION1; + outSqlDa->sqln = 1; + FbException::check(isc_dsql_describe(statusVector, &stmtHandle, + SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); + outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; + outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; + + FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); + FbException::check(isc_dsql_free_statement( + statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); + + delete [] inSqlDa->sqlvar[0].sqldata; + delete [] reinterpret_cast<char*>(inSqlDa); + + unsigned count = triggerMetadata->getCount(status); + + char buffer[65536]; + strcpy(buffer, "execute block (\n"); + + for (unsigned i = 0; i < count; ++i) + { + if (i > 0) + strcat(buffer, ",\n"); + + const char* name = triggerMetadata->getField(status, i); + + strcat(buffer, " p"); + sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, table, name); + } + + strcat(buffer, + ")\n" + "as\n" + "begin\n" + " execute statement ('insert into \""); + + strcat(buffer, table); + strcat(buffer, "\" ("); + + for (unsigned i = 0; i < count; ++i) + { + if (i > 0) + strcat(buffer, ", "); + + const char* name = triggerMetadata->getField(status, i); + + strcat(buffer, "\""); + strcat(buffer, name); + strcat(buffer, "\""); + } + + strcat(buffer, ") values ("); + + for (unsigned i = 0; i < count; ++i) + { + if (i > 0) + strcat(buffer, ", "); + strcat(buffer, "?"); + } + + strcat(buffer, ")') ("); + + for (unsigned i = 0; i < count; ++i) + { + if (i > 0) + strcat(buffer, ", "); + strcat(buffer, ":p"); + sprintf(buffer + strlen(buffer), "%d", i); + } + + strcat(buffer, ")\n on external data source '"); + strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); + strcat(buffer, "';\nend"); + + IAttachment* attachment = context->getAttachment(status); + ITransaction* transaction = context->getTransaction(status); + + stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); + + delete [] outSqlDa->sqlvar[0].sqldata; + delete [] reinterpret_cast<char*>(outSqlDa); + } + + /*** + FB_UDR_DESTRUCTOR + { + } + ***/ + + FB_UDR_EXECUTE_TRIGGER + { + ITransaction* transaction = context->getTransaction(status); + + // This will not work if the table has computed fields. + stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); + } + + AutoRelease<IMessageMetadata> triggerMetadata; + AutoRelease<IStatement> stmt; +FB_UDR_END_TRIGGER + + +FB_UDR_BEGIN_TRIGGER(replicate_persons) + // Order of fields does not need to match the fields order in the table, but it should match + // the order of fields in the SQL command constructed in the initialization. + FB_UDR_TRIGGER_MESSAGE(FieldsMessage, + (FB_INTEGER, id, "ID") + (FB_BLOB, info, "INFO") + ///(FB_VARCHAR(60 * 4), address, "ADDRESS") + (FB_VARCHAR(60 * 4), name, "NAME") + ); + + FB_UDR_CONSTRUCTOR + , triggerMetadata(metadata->getTriggerMetadata(status)) + { + ISC_STATUS_ARRAY statusVector = {0}; + isc_db_handle dbHandle = getIscDbHandle(status, context); + isc_tr_handle trHandle = getIscTrHandle(status, context); + + isc_stmt_handle stmtHandle = 0; + FbException::check(isc_dsql_allocate_statement( + statusVector, &dbHandle, &stmtHandle), status, statusVector); + FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, + "select data_source from replicate_config where name = ?", + SQL_DIALECT_CURRENT, NULL), status, statusVector); + + const char* table = metadata->getTriggerTable(status); + + // Skip the first exclamation point, separating the module name and entry point. + const char* info = strchr(metadata->getEntryPoint(status), '!'); + + // Skip the second exclamation point, separating the entry point and the misc info (config). + if (info) + info = strchr(info + 1, '!'); + + if (info) + ++info; + else + info = ""; + + XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); + inSqlDa->version = SQLDA_VERSION1; + inSqlDa->sqln = 1; + FbException::check(isc_dsql_describe_bind( + statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); + inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; + strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); + *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); + + XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); + outSqlDa->version = SQLDA_VERSION1; + outSqlDa->sqln = 1; + FbException::check(isc_dsql_describe( + statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); + outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; + outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; + + FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, + SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); + FbException::check(isc_dsql_free_statement( + statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); + + delete [] inSqlDa->sqlvar[0].sqldata; + delete [] reinterpret_cast<char*>(inSqlDa); + + char buffer[65536]; + strcpy(buffer, + "execute block (\n" + " id type of column PERSONS.ID = ?,\n" + " info type of column PERSONS.INFO = ?,\n" + ///" address type of column PERSONS.ADDRESS = ?,\n" + " name type of column PERSONS.NAME = ?\n" + ")" + "as\n" + "begin\n" + " execute statement ('insert into persons (id, name/***, address***/, info)\n" + " values (?, ?/***, ?***/, ?)') (:id, :name/***, :address***/, :info)\n" + " on external data source '"); + strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); + strcat(buffer, "';\nend"); + + IAttachment* attachment = context->getAttachment(status); + ITransaction* transaction = context->getTransaction(status); + + stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); + + delete [] outSqlDa->sqlvar[0].sqldata; + delete [] reinterpret_cast<char*>(outSqlDa); + } + + /*** + FB_UDR_DESTRUCTOR + { + } + ***/ + + FB_UDR_EXECUTE_TRIGGER + { + ITransaction* transaction = context->getTransaction(status); + + stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); + } + + AutoRelease<IMessageMetadata> triggerMetadata; + AutoRelease<IStatement> stmt; +FB_UDR_END_TRIGGER Property changes on: firebird/trunk/examples/udr/Triggers.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Deleted: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-26 14:39:48 UTC (rev 60558) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-26 14:52:54 UTC (rev 60559) @@ -1,788 +0,0 @@ -/* - * The contents of this file are subject to the Initial - * Developer's Public License Version 1.0 (the "License"); - * you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. - * - * Software distributed under the License is distributed AS IS, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. - * See the License for the specific language governing rights - * and limitations under the License. - * - * The Original Code was created by Adriano dos Santos Fernandes - * for the Firebird Open Source RDBMS project. - * - * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@uo...> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - */ - -#define FB_UDR_STATUS_TYPE ::Firebird::ThrowStatusWrapper - -#include "ibase.h" -#include "firebird/UdrCppEngine.h" -#include <assert.h> -#include <stdio.h> - - -using namespace Firebird; -using namespace Firebird::Udr; - - -namespace -{ - template <typename T> - class AutoReleaseClear - { - public: - static void clear(T* ptr) - { - if (ptr) - ptr->release(); - } - }; - - template <typename T> - class AutoDisposeClear - { - public: - static void clear(T* ptr) - { - if (ptr) - ptr->dispose(); - } - }; - - template <typename T> - class AutoDeleteClear - { - public: - static void clear(T* ptr) - { - delete ptr; - } - }; - - template <typename T> - class AutoArrayDeleteClear - { - public: - static void clear(T* ptr) - { - delete [] ptr; - } - }; - - template <typename T, typename Clear> - class AutoImpl - { - public: - AutoImpl<T, Clear>(T* aPtr = NULL) - : ptr(aPtr) - { - } - - ~AutoImpl() - { - Clear::clear(ptr); - } - - AutoImpl<T, Clear>& operator =(T* aPtr) - { - Clear::clear(ptr); - ptr = aPtr; - return *this; - } - - operator T*() - { - return ptr; - } - - operator const T*() const - { - return ptr; - } - - bool operator !() const - { - return !ptr; - } - - bool hasData() const - { - return ptr != NULL; - } - - T* operator ->() - { - return ptr; - } - - T* release() - { - T* tmp = ptr; - ptr = NULL; - return tmp; - } - - void reset(T* aPtr = NULL) - { - if (aPtr != ptr) - { - Clear::clear(ptr); - ptr = aPtr; - } - } - - private: - // not implemented - AutoImpl<T, Clear>(AutoImpl<T, Clear>&); - void operator =(AutoImpl<T, Clear>&); - - private: - T* ptr; - }; - - template <typename T> class AutoDispose : public AutoImpl<T, AutoDisposeClear<T> > - { - public: - AutoDispose(T* ptr = NULL) - : AutoImpl<T, AutoDisposeClear<T> >(ptr) - { - } - }; - - template <typename T> class AutoRelease : public AutoImpl<T, AutoReleaseClear<T> > - { - public: - AutoRelease(T* ptr = NULL) - : AutoImpl<T, AutoReleaseClear<T> >(ptr) - { - } - }; - - template <typename T> class AutoDelete : public AutoImpl<T, AutoDeleteClear<T> > - { - public: - AutoDelete(T* ptr = NULL) - : AutoImpl<T, AutoDeleteClear<T> >(ptr) - { - } - }; - - template <typename T> class AutoArrayDelete : public AutoImpl<T, AutoArrayDeleteClear<T> > - { - public: - AutoArrayDelete(T* ptr = NULL) - : AutoImpl<T, AutoArrayDeleteClear<T> >(ptr) - { - } - }; -} - - -//------------------------------------------------------------------------------ - - -/*** -create function wait_event ( - event_name varchar(31) character set utf8 not null -) returns integer not null - external name 'udrcpp_example!wait_event' - engine udr; -***/ -FB_UDR_BEGIN_FUNCTION(wait_event) - FB_UDR_MESSAGE(InMessage, - (FB_VARCHAR(31 * 4), name) - ); - - FB_UDR_MESSAGE(OutMessage, - (FB_INTEGER, result) - ); - - FB_UDR_EXECUTE_FUNCTION - { - char* s = new char[in->name.length + 1]; - memcpy(s, in->name.str, in->name.length); - s[in->name.length] = '\0'; - - unsigned char* eveBuffer; - unsigned char* eveResult; - int eveLen = isc_event_block(&eveBuffer, &eveResult, 1, s); - - delete [] s; - - ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(status, context); - ISC_ULONG counter = 0; - - FbException::check(isc_wait_for_event( - statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); - isc_event_counts(&counter, eveLen, eveBuffer, eveResult); - FbException::check(isc_wait_for_event( - statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector); - isc_event_counts(&counter, eveLen, eveBuffer, eveResult); - - isc_free((char*) eveBuffer); - isc_free((char*) eveResult); - - out->resultNull = FB_FALSE; - out->result = counter; - } -FB_UDR_END_FUNCTION - - -/*** -create function sum_args ( - n1 integer, - n2 integer, - n3 integer -) returns integer - external name 'udrcpp_example!sum_args' - engine udr; -***/ -FB_UDR_BEGIN_FUNCTION(sum_args) - // Without InMessage/OutMessage definitions, messages will be byte-based. - - FB_UDR_CONSTRUCTOR - // , inCount(0) - { - // Get input metadata. - AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); - - // Get count of input parameters. - inCount = inMetadata->getCount(status); - - inNullOffsets.reset(new unsigned[inCount]); - inOffsets.reset(new unsigned[inCount]); - - for (unsigned i = 0; i < inCount; ++i) - { - // Get null offset of the i-th input parameter. - inNullOffsets[i] = inMetadata->getNullOffset(status, i); - - // Get the offset of the i-th input parameter. - inOffsets[i] = inMetadata->getOffset(status, i); - } - - // Get output metadata. - AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); - - // Get null offset of the return value. - outNullOffset = outMetadata->getNullOffset(status, 0); - - // Get offset of the return value. - outOffset = outMetadata->getOffset(status, 0); - } - - // This function requires the INTEGER parameters and return value, otherwise it will crash. - // Metadata is inspected dynamically (in execute). This is not the fastest method. - FB_UDR_EXECUTE_FUNCTION - { - *(ISC_SHORT*) (out + outNullOffset) = FB_FALSE; - - // Get a reference to the return value. - ISC_LONG& ret = *(ISC_LONG*) (out + outOffset); - - // The return value is automatically initialized to 0. - ///ret = 0; - - for (unsigned i = 0; i < inCount; ++i) - { - // If the i-th input parameter is NULL, set the output to NULL and finish. - if (*(ISC_SHORT*) (in + inNullOffsets[i])) - { - *(ISC_SHORT*) (out + outNullOffset) = FB_TRUE; - return; - } - - // Read the i-th input parameter value and sum it in the referenced return value. - ret += *(ISC_LONG*) (in + inOffsets[i]); - } - } - - unsigned inCount; - AutoArrayDelete<unsigned> inNullOffsets; - AutoArrayDelete<unsigned> inOffsets; - unsigned outNullOffset; - unsigned outOffset; -FB_UDR_END_FUNCTION - - -/*** -create procedure gen_rows ( - start_n integer not null, - end_n integer not null -) returns ( - n integer not null -) - external name 'udrcpp_example!gen_rows' - engine udr; -***/ -FB_UDR_BEGIN_PROCEDURE(gen_rows) - // Without InMessage/OutMessage definitions, messages will be byte-based. - - // Procedure variables. - unsigned inOffsetStart, inOffsetEnd, outNullOffset, outOffset; - - // Get offsets once per procedure. - FB_UDR_CONSTRUCTOR - { - AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status)); - - inOffsetStart = inMetadata->getOffset(status, 0); - inOffsetEnd = inMetadata->getOffset(status, 1); - - AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status)); - - outNullOffset = outMetadata->getNullOffset(status, 0); - outOffset = outMetadata->getOffset(status, 0); - } - - /*** Procedure destructor. - FB_UDR_DESTRUCTOR - { - } - ***/ - - FB_UDR_EXECUTE_PROCEDURE - { - counter = *(ISC_LONG*) (in + procedure->inOffsetStart); - end = *(ISC_LONG*) (in + procedure->inOffsetEnd); - - *(ISC_SHORT*) (out + procedure->outNullOffset) = FB_FALSE; - } - - // After procedure's execute definition, starts the result set definition. - - FB_UDR_FETCH_PROCEDURE - { - if (counter > end) - return false; - - *(ISC_LONG*) (out + procedure->outOffset) = counter++; - return true; - } - - /*** ResultSet destructor. - ~ResultSet() - { - } - ***/ - - // ResultSet variables. - ISC_LONG counter; - ISC_LONG end; -FB_UDR_END_PROCEDURE - - -/*** -create procedure gen_rows2 ( - start_n integer not null, - end_n integer not null -) returns ( - n integer not null -) - external name 'udrcpp_example!gen_rows2' - engine udr; -***/ -FB_UDR_BEGIN_PROCEDURE(gen_rows2) - FB_UDR_MESSAGE(InMessage, - (FB_INTEGER, start) - (FB_INTEGER, end) - ); - - FB_UDR_MESSAGE(OutMessage, - (FB_INTEGER, result) - ); - - FB_UDR_EXECUTE_PROCEDURE - { - out->resultNull = FB_FALSE; - out->result = in->start - 1; - } - - FB_UDR_FETCH_PROCEDURE - { - return out->result++ < in->end; - } -FB_UDR_END_PROCEDURE - - -/*** -create procedure inc ( - count_n integer not null -) returns ( - n0 integer not null, - n1 integer not null, - n2 integer not null, - n3 integer not null, - n4 integer not null -) - external name 'udrcpp_example!inc' - engine udr; -***/ -// This is a sample procedure demonstrating how the scopes of variables works. -// n1 and n2 are on the Procedure scope, i.e., they're shared for each execution of the same cached -// metadata object. -// n3 and n4 are on the ResultSet scope, i.e., each procedure execution have they own instances. -FB_UDR_BEGIN_PROCEDURE(inc) - FB_UDR_MESSAGE(InMessage, - (FB_INTEGER, count) - ); - - FB_UDR_MESSAGE(OutMessage, - (FB_INTEGER, n0) - (FB_INTEGER, n1) - (FB_INTEGER, n2) - (FB_INTEGER, n3) - (FB_INTEGER, n4) - ); - - ISC_LONG n1; - - // This is how a procedure (class) initializer is written. - // ResultSet variables are not accessible here. - // If there is nothing to initialize, it can be completelly suppressed. - FB_UDR_CONSTRUCTOR - , n1(0), - n2(0) - { - } - - ISC_LONG n2; - - // FB_UDR_EXECUTE_PROCEDURE starts the ResultSet scope. - FB_UDR_EXECUTE_PROCEDURE - // This is the ResultSet (class) initializer. - , n3(procedure->n1), // n3 will start with the next value for n1 of the last execution - n4(0) - { - out->n0Null = out->n1Null = out->n2Null = out->n3Null = out->n4Null = FB_FALSE; - - out->n0 = 0; - - // In the execute method, the procedure scope must be accessed using the 'procedure' pointer. - procedure->n1 = 0; - - // We don't touch n2 here, so it incremented counter will be kept after each execution. - - // The ResultSet scope must be accessed directly, i.e., they're member variables of the - // 'this' pointer. - ++n4; - } - - ISC_LONG n3; - - // FB_UDR_FETCH_PROCEDURE must be always after FB_UDR_EXECUTE_PROCEDURE. - FB_UDR_FETCH_PROCEDURE - { - if (out->n0++ <= in->count) - { - out->n1 = ++procedure->n1; - out->n2 = ++procedure->n2; - out->n3 = ++n3; - out->n4 = ++n4; - return true; - } - - return false; - } - - ISC_LONG n4; -FB_UDR_END_PROCEDURE - - -/*** -Sample usage: - -create database 'c:\temp\slave.fdb'; -create table persons ( - id integer not null, - name varchar(60) not null, - address varchar(60), - info blob sub_type text -); -commit; - -create database 'c:\temp\master.fdb'; -create table persons ( - id integer not null, - name varchar(60) not null, - address varchar(60), - info blob sub_type text -); - -create table replicate_config ( - name varchar(31) not null, - data_source varchar(255) not null -); - -insert into replicate_config (name, data_source) - values ('ds1', 'c:\temp\slave.fdb'); - -create trigger persons_replicate - after insert on persons - external name 'udrcpp_example!replicate!ds1' - engine udr; - -create trigger persons_replicate2 - after insert on persons - external name 'udrcpp_example!replicate_persons!ds1' - engine udr; -***/ -FB_UDR_BEGIN_TRIGGER(replicate) - // Without FieldsMessage definition, messages will be byte-based. - - FB_UDR_CONSTRUCTOR - , triggerMetadata(metadata->getTriggerMetadata(status)) - { - ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(status, context); - isc_tr_handle trHandle = getIscTrHandle(status, context); - - isc_stmt_handle stmtHandle = 0; - FbException::check(isc_dsql_allocate_statement( - statusVector, &dbHandle, &stmtHandle), status, statusVector); - FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, - "select data_source from replicate_config where name = ?", - SQL_DIALECT_CURRENT, NULL), status, statusVector); - - const char* table = metadata->getTriggerTable(status); - - // Skip the first exclamation point, separating the module name and entry point. - const char* info = strchr(metadata->getEntryPoint(status), '!'); - - // Skip the second exclamation point, separating the entry point and the misc info (config). - if (info) - info = strchr(info + 1, '!'); - - if (info) - ++info; - else - info = ""; - - XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); - inSqlDa->version = SQLDA_VERSION1; - inSqlDa->sqln = 1; - FbException::check(isc_dsql_describe_bind(statusVector, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); - inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; - strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); - *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); - - XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); - outSqlDa->version = SQLDA_VERSION1; - outSqlDa->sqln = 1; - FbException::check(isc_dsql_describe(statusVector, &stmtHandle, - SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); - outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; - outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; - - FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); - FbException::check(isc_dsql_free_statement( - statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); - - delete [] inSqlDa->sqlvar[0].sqldata; - delete [] reinterpret_cast<char*>(inSqlDa); - - unsigned count = triggerMetadata->getCount(status); - - char buffer[65536]; - strcpy(buffer, "execute block (\n"); - - for (unsigned i = 0; i < count; ++i) - { - if (i > 0) - strcat(buffer, ",\n"); - - const char* name = triggerMetadata->getField(status, i); - - strcat(buffer, " p"); - sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, table, name); - } - - strcat(buffer, - ")\n" - "as\n" - "begin\n" - " execute statement ('insert into \""); - - strcat(buffer, table); - strcat(buffer, "\" ("); - - for (unsigned i = 0; i < count; ++i) - { - if (i > 0) - strcat(buffer, ", "); - - const char* name = triggerMetadata->getField(status, i); - - strcat(buffer, "\""); - strcat(buffer, name); - strcat(buffer, "\""); - } - - strcat(buffer, ") values ("); - - for (unsigned i = 0; i < count; ++i) - { - if (i > 0) - strcat(buffer, ", "); - strcat(buffer, "?"); - } - - strcat(buffer, ")') ("); - - for (unsigned i = 0; i < count; ++i) - { - if (i > 0) - strcat(buffer, ", "); - strcat(buffer, ":p"); - sprintf(buffer + strlen(buffer), "%d", i); - } - - strcat(buffer, ")\n on external data source '"); - strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); - strcat(buffer, "';\nend"); - - IAttachment* attachment = context->getAttachment(status); - ITransaction* transaction = context->getTransaction(status); - - stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); - - delete [] outSqlDa->sqlvar[0].sqldata; - delete [] reinterpret_cast<char*>(outSqlDa); - } - - /*** - FB_UDR_DESTRUCTOR - { - } - ***/ - - FB_UDR_EXECUTE_TRIGGER - { - ITransaction* transaction = context->getTransaction(status); - - // This will not work if the table has computed fields. - stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); - } - - AutoRelease<IMessageMetadata> triggerMetadata; - AutoRelease<IStatement> stmt; -FB_UDR_END_TRIGGER - - -FB_UDR_BEGIN_TRIGGER(replicate_persons) - // Order of fields does not need to match the fields order in the table, but it should match - // the order of fields in the SQL command constructed in the initialization. - FB_UDR_TRIGGER_MESSAGE(FieldsMessage, - (FB_INTEGER, id, "ID") - (FB_BLOB, info, "INFO") - ///(FB_VARCHAR(60 * 4), address, "ADDRESS") - (FB_VARCHAR(60 * 4), name, "NAME") - ); - - FB_UDR_CONSTRUCTOR - , triggerMetadata(metadata->getTriggerMetadata(status)) - { - ISC_STATUS_ARRAY statusVector = {0}; - isc_db_handle dbHandle = getIscDbHandle(status, context); - isc_tr_handle trHandle = getIscTrHandle(status, context); - - isc_stmt_handle stmtHandle = 0; - FbException::check(isc_dsql_allocate_statement( - statusVector, &dbHandle, &stmtHandle), status, statusVector); - FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0, - "select data_source from replicate_config where name = ?", - SQL_DIALECT_CURRENT, NULL), status, statusVector); - - const char* table = metadata->getTriggerTable(status); - - // Skip the first exclamation point, separating the module name and entry point. - const char* info = strchr(metadata->getEntryPoint(status), '!'); - - // Skip the second exclamation point, separating the entry point and the misc info (config). - if (info) - info = strchr(info + 1, '!'); - - if (info) - ++info; - else - info = ""; - - XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); - inSqlDa->version = SQLDA_VERSION1; - inSqlDa->sqln = 1; - FbException::check(isc_dsql_describe_bind( - statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), status, statusVector); - inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; - strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); - *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); - - XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); - outSqlDa->version = SQLDA_VERSION1; - outSqlDa->sqln = 1; - FbException::check(isc_dsql_describe( - statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), status, statusVector); - outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1]; - outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0'; - - FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle, - SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector); - FbException::check(isc_dsql_free_statement( - statusVector, &stmtHandle, DSQL_unprepare), status, statusVector); - - delete [] inSqlDa->sqlvar[0].sqldata; - delete [] reinterpret_cast<char*>(inSqlDa); - - char buffer[65536]; - strcpy(buffer, - "execute block (\n" - " id type of column PERSONS.ID = ?,\n" - " info type of column PERSONS.INFO = ?,\n" - ///" address type of column PERSONS.ADDRESS = ?,\n" - " name type of column PERSONS.NAME = ?\n" - ")" - "as\n" - "begin\n" - " execute statement ('insert into persons (id, name/***, address***/, info)\n" - " values (?, ?/***, ?***/, ?)') (:id, :name/***, :address***/, :info)\n" - " on external data source '"); - strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short)); - strcat(buffer, "';\nend"); - - IAttachment* attachment = context->getAttachment(status); - ITransaction* transaction = context->getTransaction(status); - - stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)); - - delete [] outSqlDa->sqlvar[0].sqldata; - delete [] reinterpret_cast<char*>(outSqlDa); - } - - /*** - FB_UDR_DESTRUCTOR - { - } - ***/ - - FB_UDR_EXECUTE_TRIGGER - { - ITransaction* transaction = context->getTransaction(status); - - stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL); - } - - AutoRelease<IMessageMetadata> triggerMetadata; - AutoRelease<IStatement> stmt; -FB_UDR_END_TRIGGER - - -FB_UDR_IMPLEMENT_ENTRY_POINT Added: firebird/trunk/examples/udr/UdrCppExample.h =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.h (rev 0) +++ firebird/trunk/examples/udr/UdrCppExample.h 2015-01-26 14:52:54 UTC (rev 60559) @@ -0,0 +1,186 @@ +/* + * The contents of this file are subject to the Initial + * Developer's Public License Version 1.0 (the "License"); + * you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. + * + * Software distributed under the License is distributed AS IS, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights + * and limitations under the License. + * + * The Original Code was created by Adriano dos Santos Fernandes + * for the Firebird Open Source RDBMS project. + * + * Copyright (c) 2015 Adriano dos Santos Fernandes <adr...@gm...> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#ifndef UDR_CPP_EXAMPLE_H +#define UDR_CPP_EXAMPLE_H + +#define FB_UDR_STATUS_TYPE ::Firebird::ThrowStatusWrapper + +#include "ibase.h" +#include "firebird/UdrCppEngine.h" +#include <assert.h> +#include <stdio.h> + + +namespace +{ + template <typename T> + class AutoReleaseClear + { + public: + static void clear(T* ptr) + { + if (ptr) + ptr->release(); + } + }; + + template <typename T> + class AutoDisposeClear + { + public: + static void clear(T* ptr) + { + if (ptr) + ptr->dispose(); + } + }; + + template <typename T> + class AutoDeleteClear + { + public: + static void clear(T* ptr) + { + delete ptr; + } + }; + + template <typename T> + class AutoArrayDeleteClear + { + public: + static void clear(T* ptr) + { + delete [] ptr; + } + }; + + template <typename T, typename Clear> + class AutoImpl + { + public: + AutoImpl<T, Clear>(T* aPtr = NULL) + : ptr(aPtr) + { + } + + ~AutoImpl() + { + Clear::clear(ptr); + } + + AutoImpl<T, Clear>& operator =(T* aPtr) + { + Clear::clear(ptr); + ptr = aPtr; + return *this; + } + + operator T*() + { + return ptr; + } + + operator const T*() const + { + return ptr; + } + + bool operator !() const + { + return !ptr; + } + + bool hasData() const + { + return ptr != NULL; + } + + T* operator ->() + { + return ptr; + } + + T* release() + { + T* tmp = ptr; + ptr = NULL; + return tmp; + } + + void reset(T* aPtr = NULL) + { + if (aPtr != ptr) + { + Clear::clear(ptr); + ptr = aPtr; + } + } + + private: + // not implemented + AutoImpl<T, Clear>(AutoImpl<T, Clear>&); + void operator =(AutoImpl<T, Clear>&); + + private: + T* ptr; + }; + + template <typename T> class AutoDispose : public AutoImpl<T, AutoDisposeClear<T> > + { + public: + AutoDispose(T* ptr = NULL) + : AutoImpl<T, AutoDisposeClear<T> >(ptr) + { + } + }; + + template <typename T> class AutoRelease : public AutoImpl<T, AutoReleaseClear<T> > + { + public: + AutoRelease(T* ptr = NULL) + : AutoImpl<T, AutoReleaseClear<T> >(ptr) + { + } + }; + + template <typename T> class AutoDelete : public AutoImpl<T, AutoDeleteClear<T> > + { + public: + AutoDelete(T* ptr = NULL) + : AutoImpl<T, AutoDeleteClear<T> >(ptr) + { + } + }; + + template <typename T> class AutoArrayDelete : public AutoImpl<T, AutoArrayDeleteClear<T> > + { + public: + AutoArrayDelete(T* ptr = NULL) + : AutoImpl<T, AutoArrayDeleteClear<T> >(ptr) + { + } + }; +} + +#endif // UDR_CPP_EXAMPLE_H Property changes on: firebird/trunk/examples/udr/UdrCppExample.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-26 15:23:29
|
Revision: 60563 http://sourceforge.net/p/firebird/code/60563 Author: egorpugin Date: 2015-01-26 15:23:27 +0000 (Mon, 26 Jan 2015) Log Message: ----------- [build] [cmake] Update build according to the last changes. Modified Paths: -------------- firebird/trunk/CMakeLists.txt firebird/trunk/builds/cmake/BuildFunctions.cmake firebird/trunk/examples/CMakeLists.txt firebird/trunk/src/CMakeLists.txt Modified: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt 2015-01-26 15:00:31 UTC (rev 60562) +++ firebird/trunk/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) @@ -238,8 +238,9 @@ if (NOT CMAKE_CROSSCOMPILING) -add_executable (btyacc ${btyacc_src}) -project_group (btyacc Extern) +add_executable (btyacc ${btyacc_src}) +project_group (btyacc Extern) +set_output_directory (btyacc . FORCE) endif() # if (NOT CMAKE_CROSSCOMPILING) @@ -250,8 +251,8 @@ file(GLOB libtommath_src "extern/libtommath/*.c" "extern/libtommath/*.h") -add_library (libtommath ${libtommath_src}) -project_group (libtommath Extern) +add_library (libtommath ${libtommath_src}) +project_group (libtommath Extern) ######################################## Modified: firebird/trunk/builds/cmake/BuildFunctions.cmake =================================================================== --- firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-01-26 15:00:31 UTC (rev 60562) +++ firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-01-26 15:23:27 UTC (rev 60563) @@ -136,7 +136,7 @@ ####################################### function(set_win32 var) if (WIN32) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_win32) @@ -145,7 +145,7 @@ ####################################### function(set_unix var) if (UNIX) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_unix) @@ -154,7 +154,7 @@ ####################################### function(set_apple var) if (APPLE) - set(${var} ${ARGN} PARENT_SCOPE) + set(${var} "${ARGN}" PARENT_SCOPE) endif() endfunction(set_apple) Modified: firebird/trunk/examples/CMakeLists.txt =================================================================== --- firebird/trunk/examples/CMakeLists.txt 2015-01-26 15:00:31 UTC (rev 60562) +++ firebird/trunk/examples/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) @@ -31,9 +31,9 @@ COMMAND gpre -r -m -n -z ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e empbuild.c ) -add_executable (empbuild empbuild.c ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) +add_executable (empbuild empbuild.c empbuild.fdb ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) target_link_libraries (empbuild yvalve) -set_output_directory (empbuild empbuild FORCE) +set_output_directory (empbuild . FORCE) add_dependencies (empbuild gfix engine12 fbtrace) project_group (empbuild Examples) @@ -47,21 +47,19 @@ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${F} ${name}) endforeach() -set_unix (CMD PATH=${output_dir}/bin) -set_apple(CMD DYLD_LIBRARY_PATH=${output_dir}/plugins:${output_dir}/lib ${CMD}) +set(EMPBUILD_CMD empbuild employe2.fdb) +set_win32(EMPBUILD_CMD set PATH=%PATH%\\\\;${output_dir} COMMAND ${EMPBUILD_CMD}) +set_unix (EMPBUILD_CMD PATH=${output_dir}/bin ${EMPBUILD_CMD}) +set_apple(EMPBUILD_CMD DYLD_LIBRARY_PATH=${output_dir}/plugins:${output_dir}/lib ${EMPBUILD_CMD}) -if (WIN32) - add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} - COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb - COMMAND set PATH=%PATH%\;${output_dir} - COMMAND ${CMD} $<TARGET_FILE:empbuild> employe2.fdb - ) -else() - add_custom_command(OUTPUT employe2.fdb DEPENDS empbuild ${files} - COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb - COMMAND ${CMD} $<TARGET_FILE:empbuild> employe2.fdb - ) -endif() +add_custom_command( + OUTPUT employe2.fdb + DEPENDS + empbuild + ${files} + COMMAND ${CMAKE_COMMAND} -E remove employe2.fdb + COMMAND ${EMPBUILD_CMD} +) add_custom_target (employee_db DEPENDS employe2.fdb SOURCES ${files}) project_group (employee_db Examples) @@ -71,7 +69,9 @@ # SHARED LIBRARY udrcpp_example ######################################## -add_library (udrcpp_example SHARED udr/UdrCppExample.cpp) +file(GLOB udrcpp_example_src "udr/*") + +add_library (udrcpp_example SHARED ${udrcpp_example_src}) target_link_libraries (udrcpp_example udr_engine) set_output_directory (udrcpp_example plugins/udr) project_group (udrcpp_example Examples) Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-01-26 15:00:31 UTC (rev 60562) +++ firebird/trunk/src/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) @@ -181,8 +181,10 @@ add_custom_target(databases DEPENDS boot_engine12 + help.fdb + metadata.fdb msg.fdb - help.fdb + security.fdb SOURCES ${databases_src} ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-26 19:20:52
|
Revision: 60564 http://sourceforge.net/p/firebird/code/60564 Author: egorpugin Date: 2015-01-26 19:20:48 +0000 (Mon, 26 Jan 2015) Log Message: ----------- [build] [cmake] Fix crosscompiling for android on linux. Modified Paths: -------------- firebird/trunk/CMakeLists.txt firebird/trunk/examples/CMakeLists.txt firebird/trunk/src/CMakeLists.txt firebird/trunk/src/utilities/CMakeLists.txt Modified: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) +++ firebird/trunk/CMakeLists.txt 2015-01-26 19:20:48 UTC (rev 60564) @@ -122,6 +122,24 @@ endif() if (UNIX) + if (CMAKE_CROSSCOMPILING) + find_path(ICU_INCLUDE_DIR unicode/ucnv.h + PATHS + /usr/include + /usr/include/x86_64-linux-gnu + /usr/local/include + /opt/local/include + CMAKE_FIND_ROOT_PATH_BOTH + ) + if (ICU_INCLUDE_DIR) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory + ${ICU_INCLUDE_DIR}/unicode + ${CMAKE_BINARY_DIR}/unicode + ) + include_directories(${CMAKE_BINARY_DIR}) + endif() + endif() + set(OS_DIR posix) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") Modified: firebird/trunk/examples/CMakeLists.txt =================================================================== --- firebird/trunk/examples/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) +++ firebird/trunk/examples/CMakeLists.txt 2015-01-26 19:20:48 UTC (rev 60564) @@ -34,7 +34,7 @@ add_executable (empbuild empbuild.c empbuild.fdb ${CMAKE_CURRENT_SOURCE_DIR}/empbuild/empbuild.e) target_link_libraries (empbuild yvalve) set_output_directory (empbuild . FORCE) -add_dependencies (empbuild gfix engine12 fbtrace) +add_dependencies_cc (empbuild gfix engine12 fbtrace) project_group (empbuild Examples) file(GLOB files Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) +++ firebird/trunk/src/CMakeLists.txt 2015-01-26 19:20:48 UTC (rev 60564) @@ -504,7 +504,7 @@ add_library (udr_engine SHARED ${udr_engine_src} ${VERSION_RC}) target_link_libraries (udr_engine common yvalve) set_output_directory (udr_engine plugins) -set_exported_symbols (udr_engine plugin) +set_exported_symbols (udr_engine fbplugin) ######################################## Modified: firebird/trunk/src/utilities/CMakeLists.txt =================================================================== --- firebird/trunk/src/utilities/CMakeLists.txt 2015-01-26 15:23:27 UTC (rev 60563) +++ firebird/trunk/src/utilities/CMakeLists.txt 2015-01-26 19:20:48 UTC (rev 60564) @@ -57,7 +57,7 @@ add_library (fbtrace SHARED ${fbtrace_src} ${fbtrace_os_src} ${fbtrace_include} ${VERSION_RC}) target_link_libraries (fbtrace common yvalve) -add_dependencies (fbtrace engine12 build_msg codes) # try to wait all generators stop +add_dependencies_cc (fbtrace engine12 build_msg codes) # try to wait all generators stop set_output_directory (fbtrace plugins) set_exported_symbols (fbtrace fbplugin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2015-01-27 10:46:56
|
Revision: 60571 http://sourceforge.net/p/firebird/code/60571 Author: alexpeshkoff Date: 2015-01-27 10:46:48 +0000 (Tue, 27 Jan 2015) Log Message: ----------- Work in progress on CORE-3885: Firebird for Android, build is complete Modified Paths: -------------- firebird/trunk/builds/posix/Makefile.in firebird/trunk/builds/posix/Makefile.in.plugins_examples firebird/trunk/builds/posix/make.android.arme firebird/trunk/builds/posix/make.defaults firebird/trunk/builds/posix/make.rules firebird/trunk/configure.ac firebird/trunk/src/common/ThreadStart.cpp firebird/trunk/src/common/ThreadStart.h firebird/trunk/src/common/classes/init.cpp firebird/trunk/src/include/cross/android.arme firebird/trunk/src/remote/server/os/posix/inet_server.cpp Modified: firebird/trunk/builds/posix/Makefile.in =================================================================== --- firebird/trunk/builds/posix/Makefile.in 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/Makefile.in 2015-01-27 10:46:48 UTC (rev 60571) @@ -130,7 +130,7 @@ # main build target for both debug abd release builds # -.PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples +.PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples cross_rest master_process: ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h @@ -187,13 +187,22 @@ # even if gpre itself was not rebuilt -$(RM) $(GPRE_CURRENT) (cd $(BIN); $(LN) $(notdir $(RUN_GPRE)) $(notdir $(GPRE_CURRENT))) + $(MAKE) include_generic + $(MAKE) -f Makefile.examples -C $(GEN_ROOT)/examples/ cross2: ln -sf $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h + $(MAKE) prerequisites $(MAKE) tommath $(MAKE) yvalve + $(MAKE) engine + $(MAKE) fbintl + $(MAKE) utilities + $(MAKE) $(GPRE) + $(MAKE) plugins + $(MAKE) -f Makefile.plugins_examples -C $(GEN_ROOT)/examples/ + $(MAKE) cross_rest - #___________________________________________________________________________ # static library - various common code, used in different FB projects # @@ -493,10 +502,17 @@ # all the rest we need to build # -.PHONY: qli message_file +.PHONY: qli message_file gbak_files +FDB_FILES := $(HELP_FDB) $(ROOT)/gen/msg.fdb $(SECURITY_FDB) $(FIREBIRD)/examples/empbuild/employee.fdb +GBAK_FILES := $(FDB_FILES:.fdb=.gbak) $(FIREBIRD)/msg.gbak +GBAK_FILES := $(subst Native,$(TARGET),$(GBAK_FILES)) + rest: qli message_file +cross_rest: qli gbak_files + $(MAKE) $(BUILD_FILE) + qli: $(QLI) $(QLI): $(QLI_Objects) $(COMMON_LIB) @@ -508,14 +524,18 @@ message_file: $(FIREBIRD_MSG) -$(FIREBIRD_MSG): $(RUN_BUILD_FILE) msg.timestamp - $(RUN_BUILD_FILE) -d msg.fdb -f $@ +$(FIREBIRD_MSG): $(BUILD_FILE) msg.timestamp + $(BUILD_FILE) -d msg.fdb -f $@ $(CHMOD_6) $@ $(BUILD_FILE): $(BUILD_Objects) $(COMMON_LIB) $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LINK_LIBS) +gbak_files: $(GBAK_FILES) +$(GEN_ROOT)/$(TARGET)/firebird/msg.gbak: $(ROOT)/gen/msg.gbak + cp $^ $@ + #--------------------------------------------------------------------------- # This target builds the include files for distribution with the release Modified: firebird/trunk/builds/posix/Makefile.in.plugins_examples =================================================================== --- firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/Makefile.in.plugins_examples 2015-01-27 10:46:48 UTC (rev 60571) @@ -39,7 +39,11 @@ CPPFLAGS+= -I$(FB_BUILD)/include include $(ROOT)/gen/make.defaults +ifeq ($(CROSS_OUT), Y) +include $(ROOT)/gen/make.crossPlatform +else include $(ROOT)/gen/make.platform +endif include $(ROOT)/gen/make.rules include $(ROOT)/gen/make.shared.variables Modified: firebird/trunk/builds/posix/make.android.arme =================================================================== --- firebird/trunk/builds/posix/make.android.arme 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.android.arme 2015-01-27 10:46:48 UTC (rev 60571) @@ -3,16 +3,24 @@ $(error Must export NDK location before building for Android) endif NDK_ROOT:=$(NDK) -NDK_LOG:=1 +#NDK_LOG:=1 include $(NDK)/build/core/init.mk + TOOLCHAIN_DIR:=$(foreach chain, $(NDK_ALL_TOOLCHAINS), $(if $(findstring arm, $(chain)), $(chain), )) -TOOLCHAIN_DIR:=$(strip $(TOOLCHAIN_DIR)) +# Filter out clang +TEMP_LIST_DIR := $(foreach chain, $(TOOLCHAIN_DIR), $(if $(findstring clang, $(chain)), , $(chain))) +ifdef TEMP_LIST_DIR + TOOLCHAIN_DIR := $(TEMP_LIST_DIR) +endif +# use freshmost compiler +TOOLCHAIN_DIR:=$(lastword $(TOOLCHAIN_DIR)) + ifeq ($(HOST_TAG64),) HOST_TAG64:=linux-x86 endif NDK_TOOLCHAIN_VERSION:=$(shell echo $(TOOLCHAIN_DIR) | awk -F - '{print $$NF;}') -CROSS_PLATFORM:=$(NDK)/platforms/android-9/arch-arm +CROSS_PLATFORM:=$(NDK)/platforms/android-14/arch-arm CROSS_PREFIX:=$(NDK)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG64)/bin/arm-linux-androideabi- CXX:=$(CROSS_PREFIX)g++ @@ -28,8 +36,9 @@ COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DANDROID -DARM -pipe -MMD -fPIC -fmessage-length=0 \ -I$(ROOT)/extern/libtommath --sysroot=$(CROSS_PLATFORM) \ - -I/usr/include -OPTIMIZE_FLAGS=-O0 -fno-omit-frame-pointer # optimizing cause bugs... - i.e. -O0 + -I$(CROSS_PLATFORM)/usr/include -I$(ROOT)/gen/cross + +OPTIMIZE_FLAGS=-fno-omit-frame-pointer WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS) @@ -47,3 +56,19 @@ EXE_LINK_OPTIONS= $(LDFLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS) LIB_LINK_OPTIONS= $(LDFLAGS) -shared + +UNICODE_DIR := $(shell dirname `find /usr/include -name ucnv.h`) +UNICODE_DIR := $(filter %unicode, $(UNICODE_DIR)) +UNICODE_DIR := $(firstword $(UNICODE_DIR)) +ifndef UNICODE_DIR + $(error ERROR while locating ICU include directory, probably missing ucnv.h) +endif + +.PHONY: prerequisites +prerequisites: $(ROOT)/gen/cross/unicode + +$(ROOT)/gen/cross/unicode: + echo $(UNICODE_DIR) + rm -rf $(ROOT)/gen/cross + mkdir $(ROOT)/gen/cross + ln -s $(UNICODE_DIR) cross/unicode Modified: firebird/trunk/builds/posix/make.defaults =================================================================== --- firebird/trunk/builds/posix/make.defaults 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.defaults 2015-01-27 10:46:48 UTC (rev 60571) @@ -297,8 +297,8 @@ # Per-library link rules LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) $(UNDEF_FLAGS)\ - $(call LIB_LINK_RPATH,lib) $(SO_LINK_LIBS) -LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util + $(call LIB_LINK_RPATH,lib) +LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util $(SO_LINK_LIBS) LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS) $(UNDEF_FLAGS)\ $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib) @@ -375,7 +375,6 @@ # From msgs CHECK_MESSAGES = $(BIN)/check_messages$(EXEC_EXT) BUILD_FILE = $(BIN)/build_file$(EXEC_EXT) -RUN_BUILD_FILE = $(RBIN)/build_file$(EXEC_EXT) FIREBIRD_MSG = $(FIREBIRD)/firebird.msg ENTER_MESSAGES = $(BIN)/enter_messages$(EXEC_EXT) Modified: firebird/trunk/builds/posix/make.rules =================================================================== --- firebird/trunk/builds/posix/make.rules 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/builds/posix/make.rules 2015-01-27 10:46:48 UTC (rev 60571) @@ -104,3 +104,13 @@ $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc windres --output-format=coff --include-dir=$(<D) $< $@ + +# Rule for making gbak files when cross-compiling + +.SUFFIXES: .gbak .fdb + +$(GEN_ROOT)/$(TARGET)/%.gbak: $(GEN_ROOT)/Native/%.fdb + $(RUN_GBAK) -b $(firstword $<) $(firstword $@) + +$(GEN_ROOT)/%.gbak: $(GEN_ROOT)/%.fdb + $(RUN_GBAK) -b $(firstword $<) $(firstword $@) Modified: firebird/trunk/configure.ac =================================================================== --- firebird/trunk/configure.ac 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/configure.ac 2015-01-27 10:46:48 UTC (rev 60571) @@ -706,6 +706,7 @@ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/select.h) AC_CHECK_HEADERS(sys/syscall.h) +AC_CHECK_HEADERS(sys/signal.h) AC_CHECK_HEADERS(limits.h) AC_CHECK_HEADERS(setjmp.h) AC_CHECK_HEADERS(stdarg.h) Modified: firebird/trunk/src/common/ThreadStart.cpp =================================================================== --- firebird/trunk/src/common/ThreadStart.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/ThreadStart.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -200,7 +200,7 @@ ThreadId Thread::getId() { -#ifdef LINUX +#if defined(LINUX) && !defined(ANDROID) return syscall(SYS_gettid); #else return pthread_self(); Modified: firebird/trunk/src/common/ThreadStart.h =================================================================== --- firebird/trunk/src/common/ThreadStart.h 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/ThreadStart.h 2015-01-27 10:46:48 UTC (rev 60571) @@ -56,7 +56,7 @@ #if defined(WIN_NT) typedef DWORD ThreadId; -#elif defined(LINUX) +#elif defined(LINUX) && !defined(ANDROID) typedef int ThreadId; #elif defined(USE_POSIX_THREADS) typedef pthread_t ThreadId; Modified: firebird/trunk/src/common/classes/init.cpp =================================================================== --- firebird/trunk/src/common/classes/init.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/common/classes/init.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -56,7 +56,7 @@ // This helps initialize globals, needed before regular ctors run int initDone = 0; -#ifndef WIN_NT +#ifdef HAVE_PTHREAD_ATFORK void child(void) { // turn off dtors execution in forked process @@ -132,7 +132,7 @@ #endif //DEBUG_INIT initDone = 1; -#ifndef WIN_NT +#ifdef HAVE_PTHREAD_ATFORK int ret = pthread_atfork(NULL, NULL, child); #endif Modified: firebird/trunk/src/include/cross/android.arme =================================================================== --- firebird/trunk/src/include/cross/android.arme 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/include/cross/android.arme 2015-01-27 10:46:48 UTC (rev 60571) @@ -125,7 +125,7 @@ /* #undef GPRE_PASCAL */ /* Define to 1 if you have the <aio.h> header file. */ -#define HAVE_AIO_H 1 +/* #undef HAVE_AIO_H */ /* Define this if AO_compare_and_swap_full() is defined in atomic_ops.h */ /* #undef HAVE_AO_COMPARE_AND_SWAP_FULL */ @@ -162,7 +162,7 @@ #define HAVE_DLFCN_H 1 /* Define this if editline is in use */ -#define HAVE_EDITLINE_H 1 +/* #undef HAVE_EDITLINE_H */ /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 @@ -291,7 +291,7 @@ #define HAVE_POLL_H 1 /* Define this if posix_fadvise() is present on the platform */ -#define HAVE_POSIX_FADVISE 1 +/* #undef HAVE_POSIX_FADVISE */ /* Define to 1 if you have the `pread' function. */ #define HAVE_PREAD 1 @@ -369,7 +369,7 @@ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the `sigset' function. */ -#define HAVE_SIGSET 1 +/* #undef HAVE_SIGSET */ /* Define to 1 if you have the `snprintf' function. */ #define HAVE_SNPRINTF 1 @@ -587,6 +587,9 @@ /* Architecture is big-edian sh4 */ /* #undef SHEB */ +/* Extension for shared libraries */ +#define SHRLIB_EXT "so" + /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 Modified: firebird/trunk/src/remote/server/os/posix/inet_server.cpp =================================================================== --- firebird/trunk/src/remote/server/os/posix/inet_server.cpp 2015-01-27 10:33:10 UTC (rev 60570) +++ firebird/trunk/src/remote/server/os/posix/inet_server.cpp 2015-01-27 10:46:48 UTC (rev 60571) @@ -92,13 +92,11 @@ #include "../auth/trusted/AuthSspi.h" #include "../auth/SecureRemotePassword/server/SrpServer.h" -#ifdef UNIX -#ifdef NETBSD +#ifdef HAVE_SYS_SIGNAL_H +#include <sys/signal.h> +#else #include <signal.h> -#else -#include <sys/signal.h> #endif -#endif #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-27 14:38:01
|
Revision: 60572 http://sourceforge.net/p/firebird/code/60572 Author: egorpugin Date: 2015-01-27 14:37:59 +0000 (Tue, 27 Jan 2015) Log Message: ----------- Improve Qt+MSVC build. Fix some messages. Crosscompiling improvements (add some defines). Modified Paths: -------------- firebird/trunk/CMakeLists.txt firebird/trunk/builds/cmake/BuildFunctions.cmake firebird/trunk/builds/cmake/Configure.cmake firebird/trunk/src/CMakeLists.txt firebird/trunk/src/include/gen/autoconfig.h.in Modified: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt 2015-01-27 10:46:48 UTC (rev 60571) +++ firebird/trunk/CMakeLists.txt 2015-01-27 14:37:59 UTC (rev 60572) @@ -2,18 +2,18 @@ # firebird (trunk) # -############################################################################### +################################################################################ # # cmake settings # -############################################################################### +################################################################################ cmake_minimum_required(VERSION 2.8.8) # In-source builds are not possible and so disabled. if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR - "CMake generation for firebird is not possible within the source directory!" + "CMake generation for Firebird is not possible within the source directory!" "\n Remove the CMakeCache.txt file and try again from another folder, e.g.:" "\n " "\n rm CMakeCache.txt" @@ -35,16 +35,37 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake Targets") -############################################################################### +################################################################################ # # project settings # -############################################################################### +################################################################################ project("firebird" C CXX) -####################################### +######################################## +# build type settings +######################################## +# Define build mode +if (NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build.") +endif() + +# Qt with MSVC does not have multiconfiguration option by default, +# so we create it. +set(DEFAULT_CONFIGURATION) + +# Set build types if none was specified +if (NOT DEFINED CMAKE_CONFIGURATION_TYPES) + set(CMAKE_CONFIGURATION_TYPES Debug Release MinSizeRel RelWithDebInfo) + set(DEFAULT_CONFIGURATION ${CMAKE_BUILD_TYPE}) +endif() + +######################################## +# Output directory settings +######################################## + set(output_dir ${CMAKE_BINARY_DIR}/${PROJECT_NAME}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${output_dir}) @@ -54,6 +75,13 @@ set(output_dir ${output_dir}/$<CONFIG>) endif() +if (MSVC AND DEFAULT_CONFIGURATION) + foreach(conf ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${conf} conf2) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${conf2} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DEFAULT_CONFIGURATION}) + endforeach() +endif() + if (XCODE) foreach(conf ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${conf} conf2) @@ -64,11 +92,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${output_dir}/bin) endif() -############################################################################### +################################################################################ # # configure # -############################################################################### +################################################################################ include(Configure) @@ -93,11 +121,11 @@ set(AUTOCONFIG ${CMAKE_BINARY_DIR}/src/include/gen/autoconfig.h) configure_file(${AUTOCONFIG_SRC} ${AUTOCONFIG} @ONLY) -############################################################################### +################################################################################ # # compiler & linker # -############################################################################### +################################################################################ add_definitions(-DDEV_BUILD) @@ -175,11 +203,11 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") endif() -############################################################################### +################################################################################ # # pre build # -############################################################################### +################################################################################ if (WIN32) # icu @@ -228,12 +256,11 @@ endforeach() endif() - -############################################################################### +################################################################################ # # build # -############################################################################### +################################################################################ include(BuildFunctions) @@ -273,9 +300,11 @@ project_group (libtommath Extern) ######################################## +# subdirectories +######################################## add_subdirectory("examples") add_subdirectory("src") -############################################################################### +################################################################################ Modified: firebird/trunk/builds/cmake/BuildFunctions.cmake =================================================================== --- firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-01-27 10:46:48 UTC (rev 60571) +++ firebird/trunk/builds/cmake/BuildFunctions.cmake 2015-01-27 14:37:59 UTC (rev 60572) @@ -27,7 +27,7 @@ set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${conf2} ${out}/${conf}/${dir}) endforeach() else() # single configuration - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${out}/${dir}) + add_custom_command(TARGET ${target} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${out}/${dir}) set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${out}/${dir}) set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${out}/${dir}) endif() @@ -103,7 +103,7 @@ ) elseif ("${type}" STREQUAL "master") get_filename_component(file ${out} NAME) - set(dir ${dir}/${file}.d) + set(dir ${dir}/${file}.d) add_custom_command( OUTPUT ${out} DEPENDS ${in} databases Modified: firebird/trunk/builds/cmake/Configure.cmake =================================================================== --- firebird/trunk/builds/cmake/Configure.cmake 2015-01-27 10:46:48 UTC (rev 60571) +++ firebird/trunk/builds/cmake/Configure.cmake 2015-01-27 14:37:59 UTC (rev 60572) @@ -40,8 +40,8 @@ function(check_type_alignment type var) if (NOT DEFINED ${var}) check_c_source_runs("main(){struct s{char a;${type} b;};exit((int)&((struct s*)0)->b);}" ${var}) - #message("-- Performing Test ${var} - It's still OK.") - message("-- Performing Test ${var} - Success") + #message(STATUS "Performing Test ${var} - It's still OK.") + message(STATUS "Performing Test ${var} - Success") set(${var} ${${var}_EXITCODE} CACHE STRING "${type} alignment" FORCE) endif() endfunction(check_type_alignment) Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-01-27 10:46:48 UTC (rev 60571) +++ firebird/trunk/src/CMakeLists.txt 2015-01-27 14:37:59 UTC (rev 60572) @@ -92,18 +92,22 @@ # BUILD STEP databases ######################################## -set(databases_src - ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql +set(msgs_src ${CMAKE_CURRENT_SOURCE_DIR}/msgs/facilities2.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/history2.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/locales.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/messages2.sql + ${CMAKE_CURRENT_SOURCE_DIR}/msgs/msg.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/sqlstates.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/symbols2.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/system_errors2.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.de_DE2.sql ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.fr_FR2.sql ) +set(databases_src + ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql + ${msgs_src} +) add_custom_command( OUTPUT security.fdb DEPENDS @@ -112,8 +116,8 @@ VERBATIM # COMMAND ${CMAKE_COMMAND} -E remove security3.fdb - COMMAND ${CMAKE_COMMAND} -E echo "create database 'security3.fdb';" > create_db.sql - COMMAND boot_isql -q -i create_db.sql + COMMAND ${CMAKE_COMMAND} -E echo "create database 'security3.fdb';" > create_db_security3.sql + COMMAND boot_isql -q -i create_db_security3.sql COMMAND boot_isql -q security3.fdb -i ${CMAKE_CURRENT_SOURCE_DIR}/dbs/security.sql COMMAND ${CMAKE_COMMAND} -E copy_if_different security3.fdb security.fdb ) @@ -132,21 +136,11 @@ VERBATIM DEPENDS boot_isql - metadata.fdb - security.fdb - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/facilities2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/history2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/locales.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/messages2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/sqlstates.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/symbols2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/system_errors2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.de_DE2.sql - ${CMAKE_CURRENT_SOURCE_DIR}/msgs/transmsgs.fr_FR2.sql + ${msgs_src} # COMMAND ${CMAKE_COMMAND} -E remove msg.fdb - COMMAND ${CMAKE_COMMAND} -E echo "create database 'msg.fdb';" > create_db.sql - COMMAND boot_isql -q -i create_db.sql + COMMAND ${CMAKE_COMMAND} -E echo "create database 'msg.fdb';" > create_db_msg.sql + COMMAND boot_isql -q -i create_db_msg.sql COMMAND ${isql_exec_msg}/msg.sql # COMMAND echo loading facilities @@ -774,7 +768,7 @@ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/extern/icu/icudt52l_empty.dat ${output_dir}/icudt52l_empty.dat ) - string(FIND ${CMAKE_EXE_LINKER_FLAGS} "/machine:x64" arch) + string(FIND "${CMAKE_EXE_LINKER_FLAGS}" "/machine:x64" arch) if (NOT ${arch} EQUAL -1) set(arch "x64") else() Modified: firebird/trunk/src/include/gen/autoconfig.h.in =================================================================== --- firebird/trunk/src/include/gen/autoconfig.h.in 2015-01-27 10:46:48 UTC (rev 60571) +++ firebird/trunk/src/include/gen/autoconfig.h.in 2015-01-27 14:37:59 UTC (rev 60572) @@ -45,6 +45,9 @@ /* Define this if OS is AIX */ #cmakedefine AIX 1 +/* Define this if OS is ANDROID */ +#cmakedefine ANDROID 1 + /* Define this if OS is DARWIN */ #cmakedefine DARWIN 1 @@ -54,6 +57,9 @@ /* Define this if OS is HP-UX */ #cmakedefine HPUX 1 +/* Define this if OS is iOS */ +#cmakedefine IOS 1 + /* Define this if OS is Linux */ #cmakedefine LINUX 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ego...@us...> - 2015-01-29 07:10:49
|
Revision: 60580 http://sourceforge.net/p/firebird/code/60580 Author: egorpugin Date: 2015-01-29 07:10:47 +0000 (Thu, 29 Jan 2015) Log Message: ----------- [build] [cmake] Extract ICU and zlib only once. Modified Paths: -------------- firebird/trunk/CMakeLists.txt firebird/trunk/src/CMakeLists.txt Modified: firebird/trunk/CMakeLists.txt =================================================================== --- firebird/trunk/CMakeLists.txt 2015-01-28 17:12:57 UTC (rev 60579) +++ firebird/trunk/CMakeLists.txt 2015-01-29 07:10:47 UTC (rev 60580) @@ -211,14 +211,20 @@ if (WIN32) # icu - set(ICU_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/icu/icu.exe -y) - #message("Extracting pre-built ICU") - execute_process(COMMAND ${ICU_EXTRACT}) + if (NOT ICU_EXTRACT) + message(STATUS "Extracting pre-built ICU") + set(ICU_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/icu/icu.exe -y + CACHE STRING "ICU extraction variable") + execute_process(COMMAND ${ICU_EXTRACT}) + endif() # zlib - set(ZLIB_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/zlib/zlib.exe -y) - #message("Extracting pre-built zlib") - execute_process(COMMAND ${ZLIB_EXTRACT}) + if (NOT ZLIB_EXTRACT) + message(STATUS "Extracting pre-built zlib") + set(ZLIB_EXTRACT ${CMAKE_CURRENT_SOURCE_DIR}/extern/zlib/zlib.exe -y + CACHE STRING "zlib extraction variable") + execute_process(COMMAND ${ZLIB_EXTRACT}) + endif() endif() if (UNIX) Modified: firebird/trunk/src/CMakeLists.txt =================================================================== --- firebird/trunk/src/CMakeLists.txt 2015-01-28 17:12:57 UTC (rev 60579) +++ firebird/trunk/src/CMakeLists.txt 2015-01-29 07:10:47 UTC (rev 60580) @@ -413,13 +413,13 @@ file(GLOB_RECURSE engine12_include "dsql/*.h" "jrd/*.h" include/gen/iberror.h) -add_library (engine12_common OBJECT ${engine12_src} ${engine12_include} ${parse_src}) +add_library (engine12_common ${engine12_src} ${engine12_include} ${parse_src}) add_dependencies_cc (engine12_common parse) if (NOT CMAKE_CROSSCOMPILING) -add_library (boot_engine12 SHARED $<TARGET_OBJECTS:engine12_common> ${engine12_generated_src_boot} ${VERSION_RC}) -target_link_libraries (boot_engine12 boot_alice boot_burp common boot_yvalve) +add_library (boot_engine12 SHARED ${engine12_generated_src_boot} ${VERSION_RC}) +target_link_libraries (boot_engine12 engine12_common boot_alice boot_burp common boot_yvalve) set_output_directory (boot_engine12 plugins) set_exported_symbols (boot_engine12 fbplugin) copy_and_rename_lib (boot_engine12 Engine12) @@ -432,8 +432,8 @@ # SHARED LIBRARY engine12 ######################################## -add_library (engine12 SHARED $<TARGET_OBJECTS:engine12_common> ${engine12_generated_src_master} ${VERSION_RC}) -target_link_libraries (engine12 alice burp common yvalve) +add_library (engine12 SHARED ${engine12_generated_src_master} ${VERSION_RC}) +target_link_libraries (engine12 engine12_common alice burp common yvalve) add_dependencies_cc (engine12 messages) # possible build during build_msg or codes run set_target_properties (engine12 PROPERTIES OUTPUT_NAME Engine12) set_output_directory (engine12 plugins) @@ -724,7 +724,7 @@ ######################################## add_executable (gbak burp/main/burpMain.cpp ${gbak_include} ${VERSION_RC}) -target_link_libraries (gbak burp yvalve common) +target_link_libraries (gbak burp common yvalve) ######################################## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |