From: <asf...@us...> - 2011-06-02 17:24:04
|
Revision: 53093 http://firebird.svn.sourceforge.net/firebird/?rev=53093&view=rev Author: asfernandes Date: 2011-06-02 15:57:08 +0000 (Thu, 02 Jun 2011) Log Message: ----------- Move v3 public include files to src/include/firebird. Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/auth/AuthInterface.h firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp firebird/trunk/src/auth/trusted/AuthSspi.cpp firebird/trunk/src/common/StatementMetadata.h firebird/trunk/src/common/StatusHolder.h firebird/trunk/src/common/classes/ImplementHelper.h firebird/trunk/src/common/config/config.cpp firebird/trunk/src/common/fb_exception.cpp firebird/trunk/src/common/utils_proto.h firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp firebird/trunk/src/jrd/EngineInterface.h firebird/trunk/src/jrd/ErrorImpl.h firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/jrd/blb.h firebird/trunk/src/jrd/event.h firebird/trunk/src/jrd/jrd.h firebird/trunk/src/jrd/ntrace.h firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/remote/remote.cpp firebird/trunk/src/remote/server/os/posix/inet_server.cpp firebird/trunk/src/remote/server/os/win32/srvr_w32.cpp firebird/trunk/src/yvalve/MasterImplementation.cpp firebird/trunk/src/yvalve/MasterImplementation.h firebird/trunk/src/yvalve/PluginManager.h firebird/trunk/src/yvalve/YObjects.h firebird/trunk/src/yvalve/gds.cpp firebird/trunk/src/yvalve/why.cpp Added Paths: ----------- firebird/trunk/src/include/firebird/ firebird/trunk/src/include/firebird/ExternalEngine.h firebird/trunk/src/include/firebird/Interface.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/UdrCppEngine.h firebird/trunk/src/include/firebird/UdrEngine.h Removed Paths: ------------- firebird/trunk/src/include/FirebirdExternalApi.h firebird/trunk/src/include/FirebirdPluginApi.h firebird/trunk/src/include/FirebirdUdr.h firebird/trunk/src/include/FirebirdUdrCpp.h firebird/trunk/src/include/Interface.h firebird/trunk/src/include/ProviderInterface.h firebird/trunk/src/include/Timer.h Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -21,7 +21,7 @@ */ #include "ibase.h" -#include "FirebirdUdrCpp.h" +#include "firebird/UdrCppEngine.h" #include <assert.h> #include <stdio.h> Modified: firebird/trunk/src/auth/AuthInterface.h =================================================================== --- firebird/trunk/src/auth/AuthInterface.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/auth/AuthInterface.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -29,7 +29,7 @@ #ifndef FB_AUTH_INTERFACE #define FB_AUTH_INTERFACE -#include "FirebirdPluginApi.h" +#include "firebird/Plugin.h" namespace Firebird { class IStatus; Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2011-06-02 15:57:08 UTC (rev 53093) @@ -40,7 +40,7 @@ #include "../auth/SecurityDatabase/LegacyManagement.h" #include "../common/classes/ImplementHelper.h" #include "../common/classes/ClumpletWriter.h" -#include "FirebirdPluginApi.h" +#include "firebird/Plugin.h" // Here we use version-independent symbolic link (or copy) of actual database DATABASE database = STATIC FILENAME "security.fdb"; Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -43,7 +43,7 @@ #include "../common/classes/objects_array.h" #include "../common/classes/init.h" #include "../common/classes/ImplementHelper.h" -#include "Timer.h" +#include "firebird/Timer.h" using namespace Firebird; Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp =================================================================== --- firebird/trunk/src/auth/trusted/AuthSspi.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/auth/trusted/AuthSspi.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -30,7 +30,7 @@ #ifdef TRUSTED_AUTH #include "../common/classes/ClumpletReader.h" -#include "Interface.h" +#include "firebird/Interface.h" #include "../common/classes/ImplementHelper.h" using namespace Firebird; Modified: firebird/trunk/src/common/StatementMetadata.h =================================================================== --- firebird/trunk/src/common/StatementMetadata.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/StatementMetadata.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -24,7 +24,7 @@ #ifndef COMMON_STATEMENT_METADATA_H #define COMMON_STATEMENT_METADATA_H -#include "ProviderInterface.h" +#include "firebird/Provider.h" #include "iberror.h" #include "../common/classes/Nullable.h" #include "../common/classes/array.h" Modified: firebird/trunk/src/common/StatusHolder.h =================================================================== --- firebird/trunk/src/common/StatusHolder.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/StatusHolder.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -29,7 +29,7 @@ #ifndef FB_STATUS_HOLDER #define FB_STATUS_HOLDER -#include "ProviderInterface.h" +#include "firebird/Provider.h" #include "../common/utils_proto.h" #include "../common/classes/ImplementHelper.h" Modified: firebird/trunk/src/common/classes/ImplementHelper.h =================================================================== --- firebird/trunk/src/common/classes/ImplementHelper.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/classes/ImplementHelper.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -29,9 +29,9 @@ #ifndef FB_COMMON_CLASSES_IMPLEMENT_HELPER #define FB_COMMON_CLASSES_IMPLEMENT_HELPER -#include "FirebirdPluginApi.h" -#include "Timer.h" -#include "ProviderInterface.h" +#include "firebird/Plugin.h" +#include "firebird/Timer.h" +#include "firebird/Provider.h" #include "../common/classes/alloc.h" #include "gen/iberror.h" #include "../yvalve/gds_proto.h" Modified: firebird/trunk/src/common/config/config.cpp =================================================================== --- firebird/trunk/src/common/config/config.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/config/config.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -28,7 +28,7 @@ #include "../common/classes/init.h" #include "../common/dllinst.h" #include "../common/os/fbsyslog.h" -#include "FirebirdPluginApi.h" +#include "firebird/Plugin.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> Modified: firebird/trunk/src/common/fb_exception.cpp =================================================================== --- firebird/trunk/src/common/fb_exception.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/fb_exception.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,6 +1,6 @@ #include "firebird.h" -#include "ProviderInterface.h" +#include "firebird/Provider.h" #include <string.h> #include <errno.h> Modified: firebird/trunk/src/common/utils_proto.h =================================================================== --- firebird/trunk/src/common/utils_proto.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/common/utils_proto.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -33,7 +33,7 @@ #include "../common/classes/fb_string.h" #include "../common/classes/array.h" #include "gen/iberror.h" -#include "ProviderInterface.h" +#include "firebird/Provider.h" #ifdef SFIO #include <stdio.h> Modified: firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp =================================================================== --- firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-06-02 15:57:08 UTC (rev 53093) @@ -670,7 +670,7 @@ return false; } -#include "Interface.h" +#include "firebird/Interface.h" using namespace Firebird; Deleted: firebird/trunk/src/include/FirebirdExternalApi.h =================================================================== --- firebird/trunk/src/include/FirebirdExternalApi.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/FirebirdExternalApi.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,205 +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, based on previous work done - * by Eugeney Putilin <evgeneyputilin at mail.ru>, - * Vlad Khorsun <hvlad at users.sourceforge.net> and - * Roman Rokytskyy <roman at rokytskyy.de>. - * - * Copyright (c) 2008 Adriano dos Santos Fernandes <adr...@uo...> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - * Eugeney Putilin <evgeneyputilin at mail.ru> - * Vlad Khorsun <hvlad at users.sourceforge.net> - * Roman Rokytskyy <roman at rokytskyy.de> - */ - -#ifndef FIREBIRD_EXTERNAL_API_H -#define FIREBIRD_EXTERNAL_API_H - -#include "FirebirdApi.h" -#include "FirebirdPluginApi.h" -#include "ProviderInterface.h" - - -namespace Firebird { - -class ExternalEngine; - - -const int EXTERNAL_VERSION_1 = 1; - - -// Connection to current database in external engine. -// Context passed to ExternalEngine has SYSDBA privileges. -// Context passed to ExternalFunction, ExternalProcedure and ExternalTrigger -// has user privileges. -// There is one ExternalContext per attachment. The privileges and character -// set properties are changed during the calls. -class ExternalContext -{ -public: - // Gets the ExternalEngine associated with this context. - virtual ExternalEngine* FB_CALL getEngine(Error* error) = 0; - - // Gets the Attachment associated with this context. - virtual IAttachment* FB_CALL getAttachment(Error* error) = 0; - - // Obtained transaction is valid only before control is returned to the engine - // or in ExternalResultSet::fetch calls of correspondent ExternalProcedure::open. - virtual ITransaction* FB_CALL getTransaction(Error* error) = 0; - - virtual const char* FB_CALL getUserName() = 0; - virtual const char* FB_CALL getDatabaseName() = 0; - - // Get user attachment character set. - virtual const Utf8* FB_CALL getClientCharSet() = 0; - - // Misc info associated with a context. The pointers are never accessed or freed by Firebird. - - // Obtains an unique (across all contexts) code to associate plugin and/or user information. - virtual int FB_CALL obtainInfoCode() = 0; - // Gets a value associated with this code or FB_NULL if no value was set. - virtual void* FB_CALL getInfo(int code) = 0; - // Sets a value associated with this code and returns the last value. - virtual void* FB_CALL setInfo(int code, void* value) = 0; -}; - - -// To return set of rows in selectable procedures. -class ExternalResultSet : public Disposable -{ -public: - virtual bool FB_CALL fetch(Error* error) = 0; -}; - - -class ExternalFunction : public Disposable -{ -public: - // This method is called just before execute and informs the engine our requested character - // set for data exchange inside that method. - // During this call, the context uses the character set obtained from ExternalEngine::getCharSet. - virtual void FB_CALL getCharSet(Error* error, ExternalContext* context, - Utf8* name, uint nameSize) = 0; - - virtual void FB_CALL execute(Error* error, ExternalContext* context, - UCHAR* inMsg, UCHAR* outMsg) = 0; -}; - - -class ExternalProcedure : public Disposable -{ -public: - // This method is called just before open and informs the engine our requested character - // set for data exchange inside that method and ExternalResultSet::fetch. - // During this call, the context uses the character set obtained from ExternalEngine::getCharSet. - virtual void FB_CALL getCharSet(Error* error, ExternalContext* context, - Utf8* name, uint nameSize) = 0; - - // Returns a ExternalResultSet for selectable procedures. - // Returning NULL results in a result set of one record. - // Procedures without output parameters should return NULL. - virtual ExternalResultSet* FB_CALL open(Error* error, ExternalContext* context, - UCHAR* inMsg, UCHAR* outMsg) = 0; -}; - - -class ExternalTrigger : public Disposable -{ -public: - enum Type - { - TYPE_BEFORE = 1, - TYPE_AFTER, - TYPE_DATABASE - }; - - enum Action - { - ACTION_INSERT = 1, - ACTION_UPDATE, - ACTION_DELETE, - ACTION_CONNECT, - ACTION_DISCONNECT, - ACTION_TRANS_START, - ACTION_TRANS_COMMIT, - ACTION_TRANS_ROLLBACK, - ACTION_DDL - }; - -public: - // This method is called just before execute and informs the engine our requested character - // set for data exchange inside that method. - // During this call, the context uses the character set obtained from ExternalEngine::getCharSet. - virtual void FB_CALL getCharSet(Error* error, ExternalContext* context, - Utf8* name, uint nameSize) = 0; - - virtual void FB_CALL execute(Error* error, ExternalContext* context, - Action action, UCHAR* oldMsg, UCHAR* newMsg) = 0; -}; - - -class IRoutineMetadata : public IVersioned -{ -public: - virtual const char* FB_CARG getPackage(IStatus* status) const = 0; - virtual const char* FB_CARG getName(IStatus* status) const = 0; - virtual const char* FB_CARG getEntryPoint(IStatus* status) const = 0; - virtual const char* FB_CARG getBody(IStatus* status) const = 0; - virtual const IParametersMetadata* FB_CARG getInputParameters(IStatus* status) const = 0; - virtual const IParametersMetadata* FB_CARG getOutputParameters(IStatus* status) const = 0; - virtual const IParametersMetadata* FB_CARG getTriggerFields(IStatus* status) const = 0; - virtual const char* FB_CARG getTriggerTable(IStatus* status) const = 0; - virtual ExternalTrigger::Type FB_CARG getTriggerType(IStatus* status) const = 0; -}; -#define FB_ROUTINE_METADATA_VERSION (FB_VERSIONED_VERSION + 9) - - -// In SuperServer, shared by all attachments to one database and disposed when last (non-external) -// user attachment to the database is closed. -class ExternalEngine : public IPluginBase -{ -public: - virtual int FB_CALL getVersion(Error* error) = 0; - - // This method is called once (per ExternalEngine instance) before any following methods. - // The requested character set for data exchange inside methods of this interface should - // be copied to charSet parameter. - // During this call, the context uses the UTF-8 character set. - virtual void FB_CALL open(Error* error, ExternalContext* context, - Utf8* charSet, uint charSetSize) = 0; - - // Attachment is being opened. - virtual void FB_CALL openAttachment(Error* error, ExternalContext* context) = 0; - - // Attachment is being closed. - virtual void FB_CALL closeAttachment(Error* error, ExternalContext* context) = 0; - - // Called when engine wants to load object in the cache. Objects are disposed when - // going out of the cache. - virtual ExternalFunction* FB_CALL makeFunction(Error* error, ExternalContext* context, - const IRoutineMetadata* metadata) = 0; - virtual ExternalProcedure* FB_CALL makeProcedure(Error* error, ExternalContext* context, - const IRoutineMetadata* metadata) = 0; - virtual ExternalTrigger* FB_CALL makeTrigger(Error* error, ExternalContext* context, - const IRoutineMetadata* metadata) = 0; -}; -#define FB_EXTERNAL_ENGINE_VERSION (FB_PLUGIN_VERSION + 7) - -} // namespace Firebird - - -#endif // FIREBIRD_EXTERNAL_API_H Deleted: firebird/trunk/src/include/FirebirdPluginApi.h =================================================================== --- firebird/trunk/src/include/FirebirdPluginApi.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/FirebirdPluginApi.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,220 +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): ______________________________________. - */ - -/* - * Firebird plugins are accessed using methods of PluginLoader interface. - * For each plugin_module tag found, it constructs a Plugin object, reads the corresponding - * plugin_config tag and inserts all config information in the object. - * - * When requested, the engine gets the attribute value of plugin_module/filename, load it as a - * dynamic (shared) library and calls the exported function firebirdPlugin (FB_PLUGIN_ENTRY_POINT - * definition, PluginEntrypoint prototype) passing the Plugin object as parameter. - * - * The plugin library may save the plugin object and call they methods later. The object and all - * pointers returned by it are valid until the plugin is unloaded (done through OS unload of the - * dynamic library) when Firebird is shutting down. - * - * Inside the plugin entry point (firebirdPlugin), the plugin may register extra functionality that - * may be obtained by Firebird when required. Currently only External Engines may be registered - * through Plugin::setExternalEngineFactory. - * - * Example plugin configuration file: - * - * <external_engine UDR> - * plugin_module UDR_engine - * </external_engine> - * - * <plugin_module UDR_engine> - * filename $(this)/udr_engine - * plugin_config UDR_config - * </plugin_module> - * - * <plugin_config UDR_config> - * path $(this)/udr - * </plugin_config> - * - * Note that the external_engine tag is ignored at this stage. Only plugin_module and plugin_config - * are read. The dynamic library extension may be ommitted, and $(this) expands to the directory of - * the .conf file. - * - * Plugins may access Firebird API through the fbclient library. - */ - -#ifndef FIREBIRD_PLUGIN_API_H -#define FIREBIRD_PLUGIN_API_H - -#include "Interface.h" - -#define FB_PLUGIN_ENTRY_POINT firebird_plugin - - -namespace Firebird { - -// IPluginBase interface - base for master plugin interfaces (factories are registered for them) -class IPluginBase : public IRefCounted -{ -public: - // Additional (compared with Interface) functions getOwner() and setOwner() - // are needed to release() owner of the plugin. This is done in releasePlugin() - // function in IPluginManager. Such method is needed to make sure that owner is released - // after plugin itself, and therefore module is unloaded after release of last plugin from it. - // Releasing owner from release() of plugin will unload module and after returning control - // to missing code segfault is unavoidable. - virtual void FB_CARG setOwner(IRefCounted*) = 0; - virtual IRefCounted* FB_CARG getOwner() = 0; -}; -#define FB_PLUGIN_VERSION (FB_REFCOUNTED_VERSION + 2) - -// IPluginSet - low level tool to access plugins according to parameter from firebird.conf -class IPluginSet : public IRefCounted -{ -public: - virtual const char* FB_CARG getName() const = 0; - virtual const char* FB_CARG getModule() const = 0; - virtual IPluginBase* FB_CARG getPlugin() = 0; - virtual void FB_CARG next() = 0; - virtual void FB_CARG set(const char*) = 0; -}; -#define FB_PLUGIN_SET_VERSION (FB_REFCOUNTED_VERSION + 5) - -// Interfaces to work with configuration data -class IConfig; - -// Entry in configuration file -class IConfigEntry : public IRefCounted -{ -public: - virtual const char* FB_CARG getName() = 0; - virtual const char* FB_CARG getValue() = 0; - virtual IConfig* FB_CARG getSubConfig() = 0; -}; -#define FB_CONFIG_PARAMETER_VERSION (FB_REFCOUNTED_VERSION + 3) - -// Generic form of access to configuration file - find specific entry in it -class IConfig : public IRefCounted -{ -public: - virtual IConfigEntry* FB_CARG find(const char* name) = 0; - virtual IConfigEntry* FB_CARG findValue(const char* name, const char* value) = 0; - virtual IConfigEntry* FB_CARG findPos(const char* name, unsigned int pos) = 0; -}; -#define FB_CONFIG_VERSION (FB_REFCOUNTED_VERSION + 3) - -// Used to access config values from firebird.conf (may be DB specific) -class IFirebirdConf : public IRefCounted -{ -public: - // Get integer key by it's name - // Value ~0 means name is invalid - // Keys are stable: one can use once obtained key in other instances of this interface - virtual unsigned int FB_CARG getKey(const char* name) = 0; - // Use to access integer and boolean values - virtual int FB_CARG asInteger(unsigned int key) = 0; - // Use to access string values - virtual const char* FB_CARG asString(unsigned int key) = 0; -}; -#define FB_FIREBIRD_CONF_VERSION (FB_REFCOUNTED_VERSION + 3) - -// This interface is passed to plugin's factory as it's single parameter -// and contains methods to access specific plugin's configuration data -class IPluginConfig : public IRefCounted -{ -public: - virtual const char* FB_CARG getConfigFileName() = 0; - virtual IConfig* FB_CARG getDefaultConfig() = 0; - virtual IFirebirdConf* FB_CARG getFirebirdConf() = 0; -}; -#define FB_PLUGIN_CONFIG_VERSION (FB_REFCOUNTED_VERSION + 3) - -// Required to creat instances of given plugin -class IPluginFactory : public IVersioned -{ -public: - virtual IPluginBase* FB_CARG createPlugin(IPluginConfig* factoryParameter) = 0; -}; -#define FB_PLUGIN_FACTORY_VERSION (FB_VERSIONED_VERSION + 1) - -// Required to let plugins manager invoke module's cleanup routine before unloading it. -// For some OS/compiler this may be done in dtor of global variable in module itself. -// Others (Windows/VC) fail to create some very useful resources (threads) when module is unloading. -class IPluginModule : public IVersioned -{ -public: - virtual void FB_CARG doClean() = 0; -}; -#define FB_PLUGIN_MODULE_VERSION (FB_VERSIONED_VERSION + 1) - - -// Interface to deal with plugins here and there, returned by master interface -class IPluginManager : public IVersioned -{ -public: - // Main function called by plugin modules in firebird_plugin() - virtual void FB_CARG registerPluginFactory(unsigned int interfaceType, const char* defaultName, - IPluginFactory* factory) = 0; - // Sets cleanup for plugin module - // Pay attention - this should be called at plugin-regsiter time! - // Only at this moment manager knows, which module sets his cleanup - virtual void FB_CARG registerModule(IPluginModule* cleanup) = 0; - // Remove registered before cleanup routine. - // This method must be called by module which detects that it's unloaded, - // but not notified prior to it by PluginManager via IPluginModule. - virtual void FB_CARG unregisterModule(IPluginModule* cleanup) = 0; - // Main function called to access plugins registered in plugins manager - // Has front-end in GetPlugins.h - template GetPlugins - // In namesList parameter comma or space separated list of names of configured plugins is passed - // missingFunctionClass is used to add functions "notImplemented" to the end of vtable - // in case when plugin's version is less than desired - // If caller already has an interface for firebird.conf, it may be passed here - // If parameter is missing, plugins will get access to default (non database specific) config - virtual IPluginSet* FB_CARG getPlugins(unsigned int interfaceType, const char* namesList, - int desiredVersion, void* missingFunctionClass, - IFirebirdConf* firebirdConf) = 0; - // Get generic config interface for given file - virtual IConfig* FB_CARG getConfig(const char* filename) = 0; - // Plugins must be released using this function - use of plugin's release() - // will cause resources leak - virtual void FB_CARG releasePlugin(IPluginBase* plugin) = 0; -}; -#define FB_PLUGIN_MANAGER_VERSION (FB_VERSIONED_VERSION + 6) - - -typedef void PluginEntrypoint(IMaster* masterInterface); - -namespace PluginType { - static const unsigned int YValve = 1; - static const unsigned int Provider = 2; - // leave space for may be some more super-std plugins - static const unsigned int FirstNonLibPlugin = 11; - static const unsigned int AuthServer = 11; - static const unsigned int AuthClient = 12; - static const unsigned int AuthUserManagement = 13; - static const unsigned int ExternalEngine = 14; - static const unsigned int Trace = 15; - - static const unsigned int MaxType = 16; // keep in sync please -}; - -} // namespace Firebird - - -#endif // FIREBIRD_PLUGIN_API_H Deleted: firebird/trunk/src/include/FirebirdUdr.h =================================================================== --- firebird/trunk/src/include/FirebirdUdr.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/FirebirdUdr.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,73 +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 "FirebirdApi.h" -#include "FirebirdExternalApi.h" - - -namespace Firebird -{ - namespace Udr - { -//------------------------------------------------------------------------------ - - -// Factory classes. They should be singletons instances created by user's modules and -// registered. When UDR engine is going to load a routine, it calls newItem. - -class FunctionFactory -{ -public: - virtual const char* FB_CALL getName() = 0; - virtual ExternalFunction* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; -}; - -class ProcedureFactory -{ -public: - virtual const char* FB_CALL getName() = 0; - virtual ExternalProcedure* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; -}; - -class TriggerFactory -{ -public: - virtual const char* FB_CALL getName() = 0; - virtual ExternalTrigger* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; -}; - - -// Routine registration functions. -extern "C" void fbUdrRegFunction(FunctionFactory* factory); -extern "C" void fbUdrRegProcedure(ProcedureFactory* factory); -extern "C" void fbUdrRegTrigger(TriggerFactory* factory); -extern "C" void* fbUdrGetFunction(const char* symbol); - - -//------------------------------------------------------------------------------ - } // namespace Udr -} // namespace Firebird - -#endif // FIREBIRD_UDR_H Deleted: firebird/trunk/src/include/FirebirdUdrCpp.h =================================================================== --- firebird/trunk/src/include/FirebirdUdrCpp.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/FirebirdUdrCpp.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,641 +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_PLUGIN_UDR_CPP -#define FIREBIRD_PLUGIN_UDR_CPP - -#include "FirebirdApi.h" -#include "FirebirdExternalApi.h" -#include "FirebirdUdr.h" -#ifndef JRD_IBASE_H -#include "ibase.h" -#include "iberror.h" -#endif -#include <string.h> - - -namespace Firebird -{ - namespace Udr - { -//------------------------------------------------------------------------------ - - -#define FB_UDR_FUNCTION(name) Func##name -#define FB_UDR_PROCEDURE(name) Proc##name -#define FB_UDR_TRIGGER(name) Trig##name - - -#define FB_UDR_BEGIN_DECLARE_FUNCTION(name) \ - class FB_UDR_FUNCTION(name) : public ::Firebird::Udr::Function \ - { \ - public: \ - virtual void FB_CALL execute(::Firebird::Error* error, ::Firebird::ExternalContext* context, \ - UCHAR* inMsg, UCHAR* outMsg); \ - private: - -#define FB_UDR_END_DECLARE_FUNCTION(name) \ - }; - -#define FB_UDR_DECLARE_FUNCTION(name) \ - FB_UDR_BEGIN_DECLARE_FUNCTION(name) \ - FB_UDR_END_DECLARE_FUNCTION(name) - -#define FB_UDR_BEGIN_FUNCTION(name) \ - void FB_CALL FB_UDR_FUNCTION(name)::execute(::Firebird::Error* error, \ - ::Firebird::ExternalContext* context, UCHAR* inMsg, UCHAR* outMsg) \ - { \ - try \ - { - -#define FB_UDR_END_FUNCTION(name) \ - } \ - catch (const ::Firebird::Udr::ThrowError::Exception& e) \ - { \ - e.stuff(error); \ - } \ - catch (...) \ - { \ - error->addCode(isc_arg_gds); \ - error->addCode(isc_random); \ - error->addString( \ - FB_UDR_UNRECOGNIZED_EXCEPTION, \ - strlen(FB_UDR_UNRECOGNIZED_EXCEPTION)); \ - } \ - } \ - ::Firebird::Udr::FunctionFactoryImpl<FB_UDR_FUNCTION(name)> FuncFactory##name(#name); - - -#define FB_UDR_BEGIN_DECLARE_PROCEDURE(name) \ - class FB_UDR_PROCEDURE(name) : public ::Firebird::Udr::Procedure \ - { \ - public: \ - virtual ::Firebird::ExternalResultSet* FB_CALL open(::Firebird::Error* error, \ - ::Firebird::ExternalContext* context, UCHAR* inMsg, UCHAR* outMsg); \ - -#define FB_UDR_END_DECLARE_PROCEDURE(name) \ - }; - -#define FB_UDR_DECLARE_PROCEDURE(name) \ - FB_UDR_BEGIN_DECLARE_PROCEDURE(name) \ - FB_UDR_END_DECLARE_PROCEDURE(name) - -#define FB_UDR_BEGIN_DECLARE_FETCH_PROCEDURE(name) \ - class ResultSet##name : public ::Firebird::Udr::ResultSet \ - { \ - public: \ - ResultSet##name(::Firebird::Error* error, ::Firebird::ExternalContext* context, \ - ::Firebird::Udr::Procedure* procedure, UCHAR* inMsg, UCHAR* outMsg); \ - \ - public: \ - virtual bool FB_CALL fetch(::Firebird::Error* error); \ - \ - private: - -#define FB_UDR_END_DECLARE_FETCH_PROCEDURE(name) \ - }; - -#define FB_UDR_DECLARE_FETCH_PROCEDURE(name) \ - FB_UDR_BEGIN_DECLARE_FETCH_PROCEDURE(name) \ - FB_UDR_END_DECLARE_FETCH_PROCEDURE(name) - -#define FB_UDR_DECLARE_PROCEDURE(name) \ - FB_UDR_BEGIN_DECLARE_PROCEDURE(name) \ - FB_UDR_END_DECLARE_PROCEDURE(name) - -#define FB_UDR_BEGIN_PROCEDURE(name) \ - ::Firebird::ExternalResultSet* FB_CALL Proc##name::open(::Firebird::Error* error, \ - ::Firebird::ExternalContext* context, UCHAR* inMsg, UCHAR* outMsg) \ - { \ - return new ResultSet##name(error, context, this, inMsg, outMsg); \ - } \ - \ - ResultSet##name::ResultSet##name(::Firebird::Error* error, ::Firebird::ExternalContext* context, \ - ::Firebird::Udr::Procedure* procedure, UCHAR* inMsg, UCHAR* outMsg) \ - : ResultSet(context, procedure, inMsg, outMsg) \ - { \ - try \ - { - -#define FB_UDR_FETCH_PROCEDURE(name) \ - } \ - catch (const ::Firebird::Udr::ThrowError::Exception& e) \ - { \ - e.stuff(error); \ - } \ - catch (...) \ - { \ - error->addCode(isc_arg_gds); \ - error->addCode(isc_random); \ - error->addString( \ - FB_UDR_UNRECOGNIZED_EXCEPTION, \ - strlen(FB_UDR_UNRECOGNIZED_EXCEPTION)); \ - } \ - } \ - \ - bool FB_CALL ResultSet##name::fetch(::Firebird::Error* error) \ - { \ - try \ - { - -#define FB_UDR_END_PROCEDURE(name) \ - } \ - catch (const ::Firebird::Udr::ThrowError::Exception& e) \ - { \ - e.stuff(error); \ - } \ - catch (...) \ - { \ - error->addCode(isc_arg_gds); \ - error->addCode(isc_random); \ - error->addString( \ - FB_UDR_UNRECOGNIZED_EXCEPTION, \ - strlen(FB_UDR_UNRECOGNIZED_EXCEPTION)); \ - } \ - return false; \ - } \ - ::Firebird::Udr::ProcedureFactoryImpl<FB_UDR_PROCEDURE(name)> ProcFactory##name(#name); - - -#define FB_UDR_BEGIN_DECLARE_TRIGGER(name) \ - class FB_UDR_TRIGGER(name) : public ::Firebird::Udr::Trigger \ - { \ - public: \ - virtual void FB_CALL execute(::Firebird::Error* error, ::Firebird::ExternalContext* context, \ - ::Firebird::ExternalTrigger::Action action, UCHAR* oldMsg, UCHAR* newMsg); \ - private: - -#define FB_UDR_END_DECLARE_TRIGGER(name) \ - }; - -#define FB_UDR_DECLARE_TRIGGER(name) \ - FB_UDR_BEGIN_DECLARE_TRIGGER(name) \ - FB_UDR_END_DECLARE_TRIGGER(name) - -#define FB_UDR_BEGIN_TRIGGER(name) \ - void FB_CALL FB_UDR_TRIGGER(name)::execute(::Firebird::Error* error, \ - ::Firebird::ExternalContext* context, ::Firebird::ExternalTrigger::Action action, \ - UCHAR* oldMsg, UCHAR* newMsg) \ - { \ - try \ - { - -#define FB_UDR_END_TRIGGER(name) \ - } \ - catch (const ::Firebird::Udr::ThrowError::Exception& e) \ - { \ - e.stuff(error); \ - } \ - catch (...) \ - { \ - error->addCode(isc_arg_gds); \ - error->addCode(isc_random); \ - error->addString( \ - FB_UDR_UNRECOGNIZED_EXCEPTION, \ - strlen(FB_UDR_UNRECOGNIZED_EXCEPTION)); \ - } \ - } \ - ::Firebird::Udr::TriggerFactoryImpl<FB_UDR_TRIGGER(name)> TrigFactory##name(#name); - - -#define FB_UDR_UNRECOGNIZED_EXCEPTION "Unrecognized C++ exception" - - -class ThrowError : public Error -{ -private: - struct Info - { - Info() - : next(FB_NULL), - str(FB_NULL) - { - } - - ~Info() - { - if (str) - delete [] str; - } - - static void free(Info* info) - { - while (info) - { - Info* p = info; - info = info->next; - delete p; - } - } - - enum { TYPE_CODE, TYPE_STR } type; - - Info* next; - int32 code; - char* str; - int strLength; - }; - -public: - class Exception - { - public: - explicit Exception(Info* aInfo) - : info(aInfo) - { - } - - Exception(const Exception& e) - : info(FB_NULL) - { - Info* end = FB_NULL; - - for (const Info* p = e.info; p; p = p->next) - { - Info* newInfo = new Info; - newInfo->type = p->type; - newInfo->code = p->code; - - if (p->str) - { - newInfo->str = new char[p->strLength]; - memcpy(newInfo->str, p->str, p->strLength); - newInfo->strLength = p->strLength; - } - - if (end) - end->next = newInfo; - - end = newInfo; - - if (!info) - info = newInfo; - } - } - - ~Exception() - { - Info::free(info); - } - - public: - void stuff(Error* error) const - { - for (const Info* p = info; p; p = p->next) - { - if (p->type == Info::TYPE_CODE) - error->addCode(p->code); - else if (p->type == Info::TYPE_STR) - error->addString(p->str, p->strLength); - } - } - - private: - Info* info; - }; - -public: - ThrowError() - : start(FB_NULL), - end(FB_NULL) - { - } - - virtual ~ThrowError() - { - raise(); - Info::free(start); - } - -public: - static void check(ISC_STATUS status, const ISC_STATUS* vector) - { - if (status == 0) - return; - - ThrowError error; - - while (*vector != isc_arg_end) - { - switch (*vector) - { - case isc_arg_warning: - case isc_arg_gds: - case isc_arg_number: - case isc_arg_interpreted: - case isc_arg_vms: - case isc_arg_unix: - case isc_arg_win32: - error.addCode(*vector++); - error.addCode(*vector++); - break; - - case isc_arg_string: - error.addString((const char*) vector[1], strlen((const char*) vector[1])); - vector += 2; - break; - - case isc_arg_cstring: - error.addString((const char*) vector[2], vector[1]); - vector += 3; - break; - - default: - return; - } - } - } - - static void check(const ISC_STATUS* vector) - { - check(vector[1], vector); - } - -public: - inline operator Firebird::Error* () - { - return this; - } - -public: - virtual bool FB_CALL addCode(Firebird::int32 code) - { - Info* info = new Info; - info->type = Info::TYPE_CODE; - info->code = code; - - if (end) - end->next = info; - - end = info; - - if (!start) - start = info; - - return true; - } - - virtual bool FB_CALL addString(const char* str, uint strLength) - { - Info* info = new Info; - info->type = Info::TYPE_STR; - info->str = new char[strLength]; - memcpy(info->str, str, strLength); - info->strLength = strLength; - - if (end) - end->next = info; - - end = info; - - if (!start) - start = info; - - return true; - } - -private: - void raise() - { - if (start) - throw Exception(start); - } - -protected: - Info* start; - Info* end; -}; - - -class Procedure; - - -class Helper -{ -public: - static isc_db_handle getIscDbHandle(ExternalContext* context) - { - ISC_STATUS_ARRAY status = {0}; - isc_db_handle handle = 0; - fb_get_database_handle(status, &handle, context->getAttachment(ThrowError())); - ThrowError::check(status); - return handle; - } - - static isc_tr_handle getIscTrHandle(ExternalContext* context) - { - ISC_STATUS_ARRAY status = {0}; - isc_tr_handle handle = 0; - fb_get_transaction_handle(status, &handle, context->getTransaction(ThrowError())); - ThrowError::check(status); - return handle; - } - - static void* getEntryPoint(ExternalContext* /*context*/, const char* entryPoint) - { - return fbUdrGetFunction(entryPoint); - } -}; - - -class ResultSet : public ExternalResultSet, public Helper -{ -public: - ResultSet(Firebird::ExternalContext* aContext, Firebird::Udr::Procedure* aProcedure, - UCHAR* aInMsg, UCHAR* aOutMsg) - : context(aContext), - procedure(aProcedure), - inMsg(aInMsg), - outMsg(aOutMsg) - { - } - - virtual ~ResultSet() - { - } - -public: - virtual void FB_CALL dispose(Firebird::Error* /*error*/) - { - delete this; - } - -protected: - Firebird::ExternalContext* context; - Firebird::Udr::Procedure* procedure; - UCHAR* inMsg; - UCHAR* outMsg; -}; - - -class Function : public ExternalFunction, public Helper -{ -public: - virtual ~Function() - { - } - -public: - virtual void FB_CALL dispose(Error* /*error*/) - { - delete this; - } - - void FB_CALL getCharSet(Error* /*error*/, ExternalContext* /*context*/, Utf8* /*name*/, uint /*nameSize*/) - { - } - -public: - const IRoutineMetadata* metadata; -}; - - -class Procedure : public ExternalProcedure, public Helper -{ -public: - virtual ~Procedure() - { - } - -public: - virtual void FB_CALL dispose(Error* /*error*/) - { - delete this; - } - - void FB_CALL getCharSet(Error* /*error*/, ExternalContext* /*context*/, Utf8* /*name*/, uint /*nameSize*/) - { - } - -public: - const IRoutineMetadata* metadata; -}; - - -class Trigger : public ExternalTrigger, public Helper -{ -public: - virtual ~Trigger() - { - } - -public: - virtual void FB_CALL dispose(Error* /*error*/) - { - delete this; - } - - void FB_CALL getCharSet(Error* /*error*/, ExternalContext* /*context*/, Utf8* /*name*/, uint /*nameSize*/) - { - } - -public: - const IRoutineMetadata* metadata; -}; - - -template <typename T> class FunctionFactoryImpl : public FunctionFactory -{ -public: - explicit FunctionFactoryImpl(const char* aName) - : name(aName) - { - fbUdrRegFunction(this); - } - -public: - virtual const char* FB_CALL getName() - { - return name; - } - - virtual ExternalFunction* FB_CALL newItem(const IRoutineMetadata* metadata) - { - Function* function = new T(); - function->metadata = metadata; - return function; - } - -private: - const char* name; -}; - - -template <typename T> class ProcedureFactoryImpl : public ProcedureFactory -{ -public: - explicit ProcedureFactoryImpl(const char* aName) - : name(aName) - { - fbUdrRegProcedure(this); - } - -public: - virtual const char* FB_CALL getName() - { - return name; - } - - virtual ExternalProcedure* FB_CALL newItem(const IRoutineMetadata* metadata) - { - Procedure* procedure = new T(); - procedure->metadata = metadata; - return procedure; - } - -private: - const char* name; -}; - - -template <typename T> class TriggerFactoryImpl : public TriggerFactory -{ -public: - explicit TriggerFactoryImpl(const char* aName) - : name(aName) - { - fbUdrRegTrigger(this); - } - -public: - virtual const char* FB_CALL getName() - { - return name; - } - - virtual ExternalTrigger* FB_CALL newItem(const IRoutineMetadata* metadata) - { - Trigger* trigger = new T(); - trigger->metadata = metadata; - return trigger; - } - -private: - const char* name; -}; - - -//------------------------------------------------------------------------------ - } // namespace Udr -} // namespace Firebird - -#endif // FIREBIRD_PLUGIN_UDR_CPP Deleted: firebird/trunk/src/include/Interface.h =================================================================== --- firebird/trunk/src/include/Interface.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/Interface.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,116 +0,0 @@ -/* - * PROGRAM: Firebird interface. - * MODULE: Interface.h - * DESCRIPTION: Base class for all FB interfaces / plugins. - * - * 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 Alex Peshkov - * for the Firebird Open Source RDBMS project. - * - * Copyright (c) 2010 Alex Peshkov <peshkoff at mail.ru> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - * - * - */ - -#ifndef FB_INCLUDE_INTERFACE -#define FB_INCLUDE_INTERFACE - -#include "types_pub.h" - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -# define FB_CARG __cdecl -#else -# define FB_CARG -#endif - -namespace Firebird { - -// Versioned interface - base for all FB interfaces -class IVersioned -{ -public: - virtual int FB_CARG getVersion() = 0; -}; -// If this is changed, types of all interfaces must be changed -#define FB_VERSIONED_VERSION 1 - -// Reference counted interface - base for refCounted FB interfaces -class IRefCounted : public IVersioned -{ -public: - virtual void FB_CARG addRef() = 0; - virtual int FB_CARG release() = 0; -}; -// If this is changed, types of refCounted interfaces must be changed -#define FB_REFCOUNTED_VERSION (FB_VERSIONED_VERSION + 2) - -// Disposable interface - base for disposable FB interfaces -class IDisposable : public IVersioned -{ -public: - virtual void FB_CARG dispose() = 0; -}; -// If this is changed, types of disposable interfaces must be changed -#define FB_DISPOSABLE_VERSION (FB_VERSIONED_VERSION + 1) - -// Interface to work with status vector -// Created by master interface by request -// Also may be implemented on stack by internal FB code -class IStatus : public IDisposable -{ -public: - virtual void FB_CARG set(unsigned int length, const ISC_STATUS* value) = 0; - virtual void FB_CARG set(const ISC_STATUS* value) = 0; - virtual void FB_CARG init() = 0; - - virtual const ISC_STATUS* FB_CARG get() const = 0; - virtual int FB_CARG isSuccess() const = 0; -}; -#define FB_STATUS_VERSION (FB_DISPOSABLE_VERSION + 5) - -class IProvider; -class IPluginManager; -class ITimerControl; -class IAttachment; -class ITransaction; -class IDtc; - -// Master interface is used to access almost all other interfaces. -class IMaster : public IVersioned -{ -public: - virtual IStatus* FB_CARG getStatus() = 0; - virtual IProvider* FB_CARG getDispatcher() = 0; - virtual IPluginManager* FB_CARG getPluginManager() = 0; - virtual int FB_CARG upgradeInterface(IVersioned* toUpgrade, int desiredVersion, void* missingFunctionClass) = 0; - virtual const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr) = 0; - virtual ITimerControl* FB_CARG getTimerControl() = 0; - virtual IDtc* FB_CARG getDtc() = 0; - virtual IAttachment* registerAttachment(IProvider* provider, IAttachment* attachment) = 0; - virtual ITransaction* registerTransaction(IAttachment* attachment, ITransaction* transaction) = 0; -}; -#define FB_MASTER_VERSION (FB_VERSIONED_VERSION + 9) - -} // namespace Firebird - -extern "C" -{ - // additional API function - Firebird::IMaster* ISC_EXPORT fb_get_master_interface(); -} - -#endif // FB_INCLUDE_INTERFACE Deleted: firebird/trunk/src/include/ProviderInterface.h =================================================================== --- firebird/trunk/src/include/ProviderInterface.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/ProviderInterface.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,264 +0,0 @@ -/* - * PROGRAM: Firebird basic API - * MODULE: YValveInterface.h - * DESCRIPTION: Interfaces, used by yValve - * - * 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 Alex Peshkov - * for the Firebird Open Source RDBMS project. - * - * Copyright (c) 2010 Alex Peshkov <peshkoff at mail.ru> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - * - * - */ - -#ifndef FB_PROVIDER_INTERFACE -#define FB_PROVIDER_INTERFACE - -#include "firebird.h" -#include "FirebirdPluginApi.h" - -namespace Firebird { - -// This interfaces are implemented by yvalve code and by each of providers. - -class IAttachment; // Forward - -struct FbMessage -{ - const unsigned char* blr; - unsigned char* buffer; - unsigned int blrLength; - unsigned int bufferLength; -}; - -class IEventCallback : public IVersioned -{ -public: - virtual void FB_CARG eventCallbackFunction(unsigned int length, const unsigned char* events) = 0; -}; -#define FB_EVENT_CALLBACK_VERSION (FB_VERSIONED_VERSION + 1) - -/* -class ShutdownCallback -{ -public: - virtual void FB_CARG shutdownCallbackFunction(int reason, int mask) = 0; -}; -*/ - -class IBlob : public IRefCounted -{ -public: - virtual void FB_CARG getInfo(IStatus* status, - unsigned int itemsLength, const unsigned char* items, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual unsigned int FB_CARG getSegment(IStatus* status, unsigned int length, - void* buffer) = 0; // returns real length - virtual void FB_CARG putSegment(IStatus* status, unsigned int length, - const void* buffer) = 0; - virtual void FB_CARG cancel(IStatus* status) = 0; - virtual void FB_CARG close(IStatus* status) = 0; - virtual int FB_CARG seek(IStatus* status, int mode, int offset) = 0; // returns position -}; -#define FB_BLOB_VERSION (FB_REFCOUNTED_VERSION + 6) - -class ITransaction : public IRefCounted -{ -public: - virtual void FB_CARG getInfo(IStatus* status, - unsigned int itemsLength, const unsigned char* items, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual void FB_CARG prepare(IStatus* status, - unsigned int msgLength = 0, const unsigned char* message = 0) = 0; - virtual void FB_CARG commit(IStatus* status) = 0; - virtual void FB_CARG commitRetaining(IStatus* status) = 0; - virtual void FB_CARG rollback(IStatus* status) = 0; - virtual void FB_CARG rollbackRetaining(IStatus* status) = 0; - virtual void FB_CARG disconnect(IStatus* status) = 0; - virtual ITransaction* FB_CARG join(IStatus* status, ITransaction* transaction) = 0; - virtual ITransaction* FB_CARG validate(IStatus* status, IAttachment* attachment) = 0; - virtual ITransaction* FB_CARG enterDtc(IStatus* status) = 0; -}; -#define FB_TRANSACTION_VERSION (FB_REFCOUNTED_VERSION + 10) - -class IParametersMetadata : public IVersioned -{ -public: - virtual unsigned FB_CARG getCount(IStatus* status) const = 0; - virtual const char* FB_CARG getField(IStatus* status, unsigned index) const = 0; - virtual const char* FB_CARG getRelation(IStatus* status, unsigned index) const = 0; - virtual const char* FB_CARG getOwner(IStatus* status, unsigned index) const = 0; - virtual const char* FB_CARG getAlias(IStatus* status, unsigned index) const = 0; - virtual unsigned FB_CARG getType(IStatus* status, unsigned index) const = 0; - virtual bool FB_CARG isNullable(IStatus* status, unsigned index) const = 0; - virtual unsigned FB_CARG getSubType(IStatus* status, unsigned index) const = 0; - virtual unsigned FB_CARG getLength(IStatus* status, unsigned index) const = 0; - virtual unsigned FB_CARG getScale(IStatus* status, unsigned index) const = 0; -}; -#define FB_PARAMETERS_METADATA_VERSION (FB_VERSIONED_VERSION + 10) - -class IStatement : public IRefCounted -{ -public: - // Prepare flags. - static const unsigned PREPARE_PREFETCH_TYPE = 0x01; - static const unsigned PREPARE_PREFETCH_INPUT_PARAMETERS = 0x02; - static const unsigned PREPARE_PREFETCH_OUTPUT_PARAMETERS = 0x04; - static const unsigned PREPARE_PREFETCH_LEGACY_PLAN = 0x08; - static const unsigned PREPARE_PREFETCH_DETAILED_PLAN = 0x10; - static const unsigned PREPARE_PREFETCH_AFFECTED_RECORDS = 0x20; // not used yet - static const unsigned PREPARE_PREFETCH_METADATA = - PREPARE_PREFETCH_TYPE | PREPARE_PREFETCH_INPUT_PARAMETERS | PREPARE_PREFETCH_OUTPUT_PARAMETERS; - static const unsigned PREPARE_PREFETCH_ALL = - PREPARE_PREFETCH_METADATA | PREPARE_PREFETCH_LEGACY_PLAN | PREPARE_PREFETCH_DETAILED_PLAN | - PREPARE_PREFETCH_AFFECTED_RECORDS; - - virtual void FB_CARG prepare(IStatus* status, ITransaction* tra, - unsigned int stmtLength, const char* sqlStmt, unsigned int dialect, - unsigned int flags) = 0; - virtual void FB_CARG getInfo(IStatus* status, - unsigned int itemsLength, const unsigned char* items, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual unsigned FB_CARG getType(IStatus* status) = 0; - virtual const char* FB_CARG getPlan(IStatus* status, bool detailed) = 0; - virtual const IParametersMetadata* FB_CARG getInputParameters(IStatus* status) = 0; - virtual const IParametersMetadata* FB_CARG getOutputParameters(IStatus* status) = 0; - virtual ISC_UINT64 FB_CARG getAffectedRecords(IStatus* status) = 0; - virtual void FB_CARG setCursorName(IStatus* status, const char* name) = 0; - virtual ITransaction* FB_CARG execute(IStatus* status, ITransaction* tra, - unsigned int inMsgType, const FbMessage* inMsgBuffer, - const FbMessage* outMsgBuffer) = 0; - virtual int FB_CARG fetch(IStatus* status, const FbMessage* msgBuffer) = 0; // returns 100 if EOF, 101 if fragmented - virtual void FB_CARG insert(IStatus* status, const FbMessage* msgBuffer) = 0; - virtual void FB_CARG free(IStatus* status, unsigned int option) = 0; -}; -#define FB_STATEMENT_VERSION (FB_REFCOUNTED_VERSION + 12) - -class IRequest : public IRefCounted -{ -public: - virtual void FB_CARG receive(IStatus* status, int level, unsigned int msgType, - unsigned int length, unsigned char* message) = 0; - virtual void FB_CARG send(IStatus* status, int level, unsigned int msgType, - unsigned int length, const unsigned char* message) = 0; - virtual void FB_CARG getInfo(IStatus* status, int level, - unsigned int itemsLength, const unsigned char* items, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual void FB_CARG start(IStatus* status, ITransaction* tra, int level) = 0; - virtual void FB_CARG startAndSend(IStatus* status, ITransaction* tra, int level, unsigned int msgType, - unsigned int length, const unsigned char* message) = 0; - virtual void FB_CARG unwind(IStatus* status, int level) = 0; - virtual void FB_CARG free(IStatus* status) = 0; -}; -#define FB_REQUEST_VERSION (FB_REFCOUNTED_VERSION + 7) - -class IEvents : public IRefCounted -{ -public: - virtual void FB_CARG cancel(IStatus* status) = 0; -}; -#define FB_EVENTS_VERSION (FB_REFCOUNTED_VERSION + 1) - -class IAttachment : public IRefCounted -{ -public: - virtual void FB_CARG getInfo(IStatus* status, - unsigned int itemsLength, const unsigned char* items, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb) = 0; - virtual ITransaction* FB_CARG reconnectTransaction(IStatus* status, unsigned int length, const unsigned char* id) = 0; - virtual IStatement* FB_CARG allocateStatement(IStatus* status) = 0; - virtual IRequest* FB_CARG compileRequest(IStatus* status, unsigned int blrLength, const unsigned char* blr) = 0; - virtual void FB_CARG transactRequest(IStatus* status, ITransaction* transaction, - unsigned int blrLength, const unsigned char* blr, - unsigned int inMsgLength, const unsigned char* inMsg, - unsigned int outMsgLength, unsigned char* outMsg) = 0; - virtual IBlob* FB_CARG createBlob(IStatus* status, ITransaction* transaction, ISC_QUAD* id, - unsigned int bpbLength = 0, const unsigned char* bpb = 0) = 0; - virtual IBlob* FB_CARG openBlob(IStatus* status, ITransaction* transaction, ISC_QUAD* id, - unsigned int bpbLength = 0, const unsigned char* bpb = 0) = 0; - virtual int FB_CARG getSlice(IStatus* status, ITransaction* transaction, ISC_QUAD* id, - unsigned int sdlLength, const unsigned char* sdl, - unsigned int paramLength, const unsigned char* param, - int sliceLength, unsigned char* slice) = 0; - virtual void FB_CARG putSlice(IStatus* status, ITransaction* transaction, ISC_QUAD* id, - unsigned int sdlLength, const unsigned char* sdl, - unsigned int paramLength, const unsigned char* param, - int sliceLength, unsigned char* slice) = 0; - virtual void FB_CARG ddl(IStatus* status, ITransaction* transaction, unsigned int length, - const unsigned char* dyn) = 0; - virtual ITransaction* FB_CARG execute(IStatus* status, ITransaction* transaction, - unsigned int length, const char* string, unsigned int dialect, - unsigned int inMsgType, const FbMessage* inMsgBuffer, - const FbMessage* outMsgBuffer) = 0; - virtual IEvents* FB_CARG queEvents(IStatus* status, IEventCallback* callback, - unsigned int length, const unsigned char* events) = 0; - virtual void FB_CARG cancelOperation(IStatus* status, int option) = 0; - virtual void FB_CARG ping(IStatus* status) = 0; - virtual void FB_CARG detach(IStatus* status) = 0; - virtual void FB_CARG drop(IStatus* status) = 0; -}; -#define FB_ATTACHMENT_VERSION (FB_REFCOUNTED_VERSION + 17) - -class IService : public IRefCounted -{ -public: - virtual void FB_CARG detach(IStatus* status) = 0; - virtual void FB_CARG query(IStatus* status, - unsigned int sendLength, const unsigned char* sendItems, - unsigned int receiveLength, const unsigned char* receiveItems, - unsigned int bufferLength, unsigned char* buffer) = 0; - virtual void FB_CARG start(IStatus* status, - unsigned int spbLength, const unsigned char* spb) = 0; -}; -#define FB_SERVICE_VERSION (FB_REFCOUNTED_VERSION + 3) - -class IProvider : public IPluginBase -{ -public: - virtual IAttachment* FB_CARG attachDatabase(IStatus* status, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb) = 0; - virtual IAttachment* FB_CARG createDatabase(IStatus* status, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb) = 0; - virtual IService* FB_CARG attachServiceManager(IStatus* status, const char* service, - unsigned int spbLength, const unsigned char* spb) = 0; - virtual void FB_CARG shutdown(IStatus* status, unsigned int timeout, const int reason) = 0; -}; -#define FB_PROVIDER_VERSION (FB_PLUGIN_VERSION + 4) - -// DtcStart - structure to start transaction over >1 attachments (former TEB) -struct DtcStart -{ - IAttachment* attachment; - const unsigned char* tpb; - unsigned int tpbLength; -}; - -// Distributed transactions coordinator -class IDtc : public IVersioned -{ -public: - virtual ITransaction* FB_CARG start(IStatus* status, unsigned int cnt, DtcStart* components) = 0; - virtual ITransaction* FB_CARG join(IStatus* status, ITransaction* one, ITransaction* two) = 0; -}; -#define FB_DTC_VERSION (FB_VERSIONED_VERSION + 2) - -} // namespace Firebird - - -#endif // FB_PROVIDER_INTERFACE Deleted: firebird/trunk/src/include/Timer.h =================================================================== --- firebird/trunk/src/include/Timer.h 2011-06-02 14:19:31 UTC (rev 53092) +++ firebird/trunk/src/include/Timer.h 2011-06-02 15:57:08 UTC (rev 53093) @@ -1,61 +0,0 @@ -/* - * PROGRAM: Firebird interface. - * MODULE: Timer.h - * DESCRIPTION: Timer interface defnition. - * - * 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 Alex Peshkov - * for the Firebird Open Source RDBMS project. - * - * Copyright (c) 2011 Alex Peshkov <peshkoff at mail.ru> - * and all contributors signed below. - * - * All Rights Reserved. - * Contributor(s): ______________________________________. - * - * - */ - -#ifndef FIREBIRD_TIMER_H -#define FIREBIRD_TIMER_H - -#include "Interface.h" - -namespace Firebird { - -// Identifies particular timer. -// Callback function is invoked when timer fires. -class ITimer : public IRefCounted -{ -public: - virtual void FB_CARG handler() = 0; -}; -#define FB_TIMER_VERSION (FB_REFCOUNTED_VERSION + 1) - -typedef ISC_INT64 TimerDelay; - -// Interface to set timer for particular time -class ITimerControl : public IVersioned -{ -public: - // Set timer - virtual void FB_CARG start(ITimer* timer, TimerDelay microSeconds) = 0; - // Stop timer - virtual void FB_CARG stop(ITimer* timer) = 0; -}; -#define FB_TIMER_CONTROL_VERSION (FB_VERSIONED_VERSION + 2) - -} // namespace Firebird - - -#endif // FIREBIRD_TIMER_H Copied: firebird/trunk/src/include/firebird... [truncated message content] |