|
From: <ale...@us...> - 2014-09-29 11:03:56
|
Revision: 60059
http://sourceforge.net/p/firebird/code/60059
Author: alexpeshkoff
Date: 2014-09-29 11:03:47 +0000 (Mon, 29 Sep 2014)
Log Message:
-----------
Language independent API
Modified Paths:
--------------
firebird/trunk/examples/dbcrypt/CryptApplication.cpp
firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
firebird/trunk/examples/dbcrypt/DbCrypt.cpp
firebird/trunk/examples/interfaces/01.create.cpp
firebird/trunk/examples/interfaces/02.update.cpp
firebird/trunk/examples/interfaces/03.select.cpp
firebird/trunk/examples/interfaces/04.print_table.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/client/SrpClient.h
firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp
firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp
firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.h
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/SecurityDatabase/LegacyServer.h
firebird/trunk/src/auth/trusted/AuthSspi.cpp
firebird/trunk/src/auth/trusted/AuthSspi.h
firebird/trunk/src/common/Auth.h
firebird/trunk/src/common/MsgMetadata.cpp
firebird/trunk/src/common/MsgMetadata.h
firebird/trunk/src/common/StatementMetadata.cpp
firebird/trunk/src/common/StatementMetadata.h
firebird/trunk/src/common/StatusArg.cpp
firebird/trunk/src/common/StatusArg.h
firebird/trunk/src/common/StatusHolder.h
firebird/trunk/src/common/call_service.cpp
firebird/trunk/src/common/call_service.h
firebird/trunk/src/common/classes/ClumpletReader.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/InternalMessageBuffer.cpp
firebird/trunk/src/common/classes/InternalMessageBuffer.h
firebird/trunk/src/common/classes/MsgPrint.cpp
firebird/trunk/src/common/classes/TempFile.h
firebird/trunk/src/common/classes/locks.h
firebird/trunk/src/common/classes/semaphore.h
firebird/trunk/src/common/classes/timestamp.cpp
firebird/trunk/src/common/config/config.cpp
firebird/trunk/src/common/config/config.h
firebird/trunk/src/common/config/config_file.cpp
firebird/trunk/src/common/db_alias.cpp
firebird/trunk/src/common/fb_exception.cpp
firebird/trunk/src/common/isc_sync.cpp
firebird/trunk/src/common/os/win32/mod_loader.cpp
firebird/trunk/src/common/security.cpp
firebird/trunk/src/common/security.h
firebird/trunk/src/common/utils.cpp
firebird/trunk/src/common/utils_proto.h
firebird/trunk/src/dsql/ExprNodes.cpp
firebird/trunk/src/dsql/StmtNodes.cpp
firebird/trunk/src/dsql/dsql.cpp
firebird/trunk/src/dsql/dsql_proto.h
firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp
firebird/trunk/src/gpre/languages/ftn.cpp
firebird/trunk/src/gpre/obj_cxx.cpp
firebird/trunk/src/include/fb_exception.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/include/firebird.h
firebird/trunk/src/intl/utils/dtest.c
firebird/trunk/src/isql/isql.epp
firebird/trunk/src/isql/isql_proto.h
firebird/trunk/src/isql/show.epp
firebird/trunk/src/isql/show_proto.h
firebird/trunk/src/jrd/Attachment.h
firebird/trunk/src/jrd/CryptoManager.cpp
firebird/trunk/src/jrd/CryptoManager.h
firebird/trunk/src/jrd/Database.h
firebird/trunk/src/jrd/DbCreators.cpp
firebird/trunk/src/jrd/EngineInterface.h
firebird/trunk/src/jrd/ExtEngineManager.cpp
firebird/trunk/src/jrd/ExtEngineManager.h
firebird/trunk/src/jrd/IntlManager.cpp
firebird/trunk/src/jrd/Mapping.cpp
firebird/trunk/src/jrd/SysFunction.cpp
firebird/trunk/src/jrd/UserManagement.cpp
firebird/trunk/src/jrd/UserManagement.h
firebird/trunk/src/jrd/blb.h
firebird/trunk/src/jrd/constants.h
firebird/trunk/src/jrd/event.h
firebird/trunk/src/jrd/exe.cpp
firebird/trunk/src/jrd/fun.epp
firebird/trunk/src/jrd/ibase.h
firebird/trunk/src/jrd/jrd.cpp
firebird/trunk/src/jrd/jrd.h
firebird/trunk/src/jrd/ntrace.h
firebird/trunk/src/jrd/recsrc/ProcedureScan.cpp
firebird/trunk/src/jrd/req.h
firebird/trunk/src/jrd/scl.h
firebird/trunk/src/jrd/svc.cpp
firebird/trunk/src/jrd/svc.h
firebird/trunk/src/jrd/tra.cpp
firebird/trunk/src/jrd/tra.h
firebird/trunk/src/jrd/trace/TraceConfigStorage.cpp
firebird/trunk/src/jrd/trace/TraceConfigStorage.h
firebird/trunk/src/jrd/trace/TraceDSQLHelpers.h
firebird/trunk/src/jrd/trace/TraceJrdHelpers.h
firebird/trunk/src/jrd/trace/TraceLog.cpp
firebird/trunk/src/jrd/trace/TraceManager.cpp
firebird/trunk/src/jrd/trace/TraceManager.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/crypt/arc4/Arc4.h
firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
firebird/trunk/src/qli/help.epp
firebird/trunk/src/remote/client/BlrFromMessage.cpp
firebird/trunk/src/remote/client/BlrFromMessage.h
firebird/trunk/src/remote/client/interface.cpp
firebird/trunk/src/remote/remote.cpp
firebird/trunk/src/remote/remote.h
firebird/trunk/src/remote/server/os/posix/inet_server.cpp
firebird/trunk/src/remote/server/os/win32/srvr_w32.cpp
firebird/trunk/src/remote/server/server.cpp
firebird/trunk/src/utilities/gsec/gsec.cpp
firebird/trunk/src/utilities/guard/util.cpp
firebird/trunk/src/utilities/ibmgr/srvrmgr.cpp
firebird/trunk/src/utilities/ntrace/PluginLogWriter.h
firebird/trunk/src/utilities/ntrace/TracePluginImpl.cpp
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/gds.cpp
firebird/trunk/src/yvalve/gds_proto.h
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/utl_proto.h
firebird/trunk/src/yvalve/why.cpp
firebird/trunk/src/yvalve/why_proto.h
Added Paths:
-----------
firebird/trunk/src/include/firebird/FirebirdInterface.idl
firebird/trunk/src/include/firebird/IdlFbInterfaces.h
Removed Paths:
-------------
firebird/trunk/src/include/firebird/Auth.h
firebird/trunk/src/include/firebird/Crypt.h
firebird/trunk/src/include/firebird/ExternalEngine.h
firebird/trunk/src/include/firebird/Plugin.h
firebird/trunk/src/include/firebird/Provider.h
firebird/trunk/src/include/firebird/Timer.h
firebird/trunk/src/include/firebird/Utl.h
Modified: firebird/trunk/examples/dbcrypt/CryptApplication.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/CryptApplication.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/dbcrypt/CryptApplication.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -29,15 +29,14 @@
#include <stdlib.h>
#include <ibase.h>
-#include <firebird/Crypt.h>
-#include <firebird/Provider.h>
+#include <firebird/Interface.h>
using namespace Firebird;
-class CryptKey : public ICryptKeyCallback
+class CryptKey : public Api::CryptKeyCallbackImpl<CryptKey>
{
public:
- unsigned int FB_CARG callback(unsigned int, const void*, unsigned int length, void* buffer)
+ unsigned int callback(unsigned int, const void*, unsigned int length, void* buffer)
{
if (length > 0 && buffer)
{
@@ -48,13 +47,8 @@
return 1;
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_CRYPT_CALLBACK_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return NULL; // OK for application, not for plugin
}
};
@@ -72,7 +66,7 @@
if (tra)
{
tra->rollback(status);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
{
print("rollback");
tra->release();
@@ -81,7 +75,7 @@
if (att)
{
att->detach(status);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
{
print("detach");
att->release();
@@ -103,19 +97,19 @@
p = master->getDispatcher();
p->setDbCryptCallback(status, &key);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "setDbCryptCallback";
char s[256];
sprintf(s, "localhost:%s", dbName);
att = p->attachDatabase(status, s, 0, NULL);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "attachDatabase";
if (a != NONE)
{
tra = att->startTransaction(status, 0, NULL);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "startTransaction";
}
@@ -123,20 +117,20 @@
{
att->execute(status, tra, 0,
"ALTER DATABASE ENCRYPT WITH \"DbCrypt_example\"", 3, NULL, NULL, NULL, NULL);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "execute";
}
if (a == DEC)
{
att->execute(status, tra, 0, "ALTER DATABASE DECRYPT", 3, NULL, NULL, NULL, NULL);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "execute";
}
if (tra)
{
tra->commit(status);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "commit";
tra = NULL;
}
@@ -145,7 +139,7 @@
getchar();
att->detach(status);
- if (!status->isSuccess())
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
throw "detach";
att = NULL;
@@ -156,7 +150,7 @@
void print(const char* where)
{
fprintf(stderr, "Error in %s: ", where);
- isc_print_status(status->get());
+ isc_print_status(status->getErrors());
}
private:
Modified: firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -27,11 +27,12 @@
#include <stdio.h>
#include <string.h>
-#include "firebird.h"
-#include "firebird/Crypt.h"
+#include "firebird/Interface.h"
+#include "firebird.h" // Needed for atomic support
#include "../common/classes/fb_atomic.h"
+
using namespace Firebird;
namespace
@@ -40,7 +41,7 @@
IMaster* master = NULL;
IPluginManager* pluginManager = NULL;
-class PluginModule : public IPluginModule
+class PluginModule : public Api::PluginModuleImpl<PluginModule>
{
public:
PluginModule()
@@ -62,17 +63,12 @@
}
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_PLUGIN_MODULE_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return this;
}
- void FB_CARG doClean()
+ void doClean()
{
flag = false;
}
@@ -83,10 +79,10 @@
PluginModule module;
-class CryptKeyHolder : public IKeyHolderPlugin
+class CryptKeyHolder : public Api::KeyHolderPluginImpl<CryptKeyHolder>
{
public:
- explicit CryptKeyHolder(IPluginConfig* cnf)
+ explicit CryptKeyHolder(IPluginConfig* cnf) throw()
: callbackInterface(this), config(cnf), key(0), owner(NULL)
{
config->addRef();
@@ -98,10 +94,10 @@
}
// IKeyHolderPlugin implementation
- virtual int FB_CARG keyCallback(IStatus* status, ICryptKeyCallback* callback);
- virtual ICryptKeyCallback* FB_CARG keyHandle(IStatus* status, const char* keyName);
+ int keyCallback(IStatus* status, ICryptKeyCallback* callback);
+ ICryptKeyCallback* keyHandle(IStatus* status, const char* keyName);
- int FB_CARG release()
+ int release()
{
if (--refCounter == 0)
{
@@ -111,27 +107,22 @@
return 1;
}
- void FB_CARG addRef()
+ void addRef()
{
++refCounter;
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_KEYHOLDER_PLUGIN_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return &module;
}
- void FB_CARG setOwner(Firebird::IRefCounted* o)
+ void setOwner(Firebird::IReferenceCounted* o)
{
owner = o;
}
- IRefCounted* FB_CARG getOwner()
+ IReferenceCounted* getOwner()
{
return owner;
}
@@ -142,14 +133,14 @@
}
private:
- class CallbackInterface : public ICryptKeyCallback
+ class CallbackInterface : public Api::CryptKeyCallbackImpl<CallbackInterface>
{
public:
explicit CallbackInterface(CryptKeyHolder* p)
: parent(p)
{ }
- unsigned int FB_CARG callback(unsigned int, const void*, unsigned int length, void* buffer)
+ unsigned int callback(unsigned int, const void*, unsigned int length, void* buffer)
{
UCHAR k = parent->getKey();
if (!k)
@@ -164,13 +155,8 @@
return 1;
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_CRYPT_CALLBACK_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return &module;
}
@@ -184,7 +170,7 @@
UCHAR key;
AtomicCounter refCounter;
- IRefCounted* owner;
+ IReferenceCounted* owner;
void noKeyError(IStatus* status);
};
@@ -200,7 +186,7 @@
status->setErrors(vector);
}
-int FB_CARG CryptKeyHolder::keyCallback(IStatus* status, ICryptKeyCallback* callback)
+int CryptKeyHolder::keyCallback(IStatus* status, ICryptKeyCallback* callback)
{
status->init();
@@ -236,7 +222,7 @@
return 1;
}
-ICryptKeyCallback* FB_CARG CryptKeyHolder::keyHandle(IStatus* status, const char* keyName)
+ICryptKeyCallback* CryptKeyHolder::keyHandle(IStatus* status, const char* keyName)
{
if (strcmp(keyName, "sample") != 0)
{
@@ -246,20 +232,15 @@
return &callbackInterface;
}
-class Factory : public IPluginFactory
+class Factory : public Api::PluginFactoryImpl<Factory>
{
public:
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_PLUGIN_FACTORY_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return &module;
}
- IPluginBase* FB_CARG createPlugin(IStatus* status, IPluginConfig* factoryParameter)
+ IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter)
{
try
{
@@ -267,9 +248,10 @@
p->addRef();
return p;
}
- catch (const Exception& ex)
+ catch (...)
{
- ex.stuffException(status);
+ ISC_STATUS st[3] = {isc_arg_gds, isc_virmemexh, isc_arg_end};
+ status->setErrors(st);
}
return NULL;
}
@@ -285,6 +267,6 @@
pluginManager = master->getPluginManager();
module.registerMe();
- pluginManager->registerPluginFactory(PluginType::KeyHolder, "CryptKeyHolder_example",
+ pluginManager->registerPluginFactory(IPluginManager::KeyHolder, "CryptKeyHolder_example",
&factory);
}
Modified: firebird/trunk/examples/dbcrypt/DbCrypt.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -24,9 +24,9 @@
* Contributor(s): ______________________________________.
*/
-#include "firebird.h"
-#include "firebird/Crypt.h"
+#include "firebird/Interface.h"
+#include "firebird.h" // Needed for atomic support
#include "../common/classes/fb_atomic.h"
using namespace Firebird;
@@ -37,7 +37,7 @@
IMaster* master = NULL;
IPluginManager* pluginManager = NULL;
-class PluginModule : public IPluginModule
+class PluginModule : public Api::PluginModuleImpl<PluginModule>
{
public:
PluginModule()
@@ -59,17 +59,12 @@
}
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_PLUGIN_MODULE_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return this;
}
- void FB_CARG doClean()
+ void doClean()
{
flag = false;
}
@@ -80,10 +75,10 @@
PluginModule module;
-class DbCrypt : public IDbCryptPlugin
+class DbCrypt : public Api::DbCryptPluginImpl<DbCrypt>
{
public:
- explicit DbCrypt(IPluginConfig* cnf)
+ explicit DbCrypt(IPluginConfig* cnf) throw()
: config(cnf), key(0), owner(NULL)
{
config->addRef();
@@ -95,11 +90,11 @@
}
// ICryptPlugin implementation
- void FB_CARG encrypt(IStatus* status, unsigned int length, const void* from, void* to);
- void FB_CARG decrypt(IStatus* status, unsigned int length, const void* from, void* to);
- void FB_CARG setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources);
+ 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);
- int FB_CARG release()
+ int release()
{
if (--refCounter == 0)
{
@@ -109,27 +104,22 @@
return 1;
}
- void FB_CARG addRef()
+ void addRef()
{
++refCounter;
}
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_DBCRYPT_PLUGIN_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return &module;
}
- void FB_CARG setOwner(IRefCounted* o)
+ void setOwner(IReferenceCounted* o)
{
owner = o;
}
- IRefCounted* FB_CARG getOwner()
+ IReferenceCounted* getOwner()
{
return owner;
}
@@ -139,7 +129,7 @@
UCHAR key;
AtomicCounter refCounter;
- IRefCounted* owner;
+ IReferenceCounted* owner;
void noKeyError(IStatus* status);
};
@@ -155,7 +145,7 @@
status->setErrors(vector);
}
-void FB_CARG DbCrypt::encrypt(IStatus* status, unsigned int length, const void* from, void* to)
+void DbCrypt::encrypt(IStatus* status, unsigned int length, const void* from, void* to)
{
status->init();
@@ -174,7 +164,7 @@
}
}
-void FB_CARG DbCrypt::decrypt(IStatus* status, unsigned int length, const void* from, void* to)
+void DbCrypt::decrypt(IStatus* status, unsigned int length, const void* from, void* to)
{
status->init();
@@ -193,7 +183,7 @@
}
}
-void FB_CARG DbCrypt::setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources)
+void DbCrypt::setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources)
{
status->init();
@@ -249,20 +239,15 @@
noKeyError(status);
}
-class Factory : public IPluginFactory
+class Factory : public Api::PluginFactoryImpl<Factory>
{
public:
- int FB_CARG getVersion()
+ IPluginModule* getModule()
{
- return FB_PLUGIN_FACTORY_VERSION;
- }
-
- IPluginModule* FB_CARG getModule()
- {
return &module;
}
- IPluginBase* FB_CARG createPlugin(IStatus* status, IPluginConfig* factoryParameter)
+ IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter)
{
try
{
@@ -270,9 +255,10 @@
p->addRef();
return p;
}
- catch (const Exception& ex)
+ catch (...)
{
- ex.stuffException(status);
+ ISC_STATUS st[3] = {isc_arg_gds, isc_virmemexh, isc_arg_end};
+ status->setErrors(st);
}
return NULL;
}
@@ -288,5 +274,5 @@
pluginManager = master->getPluginManager();
module.registerMe();
- pluginManager->registerPluginFactory(PluginType::DbCrypt, "DbCrypt_example", &factory);
+ pluginManager->registerPluginFactory(IPluginManager::DbCrypt, "DbCrypt_example", &factory);
}
Modified: firebird/trunk/examples/interfaces/01.create.cpp
===================================================================
--- firebird/trunk/examples/interfaces/01.create.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/interfaces/01.create.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -38,7 +38,7 @@
#include <string.h>
#include <ibase.h>
-#include <firebird/Provider.h>
+#include <firebird/Interface.h>
using namespace Firebird;
Modified: firebird/trunk/examples/interfaces/02.update.cpp
===================================================================
--- firebird/trunk/examples/interfaces/02.update.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/interfaces/02.update.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -40,7 +40,7 @@
#include <string.h>
#include <ibase.h>
-#include <firebird/Provider.h>
+#include <firebird/Interface.h>
using namespace Firebird;
Modified: firebird/trunk/examples/interfaces/03.select.cpp
===================================================================
--- firebird/trunk/examples/interfaces/03.select.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/interfaces/03.select.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -38,7 +38,7 @@
#include <string.h>
#include <ibase.h>
-#include <firebird/Provider.h>
+#include <firebird/Interface.h>
using namespace Firebird;
Modified: firebird/trunk/examples/interfaces/04.print_table.cpp
===================================================================
--- firebird/trunk/examples/interfaces/04.print_table.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/examples/interfaces/04.print_table.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -37,7 +37,7 @@
#include <string.h>
#include <ibase.h>
-#include <firebird/Provider.h>
+#include <firebird/Interface.h>
using namespace Firebird;
@@ -254,7 +254,7 @@
try
{
// use attachment's method to access BLOB object
- blob = att->openBlob(st, tra, (ISC_QUAD*) (buf + offset));
+ blob = att->openBlob(st, tra, (ISC_QUAD*) (buf + offset), 0, NULL);
check(st, "openBlob");
char segbuf[16];
Modified: firebird/trunk/src/auth/AuthDbg.cpp
===================================================================
--- firebird/trunk/src/auth/AuthDbg.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/AuthDbg.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -34,8 +34,6 @@
//#define AUTH_VERBOSE
-static Firebird::MakeUpgradeInfo<> upInfo;
-
// register plugin
static Firebird::SimpleFactory<Auth::DebugClient> clientFactory;
static Firebird::SimpleFactory<Auth::DebugServer> serverFactory;
@@ -48,8 +46,8 @@
Firebird::PluginManagerInterfacePtr iPlugin;
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthClient, name, &clientFactory);
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthServer, name, &serverFactory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthClient, name, &clientFactory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthServer, name, &serverFactory);
}
@@ -63,8 +61,8 @@
check(&s);
}
-int FB_CARG DebugServer::authenticate(Firebird::IStatus* status, IServerBlock* sb,
- IWriter* writerInterface)
+int DebugServer::authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sb,
+ Firebird::IWriter* writerInterface)
{
try
{
@@ -123,7 +121,7 @@
return AUTH_FAILED;
}
-int FB_CARG DebugServer::release()
+int DebugServer::release()
{
if (--refCounter == 0)
{
@@ -138,7 +136,7 @@
: str(getPool())
{ }
-int FB_CARG DebugClient::authenticate(Firebird::IStatus* status, IClientBlock* cb)
+int DebugClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb)
{
try
{
@@ -185,7 +183,7 @@
return AUTH_FAILED;
}
-int FB_CARG DebugClient::release()
+int DebugClient::release()
{
if (--refCounter == 0)
{
Modified: firebird/trunk/src/auth/AuthDbg.h
===================================================================
--- firebird/trunk/src/auth/AuthDbg.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/AuthDbg.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -34,8 +34,7 @@
#ifdef AUTH_DEBUG
-#include "firebird/Auth.h"
-#include "firebird/Plugin.h"
+#include "firebird/Interface.h"
#include "../common/classes/ImplementHelper.h"
#include "../common/classes/ClumpletWriter.h"
#include "../common/classes/init.h"
@@ -47,13 +46,13 @@
// 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<IServer, FB_AUTH_SERVER_VERSION>
+class DebugServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ServerImpl<DebugServer> >
{
public:
explicit DebugServer(Firebird::IPluginConfig*);
- int authenticate(Firebird::IStatus* status, IServerBlock* sBlock,
- IWriter* writerInterface);
+ int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock,
+ Firebird::IWriter* writerInterface);
int release();
private:
@@ -61,12 +60,12 @@
Firebird::RefPtr<Firebird::IConfig> config;
};
-class DebugClient FB_FINAL : public Firebird::StdPlugin<IClient, FB_AUTH_CLIENT_VERSION>
+class DebugClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ClientImpl<DebugClient> >
{
public:
DebugClient(Firebird::IPluginConfig*);
- int authenticate(Firebird::IStatus* status, IClientBlock* sBlock);
+ int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock);
int release();
private:
Modified: firebird/trunk/src/auth/SecureRemotePassword/Message.h
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/Message.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/Message.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -2,13 +2,14 @@
#define INTERNAL_FIREBIRD
#endif
-#include "firebird/Provider.h"
+#include "firebird/Interface.h"
#ifdef INTERNAL_FIREBIRD
#include "../common/classes/alloc.h"
#include "../common/StatusHolder.h"
#include "../common/classes/ImplementHelper.h"
+#include "../dsql/sqlda_pub.h"
#else // INTERNAL_FIREBIRD
Modified: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -34,7 +34,7 @@
namespace Auth {
-class SrpClient FB_FINAL : public StdPlugin<IClient, FB_AUTH_CLIENT_VERSION>
+class SrpClient FB_FINAL : public StdPlugin<Api::ClientImpl<SrpClient> >
{
public:
explicit SrpClient(IPluginConfig*)
@@ -43,8 +43,8 @@
{ }
// IClient implementation
- int FB_CARG authenticate(IStatus*, IClientBlock* cb);
- int FB_CARG release();
+ int authenticate(IStatus*, IClientBlock* cb);
+ int release();
private:
RemotePassword* client;
@@ -75,7 +75,9 @@
client->genClientKey(data);
dumpIt("Clnt: clientPubKey", data);
cb->putData(status, data.length(), data.begin());
- return status->getStatus() & IStatus::FB_HAS_ERRORS ? AUTH_FAILED : AUTH_MORE_DATA;
+ if (status->getStatus() & IStatus::FB_HAS_ERRORS)
+ return AUTH_FAILED;
+ return AUTH_MORE_DATA;
}
HANDSHAKE_DEBUG(fprintf(stderr, "Cli: SRP phase2\n"));
@@ -164,7 +166,7 @@
void registerSrpClient(IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(PluginType::AuthClient, RemotePassword::plugName, &factory);
+ iPlugin->registerPluginFactory(IPluginManager::AuthClient, RemotePassword::plugName, &factory);
}
} // namespace Auth
Modified: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -27,7 +27,7 @@
#ifndef AUTH_SRP_CLIENT_H
#define AUTH_SRP_CLIENT_H
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
namespace Auth {
Modified: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -29,16 +29,16 @@
#include "../common/classes/ImplementHelper.h"
#include "../common/classes/ClumpletWriter.h"
#include "../common/StatusHolder.h"
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
#include "../auth/SecureRemotePassword/srp.h"
#include "../jrd/constants.h"
+#include "../jrd/inf_pub.h"
#include "../utilities/gsec/gsec.h"
#include "../auth/SecureRemotePassword/Message.h"
#include "../common/classes/auto.h"
namespace {
-Firebird::MakeUpgradeInfo<> upInfo;
const unsigned int INIT_KEY = ((~0) - 1);
unsigned int secDbKey = INIT_KEY;
@@ -52,7 +52,7 @@
namespace Auth {
-class SrpManagement FB_FINAL : public Firebird::StdPlugin<IManagement, FB_AUTH_MANAGE_VERSION>
+class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ManagementImpl<SrpManagement> >
{
public:
explicit SrpManagement(Firebird::IPluginConfig* par)
@@ -126,7 +126,7 @@
}
}
- void grantRevokeAdmin(Auth::IUser* user, bool ignoreRevoke = false)
+ void grantRevokeAdmin(Firebird::IUser* user, bool ignoreRevoke = false)
{
if (!user->admin()->entered())
{
@@ -185,12 +185,10 @@
public:
// IManagement implementation
- void FB_CARG start(Firebird::IStatus* status, ILogonInfo* logonInfo)
+ void start(Firebird::IStatus* status, Firebird::ILogonInfo* logonInfo)
{
try
{
- Firebird::MasterInterfacePtr()->upgradeInterface(logonInfo, FB_AUTH_LOGON_INFO_VERSION, upInfo);
-
status->init();
if (att)
@@ -257,16 +255,10 @@
}
}
- int FB_CARG execute(Firebird::IStatus* status, IUser* user, IListUsers* callback)
+ int execute(Firebird::IStatus* status, Firebird::IUser* user, Firebird::IListUsers* callback)
{
try
{
- if (callback)
- {
- Firebird::MasterInterfacePtr()->upgradeInterface(callback, FB_AUTH_LIST_USERS_VERSION, upInfo);
- }
- Firebird::MasterInterfacePtr()->upgradeInterface(user, FB_AUTH_USER_VERSION, upInfo);
-
status->init();
fb_assert(att);
@@ -608,7 +600,7 @@
return 0;
}
- void FB_CARG commit(Firebird::IStatus* status)
+ void commit(Firebird::IStatus* status)
{
if (tra)
{
@@ -620,7 +612,7 @@
}
}
- void FB_CARG rollback(Firebird::IStatus* status)
+ void rollback(Firebird::IStatus* status)
{
if (tra)
{
@@ -632,7 +624,7 @@
}
}
- int FB_CARG release()
+ int release()
{
if (--refCounter == 0)
{
@@ -697,7 +689,7 @@
}
}
- static void setField(Varfield& to, Auth::ICharUserField* from)
+ static void setField(Varfield& to, Firebird::ICharUserField* from)
{
if (from->entered())
{
@@ -709,7 +701,7 @@
}
}
- static void setField(Boolean& to, Auth::IIntUserField* from)
+ static void setField(Boolean& to, Firebird::IIntUserField* from)
{
if (from->entered())
{
@@ -721,7 +713,7 @@
}
}
- void setField(Firebird::IStatus* st, Blob& to, Auth::ICharUserField* from)
+ void setField(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from)
{
if (from->entered())
{
@@ -733,7 +725,7 @@
}
}
- static void allocField(Auth::IUserField* value, Firebird::string& update, const char* name)
+ static void allocField(Firebird::IUserField* value, Firebird::string& update, const char* name)
{
if (value->entered() || value->specified())
{
@@ -744,7 +736,7 @@
}
template <typename FT>
- static void allocField(Firebird::AutoPtr<FT>& field, Message& up, Auth::IUserField* value)
+ static void allocField(Firebird::AutoPtr<FT>& field, Message& up, Firebird::IUserField* value)
{
if (value->entered() || value->specified())
{
@@ -752,7 +744,7 @@
}
}
- static void assignField(Firebird::AutoPtr<Varfield>& field, Auth::ICharUserField* name)
+ static void assignField(Firebird::AutoPtr<Varfield>& field, Firebird::ICharUserField* name)
{
if (field.hasData())
{
@@ -768,7 +760,7 @@
}
}
- static void assignField(Firebird::AutoPtr<Boolean>& field, Auth::IIntUserField* name)
+ static void assignField(Firebird::AutoPtr<Boolean>& field, Firebird::IIntUserField* name)
{
if (field.hasData())
{
@@ -784,7 +776,7 @@
}
}
- void assignField(Firebird::IStatus* st, Firebird::AutoPtr<Blob>& field, Auth::ICharUserField* name)
+ void assignField(Firebird::IStatus* st, Firebird::AutoPtr<Blob>& field, Firebird::ICharUserField* name)
{
if (field.hasData())
{
@@ -801,7 +793,7 @@
}
}
- static void listField(Auth::ICharUserField* to, Varfield& from)
+ static void listField(Firebird::ICharUserField* to, Varfield& from)
{
Firebird::LocalStatus st;
to->setEntered(&st, from.null ? 0 : 1);
@@ -813,7 +805,7 @@
}
}
- static void listField(Auth::IIntUserField* to, Boolean& from)
+ static void listField(Firebird::IIntUserField* to, Boolean& from)
{
Firebird::LocalStatus st;
to->setEntered(&st, from.null ? 0 : 1);
@@ -825,7 +817,7 @@
}
}
- void listField(Auth::ICharUserField* to, Blob& from)
+ void listField(Firebird::ICharUserField* to, Blob& from)
{
Firebird::LocalStatus st;
to->setEntered(&st, from.null ? 0 : 1);
@@ -836,7 +828,7 @@
Firebird::IBlob* blob = NULL;
try
{
- blob = att->openBlob(&st, tra, &from);
+ blob = att->openBlob(&st, tra, &from, 0, NULL);
check(&st);
char segbuf[256];
@@ -865,7 +857,7 @@
}
}
- void blobWrite(Firebird::IStatus* st, Blob& to, Auth::ICharUserField* from)
+ void blobWrite(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from)
{
to.null = FB_FALSE;
const char* ptr = from->get();
@@ -874,7 +866,7 @@
Firebird::IBlob* blob = NULL;
try
{
- blob = att->createBlob(st, tra, &to);
+ blob = att->createBlob(st, tra, &to, 0, NULL);
check(st);
blob->putSegment(st, l, ptr);
@@ -900,6 +892,6 @@
extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
{
Firebird::CachedMasterInterface::set(master);
- Firebird::PluginManagerInterfacePtr()->registerPluginFactory(Firebird::PluginType::AuthUserManagement, Auth::RemotePassword::plugName, &Auth::factory);
- Firebird::myModule->registerMe();
+ Firebird::PluginManagerInterfacePtr()->registerPluginFactory(Firebird::IPluginManager::AuthUserManagement, Auth::RemotePassword::plugName, &Auth::factory);
+ Firebird::getUnloadDetector()->registerMe();
}
Modified: firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -32,7 +32,7 @@
#include "../common/classes/ClumpletWriter.h"
#include "../auth/SecureRemotePassword/Message.h"
-#include "../jrd/EngineInterface.h"
+#include "../jrd/constants.h"
using namespace Firebird;
@@ -43,14 +43,12 @@
const unsigned int SZ_LOGIN = 31;
-MakeUpgradeInfo<> upInfo;
-
}
namespace Auth {
-class SrpServer FB_FINAL : public StdPlugin<IServer, FB_AUTH_SERVER_VERSION>
+class SrpServer FB_FINAL : public StdPlugin<Api::ServerImpl<SrpServer> >
{
public:
explicit SrpServer(IPluginConfig* par)
@@ -65,8 +63,8 @@
}
// IServer implementation
- int FB_CARG authenticate(IStatus* status, IServerBlock* sBlock, IWriter* writerInterface);
- int FB_CARG release();
+ int authenticate(IStatus* status, IServerBlock* sBlock, IWriter* writerInterface);
+ int release();
private:
RemotePassword* server;
@@ -248,7 +246,6 @@
BigInteger serverProof = server->clientProof(account.c_str(), salt.c_str(), sessionKey);
if (clientProof == serverProof)
{
- MasterInterfacePtr()->upgradeInterface(writerInterface, FB_AUTH_WRITER_VERSION, upInfo);
writerInterface->add(status, account.c_str());
if (status->getStatus() & IStatus::FB_HAS_ERRORS)
{
@@ -288,7 +285,7 @@
void registerSrpServer(IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(PluginType::AuthServer, RemotePassword::plugName, &factory);
+ iPlugin->registerPluginFactory(IPluginManager::AuthServer, RemotePassword::plugName, &factory);
}
} // namespace Auth
Modified: firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.h
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -27,7 +27,7 @@
#ifndef AUTH_SRP_SERVER_H
#define AUTH_SRP_SERVER_H
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
namespace Auth {
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -35,7 +35,7 @@
namespace Auth {
-int SecurityDatabaseClient::authenticate(Firebird::IStatus* status, IClientBlock* cb)
+int SecurityDatabaseClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb)
{
// fprintf(stderr, "Clnt: Legacy: lgn=%s pswd=%s\n", cb->getLogin(), cb->getPassword());
if (!(cb->getLogin() && cb->getPassword()))
@@ -43,8 +43,8 @@
return AUTH_CONTINUE;
}
- TEXT pwt[Auth::MAX_LEGACY_PASSWORD_LENGTH + 2];
- ENC_crypt(pwt, sizeof pwt, cb->getPassword(), Auth::LEGACY_PASSWORD_SALT);
+ TEXT pwt[MAX_LEGACY_PASSWORD_LENGTH + 2];
+ ENC_crypt(pwt, sizeof pwt, cb->getPassword(), LEGACY_PASSWORD_SALT);
cb->putData(status, static_cast<unsigned>(strlen(&pwt[2])), &pwt[2]);
if (status->getStatus() & Firebird::IStatus::FB_HAS_ERRORS)
{
@@ -70,7 +70,7 @@
void registerLegacyClient(Firebird::IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthClient, "Legacy_Auth", &factory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthClient, "Legacy_Auth", &factory);
}
} // namespace Auth
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -27,7 +27,7 @@
#ifndef AUTH_LEGACY_CLIENT_H
#define AUTH_LEGACY_CLIENT_H
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
#include "../common/classes/ImplementHelper.h"
namespace Auth {
@@ -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<IClient, FB_AUTH_CLIENT_VERSION>
+class SecurityDatabaseClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ClientImpl<SecurityDatabaseClient> >
{
public:
explicit SecurityDatabaseClient(Firebird::IPluginConfig*)
@@ -43,8 +43,8 @@
}
// IClient implementation
- int FB_CARG authenticate(Firebird::IStatus*, IClientBlock* data);
- int FB_CARG release();
+ int authenticate(Firebird::IStatus*, Firebird::IClientBlock* data);
+ int release();
};
void registerLegacyClient(Firebird::IPluginManager* iPlugin);
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -41,17 +41,15 @@
#include "../common/classes/ImplementHelper.h"
#include "../common/classes/ClumpletWriter.h"
#include "../common/StatusHolder.h"
-#include "firebird/Plugin.h"
+#include "firebird/Interface.h"
-static Firebird::MakeUpgradeInfo<> upInfo;
-
// Here we use version-independent symbolic link (or copy) of actual database
DATABASE database = STATIC FILENAME "security.fdb";
static Firebird::GlobalPtr<Firebird::Mutex> execLineMutex; // protects various gpre generated structures
static bool grantRevokeAdmin(ISC_STATUS* isc_status, FB_API_HANDLE database, FB_API_HANDLE trans,
- Auth::IUser* user)
+ Firebird::IUser* user)
{
if (!user->admin()->entered())
{
@@ -113,12 +111,10 @@
check(&s);
}
-void FB_CARG SecurityDatabaseManagement::start(Firebird::IStatus* st, ILogonInfo* logonInfo)
+void SecurityDatabaseManagement::start(Firebird::IStatus* st, Firebird::ILogonInfo* logonInfo)
{
try
{
- Firebird::MasterInterfacePtr()->upgradeInterface(logonInfo, FB_AUTH_LOGON_INFO_VERSION, upInfo);
-
st->init();
if (secDbKey == INIT_KEY)
@@ -169,7 +165,7 @@
}
}
-void FB_CARG SecurityDatabaseManagement::commit(Firebird::IStatus* st)
+void SecurityDatabaseManagement::commit(Firebird::IStatus* st)
{
try
{
@@ -190,7 +186,7 @@
}
}
-void FB_CARG SecurityDatabaseManagement::rollback(Firebird::IStatus* st)
+void SecurityDatabaseManagement::rollback(Firebird::IStatus* st)
{
try
{
@@ -211,7 +207,7 @@
}
}
-int FB_CARG SecurityDatabaseManagement::release()
+int SecurityDatabaseManagement::release()
{
if (--refCounter == 0)
{
@@ -236,7 +232,7 @@
strncpy(to, from, len);
}
-int FB_CARG SecurityDatabaseManagement::execute(Firebird::IStatus* st, IUser* user, IListUsers* callback)
+int SecurityDatabaseManagement::execute(Firebird::IStatus* st, Firebird::IUser* user, Firebird::IListUsers* callback)
{
/*************************************
*
@@ -302,8 +298,6 @@
try
{
- Firebird::MasterInterfacePtr()->upgradeInterface(user, FB_AUTH_USER_VERSION, upInfo);
-
ISC_STATUS_ARRAY isc_status;
fb_utils::init_status(isc_status);
st->init();
@@ -765,6 +759,6 @@
extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
{
Firebird::CachedMasterInterface::set(master);
- Firebird::PluginManagerInterfacePtr()->registerPluginFactory(Firebird::PluginType::AuthUserManagement, "Legacy_UserManager", &factory);
- Firebird::myModule->registerMe();
+ Firebird::PluginManagerInterfacePtr()->registerPluginFactory(Firebird::IPluginManager::AuthUserManagement, "Legacy_UserManager", &factory);
+ Firebird::getUnloadDetector()->registerMe();
}
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -28,23 +28,23 @@
#define AUTH_LEGACY_MANAGEMENT_H
#include "../common/classes/ImplementHelper.h"
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
namespace Auth {
-class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<IManagement, FB_AUTH_MANAGE_VERSION>
+class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ManagementImpl<SecurityDatabaseManagement> >
{
public:
explicit SecurityDatabaseManagement(Firebird::IPluginConfig* par);
// IManagement implementation
- void FB_CARG start(Firebird::IStatus* status, ILogonInfo* logonInfo);
- int FB_CARG execute(Firebird::IStatus* status, IUser* user, IListUsers* callback);
- void FB_CARG commit(Firebird::IStatus* status);
- void FB_CARG rollback(Firebird::IStatus* status);
+ 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);
- int FB_CARG release();
+ int release();
private:
Firebird::RefPtr<Firebird::IFirebirdConf> config;
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -41,7 +41,7 @@
#include "../common/classes/objects_array.h"
#include "../common/classes/init.h"
#include "../common/classes/ImplementHelper.h"
-#include "firebird/Timer.h"
+#include "firebird/Interface.h"
#include "../remote/remot_proto.h"
@@ -51,8 +51,6 @@
namespace {
-MakeUpgradeInfo<> upInfo;
-
// BLR to search database for user name record
const UCHAR PWD_REQUEST[] =
@@ -126,7 +124,7 @@
namespace Auth {
-class SecurityDatabase FB_FINAL : public Firebird::RefCntIface<Firebird::ITimer, FB_TIMER_VERSION>
+class SecurityDatabase FB_FINAL : public Firebird::RefCntIface<Firebird::Api::TimerImpl<SecurityDatabase> >
{
public:
int verify(IWriter* authBlock, IServerBlock* sBlock);
@@ -151,9 +149,9 @@
}
// ITimer implementation
- void FB_CARG handler();
+ void handler();
- int FB_CARG release()
+ int release()
{
if (--refCounter == 0)
{
@@ -325,7 +323,7 @@
char pw1[MAX_LEGACY_PASSWORD_LENGTH + 1];
if (!lookup_user(login.c_str(), pw1))
{
- return AUTH_FAILED;
+ return IAuth::AUTH_FAILED;
}
pw1[MAX_LEGACY_PASSWORD_LENGTH] = 0;
string storedHash(pw1, MAX_LEGACY_PASSWORD_LENGTH);
@@ -346,20 +344,19 @@
}
if (!legacyHash)
{
- return AUTH_FAILED;
+ return IAuth::AUTH_FAILED;
}
}
LocalStatus s;
- MasterInterfacePtr()->upgradeInterface(authBlock, FB_AUTH_WRITER_VERSION, upInfo);
authBlock->add(&s, login.c_str());
check(&s);
authBlock->setDb(&s, secureDbName);
check(&s);
- return AUTH_SUCCESS;
+ return IAuth::AUTH_SUCCESS;
}
- return AUTH_CONTINUE;
+ return IAuth::AUTH_CONTINUE;
}
void SecurityDatabase::checkStatus(const char* callName, ISC_STATUS userError)
@@ -392,7 +389,7 @@
GlobalPtr<InstancesArray> instances;
GlobalPtr<Mutex> instancesMutex;
-void FB_CARG SecurityDatabase::handler()
+void SecurityDatabase::handler()
{
try
{
@@ -525,7 +522,7 @@
HANDSHAKE_DEBUG(fprintf(stderr, "LegacyServer: exception status %d\n", status->getStatus()));
HANDSHAKE_DEBUG(isc_print_status(status->getErrors()));
HANDSHAKE_DEBUG(isc_print_status(status->getWarnings()));
- return AUTH_FAILED;
+ return IAuth::AUTH_FAILED;
}
}
@@ -546,7 +543,7 @@
void registerLegacyServer(Firebird::IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthServer, "Legacy_Auth", &factory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthServer, "Legacy_Auth", &factory);
}
} // namespace Auth
@@ -558,9 +555,9 @@
{
CachedMasterInterface::set(master);
- myModule->setCleanup(Auth::SecurityDatabase::cleanup);
+ getUnloadDetector()->setCleanup(Auth::SecurityDatabase::cleanup);
Auth::registerLegacyServer(PluginManagerInterfacePtr());
- myModule->registerMe();
+ getUnloadDetector()->registerMe();
}
#endif // PLUG_MODULE
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -34,7 +34,7 @@
#include "../common/classes/ClumpletWriter.h"
#include "../common/classes/ImplementHelper.h"
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -43,7 +43,7 @@
namespace Auth {
-class SecurityDatabaseServer FB_FINAL : public Firebird::StdPlugin<IServer, FB_AUTH_SERVER_VERSION>
+class SecurityDatabaseServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::ServerImpl<SecurityDatabaseServer> >
{
public:
explicit SecurityDatabaseServer(Firebird::IPluginConfig* p)
@@ -51,8 +51,8 @@
{ }
// IServer implementation
- int FB_CARG authenticate(Firebird::IStatus* status, IServerBlock* sBlock, IWriter* writerInterface);
- int FB_CARG release();
+ int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
+ int release();
private:
Firebird::RefPtr<Firebird::IPluginConfig> iParameter;
Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/trusted/AuthSspi.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -71,8 +71,6 @@
*dataSize = strlen(name);
}
*/
-
- MakeUpgradeInfo<> upInfo;
}
namespace Auth {
@@ -365,7 +363,6 @@
bool wheel = false;
string login;
sspi.getLogin(login, wheel);
- MasterInterfacePtr()->upgradeInterface(writerInterface, FB_AUTH_WRITER_VERSION, upInfo);
writerInterface->add(status, login.c_str());
if (wheel)
@@ -443,12 +440,12 @@
void registerTrustedClient(Firebird::IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthClient, plugName, &clientFactory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthClient, plugName, &clientFactory);
}
void registerTrustedServer(Firebird::IPluginManager* iPlugin)
{
- iPlugin->registerPluginFactory(Firebird::PluginType::AuthServer, plugName, &serverFactory);
+ iPlugin->registerPluginFactory(Firebird::IPluginManager::AuthServer, plugName, &serverFactory);
}
} // namespace Auth
Modified: firebird/trunk/src/auth/trusted/AuthSspi.h
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/auth/trusted/AuthSspi.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -40,7 +40,7 @@
#include <../common/classes/array.h>
#include "../common/classes/ImplementHelper.h"
#include <../jrd/ibase.h>
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
#define SECURITY_WIN32
@@ -100,12 +100,12 @@
bool getLogin(Firebird::string& login, bool& wh);
};
-class WinSspiServer : public Firebird::StdPlugin<IServer, FB_AUTH_SERVER_VERSION>
+class WinSspiServer : public Firebird::StdPlugin<Firebird::Api::ServerImpl<WinSspiServer> >
{
public:
// IServer implementation
- int FB_CARG authenticate(Firebird::IStatus* status, IServerBlock* sBlock, IWriter* writerInterface);
- int FB_CARG release();
+ int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
+ int release();
WinSspiServer(Firebird::IPluginConfig*);
@@ -114,12 +114,12 @@
AuthSspi sspi;
};
-class WinSspiClient : public Firebird::StdPlugin<IClient, FB_AUTH_CLIENT_VERSION>
+class WinSspiClient : public Firebird::StdPlugin<Firebird::Api::ClientImpl<WinSspiClient> >
{
public:
// IClient implementation
- int FB_CARG authenticate(Firebird::IStatus* status, IClientBlock* sBlock);
- int FB_CARG release();
+ int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock);
+ int release();
WinSspiClient(Firebird::IPluginConfig*);
Modified: firebird/trunk/src/common/Auth.h
===================================================================
--- firebird/trunk/src/common/Auth.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/common/Auth.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -30,7 +30,7 @@
#ifndef FB_AUTH_H
#define FB_AUTH_H
-#include "firebird/Auth.h"
+#include "firebird/Interface.h"
#include "../common/classes/ClumpletWriter.h"
#include "../common/classes/init.h"
#include "../common/classes/array.h"
@@ -39,7 +39,7 @@
namespace Auth {
-class WriterImplementation : public Firebird::AutoIface<IWriter, FB_AUTH_WRITER_VERSION>
+class WriterImplementation : public Firebird::AutoIface<Firebird::Api::WriterImpl<WriterImplementation> >
{
public:
WriterImplementation();
@@ -48,10 +48,10 @@
void setPlugin(const char* m);
// IWriter implementation
- void FB_CARG reset();
- void FB_CARG add(Firebird::IStatus* st, const char* name);
- void FB_CARG setType(Firebird::IStatus* st, const char* value);
- void FB_CARG setDb(Firebird::IStatus* st, const char* value);
+ 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);
private:
Firebird::ClumpletWriter current, result;
Modified: firebird/trunk/src/common/MsgMetadata.cpp
===================================================================
--- firebird/trunk/src/common/MsgMetadata.cpp 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/common/MsgMetadata.cpp 2014-09-29 11:03:47 UTC (rev 60059)
@@ -44,7 +44,7 @@
msgMetadata->items.grow(fieldCount);
}
-int FB_CARG MetadataBuilder::release()
+int MetadataBuilder::release()
{
if (--refCounter != 0)
{
@@ -55,7 +55,7 @@
return 0;
}
-void FB_CARG MetadataBuilder::setType(IStatus* status, unsigned index, unsigned type)
+void MetadataBuilder::setType(IStatus* status, unsigned index, unsigned type)
{
try
{
@@ -81,7 +81,7 @@
}
}
-void FB_CARG MetadataBuilder::setSubType(IStatus* status, unsigned index, int subType)
+void MetadataBuilder::setSubType(IStatus* status, unsigned index, int subType)
{
try
{
@@ -96,7 +96,7 @@
}
}
-void FB_CARG MetadataBuilder::setLength(IStatus* status, unsigned index, unsigned length)
+void MetadataBuilder::setLength(IStatus* status, unsigned index, unsigned length)
{
try
{
@@ -114,7 +114,7 @@
}
}
-void FB_CARG MetadataBuilder::setCharSet(IStatus* status, unsigned index, unsigned charSet)
+void MetadataBuilder::setCharSet(IStatus* status, unsigned index, unsigned charSet)
{
try
{
@@ -129,7 +129,7 @@
}
}
-void FB_CARG MetadataBuilder::setScale(IStatus* status, unsigned index, unsigned scale)
+void MetadataBuilder::setScale(IStatus* status, unsigned index, unsigned scale)
{
try
{
@@ -144,7 +144,7 @@
}
}
-void FB_CARG MetadataBuilder::truncate(IStatus* status, unsigned count)
+void MetadataBuilder::truncate(IStatus* status, unsigned count)
{
try
{
@@ -161,7 +161,7 @@
}
}
-void FB_CARG MetadataBuilder::remove(IStatus* status, unsigned index)
+void MetadataBuilder::remove(IStatus* status, unsigned index)
{
try
{
@@ -177,7 +177,7 @@
}
}
-void FB_CARG MetadataBuilder::moveNameToIndex(IStatus* status, const char* name, unsigned index)
+void MetadataBuilder::moveNameToIndex(IStatus* status, const char* name, unsigned index)
{
try
{
@@ -206,7 +206,7 @@
}
}
-unsigned FB_CARG MetadataBuilder::addField(IStatus* status)
+unsigned MetadataBuilder::addField(IStatus* status)
{
try
{
@@ -224,7 +224,7 @@
}
}
-IMessageMetadata* FB_CARG MetadataBuilder::getMetadata(IStatus* status)
+IMessageMetadata* MetadataBuilder::getMetadata(IStatus* status)
{
try
{
@@ -386,7 +386,7 @@
return 0;
}
-
+/*
int AttMetadata::release()
{
if (--refCounter != 0)
@@ -396,6 +396,6 @@
delete this;
return 0;
-}
+}*/
} // namespace Firebird
Modified: firebird/trunk/src/common/MsgMetadata.h
===================================================================
--- firebird/trunk/src/common/MsgMetadata.h 2014-09-29 10:51:40 UTC (rev 60058)
+++ firebird/trunk/src/common/MsgMetadata.h 2014-09-29 11:03:47 UTC (rev 60059)
@@ -25,7 +25,7 @@
#ifndef COMMON_MSG_METADATA_H
#define COMMON_MSG_METADATA_H
-#include "firebird/Provider.h"
+#include "firebird/Interface.h"
#include "iberror.h"
#include "../common/classes/fb_string.h"
#include "../common/classes/objects_array.h"
@@ -38,7 +38,7 @@
class StatementMetadata;
class MetadataFromBlr;
-class MsgMetadata : public RefCntIface<IMessageMetadata, FB_MESSAGE_METADATA_VERSION>
+class MsgMetadata : public RefCntIface<Api::MessageMetadataImpl<MsgMetadata> >
{
friend class MetadataBuilder;
friend class StatementMetadata;
@@ -138,14 +138,14 @@
}
// IMessageMetadata implementation
- virtual int FB_CARG release();
+ int release();
- virtual unsigned FB_CARG getCount(IStatus* /*status*/)
+ unsigned getCount(IStatus* /*status*/)
{
return (unsigned) items.getCount();
}
- virtual const char* FB_CARG getField(IStatus* status, unsigned index)
+ const char* getField(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].field.c_str();
@@ -154,7 +154,7 @@
return NULL;
}
- virtual const char* FB_CARG getRelation(IStatus* status, unsigned index)
+ const char* getRelation(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].relation.c_str();
@@ -163,7 +163,7 @@
return NULL;
}
- virtual const char* FB_CARG getOwner(IStatus* status, unsigned index)
+ const char* getOwner(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].owner.c_str();
@@ -172,7 +172,7 @@
return NULL;
}
- virtual const char* FB_CARG getAlias(IStatus* status, unsigned index)
+ const char* getAlias(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].alias.c_str();
@@ -181,7 +181,7 @@
return NULL;
}
- virtual unsigned FB_CARG getType(IStatus* status, unsigned index)
+ unsigned getType(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].type;
@@ -190,7 +190,7 @@
return 0;
}
- virtual FB_BOOLEAN FB_CARG isNullable(IStatus* status, unsigned index)
+ FB_BOOLEAN isNullable(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].nullable;
@@ -199,7 +199,7 @@
return false;
}
- virtual int FB_CARG getSubType(IStatus* status, unsigned index)
+ int getSubType(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].subType;
@@ -208,7 +208,7 @@
return 0;
}
- virtual unsigned FB_CARG getLength(IStatus* status, unsigned index)
+ unsigned getLength(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].length;
@@ -217,7 +217,7 @@
return 0;
}
- virtual int FB_CARG getScale(IStatus* status, unsigned index)
+ int getScale(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].scale;
@@ -226,7 +226,7 @@
return 0;
}
- virtual unsigned FB_CARG getCharSet(IStatus* status, unsigned index)
+ unsigned getCharSet(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].charSet;
@@ -235,7 +235,7 @@
return 0;
}
- virtual unsigned FB_CARG getOffset(IStatus* status, unsigned index)
+ unsigned getOffset(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].offset;
@@ -244,7 +244,7 @@
return 0;
}
- virtual unsigned FB_CARG getNullOffset(IStatus* status, unsigned index)
+ unsigned getNullOffset(IStatus* status, unsigned index)
{
if (index < items.getCount())
return items[index].nullInd;
@@ -253,9 +253,9 @@
return 0;
}
- virtual IMetadataBuilder* FB_CARG getBuilder(IStatus* status);
+ IMetadataBuilder* getBuilder(IStatus* status);
- virtual unsigned FB_CARG getMessageLength(IStatus* /*status*/)
+ unsigned getMessageLength(IStatus* /*status*/)
{
return length;
}
@@ -278,39 +278,39 @@
unsigned length;
};
+//class AttMetadata : public Api::MessageMetadataBaseImpl<AttMetadata, MsgMetadata>
class AttMetadata : public MsgMetadata
{
public:
explicit AttMetadata(RefCounted* att)
- : MsgMetadata(),
- attachment(att)
+ : attachment(att)
{ }
// re-implement here release() present in MsgMetadata to call correct dtor
- virtual int FB_CARG release();
+ //virtual int release();
RefPtr<RefCounted> attachment;
};
-class MetadataBuilder FB_FINAL : public RefCntIface<IMetadataBuilder, FB_METADATA_BUILDER_VERSION>
+class MetadataBuilder FB_FINAL : public RefCntIface<Api::MetadataBuilderImpl<MetadataBuilder> >
{
public:
explicit MetadataBuilder(const MsgMetadata* from);
MetadataBuilder(unsigned fieldCount);
- virtu...
[truncated message content] |