From 6a9d2aa3fa5fbd73141818bc9f4a1fd6bc271c91 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Wed, 1 Sep 2021 19:04:35 +0300 Subject: [PATCH] Postfix for #6886, thanks to Adriano for very useful comments and suggestions --- extern/cloop/Makefile | 4 +- extern/cloop/src/cloop/Action.cpp | 133 ++++ extern/cloop/src/cloop/Action.h | 105 +++ extern/cloop/src/cloop/Expr.cpp | 23 +- extern/cloop/src/cloop/Generator.cpp | 76 +- extern/cloop/src/cloop/Generator.h | 3 + extern/cloop/src/cloop/Lexer.cpp | 14 + extern/cloop/src/cloop/Lexer.h | 7 + extern/cloop/src/cloop/Parser.cpp | 123 ++- extern/cloop/src/cloop/Parser.h | 31 +- .../test1/CalcPascalApi.implementation.pas | 6 + .../tests/test1/CalcPascalApi.interface.pas | 2 + .../cloop/src/tests/test1/CalcPascalApi.pas | 34 +- src/include/firebird/FirebirdInterface.idl | 44 +- src/include/firebird/IdlFbInterfaces.h | 322 +++++--- src/include/firebird/Interface.h | 3 + src/include/gen/Firebird.pas | 743 +++++++++++++----- src/isql/isql.epp | 4 + src/jrd/EngineInterface.h | 28 +- src/jrd/jrd.cpp | 40 +- src/misc/pascal/Pascal.implementation.pas | 21 + src/misc/pascal/Pascal.interface.pas | 2 + src/misc/pascal/fb_get_master_interface.pas | 1 + src/remote/client/interface.cpp | 84 +- src/yvalve/DistributedTransaction.cpp | 12 +- src/yvalve/YObjects.h | 28 +- src/yvalve/why.cpp | 59 +- 27 files changed, 1464 insertions(+), 488 deletions(-) create mode 100644 extern/cloop/src/cloop/Action.cpp create mode 100644 extern/cloop/src/cloop/Action.h diff --git a/extern/cloop/Makefile b/extern/cloop/Makefile index 08516c27cd..8a66554ef4 100644 --- a/extern/cloop/Makefile +++ b/extern/cloop/Makefile @@ -29,7 +29,7 @@ OBJS_CPP := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS_CPP)) C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter CXX_FLAGS := $(C_FLAGS) -FPC_FLAGS := -Mdelphi +FPC_FLAGS := -Mdelphi -Cg ifeq ($(shell uname),FreeBSD) DL_LIB := @@ -47,6 +47,7 @@ endif ifeq ($(TARGET),debug) FPC_FLAGS += -g + LD_FLAGS += -ggdb endif vpath %.c $(SRC_DIRS) @@ -85,6 +86,7 @@ $(foreach bdir,$(OBJ_DIRS),$(eval $(call compile,$(bdir)))) -include $(addsuffix .d,$(basename $(OBJS_CPP))) $(BIN_DIR)/cloop: \ + $(OBJ_DIR)/cloop/Action.o \ $(OBJ_DIR)/cloop/Expr.o \ $(OBJ_DIR)/cloop/Generator.o \ $(OBJ_DIR)/cloop/Lexer.o \ diff --git a/extern/cloop/src/cloop/Action.cpp b/extern/cloop/src/cloop/Action.cpp new file mode 100644 index 0000000000..1eb934cba9 --- /dev/null +++ b/extern/cloop/src/cloop/Action.cpp @@ -0,0 +1,133 @@ +/* + * 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 Alexander Peshkov. + * + * Copyright (c) 2021 Alexander Peshkov + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "Action.h" +#include "Parser.h" +#include "Generator.h" + +#include + +using std::string; + + +inline void identify(const ActionParametersBlock& apb, unsigned ident) +{ + identify(apb.out, ident); +} + + +void IfThenElseAction::generate(const ActionParametersBlock& apb, unsigned ident) +{ + switch(apb.language) + { + case LANGUAGE_C: + case LANGUAGE_CPP: + identify(apb, ident); + fprintf(apb.out, "if (%s) {\n", exprIf->generate(apb.language, apb.prefix).c_str()); + actThen->generate(apb, ident + 1); + identify(apb, ident); + fprintf(apb.out, "}\n"); + if (actElse) + { + identify(apb, ident); + fprintf(apb.out, "else {\n"); + actElse->generate(apb, ident + 1); + identify(apb, ident); + fprintf(apb.out, "}\n"); + } + break; + + case LANGUAGE_PASCAL: + identify(apb, ident); + fprintf(apb.out, "if %s then begin\n", exprIf->generate(apb.language, apb.prefix).c_str()); + actThen->generate(apb, ident + 1); + identify(apb, ident); + fprintf(apb.out, "end\n"); + if (actElse) + { + identify(apb, ident); + fprintf(apb.out, "else begin\n"); + actElse->generate(apb, ident + 1); + identify(apb, ident); + fprintf(apb.out, "end\n"); + } + break; + } +} + + +void CallAction::generate(const ActionParametersBlock& apb, unsigned ident) +{ + identify(apb, ident); + fprintf(apb.out, "%s(", name.c_str()); + for (auto itr = parameters.begin(); itr != parameters.end(); ++itr) + { + fprintf(apb.out, "%s%s", itr == parameters.begin() ? "" : ", ", itr->c_str()); + } + fprintf(apb.out, ");\n"); +} + + +void DefAction::generate(const ActionParametersBlock& apb, unsigned ident) +{ + switch(defType) + { + case DEF_NOT_IMPLEMENTED: + switch(apb.language) + { + case LANGUAGE_C: + if (!apb.statusName.empty()) + { + identify(apb, ident); + fprintf(apb.out, "CLOOP_setVersionError(%s, \"%s%s\", cloopVTable->version, %d);\n", + apb.statusName.c_str(), apb.prefix.c_str(), + apb.interface->name.c_str(), apb.method->version); + } + break; + + case LANGUAGE_CPP: + if (!apb.statusName.empty()) + { + identify(apb, ident); + fprintf(apb.out, "%s::setVersionError(%s, \"%s%s\", cloopVTable->version, %d);\n", + apb.exceptionClass.c_str(), apb.statusName.c_str(), apb.prefix.c_str(), + apb.interface->name.c_str(), apb.method->version); + identify(apb, ident); + fprintf(apb.out, "%s::checkException(%s);\n", + apb.exceptionClass.c_str(), apb.statusName.c_str()); + } + break; + + case LANGUAGE_PASCAL: + if (!apb.statusName.empty() && !apb.exceptionClass.empty()) + { + identify(apb, ident); + fprintf(apb.out, "%s.setVersionError(%s, \'%s%s\', vTable.version, %d);\n", + apb.exceptionClass.c_str(), apb.statusName.c_str(), apb.prefix.c_str(), + apb.interface->name.c_str(), apb.method->version); + } + break; + } + break; + } +} + + diff --git a/extern/cloop/src/cloop/Action.h b/extern/cloop/src/cloop/Action.h new file mode 100644 index 0000000000..1de5031be5 --- /dev/null +++ b/extern/cloop/src/cloop/Action.h @@ -0,0 +1,105 @@ +/* + * 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 Alexander Peshkov. + * + * Copyright (c) 2021 Alexander Peshkov + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#ifndef CLOOP_ACTION_H +#define CLOOP_ACTION_H + +#include "Expr.h" + +#include +#include +#include + +class Method; +class Interface; + +struct ActionParametersBlock +{ + FILE* out; + Language language; + const std::string& prefix; + const std::string& exceptionClass; + const std::string& statusName; + Interface* interface; + Method* method; +}; + +class Action +{ +public: + virtual ~Action() + { } + + virtual void generate(const ActionParametersBlock& apb, unsigned ident) = 0; +}; + + +class IfThenElseAction : public Action +{ +public: + IfThenElseAction() + : exprIf(nullptr), actThen(nullptr), actElse(nullptr) + { } + + IfThenElseAction(const IfThenElseAction&) = default; + + void generate(const ActionParametersBlock& apb, unsigned ident) override; + + Expr* exprIf; + Action* actThen; + Action* actElse; +}; + + +class CallAction : public Action +{ +public: + CallAction() = default; + + CallAction(const CallAction&) = default; + + void generate(const ActionParametersBlock& apb, unsigned ident) override; + + void addParam(const std::string& parName) + { + parameters.push_back(parName); + } + + std::string name; + std::vector parameters; +}; + + +class DefAction : public Action +{ +public: + enum DefType { DEF_NOT_IMPLEMENTED }; + + DefAction(DefType dt) + : defType(dt) + { } + + void generate(const ActionParametersBlock& apb, unsigned ident) override; + + DefType defType; +}; + +#endif //CLOOP_ACTION_H diff --git a/extern/cloop/src/cloop/Expr.cpp b/extern/cloop/src/cloop/Expr.cpp index 778a13b479..13e97eb408 100644 --- a/extern/cloop/src/cloop/Expr.cpp +++ b/extern/cloop/src/cloop/Expr.cpp @@ -86,19 +86,22 @@ string ConstantExpr::generate(Language language, const string& prefix) { string retPrefix; - switch (language) + if (interface) { - case LANGUAGE_C: - retPrefix = prefix + interface->name + "_"; - break; + switch (language) + { + case LANGUAGE_C: + retPrefix = prefix + interface->name + "_"; + break; - case LANGUAGE_CPP: - retPrefix = prefix + interface->name + "::"; - break; + case LANGUAGE_CPP: + retPrefix = prefix + interface->name + "::"; + break; - case LANGUAGE_PASCAL: - retPrefix = prefix + interface->name + "."; - break; + case LANGUAGE_PASCAL: + retPrefix = prefix + interface->name + "."; + break; + } } return retPrefix + name; diff --git a/extern/cloop/src/cloop/Generator.cpp b/extern/cloop/src/cloop/Generator.cpp index 22b9f85ecf..d6e0fd166b 100644 --- a/extern/cloop/src/cloop/Generator.cpp +++ b/extern/cloop/src/cloop/Generator.cpp @@ -44,6 +44,16 @@ const char* const Generator::AUTOGEN_MSG = //-------------------------------------- +static const char* tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; +void identify(FILE* out, unsigned ident) +{ + fprintf(out, "%.*s", ident, tabs); +} + + +//-------------------------------------- + + FileGenerator::FileGenerator(const string& filename, const string& prefix) : prefix(prefix) { @@ -333,17 +343,12 @@ void CppGenerator::generate() fprintf(out, "\t\t\tif (cloopVTable->version < %d)\n", method->version); fprintf(out, "\t\t\t{\n"); - if (!statusName.empty()) - { - fprintf(out, - "\t\t\t\tStatusType::setVersionError(%s, \"%s%s\", cloopVTable->version, %d);\n", - statusName.c_str(), - prefix.c_str(), - interface->name.c_str(), - method->version); + ActionParametersBlock apb = {out, LANGUAGE_CPP, prefix, "StatusType", statusName, interface, method}; - fprintf(out, "\t\t\t\tStatusType::checkException(%s);\n", statusName.c_str()); - } + if (method->notImplementedAction) + method->notImplementedAction->generate(apb, 4); + else + DefAction(DefAction::DEF_NOT_IMPLEMENTED).generate(apb, 4); fprintf(out, "\t\t\t\treturn"); @@ -1144,6 +1149,15 @@ void PascalGenerator::generate() bool isProcedure = method->returnTypeRef.token.type == Token::TYPE_VOID && !method->returnTypeRef.isPointer; + string statusName; + + if (!method->parameters.empty() && + parser->exceptionInterface && + method->parameters.front()->typeRef.token.text == parser->exceptionInterface->name) + { + statusName = method->parameters.front()->name; + } + fprintf(out, "%s %s.%s(", (isProcedure ? "procedure" : "function"), escapeName(interface->name, true).c_str(), @@ -1168,10 +1182,35 @@ void PascalGenerator::generate() fprintf(out, ";\n"); fprintf(out, "begin\n"); - fprintf(out, "\t"); - //// TODO: checkVersion + unsigned ident = 1; + if (method->version - (interface->super ? interface->super->version : 0) != 1) + { + fprintf(out, "\tif (vTable.version < %d) then begin\n", method->version); + ActionParametersBlock apb = {out, LANGUAGE_PASCAL, prefix, exceptionClass, + statusName, interface, method}; + + if (method->notImplementedAction) + method->notImplementedAction->generate(apb, 2); + else + DefAction(DefAction::DEF_NOT_IMPLEMENTED).generate(apb, 2); + + if (method->returnTypeRef.token.type != Token::TYPE_VOID || + method->returnTypeRef.isPointer) + { + fprintf(out, "\t\tResult := %s;\n", + method->notImplementedExpr ? + method->notImplementedExpr->generate(LANGUAGE_PASCAL, prefix).c_str() : + method->returnTypeRef.valueIsPointer() ? "nil" : + method->returnTypeRef.token.type == Token::TYPE_BOOLEAN ? "false" : "0"); + } + + fprintf(out, "\tend\n\telse begin\n"); + ident = 2; + } + + identify(out, ident); if (!isProcedure) fprintf(out, "Result := "); @@ -1188,14 +1227,11 @@ void PascalGenerator::generate() fprintf(out, ");\n"); - if (!method->parameters.empty() && - parser->exceptionInterface && - method->parameters.front()->typeRef.token.text == parser->exceptionInterface->name && - !exceptionClass.empty()) - { - fprintf(out, "\t%s.checkException(%s);\n", exceptionClass.c_str(), - escapeName(method->parameters.front()->name).c_str()); - } + if (ident > 1) + fprintf(out, "\tend;\n"); + + if (!statusName.empty() && !exceptionClass.empty()) + fprintf(out, "\t%s.checkException(%s);\n", exceptionClass.c_str(), escapeName(statusName).c_str()); fprintf(out, "end;\n\n"); } diff --git a/extern/cloop/src/cloop/Generator.h b/extern/cloop/src/cloop/Generator.h index 1854d4d71a..399ffa81bf 100644 --- a/extern/cloop/src/cloop/Generator.h +++ b/extern/cloop/src/cloop/Generator.h @@ -146,4 +146,7 @@ private: }; +void identify(FILE* out, unsigned ident); + + #endif // CLOOP_GENERATOR_H diff --git a/extern/cloop/src/cloop/Lexer.cpp b/extern/cloop/src/cloop/Lexer.cpp index 2c686ec858..93e9280a64 100644 --- a/extern/cloop/src/cloop/Lexer.cpp +++ b/extern/cloop/src/cloop/Lexer.cpp @@ -90,6 +90,8 @@ Token& Lexer::getToken(Token& token) token.type = Token::TYPE_INTERFACE; else if (token.text == "notImplemented") token.type = Token::TYPE_NOT_IMPLEMENTED; + else if (token.text == "notImplementedAction") + token.type = Token::TYPE_NOT_IMPLEMENTED_ACTION; else if (token.text == "struct") token.type = Token::TYPE_STRUCT; else if (token.text == "typedef") @@ -98,6 +100,18 @@ Token& Lexer::getToken(Token& token) token.type = Token::TYPE_VERSION; else if (token.text == "onError") token.type = Token::TYPE_ON_ERROR; + else if (token.text == "if") + token.type = Token::TYPE_IF; + else if (token.text == "then") + token.type = Token::TYPE_THEN; + else if (token.text == "else") + token.type = Token::TYPE_ELSE; + else if (token.text == "endif") + token.type = Token::TYPE_ENDIF; + else if (token.text == "call") + token.type = Token::TYPE_CALL; + else if (token.text == "defaultAction") + token.type = Token::TYPE_DEFAULT_ACTION; // types else if (token.text == "void") token.type = Token::TYPE_VOID; diff --git a/extern/cloop/src/cloop/Lexer.h b/extern/cloop/src/cloop/Lexer.h index 6371ecd75a..f146d5b450 100644 --- a/extern/cloop/src/cloop/Lexer.h +++ b/extern/cloop/src/cloop/Lexer.h @@ -46,10 +46,17 @@ struct Token TYPE_EXCEPTION, TYPE_INTERFACE, TYPE_NOT_IMPLEMENTED, + TYPE_NOT_IMPLEMENTED_ACTION, TYPE_STRUCT, TYPE_TYPEDEF, TYPE_VERSION, TYPE_ON_ERROR, + TYPE_IF, + TYPE_THEN, + TYPE_ELSE, + TYPE_ENDIF, + TYPE_CALL, + TYPE_DEFAULT_ACTION, // types TYPE_VOID, TYPE_BOOLEAN, diff --git a/extern/cloop/src/cloop/Parser.cpp b/extern/cloop/src/cloop/Parser.cpp index 4061a57ec4..90bd7e9403 100644 --- a/extern/cloop/src/cloop/Parser.cpp +++ b/extern/cloop/src/cloop/Parser.cpp @@ -82,6 +82,12 @@ void Parser::parse() parseTypedef(); break; + case Token::TYPE_BOOLEAN: + if (exception) + error(token, "Cannot use attribute exception in boolean."); + parseBoolean(); + break; + default: syntaxError(token); break; @@ -164,6 +170,16 @@ void Parser::parseStruct() getToken(token, TOKEN(';')); } +void Parser::parseBoolean() +{ + Boolean* b = new Boolean(); + + b->name = getToken(token, Token::TYPE_IDENTIFIER).text; + typesByName.insert(pair(b->name, b)); + + getToken(token, TOKEN(';')); +} + void Parser::parseTypedef() { Typedef* typeDef = new Typedef(); @@ -176,7 +192,8 @@ void Parser::parseTypedef() void Parser::parseItem() { - Expr* notImplementedExpr = NULL; + Expr* notImplementedExpr = nullptr; + Action* notImplementedAction = nullptr; std::string onError; while (lexer->getToken(token).type == TOKEN('[')) @@ -190,7 +207,6 @@ void Parser::parseItem() getToken(token, TOKEN('(')); notImplementedExpr = parseExpr(); getToken(token, TOKEN(')')); - getToken(token, TOKEN(']')); break; case Token::TYPE_ON_ERROR: @@ -200,13 +216,19 @@ void Parser::parseItem() if (token.type != Token::TYPE_IDENTIFIER) syntaxError(token); onError = token.text; - getToken(token, TOKEN(']')); + break; + + case Token::TYPE_NOT_IMPLEMENTED_ACTION: + if (notImplementedAction) + syntaxError(token); + notImplementedAction = parseAction(DefAction::DEF_NOT_IMPLEMENTED); break; default: syntaxError(token); break; } + getToken(token, TOKEN(']')); } lexer->pushToken(token); @@ -226,7 +248,7 @@ void Parser::parseItem() } getToken(token, TOKEN('(')); - parseMethod(typeRef, name, notImplementedExpr, onError); + parseMethod(typeRef, name, notImplementedExpr, onError, notImplementedAction); } void Parser::parseConstant(const TypeRef& typeRef, const string& name) @@ -241,7 +263,70 @@ void Parser::parseConstant(const TypeRef& typeRef, const string& name) getToken(token, TOKEN(';')); } -void Parser::parseMethod(const TypeRef& returnTypeRef, const string& name, Expr* notImplementedExpr, const string& onError) +Action* Parser::parseAction(DefAction::DefType dt) +{ + switch (lexer->getToken(token).type) + { + case Token::TYPE_IF: + return parseIfThenElseAction(dt); + + case Token::TYPE_CALL: + return parseCallAction(); + + case Token::TYPE_DEFAULT_ACTION: + return parseDefAction(dt); + + default: + break; + } + + syntaxError(token); +} + +Action* Parser::parseIfThenElseAction(DefAction::DefType dt) +{ + IfThenElseAction act; + + act.exprIf = parseLogicalExpr(); + + getToken(token, Token::TYPE_THEN); + act.actThen = parseAction(dt); + + lexer->getToken(token); + if (token.type == Token::TYPE_ELSE) + act.actElse = parseAction(dt); + else + lexer->pushToken(token); + + getToken(token, Token::TYPE_ENDIF); + return new IfThenElseAction(act); +} + +Action* Parser::parseCallAction() +{ + CallAction act; + + act.name = getToken(token, Token::TYPE_IDENTIFIER).text; + + getToken(token, TOKEN('(')); + do + { + act.addParam(getToken(token, Token::TYPE_IDENTIFIER).text); + } while(lexer->getToken(token).type == ','); + + if (token.type == ')') + return new CallAction(act); + + syntaxError(token); +} + +Action* Parser::parseDefAction(DefAction::DefType dt) +{ + return new DefAction(dt); +} + +void Parser::parseMethod(const TypeRef& returnTypeRef, const string& name, Expr* notImplementedExpr, + const string& onError, Action* notImplementedAction) { Method* method = new Method(); interface->methods.push_back(method); @@ -250,6 +335,7 @@ void Parser::parseMethod(const TypeRef& returnTypeRef, const string& name, Expr* method->name = name; method->version = interface->version; method->notImplementedExpr = notImplementedExpr; + method->notImplementedAction = notImplementedAction; method->onErrorFunction = onError; if (lexer->getToken(token).type != TOKEN(')')) @@ -354,6 +440,10 @@ Expr* Parser::parsePrimaryExpr() } } + case Token::TYPE_DOUBLE_COLON: + getToken(token, Token::TYPE_IDENTIFIER); + return new ConstantExpr(nullptr, token.text); + default: syntaxError(token); return NULL; // warning @@ -436,3 +526,26 @@ void Parser::error(const Token& token, const string& msg) lexer->filename.c_str(), token.line, token.column, msg.c_str()); throw runtime_error(buffer); } + +bool TypeRef::valueIsPointer() +{ + if (isPointer) + return true; + + switch (token.type) + { + case Token::TYPE_STRING: + return true; + + case Token::TYPE_IDENTIFIER: + if (type == BaseType::TYPE_INTERFACE) + return true; + break; + + default: + break; + } + + return false; +} + diff --git a/extern/cloop/src/cloop/Parser.h b/extern/cloop/src/cloop/Parser.h index 89c5fdc25f..6dc3ca9138 100644 --- a/extern/cloop/src/cloop/Parser.h +++ b/extern/cloop/src/cloop/Parser.h @@ -23,6 +23,7 @@ #define CLOOP_PARSER_H #include "Lexer.h" +#include "Action.h" #include #include #include @@ -38,7 +39,8 @@ public: { TYPE_INTERFACE, TYPE_STRUCT, - TYPE_TYPEDEF + TYPE_TYPEDEF, + TYPE_BOOLEAN }; protected: @@ -71,6 +73,8 @@ public: bool isConst; bool isPointer; BaseType::Type type; + + bool valueIsPointer(); }; @@ -96,6 +100,7 @@ class Method public: Method() : notImplementedExpr(NULL), + notImplementedAction(NULL), version(0), isConst(false) { @@ -105,6 +110,7 @@ public: TypeRef returnTypeRef; std::vector parameters; Expr* notImplementedExpr; + Action* notImplementedAction; unsigned version; bool isConst; std::string onErrorFunction; @@ -139,6 +145,16 @@ public: }; +class Boolean : public BaseType +{ +public: + Boolean() + : BaseType(TYPE_BOOLEAN) + { + } +}; + + class Typedef : public BaseType { public: @@ -158,15 +174,22 @@ public: void parseInterface(bool exception); void parseStruct(); void parseTypedef(); + void parseBoolean(); void parseItem(); void parseConstant(const TypeRef& typeRef, const std::string& name); - void parseMethod(const TypeRef& returnTypeRef, const std::string& name, Expr* notImplementedExpr, const std::string& onErrorFunction); + void parseMethod(const TypeRef& returnTypeRef, const std::string& name, Expr* notImplementedExpr, + const std::string& onErrorFunction, Action* notImplementedAction); Expr* parseExpr(); Expr* parseLogicalExpr(); Expr* parseUnaryExpr(); Expr* parsePrimaryExpr(); + Action* parseAction(DefAction::DefType dt); + Action* parseIfThenElseAction(DefAction::DefType dt); + Action* parseCallAction(); + Action* parseDefAction(DefAction::DefType dt); + private: void checkType(TypeRef& typeRef); @@ -174,8 +197,8 @@ private: TypeRef parseTypeRef(); - void syntaxError(const Token& token); - void error(const Token& token, const std::string& msg); + [[noreturn]] void syntaxError(const Token& token); + [[noreturn]] void error(const Token& token, const std::string& msg); public: std::vector interfaces; diff --git a/extern/cloop/src/tests/test1/CalcPascalApi.implementation.pas b/extern/cloop/src/tests/test1/CalcPascalApi.implementation.pas index 2179609804..e44c8ad5f1 100644 --- a/extern/cloop/src/tests/test1/CalcPascalApi.implementation.pas +++ b/extern/cloop/src/tests/test1/CalcPascalApi.implementation.pas @@ -25,3 +25,9 @@ begin else status.setCode(-1); end; + +class procedure CalcException.setVersionError(status: Status; interfaceName: string; + currentVersion, expectedVersion: NativeInt); +begin + status.setCode(Status.ERROR_1); +end; diff --git a/extern/cloop/src/tests/test1/CalcPascalApi.interface.pas b/extern/cloop/src/tests/test1/CalcPascalApi.interface.pas index 2f758aed0f..f7e71f5f91 100644 --- a/extern/cloop/src/tests/test1/CalcPascalApi.interface.pas +++ b/extern/cloop/src/tests/test1/CalcPascalApi.interface.pas @@ -6,6 +6,8 @@ public class procedure checkException(status: Status); class procedure catchException(status: Status; e: Exception); + class procedure setVersionError(status: Status; interfaceName: string; + currentVersion, expectedVersion: NativeInt); private code: Integer; diff --git a/extern/cloop/src/tests/test1/CalcPascalApi.pas b/extern/cloop/src/tests/test1/CalcPascalApi.pas index d929e51cc9..1b202695c1 100644 --- a/extern/cloop/src/tests/test1/CalcPascalApi.pas +++ b/extern/cloop/src/tests/test1/CalcPascalApi.pas @@ -30,6 +30,8 @@ public class procedure checkException(status: Status); class procedure catchException(status: Status; e: Exception); + class procedure setVersionError(status: Status; interfaceName: string; + currentVersion, expectedVersion: NativeInt); private code: Integer; @@ -221,17 +223,31 @@ end; function Calculator.getMemory(): Integer; begin - Result := CalculatorVTable(vTable).getMemory(Self); + if (vTable.version < 3) then begin + Result := Status.ERROR_1; + end + else begin + Result := CalculatorVTable(vTable).getMemory(Self); + end; end; procedure Calculator.setMemory(n: Integer); begin - CalculatorVTable(vTable).setMemory(Self, n); + if (vTable.version < 3) then begin + end + else begin + CalculatorVTable(vTable).setMemory(Self, n); + end; end; procedure Calculator.sumAndStore(status: Status; n1: Integer; n2: Integer); begin - CalculatorVTable(vTable).sumAndStore(Self, status, n1, n2); + if (vTable.version < 4) then begin + CalcException.setVersionError(status, 'Calculator', vTable.version, 4); + end + else begin + CalculatorVTable(vTable).sumAndStore(Self, status, n1, n2); + end; CalcException.checkException(status); end; @@ -248,7 +264,11 @@ end; procedure Calculator2.copyMemory2(address: IntegerPtr); begin - Calculator2VTable(vTable).copyMemory2(Self, address); + if (vTable.version < 6) then begin + end + else begin + Calculator2VTable(vTable).copyMemory2(Self, address); + end; end; procedure DisposableImpl_disposeDispatcher(this: Disposable); cdecl; @@ -516,6 +536,12 @@ begin else status.setCode(-1); end; + +class procedure CalcException.setVersionError(status: Status; interfaceName: string; + currentVersion, expectedVersion: NativeInt); +begin + status.setCode(Status.ERROR_1); +end; initialization DisposableImpl_vTable := DisposableVTable.create; DisposableImpl_vTable.version := 1; diff --git a/src/include/firebird/FirebirdInterface.idl b/src/include/firebird/FirebirdInterface.idl index 09ee36aaf3..31c06a3705 100644 --- a/src/include/firebird/FirebirdInterface.idl +++ b/src/include/firebird/FirebirdInterface.idl @@ -38,6 +38,8 @@ typedef FB_DEC16; typedef FB_DEC34; typedef FB_I128; +boolean FB_UsedInYValve; + // Versioned interface - base for all FB interfaces interface Versioned { @@ -347,12 +349,14 @@ interface Blob : ReferenceCounted void putSegment(Status status, uint length, const void* buffer); - void cancel_1(Status status); - void close_1(Status status); + void deprecatedCancel(Status status); + void deprecatedClose(Status status); int seek(Status status, int mode, int offset); // returns position version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedCancel(status) endif] void cancel(Status status); + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedClose(status) endif] void close(Status status); } @@ -363,18 +367,21 @@ interface Transaction : ReferenceCounted uint bufferLength, uchar* buffer); void prepare(Status status, uint msgLength, const uchar* message); - void commit_1(Status status); + void deprecatedCommit(Status status); void commitRetaining(Status status); - void rollback_1(Status status); + void deprecatedRollback(Status status); void rollbackRetaining(Status status); - void disconnect_1(Status status); + void deprecatedDisconnect(Status status); Transaction join(Status status, Transaction transaction); Transaction validate(Status status, Attachment attachment); Transaction enterDtc(Status status); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedCommit(status) endif] void commit(Status status); + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedRollback(status) endif] void rollback(Status status); + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedDisconnect(status) endif] void disconnect(Status status); } @@ -435,7 +442,7 @@ interface ResultSet : ReferenceCounted boolean isEof(Status status); boolean isBof(Status status); MessageMetadata getMetadata(Status status); - void close_1(Status status); + void deprecatedClose(Status status); // This item is for ISC API emulation only // It may be gone in future versions @@ -443,6 +450,7 @@ interface ResultSet : ReferenceCounted void setDelayedOutputFormat(Status status, MessageMetadata format); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedClose(status) endif] void close(Status status); } @@ -484,7 +492,7 @@ interface Statement : ReferenceCounted ResultSet openCursor(Status status, Transaction transaction, MessageMetadata inMetadata, void* inBuffer, MessageMetadata outMetadata, uint flags); void setCursorName(Status status, const string name); - void free_1(Status status); + void deprecatedFree(Status status); uint getFlags(Status status); version: // 3.0 => 4.0 @@ -501,6 +509,7 @@ version: // 3.0 => 4.0 */ version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedFree(status) endif] void free(Status status); } @@ -531,9 +540,10 @@ interface Batch : ReferenceCounted uint getBlobAlignment(Status status); MessageMetadata getMetadata(Status status); void setDefaultBpb(Status status, uint parLength, const uchar* par); - void close_1(Status status); + void deprecatedClose(Status status); version: // 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedClose(status) endif] void close(Status status); } @@ -572,9 +582,10 @@ interface Replicator : ReferenceCounted void process(Status status, ReplicationBatch batch); */ void process(Status status, uint length, const uchar* data); - void close_1(Status status); + void deprecatedClose(Status status); version: // 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedClose(status) endif] void close(Status status); } @@ -591,17 +602,19 @@ interface Request : ReferenceCounted void startAndSend(Status status, Transaction tra, int level, uint msgType, uint length, const void* message); void unwind(Status status, int level); - void free_1(Status status); + void deprecatedFree(Status status); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedFree(status) endif] void free(Status status); } interface Events : ReferenceCounted { - void cancel_1(Status status); + void deprecatedCancel(Status status); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedCancel(status) endif] void cancel(Status status); } @@ -647,8 +660,8 @@ interface Attachment : ReferenceCounted uint length, const uchar* events); void cancelOperation(Status status, int option); void ping(Status status); - void detach_1(Status status); - void dropDatabase_1(Status status); + void deprecatedDetach(Status status); + void deprecatedDropDatabase(Status status); version: // 3.0 => 4.0 // Idle attachment timeout, seconds @@ -672,13 +685,15 @@ version: // 3.0 => 4.0 Replicator createReplicator(Status status); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedDetach(status) endif] void detach(Status status); + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedDropDatabase(status) endif] void dropDatabase(Status status); } interface Service : ReferenceCounted { - void detach_1(Status status); + void deprecatedDetach(Status status); void query(Status status, uint sendLength, const uchar* sendItems, uint receiveLength, const uchar* receiveItems, @@ -687,6 +702,7 @@ interface Service : ReferenceCounted uint spbLength, const uchar* spb); version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + [notImplementedAction if ::FB_UsedInYValve then defaultAction else call deprecatedDetach(status) endif] void detach(Status status); } diff --git a/src/include/firebird/IdlFbInterfaces.h b/src/include/firebird/IdlFbInterfaces.h index ba6d219d98..e97cda329a 100644 --- a/src/include/firebird/IdlFbInterfaces.h +++ b/src/include/firebird/IdlFbInterfaces.h @@ -1044,8 +1044,8 @@ namespace Firebird void (CLOOP_CARG *getInfo)(IBlob* self, IStatus* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) throw(); int (CLOOP_CARG *getSegment)(IBlob* self, IStatus* status, unsigned bufferLength, void* buffer, unsigned* segmentLength) throw(); void (CLOOP_CARG *putSegment)(IBlob* self, IStatus* status, unsigned length, const void* buffer) throw(); - void (CLOOP_CARG *cancel_1)(IBlob* self, IStatus* status) throw(); - void (CLOOP_CARG *close_1)(IBlob* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedCancel)(IBlob* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedClose)(IBlob* self, IStatus* status) throw(); int (CLOOP_CARG *seek)(IBlob* self, IStatus* status, int mode, int offset) throw(); void (CLOOP_CARG *cancel)(IBlob* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IBlob* self, IStatus* status) throw(); @@ -1086,17 +1086,17 @@ namespace Firebird StatusType::checkException(status); } - template void cancel_1(StatusType* status) + template void deprecatedCancel(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->cancel_1(this, status); + static_cast(this->cloopVTable)->deprecatedCancel(this, status); StatusType::checkException(status); } - template void close_1(StatusType* status) + template void deprecatedClose(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close_1(this, status); + static_cast(this->cloopVTable)->deprecatedClose(this, status); StatusType::checkException(status); } @@ -1112,8 +1112,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedCancel(status); + } return; } StatusType::clearException(status); @@ -1125,8 +1130,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedClose(status); + } return; } StatusType::clearException(status); @@ -1142,11 +1152,11 @@ namespace Firebird { void (CLOOP_CARG *getInfo)(ITransaction* self, IStatus* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) throw(); void (CLOOP_CARG *prepare)(ITransaction* self, IStatus* status, unsigned msgLength, const unsigned char* message) throw(); - void (CLOOP_CARG *commit_1)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedCommit)(ITransaction* self, IStatus* status) throw(); void (CLOOP_CARG *commitRetaining)(ITransaction* self, IStatus* status) throw(); - void (CLOOP_CARG *rollback_1)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedRollback)(ITransaction* self, IStatus* status) throw(); void (CLOOP_CARG *rollbackRetaining)(ITransaction* self, IStatus* status) throw(); - void (CLOOP_CARG *disconnect_1)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedDisconnect)(ITransaction* self, IStatus* status) throw(); ITransaction* (CLOOP_CARG *join)(ITransaction* self, IStatus* status, ITransaction* transaction) throw(); ITransaction* (CLOOP_CARG *validate)(ITransaction* self, IStatus* status, IAttachment* attachment) throw(); ITransaction* (CLOOP_CARG *enterDtc)(ITransaction* self, IStatus* status) throw(); @@ -1182,10 +1192,10 @@ namespace Firebird StatusType::checkException(status); } - template void commit_1(StatusType* status) + template void deprecatedCommit(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->commit_1(this, status); + static_cast(this->cloopVTable)->deprecatedCommit(this, status); StatusType::checkException(status); } @@ -1196,10 +1206,10 @@ namespace Firebird StatusType::checkException(status); } - template void rollback_1(StatusType* status) + template void deprecatedRollback(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->rollback_1(this, status); + static_cast(this->cloopVTable)->deprecatedRollback(this, status); StatusType::checkException(status); } @@ -1210,10 +1220,10 @@ namespace Firebird StatusType::checkException(status); } - template void disconnect_1(StatusType* status) + template void deprecatedDisconnect(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->disconnect_1(this, status); + static_cast(this->cloopVTable)->deprecatedDisconnect(this, status); StatusType::checkException(status); } @@ -1245,8 +1255,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedCommit(status); + } return; } StatusType::clearException(status); @@ -1258,8 +1273,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedRollback(status); + } return; } StatusType::clearException(status); @@ -1271,8 +1291,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedDisconnect(status); + } return; } StatusType::clearException(status); @@ -1640,7 +1665,7 @@ namespace Firebird FB_BOOLEAN (CLOOP_CARG *isEof)(IResultSet* self, IStatus* status) throw(); FB_BOOLEAN (CLOOP_CARG *isBof)(IResultSet* self, IStatus* status) throw(); IMessageMetadata* (CLOOP_CARG *getMetadata)(IResultSet* self, IStatus* status) throw(); - void (CLOOP_CARG *close_1)(IResultSet* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedClose)(IResultSet* self, IStatus* status) throw(); void (CLOOP_CARG *setDelayedOutputFormat)(IResultSet* self, IStatus* status, IMessageMetadata* format) throw(); void (CLOOP_CARG *close)(IResultSet* self, IStatus* status) throw(); }; @@ -1730,10 +1755,10 @@ namespace Firebird return ret; } - template void close_1(StatusType* status) + template void deprecatedClose(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close_1(this, status); + static_cast(this->cloopVTable)->deprecatedClose(this, status); StatusType::checkException(status); } @@ -1748,8 +1773,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IResultSet", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IResultSet", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedClose(status); + } return; } StatusType::clearException(status); @@ -1772,7 +1802,7 @@ namespace Firebird ITransaction* (CLOOP_CARG *execute)(IStatement* self, IStatus* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, void* outBuffer) throw(); IResultSet* (CLOOP_CARG *openCursor)(IStatement* self, IStatus* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned flags) throw(); void (CLOOP_CARG *setCursorName)(IStatement* self, IStatus* status, const char* name) throw(); - void (CLOOP_CARG *free_1)(IStatement* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedFree)(IStatement* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getFlags)(IStatement* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getTimeout)(IStatement* self, IStatus* status) throw(); void (CLOOP_CARG *setTimeout)(IStatement* self, IStatus* status, unsigned timeOut) throw(); @@ -1877,10 +1907,10 @@ namespace Firebird StatusType::checkException(status); } - template void free_1(StatusType* status) + template void deprecatedFree(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->free_1(this, status); + static_cast(this->cloopVTable)->deprecatedFree(this, status); StatusType::checkException(status); } @@ -1937,8 +1967,13 @@ namespace Firebird { if (cloopVTable->version < 5) { - StatusType::setVersionError(status, "IStatement", cloopVTable->version, 5); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IStatement", cloopVTable->version, 5); + StatusType::checkException(status); + } + else { + deprecatedFree(status); + } return; } StatusType::clearException(status); @@ -1962,7 +1997,7 @@ namespace Firebird unsigned (CLOOP_CARG *getBlobAlignment)(IBatch* self, IStatus* status) throw(); IMessageMetadata* (CLOOP_CARG *getMetadata)(IBatch* self, IStatus* status) throw(); void (CLOOP_CARG *setDefaultBpb)(IBatch* self, IStatus* status, unsigned parLength, const unsigned char* par) throw(); - void (CLOOP_CARG *close_1)(IBatch* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedClose)(IBatch* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IBatch* self, IStatus* status) throw(); }; @@ -2064,10 +2099,10 @@ namespace Firebird StatusType::checkException(status); } - template void close_1(StatusType* status) + template void deprecatedClose(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close_1(this, status); + static_cast(this->cloopVTable)->deprecatedClose(this, status); StatusType::checkException(status); } @@ -2075,8 +2110,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IBatch", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IBatch", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedClose(status); + } return; } StatusType::clearException(status); @@ -2151,7 +2191,7 @@ namespace Firebird struct VTable : public IReferenceCounted::VTable { void (CLOOP_CARG *process)(IReplicator* self, IStatus* status, unsigned length, const unsigned char* data) throw(); - void (CLOOP_CARG *close_1)(IReplicator* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedClose)(IReplicator* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IReplicator* self, IStatus* status) throw(); }; @@ -2175,10 +2215,10 @@ namespace Firebird StatusType::checkException(status); } - template void close_1(StatusType* status) + template void deprecatedClose(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close_1(this, status); + static_cast(this->cloopVTable)->deprecatedClose(this, status); StatusType::checkException(status); } @@ -2186,8 +2226,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IReplicator", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IReplicator", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedClose(status); + } return; } StatusType::clearException(status); @@ -2207,7 +2252,7 @@ namespace Firebird void (CLOOP_CARG *start)(IRequest* self, IStatus* status, ITransaction* tra, int level) throw(); void (CLOOP_CARG *startAndSend)(IRequest* self, IStatus* status, ITransaction* tra, int level, unsigned msgType, unsigned length, const void* message) throw(); void (CLOOP_CARG *unwind)(IRequest* self, IStatus* status, int level) throw(); - void (CLOOP_CARG *free_1)(IRequest* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedFree)(IRequest* self, IStatus* status) throw(); void (CLOOP_CARG *free)(IRequest* self, IStatus* status) throw(); }; @@ -2266,10 +2311,10 @@ namespace Firebird StatusType::checkException(status); } - template void free_1(StatusType* status) + template void deprecatedFree(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->free_1(this, status); + static_cast(this->cloopVTable)->deprecatedFree(this, status); StatusType::checkException(status); } @@ -2277,8 +2322,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IRequest", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IRequest", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedFree(status); + } return; } StatusType::clearException(status); @@ -2292,7 +2342,7 @@ namespace Firebird public: struct VTable : public IReferenceCounted::VTable { - void (CLOOP_CARG *cancel_1)(IEvents* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedCancel)(IEvents* self, IStatus* status) throw(); void (CLOOP_CARG *cancel)(IEvents* self, IStatus* status) throw(); }; @@ -2309,10 +2359,10 @@ namespace Firebird public: static const unsigned VERSION = 4; - template void cancel_1(StatusType* status) + template void deprecatedCancel(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->cancel_1(this, status); + static_cast(this->cloopVTable)->deprecatedCancel(this, status); StatusType::checkException(status); } @@ -2320,8 +2370,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IEvents", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IEvents", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedCancel(status); + } return; } StatusType::clearException(status); @@ -2351,8 +2406,8 @@ namespace Firebird IEvents* (CLOOP_CARG *queEvents)(IAttachment* self, IStatus* status, IEventCallback* callback, unsigned length, const unsigned char* events) throw(); void (CLOOP_CARG *cancelOperation)(IAttachment* self, IStatus* status, int option) throw(); void (CLOOP_CARG *ping)(IAttachment* self, IStatus* status) throw(); - void (CLOOP_CARG *detach_1)(IAttachment* self, IStatus* status) throw(); - void (CLOOP_CARG *dropDatabase_1)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedDetach)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedDropDatabase)(IAttachment* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getIdleTimeout)(IAttachment* self, IStatus* status) throw(); void (CLOOP_CARG *setIdleTimeout)(IAttachment* self, IStatus* status, unsigned timeOut) throw(); unsigned (CLOOP_CARG *getStatementTimeout)(IAttachment* self, IStatus* status) throw(); @@ -2498,17 +2553,17 @@ namespace Firebird StatusType::checkException(status); } - template void detach_1(StatusType* status) + template void deprecatedDetach(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->detach_1(this, status); + static_cast(this->cloopVTable)->deprecatedDetach(this, status); StatusType::checkException(status); } - template void dropDatabase_1(StatusType* status) + template void deprecatedDropDatabase(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->dropDatabase_1(this, status); + static_cast(this->cloopVTable)->deprecatedDropDatabase(this, status); StatusType::checkException(status); } @@ -2598,8 +2653,13 @@ namespace Firebird { if (cloopVTable->version < 5) { - StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); + StatusType::checkException(status); + } + else { + deprecatedDetach(status); + } return; } StatusType::clearException(status); @@ -2611,8 +2671,13 @@ namespace Firebird { if (cloopVTable->version < 5) { - StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); + StatusType::checkException(status); + } + else { + deprecatedDropDatabase(status); + } return; } StatusType::clearException(status); @@ -2626,7 +2691,7 @@ namespace Firebird public: struct VTable : public IReferenceCounted::VTable { - void (CLOOP_CARG *detach_1)(IService* self, IStatus* status) throw(); + void (CLOOP_CARG *deprecatedDetach)(IService* self, IStatus* status) throw(); void (CLOOP_CARG *query)(IService* self, IStatus* status, unsigned sendLength, const unsigned char* sendItems, unsigned receiveLength, const unsigned char* receiveItems, unsigned bufferLength, unsigned char* buffer) throw(); void (CLOOP_CARG *start)(IService* self, IStatus* status, unsigned spbLength, const unsigned char* spb) throw(); void (CLOOP_CARG *detach)(IService* self, IStatus* status) throw(); @@ -2645,10 +2710,10 @@ namespace Firebird public: static const unsigned VERSION = 4; - template void detach_1(StatusType* status) + template void deprecatedDetach(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->detach_1(this, status); + static_cast(this->cloopVTable)->deprecatedDetach(this, status); StatusType::checkException(status); } @@ -2670,8 +2735,13 @@ namespace Firebird { if (cloopVTable->version < 4) { - StatusType::setVersionError(status, "IService", cloopVTable->version, 4); - StatusType::checkException(status); + if (FB_UsedInYValve) { + StatusType::setVersionError(status, "IService", cloopVTable->version, 4); + StatusType::checkException(status); + } + else { + deprecatedDetach(status); + } return; } StatusType::clearException(status); @@ -8415,8 +8485,8 @@ namespace Firebird this->getInfo = &Name::cloopgetInfoDispatcher; this->getSegment = &Name::cloopgetSegmentDispatcher; this->putSegment = &Name::cloopputSegmentDispatcher; - this->cancel_1 = &Name::cloopcancel_1Dispatcher; - this->close_1 = &Name::cloopclose_1Dispatcher; + this->deprecatedCancel = &Name::cloopdeprecatedCancelDispatcher; + this->deprecatedClose = &Name::cloopdeprecatedCloseDispatcher; this->seek = &Name::cloopseekDispatcher; this->cancel = &Name::cloopcancelDispatcher; this->close = &Name::cloopcloseDispatcher; @@ -8469,13 +8539,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopcancel_1Dispatcher(IBlob* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCancelDispatcher(IBlob* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::cancel_1(&status2); + static_cast(self)->Name::deprecatedCancel(&status2); } catch (...) { @@ -8483,13 +8553,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopclose_1Dispatcher(IBlob* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCloseDispatcher(IBlob* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::close_1(&status2); + static_cast(self)->Name::deprecatedClose(&status2); } catch (...) { @@ -8582,8 +8652,8 @@ namespace Firebird virtual void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) = 0; virtual int getSegment(StatusType* status, unsigned bufferLength, void* buffer, unsigned* segmentLength) = 0; virtual void putSegment(StatusType* status, unsigned length, const void* buffer) = 0; - virtual void cancel_1(StatusType* status) = 0; - virtual void close_1(StatusType* status) = 0; + virtual void deprecatedCancel(StatusType* status) = 0; + virtual void deprecatedClose(StatusType* status) = 0; virtual int seek(StatusType* status, int mode, int offset) = 0; virtual void cancel(StatusType* status) = 0; virtual void close(StatusType* status) = 0; @@ -8606,11 +8676,11 @@ namespace Firebird this->release = &Name::cloopreleaseDispatcher; this->getInfo = &Name::cloopgetInfoDispatcher; this->prepare = &Name::cloopprepareDispatcher; - this->commit_1 = &Name::cloopcommit_1Dispatcher; + this->deprecatedCommit = &Name::cloopdeprecatedCommitDispatcher; this->commitRetaining = &Name::cloopcommitRetainingDispatcher; - this->rollback_1 = &Name::clooprollback_1Dispatcher; + this->deprecatedRollback = &Name::cloopdeprecatedRollbackDispatcher; this->rollbackRetaining = &Name::clooprollbackRetainingDispatcher; - this->disconnect_1 = &Name::cloopdisconnect_1Dispatcher; + this->deprecatedDisconnect = &Name::cloopdeprecatedDisconnectDispatcher; this->join = &Name::cloopjoinDispatcher; this->validate = &Name::cloopvalidateDispatcher; this->enterDtc = &Name::cloopenterDtcDispatcher; @@ -8651,13 +8721,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopcommit_1Dispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCommitDispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::commit_1(&status2); + static_cast(self)->Name::deprecatedCommit(&status2); } catch (...) { @@ -8679,13 +8749,13 @@ namespace Firebird } } - static void CLOOP_CARG clooprollback_1Dispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedRollbackDispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::rollback_1(&status2); + static_cast(self)->Name::deprecatedRollback(&status2); } catch (...) { @@ -8707,13 +8777,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdisconnect_1Dispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedDisconnectDispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::disconnect_1(&status2); + static_cast(self)->Name::deprecatedDisconnect(&status2); } catch (...) { @@ -8849,11 +8919,11 @@ namespace Firebird virtual void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) = 0; virtual void prepare(StatusType* status, unsigned msgLength, const unsigned char* message) = 0; - virtual void commit_1(StatusType* status) = 0; + virtual void deprecatedCommit(StatusType* status) = 0; virtual void commitRetaining(StatusType* status) = 0; - virtual void rollback_1(StatusType* status) = 0; + virtual void deprecatedRollback(StatusType* status) = 0; virtual void rollbackRetaining(StatusType* status) = 0; - virtual void disconnect_1(StatusType* status) = 0; + virtual void deprecatedDisconnect(StatusType* status) = 0; virtual ITransaction* join(StatusType* status, ITransaction* transaction) = 0; virtual ITransaction* validate(StatusType* status, IAttachment* attachment) = 0; virtual ITransaction* enterDtc(StatusType* status) = 0; @@ -9525,7 +9595,7 @@ namespace Firebird this->isEof = &Name::cloopisEofDispatcher; this->isBof = &Name::cloopisBofDispatcher; this->getMetadata = &Name::cloopgetMetadataDispatcher; - this->close_1 = &Name::cloopclose_1Dispatcher; + this->deprecatedClose = &Name::cloopdeprecatedCloseDispatcher; this->setDelayedOutputFormat = &Name::cloopsetDelayedOutputFormatDispatcher; this->close = &Name::cloopcloseDispatcher; } @@ -9669,13 +9739,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopclose_1Dispatcher(IResultSet* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCloseDispatcher(IResultSet* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::close_1(&status2); + static_cast(self)->Name::deprecatedClose(&status2); } catch (...) { @@ -9759,7 +9829,7 @@ namespace Firebird virtual FB_BOOLEAN isEof(StatusType* status) = 0; virtual FB_BOOLEAN isBof(StatusType* status) = 0; virtual IMessageMetadata* getMetadata(StatusType* status) = 0; - virtual void close_1(StatusType* status) = 0; + virtual void deprecatedClose(StatusType* status) = 0; virtual void setDelayedOutputFormat(StatusType* status, IMessageMetadata* format) = 0; virtual void close(StatusType* status) = 0; }; @@ -9788,7 +9858,7 @@ namespace Firebird this->execute = &Name::cloopexecuteDispatcher; this->openCursor = &Name::cloopopenCursorDispatcher; this->setCursorName = &Name::cloopsetCursorNameDispatcher; - this->free_1 = &Name::cloopfree_1Dispatcher; + this->deprecatedFree = &Name::cloopdeprecatedFreeDispatcher; this->getFlags = &Name::cloopgetFlagsDispatcher; this->getTimeout = &Name::cloopgetTimeoutDispatcher; this->setTimeout = &Name::cloopsetTimeoutDispatcher; @@ -9933,13 +10003,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopfree_1Dispatcher(IStatement* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedFreeDispatcher(IStatement* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::free_1(&status2); + static_cast(self)->Name::deprecatedFree(&status2); } catch (...) { @@ -10068,7 +10138,7 @@ namespace Firebird virtual ITransaction* execute(StatusType* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, void* outBuffer) = 0; virtual IResultSet* openCursor(StatusType* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned flags) = 0; virtual void setCursorName(StatusType* status, const char* name) = 0; - virtual void free_1(StatusType* status) = 0; + virtual void deprecatedFree(StatusType* status) = 0; virtual unsigned getFlags(StatusType* status) = 0; virtual unsigned getTimeout(StatusType* status) = 0; virtual void setTimeout(StatusType* status, unsigned timeOut) = 0; @@ -10101,7 +10171,7 @@ namespace Firebird this->getBlobAlignment = &Name::cloopgetBlobAlignmentDispatcher; this->getMetadata = &Name::cloopgetMetadataDispatcher; this->setDefaultBpb = &Name::cloopsetDefaultBpbDispatcher; - this->close_1 = &Name::cloopclose_1Dispatcher; + this->deprecatedClose = &Name::cloopdeprecatedCloseDispatcher; this->close = &Name::cloopcloseDispatcher; } } vTable; @@ -10252,13 +10322,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopclose_1Dispatcher(IBatch* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCloseDispatcher(IBatch* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::close_1(&status2); + static_cast(self)->Name::deprecatedClose(&status2); } catch (...) { @@ -10329,7 +10399,7 @@ namespace Firebird virtual unsigned getBlobAlignment(StatusType* status) = 0; virtual IMessageMetadata* getMetadata(StatusType* status) = 0; virtual void setDefaultBpb(StatusType* status, unsigned parLength, const unsigned char* par) = 0; - virtual void close_1(StatusType* status) = 0; + virtual void deprecatedClose(StatusType* status) = 0; virtual void close(StatusType* status) = 0; }; @@ -10464,7 +10534,7 @@ namespace Firebird this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; this->process = &Name::cloopprocessDispatcher; - this->close_1 = &Name::cloopclose_1Dispatcher; + this->deprecatedClose = &Name::cloopdeprecatedCloseDispatcher; this->close = &Name::cloopcloseDispatcher; } } vTable; @@ -10486,13 +10556,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopclose_1Dispatcher(IReplicator* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCloseDispatcher(IReplicator* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::close_1(&status2); + static_cast(self)->Name::deprecatedClose(&status2); } catch (...) { @@ -10554,7 +10624,7 @@ namespace Firebird } virtual void process(StatusType* status, unsigned length, const unsigned char* data) = 0; - virtual void close_1(StatusType* status) = 0; + virtual void deprecatedClose(StatusType* status) = 0; virtual void close(StatusType* status) = 0; }; @@ -10579,7 +10649,7 @@ namespace Firebird this->start = &Name::cloopstartDispatcher; this->startAndSend = &Name::cloopstartAndSendDispatcher; this->unwind = &Name::cloopunwindDispatcher; - this->free_1 = &Name::cloopfree_1Dispatcher; + this->deprecatedFree = &Name::cloopdeprecatedFreeDispatcher; this->free = &Name::cloopfreeDispatcher; } } vTable; @@ -10671,13 +10741,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopfree_1Dispatcher(IRequest* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedFreeDispatcher(IRequest* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::free_1(&status2); + static_cast(self)->Name::deprecatedFree(&status2); } catch (...) { @@ -10744,7 +10814,7 @@ namespace Firebird virtual void start(StatusType* status, ITransaction* tra, int level) = 0; virtual void startAndSend(StatusType* status, ITransaction* tra, int level, unsigned msgType, unsigned length, const void* message) = 0; virtual void unwind(StatusType* status, int level) = 0; - virtual void free_1(StatusType* status) = 0; + virtual void deprecatedFree(StatusType* status) = 0; virtual void free(StatusType* status) = 0; }; @@ -10763,7 +10833,7 @@ namespace Firebird this->version = Base::VERSION; this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; - this->cancel_1 = &Name::cloopcancel_1Dispatcher; + this->deprecatedCancel = &Name::cloopdeprecatedCancelDispatcher; this->cancel = &Name::cloopcancelDispatcher; } } vTable; @@ -10771,13 +10841,13 @@ namespace Firebird this->cloopVTable = &vTable; } - static void CLOOP_CARG cloopcancel_1Dispatcher(IEvents* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedCancelDispatcher(IEvents* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::cancel_1(&status2); + static_cast(self)->Name::deprecatedCancel(&status2); } catch (...) { @@ -10838,7 +10908,7 @@ namespace Firebird { } - virtual void cancel_1(StatusType* status) = 0; + virtual void deprecatedCancel(StatusType* status) = 0; virtual void cancel(StatusType* status) = 0; }; @@ -10873,8 +10943,8 @@ namespace Firebird this->queEvents = &Name::cloopqueEventsDispatcher; this->cancelOperation = &Name::cloopcancelOperationDispatcher; this->ping = &Name::clooppingDispatcher; - this->detach_1 = &Name::cloopdetach_1Dispatcher; - this->dropDatabase_1 = &Name::cloopdropDatabase_1Dispatcher; + this->deprecatedDetach = &Name::cloopdeprecatedDetachDispatcher; + this->deprecatedDropDatabase = &Name::cloopdeprecatedDropDatabaseDispatcher; this->getIdleTimeout = &Name::cloopgetIdleTimeoutDispatcher; this->setIdleTimeout = &Name::cloopsetIdleTimeoutDispatcher; this->getStatementTimeout = &Name::cloopgetStatementTimeoutDispatcher; @@ -11123,13 +11193,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdetach_1Dispatcher(IAttachment* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedDetachDispatcher(IAttachment* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::detach_1(&status2); + static_cast(self)->Name::deprecatedDetach(&status2); } catch (...) { @@ -11137,13 +11207,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdropDatabase_1Dispatcher(IAttachment* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedDropDatabaseDispatcher(IAttachment* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::dropDatabase_1(&status2); + static_cast(self)->Name::deprecatedDropDatabase(&status2); } catch (...) { @@ -11322,8 +11392,8 @@ namespace Firebird virtual IEvents* queEvents(StatusType* status, IEventCallback* callback, unsigned length, const unsigned char* events) = 0; virtual void cancelOperation(StatusType* status, int option) = 0; virtual void ping(StatusType* status) = 0; - virtual void detach_1(StatusType* status) = 0; - virtual void dropDatabase_1(StatusType* status) = 0; + virtual void deprecatedDetach(StatusType* status) = 0; + virtual void deprecatedDropDatabase(StatusType* status) = 0; virtual unsigned getIdleTimeout(StatusType* status) = 0; virtual void setIdleTimeout(StatusType* status, unsigned timeOut) = 0; virtual unsigned getStatementTimeout(StatusType* status) = 0; @@ -11349,7 +11419,7 @@ namespace Firebird this->version = Base::VERSION; this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; - this->detach_1 = &Name::cloopdetach_1Dispatcher; + this->deprecatedDetach = &Name::cloopdeprecatedDetachDispatcher; this->query = &Name::cloopqueryDispatcher; this->start = &Name::cloopstartDispatcher; this->detach = &Name::cloopdetachDispatcher; @@ -11359,13 +11429,13 @@ namespace Firebird this->cloopVTable = &vTable; } - static void CLOOP_CARG cloopdetach_1Dispatcher(IService* self, IStatus* status) throw() + static void CLOOP_CARG cloopdeprecatedDetachDispatcher(IService* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::detach_1(&status2); + static_cast(self)->Name::deprecatedDetach(&status2); } catch (...) { @@ -11454,7 +11524,7 @@ namespace Firebird { } - virtual void detach_1(StatusType* status) = 0; + virtual void deprecatedDetach(StatusType* status) = 0; virtual void query(StatusType* status, unsigned sendLength, const unsigned char* sendItems, unsigned receiveLength, const unsigned char* receiveItems, unsigned bufferLength, unsigned char* buffer) = 0; virtual void start(StatusType* status, unsigned spbLength, const unsigned char* spb) = 0; virtual void detach(StatusType* status) = 0; diff --git a/src/include/firebird/Interface.h b/src/include/firebird/Interface.h index 9fdc60790c..bc9ff3a27b 100644 --- a/src/include/firebird/Interface.h +++ b/src/include/firebird/Interface.h @@ -106,6 +106,9 @@ inline const intptr_t* stubError() } // namespace Firebird +#ifndef FB_UsedInYValve +#define FB_UsedInYValve false +#endif #include "IdlFbInterfaces.h" diff --git a/src/include/gen/Firebird.pas b/src/include/gen/Firebird.pas index d4af3e0922..100739fe39 100644 --- a/src/include/gen/Firebird.pas +++ b/src/include/gen/Firebird.pas @@ -121,6 +121,8 @@ type class procedure checkException(status: IStatus); class procedure catchException(status: IStatus; e: Exception); + class procedure setVersionError(status: IStatus; interfaceName: string; + currentVersion, expectedVersion: NativeInt); private status: IStatus; @@ -276,18 +278,18 @@ type IBlob_getInfoPtr = procedure(this: IBlob; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IBlob_getSegmentPtr = function(this: IBlob; status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; cdecl; IBlob_putSegmentPtr = procedure(this: IBlob; status: IStatus; length: Cardinal; buffer: Pointer); cdecl; - IBlob_cancel_1Ptr = procedure(this: IBlob; status: IStatus); cdecl; - IBlob_close_1Ptr = procedure(this: IBlob; status: IStatus); cdecl; + IBlob_deprecatedCancelPtr = procedure(this: IBlob; status: IStatus); cdecl; + IBlob_deprecatedClosePtr = procedure(this: IBlob; status: IStatus); cdecl; IBlob_seekPtr = function(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer; cdecl; IBlob_cancelPtr = procedure(this: IBlob; status: IStatus); cdecl; IBlob_closePtr = procedure(this: IBlob; status: IStatus); cdecl; ITransaction_getInfoPtr = procedure(this: ITransaction; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; ITransaction_preparePtr = procedure(this: ITransaction; status: IStatus; msgLength: Cardinal; message: BytePtr); cdecl; - ITransaction_commit_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_deprecatedCommitPtr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_commitRetainingPtr = procedure(this: ITransaction; status: IStatus); cdecl; - ITransaction_rollback_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_deprecatedRollbackPtr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_rollbackRetainingPtr = procedure(this: ITransaction; status: IStatus); cdecl; - ITransaction_disconnect_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_deprecatedDisconnectPtr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_joinPtr = function(this: ITransaction; status: IStatus; transaction: ITransaction): ITransaction; cdecl; ITransaction_validatePtr = function(this: ITransaction; status: IStatus; attachment: IAttachment): ITransaction; cdecl; ITransaction_enterDtcPtr = function(this: ITransaction; status: IStatus): ITransaction; cdecl; @@ -334,7 +336,7 @@ type IResultSet_isEofPtr = function(this: IResultSet; status: IStatus): Boolean; cdecl; IResultSet_isBofPtr = function(this: IResultSet; status: IStatus): Boolean; cdecl; IResultSet_getMetadataPtr = function(this: IResultSet; status: IStatus): IMessageMetadata; cdecl; - IResultSet_close_1Ptr = procedure(this: IResultSet; status: IStatus); cdecl; + IResultSet_deprecatedClosePtr = procedure(this: IResultSet; status: IStatus); cdecl; IResultSet_setDelayedOutputFormatPtr = procedure(this: IResultSet; status: IStatus; format: IMessageMetadata); cdecl; IResultSet_closePtr = procedure(this: IResultSet; status: IStatus); cdecl; IStatement_getInfoPtr = procedure(this: IStatement; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; @@ -346,7 +348,7 @@ type IStatement_executePtr = function(this: IStatement; status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; cdecl; IStatement_openCursorPtr = function(this: IStatement; status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; cdecl; IStatement_setCursorNamePtr = procedure(this: IStatement; status: IStatus; name: PAnsiChar); cdecl; - IStatement_free_1Ptr = procedure(this: IStatement; status: IStatus); cdecl; + IStatement_deprecatedFreePtr = procedure(this: IStatement; status: IStatus); cdecl; IStatement_getFlagsPtr = function(this: IStatement; status: IStatus): Cardinal; cdecl; IStatement_getTimeoutPtr = function(this: IStatement; status: IStatus): Cardinal; cdecl; IStatement_setTimeoutPtr = procedure(this: IStatement; status: IStatus; timeOut: Cardinal); cdecl; @@ -362,14 +364,14 @@ type IBatch_getBlobAlignmentPtr = function(this: IBatch; status: IStatus): Cardinal; cdecl; IBatch_getMetadataPtr = function(this: IBatch; status: IStatus): IMessageMetadata; cdecl; IBatch_setDefaultBpbPtr = procedure(this: IBatch; status: IStatus; parLength: Cardinal; par: BytePtr); cdecl; - IBatch_close_1Ptr = procedure(this: IBatch; status: IStatus); cdecl; + IBatch_deprecatedClosePtr = procedure(this: IBatch; status: IStatus); cdecl; IBatch_closePtr = procedure(this: IBatch; status: IStatus); cdecl; IBatchCompletionState_getSizePtr = function(this: IBatchCompletionState; status: IStatus): Cardinal; cdecl; IBatchCompletionState_getStatePtr = function(this: IBatchCompletionState; status: IStatus; pos: Cardinal): Integer; cdecl; IBatchCompletionState_findErrorPtr = function(this: IBatchCompletionState; status: IStatus; pos: Cardinal): Cardinal; cdecl; IBatchCompletionState_getStatusPtr = procedure(this: IBatchCompletionState; status: IStatus; to_: IStatus; pos: Cardinal); cdecl; IReplicator_processPtr = procedure(this: IReplicator; status: IStatus; length: Cardinal; data: BytePtr); cdecl; - IReplicator_close_1Ptr = procedure(this: IReplicator; status: IStatus); cdecl; + IReplicator_deprecatedClosePtr = procedure(this: IReplicator; status: IStatus); cdecl; IReplicator_closePtr = procedure(this: IReplicator; status: IStatus); cdecl; IRequest_receivePtr = procedure(this: IRequest; status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; IRequest_sendPtr = procedure(this: IRequest; status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; @@ -377,9 +379,9 @@ type IRequest_startPtr = procedure(this: IRequest; status: IStatus; tra: ITransaction; level: Integer); cdecl; IRequest_startAndSendPtr = procedure(this: IRequest; status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; IRequest_unwindPtr = procedure(this: IRequest; status: IStatus; level: Integer); cdecl; - IRequest_free_1Ptr = procedure(this: IRequest; status: IStatus); cdecl; + IRequest_deprecatedFreePtr = procedure(this: IRequest; status: IStatus); cdecl; IRequest_freePtr = procedure(this: IRequest; status: IStatus); cdecl; - IEvents_cancel_1Ptr = procedure(this: IEvents; status: IStatus); cdecl; + IEvents_deprecatedCancelPtr = procedure(this: IEvents; status: IStatus); cdecl; IEvents_cancelPtr = procedure(this: IEvents; status: IStatus); cdecl; IAttachment_getInfoPtr = procedure(this: IAttachment; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IAttachment_startTransactionPtr = function(this: IAttachment; status: IStatus; tpbLength: Cardinal; tpb: BytePtr): ITransaction; cdecl; @@ -397,8 +399,8 @@ type IAttachment_queEventsPtr = function(this: IAttachment; status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; cdecl; IAttachment_cancelOperationPtr = procedure(this: IAttachment; status: IStatus; option: Integer); cdecl; IAttachment_pingPtr = procedure(this: IAttachment; status: IStatus); cdecl; - IAttachment_detach_1Ptr = procedure(this: IAttachment; status: IStatus); cdecl; - IAttachment_dropDatabase_1Ptr = procedure(this: IAttachment; status: IStatus); cdecl; + IAttachment_deprecatedDetachPtr = procedure(this: IAttachment; status: IStatus); cdecl; + IAttachment_deprecatedDropDatabasePtr = procedure(this: IAttachment; status: IStatus); cdecl; IAttachment_getIdleTimeoutPtr = function(this: IAttachment; status: IStatus): Cardinal; cdecl; IAttachment_setIdleTimeoutPtr = procedure(this: IAttachment; status: IStatus; timeOut: Cardinal); cdecl; IAttachment_getStatementTimeoutPtr = function(this: IAttachment; status: IStatus): Cardinal; cdecl; @@ -407,7 +409,7 @@ type IAttachment_createReplicatorPtr = function(this: IAttachment; status: IStatus): IReplicator; cdecl; IAttachment_detachPtr = procedure(this: IAttachment; status: IStatus); cdecl; IAttachment_dropDatabasePtr = procedure(this: IAttachment; status: IStatus); cdecl; - IService_detach_1Ptr = procedure(this: IService; status: IStatus); cdecl; + IService_deprecatedDetachPtr = procedure(this: IService; status: IStatus); cdecl; IService_queryPtr = procedure(this: IService; status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IService_startPtr = procedure(this: IService; status: IStatus; spbLength: Cardinal; spb: BytePtr); cdecl; IService_detachPtr = procedure(this: IService; status: IStatus); cdecl; @@ -1197,8 +1199,8 @@ type getInfo: IBlob_getInfoPtr; getSegment: IBlob_getSegmentPtr; putSegment: IBlob_putSegmentPtr; - cancel_1: IBlob_cancel_1Ptr; - close_1: IBlob_close_1Ptr; + deprecatedCancel: IBlob_deprecatedCancelPtr; + deprecatedClose: IBlob_deprecatedClosePtr; seek: IBlob_seekPtr; cancel: IBlob_cancelPtr; close: IBlob_closePtr; @@ -1210,8 +1212,8 @@ type procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); function getSegment(status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; procedure putSegment(status: IStatus; length: Cardinal; buffer: Pointer); - procedure cancel_1(status: IStatus); - procedure close_1(status: IStatus); + procedure deprecatedCancel(status: IStatus); + procedure deprecatedClose(status: IStatus); function seek(status: IStatus; mode: Integer; offset: Integer): Integer; procedure cancel(status: IStatus); procedure close(status: IStatus); @@ -1225,8 +1227,8 @@ type procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; function getSegment(status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; virtual; abstract; procedure putSegment(status: IStatus; length: Cardinal; buffer: Pointer); virtual; abstract; - procedure cancel_1(status: IStatus); virtual; abstract; - procedure close_1(status: IStatus); virtual; abstract; + procedure deprecatedCancel(status: IStatus); virtual; abstract; + procedure deprecatedClose(status: IStatus); virtual; abstract; function seek(status: IStatus; mode: Integer; offset: Integer): Integer; virtual; abstract; procedure cancel(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; @@ -1235,11 +1237,11 @@ type TransactionVTable = class(ReferenceCountedVTable) getInfo: ITransaction_getInfoPtr; prepare: ITransaction_preparePtr; - commit_1: ITransaction_commit_1Ptr; + deprecatedCommit: ITransaction_deprecatedCommitPtr; commitRetaining: ITransaction_commitRetainingPtr; - rollback_1: ITransaction_rollback_1Ptr; + deprecatedRollback: ITransaction_deprecatedRollbackPtr; rollbackRetaining: ITransaction_rollbackRetainingPtr; - disconnect_1: ITransaction_disconnect_1Ptr; + deprecatedDisconnect: ITransaction_deprecatedDisconnectPtr; join: ITransaction_joinPtr; validate: ITransaction_validatePtr; enterDtc: ITransaction_enterDtcPtr; @@ -1253,11 +1255,11 @@ type procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); procedure prepare(status: IStatus; msgLength: Cardinal; message: BytePtr); - procedure commit_1(status: IStatus); + procedure deprecatedCommit(status: IStatus); procedure commitRetaining(status: IStatus); - procedure rollback_1(status: IStatus); + procedure deprecatedRollback(status: IStatus); procedure rollbackRetaining(status: IStatus); - procedure disconnect_1(status: IStatus); + procedure deprecatedDisconnect(status: IStatus); function join(status: IStatus; transaction: ITransaction): ITransaction; function validate(status: IStatus; attachment: IAttachment): ITransaction; function enterDtc(status: IStatus): ITransaction; @@ -1273,11 +1275,11 @@ type function release(): Integer; virtual; abstract; procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; procedure prepare(status: IStatus; msgLength: Cardinal; message: BytePtr); virtual; abstract; - procedure commit_1(status: IStatus); virtual; abstract; + procedure deprecatedCommit(status: IStatus); virtual; abstract; procedure commitRetaining(status: IStatus); virtual; abstract; - procedure rollback_1(status: IStatus); virtual; abstract; + procedure deprecatedRollback(status: IStatus); virtual; abstract; procedure rollbackRetaining(status: IStatus); virtual; abstract; - procedure disconnect_1(status: IStatus); virtual; abstract; + procedure deprecatedDisconnect(status: IStatus); virtual; abstract; function join(status: IStatus; transaction: ITransaction): ITransaction; virtual; abstract; function validate(status: IStatus; attachment: IAttachment): ITransaction; virtual; abstract; function enterDtc(status: IStatus): ITransaction; virtual; abstract; @@ -1419,7 +1421,7 @@ type isEof: IResultSet_isEofPtr; isBof: IResultSet_isBofPtr; getMetadata: IResultSet_getMetadataPtr; - close_1: IResultSet_close_1Ptr; + deprecatedClose: IResultSet_deprecatedClosePtr; setDelayedOutputFormat: IResultSet_setDelayedOutputFormatPtr; close: IResultSet_closePtr; end; @@ -1436,7 +1438,7 @@ type function isEof(status: IStatus): Boolean; function isBof(status: IStatus): Boolean; function getMetadata(status: IStatus): IMessageMetadata; - procedure close_1(status: IStatus); + procedure deprecatedClose(status: IStatus); procedure setDelayedOutputFormat(status: IStatus; format: IMessageMetadata); procedure close(status: IStatus); end; @@ -1455,7 +1457,7 @@ type function isEof(status: IStatus): Boolean; virtual; abstract; function isBof(status: IStatus): Boolean; virtual; abstract; function getMetadata(status: IStatus): IMessageMetadata; virtual; abstract; - procedure close_1(status: IStatus); virtual; abstract; + procedure deprecatedClose(status: IStatus); virtual; abstract; procedure setDelayedOutputFormat(status: IStatus; format: IMessageMetadata); virtual; abstract; procedure close(status: IStatus); virtual; abstract; end; @@ -1470,7 +1472,7 @@ type execute: IStatement_executePtr; openCursor: IStatement_openCursorPtr; setCursorName: IStatement_setCursorNamePtr; - free_1: IStatement_free_1Ptr; + deprecatedFree: IStatement_deprecatedFreePtr; getFlags: IStatement_getFlagsPtr; getTimeout: IStatement_getTimeoutPtr; setTimeout: IStatement_setTimeoutPtr; @@ -1503,7 +1505,7 @@ type function execute(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; function openCursor(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; procedure setCursorName(status: IStatus; name: PAnsiChar); - procedure free_1(status: IStatus); + procedure deprecatedFree(status: IStatus); function getFlags(status: IStatus): Cardinal; function getTimeout(status: IStatus): Cardinal; procedure setTimeout(status: IStatus; timeOut: Cardinal); @@ -1525,7 +1527,7 @@ type function execute(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; virtual; abstract; function openCursor(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; virtual; abstract; procedure setCursorName(status: IStatus; name: PAnsiChar); virtual; abstract; - procedure free_1(status: IStatus); virtual; abstract; + procedure deprecatedFree(status: IStatus); virtual; abstract; function getFlags(status: IStatus): Cardinal; virtual; abstract; function getTimeout(status: IStatus): Cardinal; virtual; abstract; procedure setTimeout(status: IStatus; timeOut: Cardinal); virtual; abstract; @@ -1544,7 +1546,7 @@ type getBlobAlignment: IBatch_getBlobAlignmentPtr; getMetadata: IBatch_getMetadataPtr; setDefaultBpb: IBatch_setDefaultBpbPtr; - close_1: IBatch_close_1Ptr; + deprecatedClose: IBatch_deprecatedClosePtr; close: IBatch_closePtr; end; @@ -1572,7 +1574,7 @@ type function getBlobAlignment(status: IStatus): Cardinal; function getMetadata(status: IStatus): IMessageMetadata; procedure setDefaultBpb(status: IStatus; parLength: Cardinal; par: BytePtr); - procedure close_1(status: IStatus); + procedure deprecatedClose(status: IStatus); procedure close(status: IStatus); end; @@ -1591,7 +1593,7 @@ type function getBlobAlignment(status: IStatus): Cardinal; virtual; abstract; function getMetadata(status: IStatus): IMessageMetadata; virtual; abstract; procedure setDefaultBpb(status: IStatus; parLength: Cardinal; par: BytePtr); virtual; abstract; - procedure close_1(status: IStatus); virtual; abstract; + procedure deprecatedClose(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; end; @@ -1626,7 +1628,7 @@ type ReplicatorVTable = class(ReferenceCountedVTable) process: IReplicator_processPtr; - close_1: IReplicator_close_1Ptr; + deprecatedClose: IReplicator_deprecatedClosePtr; close: IReplicator_closePtr; end; @@ -1634,7 +1636,7 @@ type const VERSION = 4; procedure process(status: IStatus; length: Cardinal; data: BytePtr); - procedure close_1(status: IStatus); + procedure deprecatedClose(status: IStatus); procedure close(status: IStatus); end; @@ -1644,7 +1646,7 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; procedure process(status: IStatus; length: Cardinal; data: BytePtr); virtual; abstract; - procedure close_1(status: IStatus); virtual; abstract; + procedure deprecatedClose(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; end; @@ -1655,7 +1657,7 @@ type start: IRequest_startPtr; startAndSend: IRequest_startAndSendPtr; unwind: IRequest_unwindPtr; - free_1: IRequest_free_1Ptr; + deprecatedFree: IRequest_deprecatedFreePtr; free: IRequest_freePtr; end; @@ -1668,7 +1670,7 @@ type procedure start(status: IStatus; tra: ITransaction; level: Integer); procedure startAndSend(status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); procedure unwind(status: IStatus; level: Integer); - procedure free_1(status: IStatus); + procedure deprecatedFree(status: IStatus); procedure free(status: IStatus); end; @@ -1683,19 +1685,19 @@ type procedure start(status: IStatus; tra: ITransaction; level: Integer); virtual; abstract; procedure startAndSend(status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); virtual; abstract; procedure unwind(status: IStatus; level: Integer); virtual; abstract; - procedure free_1(status: IStatus); virtual; abstract; + procedure deprecatedFree(status: IStatus); virtual; abstract; procedure free(status: IStatus); virtual; abstract; end; EventsVTable = class(ReferenceCountedVTable) - cancel_1: IEvents_cancel_1Ptr; + deprecatedCancel: IEvents_deprecatedCancelPtr; cancel: IEvents_cancelPtr; end; IEvents = class(IReferenceCounted) const VERSION = 4; - procedure cancel_1(status: IStatus); + procedure deprecatedCancel(status: IStatus); procedure cancel(status: IStatus); end; @@ -1704,7 +1706,7 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; - procedure cancel_1(status: IStatus); virtual; abstract; + procedure deprecatedCancel(status: IStatus); virtual; abstract; procedure cancel(status: IStatus); virtual; abstract; end; @@ -1725,8 +1727,8 @@ type queEvents: IAttachment_queEventsPtr; cancelOperation: IAttachment_cancelOperationPtr; ping: IAttachment_pingPtr; - detach_1: IAttachment_detach_1Ptr; - dropDatabase_1: IAttachment_dropDatabase_1Ptr; + deprecatedDetach: IAttachment_deprecatedDetachPtr; + deprecatedDropDatabase: IAttachment_deprecatedDropDatabasePtr; getIdleTimeout: IAttachment_getIdleTimeoutPtr; setIdleTimeout: IAttachment_setIdleTimeoutPtr; getStatementTimeout: IAttachment_getStatementTimeoutPtr; @@ -1756,8 +1758,8 @@ type function queEvents(status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; procedure cancelOperation(status: IStatus; option: Integer); procedure ping(status: IStatus); - procedure detach_1(status: IStatus); - procedure dropDatabase_1(status: IStatus); + procedure deprecatedDetach(status: IStatus); + procedure deprecatedDropDatabase(status: IStatus); function getIdleTimeout(status: IStatus): Cardinal; procedure setIdleTimeout(status: IStatus; timeOut: Cardinal); function getStatementTimeout(status: IStatus): Cardinal; @@ -1789,8 +1791,8 @@ type function queEvents(status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; virtual; abstract; procedure cancelOperation(status: IStatus; option: Integer); virtual; abstract; procedure ping(status: IStatus); virtual; abstract; - procedure detach_1(status: IStatus); virtual; abstract; - procedure dropDatabase_1(status: IStatus); virtual; abstract; + procedure deprecatedDetach(status: IStatus); virtual; abstract; + procedure deprecatedDropDatabase(status: IStatus); virtual; abstract; function getIdleTimeout(status: IStatus): Cardinal; virtual; abstract; procedure setIdleTimeout(status: IStatus; timeOut: Cardinal); virtual; abstract; function getStatementTimeout(status: IStatus): Cardinal; virtual; abstract; @@ -1802,7 +1804,7 @@ type end; ServiceVTable = class(ReferenceCountedVTable) - detach_1: IService_detach_1Ptr; + deprecatedDetach: IService_deprecatedDetachPtr; query: IService_queryPtr; start: IService_startPtr; detach: IService_detachPtr; @@ -1811,7 +1813,7 @@ type IService = class(IReferenceCounted) const VERSION = 4; - procedure detach_1(status: IStatus); + procedure deprecatedDetach(status: IStatus); procedure query(status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); procedure start(status: IStatus; spbLength: Cardinal; spb: BytePtr); procedure detach(status: IStatus); @@ -1822,7 +1824,7 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; - procedure detach_1(status: IStatus); virtual; abstract; + procedure deprecatedDetach(status: IStatus); virtual; abstract; procedure query(status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; procedure start(status: IStatus; spbLength: Cardinal; spb: BytePtr); virtual; abstract; procedure detach(status: IStatus); virtual; abstract; @@ -3736,6 +3738,7 @@ type function fb_get_master_interface : IMaster; cdecl; external 'fbclient'; const + FB_UsedInYValve = FALSE; isc_dpb_version1 = byte(1); isc_dpb_version2 = byte(2); isc_dpb_cdd_pathname = byte(1); @@ -5855,7 +5858,13 @@ end; function IFirebirdConf.getVersion(status: IStatus): Cardinal; begin - Result := FirebirdConfVTable(vTable).getVersion(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IFirebirdConf', vTable.version, 4); + Result := 0; + end + else begin + Result := FirebirdConfVTable(vTable).getVersion(Self, status); + end; FbException.checkException(status); end; @@ -5895,7 +5904,11 @@ end; procedure IPluginModule.threadDetach(); begin - PluginModuleVTable(vTable).threadDetach(Self); + if (vTable.version < 3) then begin + end + else begin + PluginModuleVTable(vTable).threadDetach(Self); + end; end; procedure IPluginManager.registerPluginFactory(pluginType: Cardinal; defaultName: PAnsiChar; factory: IPluginFactory); @@ -5984,7 +5997,12 @@ end; function IConfigManager.getDefaultSecurityDb(): PAnsiChar; begin - Result := ConfigManagerVTable(vTable).getDefaultSecurityDb(Self); + if (vTable.version < 3) then begin + Result := nil; + end + else begin + Result := ConfigManagerVTable(vTable).getDefaultSecurityDb(Self); + end; end; procedure IEventCallback.eventCallbackFunction(length: Cardinal; events: BytePtr); @@ -6010,15 +6028,15 @@ begin FbException.checkException(status); end; -procedure IBlob.cancel_1(status: IStatus); +procedure IBlob.deprecatedCancel(status: IStatus); begin - BlobVTable(vTable).cancel_1(Self, status); + BlobVTable(vTable).deprecatedCancel(Self, status); FbException.checkException(status); end; -procedure IBlob.close_1(status: IStatus); +procedure IBlob.deprecatedClose(status: IStatus); begin - BlobVTable(vTable).close_1(Self, status); + BlobVTable(vTable).deprecatedClose(Self, status); FbException.checkException(status); end; @@ -6030,13 +6048,33 @@ end; procedure IBlob.cancel(status: IStatus); begin - BlobVTable(vTable).cancel(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IBlob', vTable.version, 4); + end + else begin + deprecatedCancel(status); + end + end + else begin + BlobVTable(vTable).cancel(Self, status); + end; FbException.checkException(status); end; procedure IBlob.close(status: IStatus); begin - BlobVTable(vTable).close(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IBlob', vTable.version, 4); + end + else begin + deprecatedClose(status); + end + end + else begin + BlobVTable(vTable).close(Self, status); + end; FbException.checkException(status); end; @@ -6052,9 +6090,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.commit_1(status: IStatus); +procedure ITransaction.deprecatedCommit(status: IStatus); begin - TransactionVTable(vTable).commit_1(Self, status); + TransactionVTable(vTable).deprecatedCommit(Self, status); FbException.checkException(status); end; @@ -6064,9 +6102,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.rollback_1(status: IStatus); +procedure ITransaction.deprecatedRollback(status: IStatus); begin - TransactionVTable(vTable).rollback_1(Self, status); + TransactionVTable(vTable).deprecatedRollback(Self, status); FbException.checkException(status); end; @@ -6076,9 +6114,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.disconnect_1(status: IStatus); +procedure ITransaction.deprecatedDisconnect(status: IStatus); begin - TransactionVTable(vTable).disconnect_1(Self, status); + TransactionVTable(vTable).deprecatedDisconnect(Self, status); FbException.checkException(status); end; @@ -6102,19 +6140,49 @@ end; procedure ITransaction.commit(status: IStatus); begin - TransactionVTable(vTable).commit(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'ITransaction', vTable.version, 4); + end + else begin + deprecatedCommit(status); + end + end + else begin + TransactionVTable(vTable).commit(Self, status); + end; FbException.checkException(status); end; procedure ITransaction.rollback(status: IStatus); begin - TransactionVTable(vTable).rollback(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'ITransaction', vTable.version, 4); + end + else begin + deprecatedRollback(status); + end + end + else begin + TransactionVTable(vTable).rollback(Self, status); + end; FbException.checkException(status); end; procedure ITransaction.disconnect(status: IStatus); begin - TransactionVTable(vTable).disconnect(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'ITransaction', vTable.version, 4); + end + else begin + deprecatedDisconnect(status); + end + end + else begin + TransactionVTable(vTable).disconnect(Self, status); + end; FbException.checkException(status); end; @@ -6210,13 +6278,25 @@ end; function IMessageMetadata.getAlignment(status: IStatus): Cardinal; begin - Result := MessageMetadataVTable(vTable).getAlignment(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMessageMetadata', vTable.version, 4); + Result := 0; + end + else begin + Result := MessageMetadataVTable(vTable).getAlignment(Self, status); + end; FbException.checkException(status); end; function IMessageMetadata.getAlignedLength(status: IStatus): Cardinal; begin - Result := MessageMetadataVTable(vTable).getAlignedLength(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMessageMetadata', vTable.version, 4); + Result := 0; + end + else begin + Result := MessageMetadataVTable(vTable).getAlignedLength(Self, status); + end; FbException.checkException(status); end; @@ -6282,25 +6362,45 @@ end; procedure IMetadataBuilder.setField(status: IStatus; index: Cardinal; field: PAnsiChar); begin - MetadataBuilderVTable(vTable).setField(Self, status, index, field); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMetadataBuilder', vTable.version, 4); + end + else begin + MetadataBuilderVTable(vTable).setField(Self, status, index, field); + end; FbException.checkException(status); end; procedure IMetadataBuilder.setRelation(status: IStatus; index: Cardinal; relation: PAnsiChar); begin - MetadataBuilderVTable(vTable).setRelation(Self, status, index, relation); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMetadataBuilder', vTable.version, 4); + end + else begin + MetadataBuilderVTable(vTable).setRelation(Self, status, index, relation); + end; FbException.checkException(status); end; procedure IMetadataBuilder.setOwner(status: IStatus; index: Cardinal; owner: PAnsiChar); begin - MetadataBuilderVTable(vTable).setOwner(Self, status, index, owner); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMetadataBuilder', vTable.version, 4); + end + else begin + MetadataBuilderVTable(vTable).setOwner(Self, status, index, owner); + end; FbException.checkException(status); end; procedure IMetadataBuilder.setAlias(status: IStatus; index: Cardinal; alias: PAnsiChar); begin - MetadataBuilderVTable(vTable).setAlias(Self, status, index, alias); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IMetadataBuilder', vTable.version, 4); + end + else begin + MetadataBuilderVTable(vTable).setAlias(Self, status, index, alias); + end; FbException.checkException(status); end; @@ -6358,9 +6458,9 @@ begin FbException.checkException(status); end; -procedure IResultSet.close_1(status: IStatus); +procedure IResultSet.deprecatedClose(status: IStatus); begin - ResultSetVTable(vTable).close_1(Self, status); + ResultSetVTable(vTable).deprecatedClose(Self, status); FbException.checkException(status); end; @@ -6372,7 +6472,17 @@ end; procedure IResultSet.close(status: IStatus); begin - ResultSetVTable(vTable).close(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IResultSet', vTable.version, 4); + end + else begin + deprecatedClose(status); + end + end + else begin + ResultSetVTable(vTable).close(Self, status); + end; FbException.checkException(status); end; @@ -6430,9 +6540,9 @@ begin FbException.checkException(status); end; -procedure IStatement.free_1(status: IStatus); +procedure IStatement.deprecatedFree(status: IStatus); begin - StatementVTable(vTable).free_1(Self, status); + StatementVTable(vTable).deprecatedFree(Self, status); FbException.checkException(status); end; @@ -6444,25 +6554,52 @@ end; function IStatement.getTimeout(status: IStatus): Cardinal; begin - Result := StatementVTable(vTable).getTimeout(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IStatement', vTable.version, 4); + Result := 0; + end + else begin + Result := StatementVTable(vTable).getTimeout(Self, status); + end; FbException.checkException(status); end; procedure IStatement.setTimeout(status: IStatus; timeOut: Cardinal); begin - StatementVTable(vTable).setTimeout(Self, status, timeOut); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IStatement', vTable.version, 4); + end + else begin + StatementVTable(vTable).setTimeout(Self, status, timeOut); + end; FbException.checkException(status); end; function IStatement.createBatch(status: IStatus; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; begin - Result := StatementVTable(vTable).createBatch(Self, status, inMetadata, parLength, par); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IStatement', vTable.version, 4); + Result := nil; + end + else begin + Result := StatementVTable(vTable).createBatch(Self, status, inMetadata, parLength, par); + end; FbException.checkException(status); end; procedure IStatement.free(status: IStatus); begin - StatementVTable(vTable).free(Self, status); + if (vTable.version < 5) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IStatement', vTable.version, 5); + end + else begin + deprecatedFree(status); + end + end + else begin + StatementVTable(vTable).free(Self, status); + end; FbException.checkException(status); end; @@ -6526,15 +6663,25 @@ begin FbException.checkException(status); end; -procedure IBatch.close_1(status: IStatus); +procedure IBatch.deprecatedClose(status: IStatus); begin - BatchVTable(vTable).close_1(Self, status); + BatchVTable(vTable).deprecatedClose(Self, status); FbException.checkException(status); end; procedure IBatch.close(status: IStatus); begin - BatchVTable(vTable).close(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IBatch', vTable.version, 4); + end + else begin + deprecatedClose(status); + end + end + else begin + BatchVTable(vTable).close(Self, status); + end; FbException.checkException(status); end; @@ -6568,15 +6715,25 @@ begin FbException.checkException(status); end; -procedure IReplicator.close_1(status: IStatus); +procedure IReplicator.deprecatedClose(status: IStatus); begin - ReplicatorVTable(vTable).close_1(Self, status); + ReplicatorVTable(vTable).deprecatedClose(Self, status); FbException.checkException(status); end; procedure IReplicator.close(status: IStatus); begin - ReplicatorVTable(vTable).close(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IReplicator', vTable.version, 4); + end + else begin + deprecatedClose(status); + end + end + else begin + ReplicatorVTable(vTable).close(Self, status); + end; FbException.checkException(status); end; @@ -6616,27 +6773,47 @@ begin FbException.checkException(status); end; -procedure IRequest.free_1(status: IStatus); +procedure IRequest.deprecatedFree(status: IStatus); begin - RequestVTable(vTable).free_1(Self, status); + RequestVTable(vTable).deprecatedFree(Self, status); FbException.checkException(status); end; procedure IRequest.free(status: IStatus); begin - RequestVTable(vTable).free(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IRequest', vTable.version, 4); + end + else begin + deprecatedFree(status); + end + end + else begin + RequestVTable(vTable).free(Self, status); + end; FbException.checkException(status); end; -procedure IEvents.cancel_1(status: IStatus); +procedure IEvents.deprecatedCancel(status: IStatus); begin - EventsVTable(vTable).cancel_1(Self, status); + EventsVTable(vTable).deprecatedCancel(Self, status); FbException.checkException(status); end; procedure IEvents.cancel(status: IStatus); begin - EventsVTable(vTable).cancel(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IEvents', vTable.version, 4); + end + else begin + deprecatedCancel(status); + end + end + else begin + EventsVTable(vTable).cancel(Self, status); + end; FbException.checkException(status); end; @@ -6736,69 +6913,123 @@ begin FbException.checkException(status); end; -procedure IAttachment.detach_1(status: IStatus); +procedure IAttachment.deprecatedDetach(status: IStatus); begin - AttachmentVTable(vTable).detach_1(Self, status); + AttachmentVTable(vTable).deprecatedDetach(Self, status); FbException.checkException(status); end; -procedure IAttachment.dropDatabase_1(status: IStatus); +procedure IAttachment.deprecatedDropDatabase(status: IStatus); begin - AttachmentVTable(vTable).dropDatabase_1(Self, status); + AttachmentVTable(vTable).deprecatedDropDatabase(Self, status); FbException.checkException(status); end; function IAttachment.getIdleTimeout(status: IStatus): Cardinal; begin - Result := AttachmentVTable(vTable).getIdleTimeout(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + Result := 0; + end + else begin + Result := AttachmentVTable(vTable).getIdleTimeout(Self, status); + end; FbException.checkException(status); end; procedure IAttachment.setIdleTimeout(status: IStatus; timeOut: Cardinal); begin - AttachmentVTable(vTable).setIdleTimeout(Self, status, timeOut); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + end + else begin + AttachmentVTable(vTable).setIdleTimeout(Self, status, timeOut); + end; FbException.checkException(status); end; function IAttachment.getStatementTimeout(status: IStatus): Cardinal; begin - Result := AttachmentVTable(vTable).getStatementTimeout(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + Result := 0; + end + else begin + Result := AttachmentVTable(vTable).getStatementTimeout(Self, status); + end; FbException.checkException(status); end; procedure IAttachment.setStatementTimeout(status: IStatus; timeOut: Cardinal); begin - AttachmentVTable(vTable).setStatementTimeout(Self, status, timeOut); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + end + else begin + AttachmentVTable(vTable).setStatementTimeout(Self, status, timeOut); + end; FbException.checkException(status); end; function IAttachment.createBatch(status: IStatus; transaction: ITransaction; stmtLength: Cardinal; sqlStmt: PAnsiChar; dialect: Cardinal; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; begin - Result := AttachmentVTable(vTable).createBatch(Self, status, transaction, stmtLength, sqlStmt, dialect, inMetadata, parLength, par); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + Result := nil; + end + else begin + Result := AttachmentVTable(vTable).createBatch(Self, status, transaction, stmtLength, sqlStmt, dialect, inMetadata, parLength, par); + end; FbException.checkException(status); end; function IAttachment.createReplicator(status: IStatus): IReplicator; begin - Result := AttachmentVTable(vTable).createReplicator(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 4); + Result := nil; + end + else begin + Result := AttachmentVTable(vTable).createReplicator(Self, status); + end; FbException.checkException(status); end; procedure IAttachment.detach(status: IStatus); begin - AttachmentVTable(vTable).detach(Self, status); + if (vTable.version < 5) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 5); + end + else begin + deprecatedDetach(status); + end + end + else begin + AttachmentVTable(vTable).detach(Self, status); + end; FbException.checkException(status); end; procedure IAttachment.dropDatabase(status: IStatus); begin - AttachmentVTable(vTable).dropDatabase(Self, status); + if (vTable.version < 5) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IAttachment', vTable.version, 5); + end + else begin + deprecatedDropDatabase(status); + end + end + else begin + AttachmentVTable(vTable).dropDatabase(Self, status); + end; FbException.checkException(status); end; -procedure IService.detach_1(status: IStatus); +procedure IService.deprecatedDetach(status: IStatus); begin - ServiceVTable(vTable).detach_1(Self, status); + ServiceVTable(vTable).deprecatedDetach(Self, status); FbException.checkException(status); end; @@ -6816,7 +7047,17 @@ end; procedure IService.detach(status: IStatus); begin - ServiceVTable(vTable).detach(Self, status); + if (vTable.version < 4) then begin + if FB_UsedInYValve then begin + FbException.setVersionError(status, 'IService', vTable.version, 4); + end + else begin + deprecatedDetach(status); + end + end + else begin + ServiceVTable(vTable).detach(Self, status); + end; FbException.checkException(status); end; @@ -6954,7 +7195,13 @@ end; function IClientBlock.getAuthBlock(status: IStatus): IAuthBlock; begin - Result := ClientBlockVTable(vTable).getAuthBlock(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IClientBlock', vTable.version, 4); + Result := nil; + end + else begin + Result := ClientBlockVTable(vTable).getAuthBlock(Self, status); + end; FbException.checkException(status); end; @@ -6966,7 +7213,12 @@ end; procedure IServer.setDbCryptCallback(status: IStatus; cryptCallback: ICryptKeyCallback); begin - ServerVTable(vTable).setDbCryptCallback(Self, status, cryptCallback); + if (vTable.version < 6) then begin + FbException.setVersionError(status, 'IServer', vTable.version, 6); + end + else begin + ServerVTable(vTable).setDbCryptCallback(Self, status, cryptCallback); + end; FbException.checkException(status); end; @@ -7103,13 +7355,25 @@ end; function ILogonInfo.attachment(status: IStatus): IAttachment; begin - Result := LogonInfoVTable(vTable).attachment(Self, status); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'ILogonInfo', vTable.version, 3); + Result := nil; + end + else begin + Result := LogonInfoVTable(vTable).attachment(Self, status); + end; FbException.checkException(status); end; function ILogonInfo.transaction(status: IStatus): ITransaction; begin - Result := LogonInfoVTable(vTable).transaction(Self, status); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'ILogonInfo', vTable.version, 3); + Result := nil; + end + else begin + Result := LogonInfoVTable(vTable).transaction(Self, status); + end; FbException.checkException(status); end; @@ -7200,13 +7464,24 @@ end; function IWireCryptPlugin.getSpecificData(status: IStatus; keyType: PAnsiChar; length: CardinalPtr): BytePtr; begin - Result := WireCryptPluginVTable(vTable).getSpecificData(Self, status, keyType, length); + if (vTable.version < 5) then begin + FbException.setVersionError(status, 'IWireCryptPlugin', vTable.version, 5); + Result := nil; + end + else begin + Result := WireCryptPluginVTable(vTable).getSpecificData(Self, status, keyType, length); + end; FbException.checkException(status); end; procedure IWireCryptPlugin.setSpecificData(status: IStatus; keyType: PAnsiChar; length: Cardinal; data: BytePtr); begin - WireCryptPluginVTable(vTable).setSpecificData(Self, status, keyType, length, data); + if (vTable.version < 5) then begin + FbException.setVersionError(status, 'IWireCryptPlugin', vTable.version, 5); + end + else begin + WireCryptPluginVTable(vTable).setSpecificData(Self, status, keyType, length, data); + end; FbException.checkException(status); end; @@ -7229,13 +7504,25 @@ end; function IKeyHolderPlugin.useOnlyOwnKeys(status: IStatus): Boolean; begin - Result := KeyHolderPluginVTable(vTable).useOnlyOwnKeys(Self, status); + if (vTable.version < 5) then begin + FbException.setVersionError(status, 'IKeyHolderPlugin', vTable.version, 5); + Result := false; + end + else begin + Result := KeyHolderPluginVTable(vTable).useOnlyOwnKeys(Self, status); + end; FbException.checkException(status); end; function IKeyHolderPlugin.chainHandle(status: IStatus): ICryptKeyCallback; begin - Result := KeyHolderPluginVTable(vTable).chainHandle(Self, status); + if (vTable.version < 5) then begin + FbException.setVersionError(status, 'IKeyHolderPlugin', vTable.version, 5); + Result := nil; + end + else begin + Result := KeyHolderPluginVTable(vTable).chainHandle(Self, status); + end; FbException.checkException(status); end; @@ -7265,7 +7552,12 @@ end; procedure IDbCryptPlugin.setInfo(status: IStatus; info: IDbCryptInfo); begin - DbCryptPluginVTable(vTable).setInfo(Self, status, info); + if (vTable.version < 5) then begin + FbException.setVersionError(status, 'IDbCryptPlugin', vTable.version, 5); + end + else begin + DbCryptPluginVTable(vTable).setInfo(Self, status, info); + end; FbException.checkException(status); end; @@ -7551,55 +7843,103 @@ end; function IUtil.getDecFloat16(status: IStatus): IDecFloat16; begin - Result := UtilVTable(vTable).getDecFloat16(Self, status); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + Result := nil; + end + else begin + Result := UtilVTable(vTable).getDecFloat16(Self, status); + end; FbException.checkException(status); end; function IUtil.getDecFloat34(status: IStatus): IDecFloat34; begin - Result := UtilVTable(vTable).getDecFloat34(Self, status); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + Result := nil; + end + else begin + Result := UtilVTable(vTable).getDecFloat34(Self, status); + end; FbException.checkException(status); end; procedure IUtil.decodeTimeTz(status: IStatus; timeTz: ISC_TIME_TZPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar); begin - UtilVTable(vTable).decodeTimeTz(Self, status, timeTz, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + end + else begin + UtilVTable(vTable).decodeTimeTz(Self, status, timeTz, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + end; FbException.checkException(status); end; procedure IUtil.decodeTimeStampTz(status: IStatus; timeStampTz: ISC_TIMESTAMP_TZPtr; year: CardinalPtr; month: CardinalPtr; day: CardinalPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar); begin - UtilVTable(vTable).decodeTimeStampTz(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + end + else begin + UtilVTable(vTable).decodeTimeStampTz(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + end; FbException.checkException(status); end; procedure IUtil.encodeTimeTz(status: IStatus; timeTz: ISC_TIME_TZPtr; hours: Cardinal; minutes: Cardinal; seconds: Cardinal; fractions: Cardinal; timeZone: PAnsiChar); begin - UtilVTable(vTable).encodeTimeTz(Self, status, timeTz, hours, minutes, seconds, fractions, timeZone); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + end + else begin + UtilVTable(vTable).encodeTimeTz(Self, status, timeTz, hours, minutes, seconds, fractions, timeZone); + end; FbException.checkException(status); end; procedure IUtil.encodeTimeStampTz(status: IStatus; timeStampTz: ISC_TIMESTAMP_TZPtr; year: Cardinal; month: Cardinal; day: Cardinal; hours: Cardinal; minutes: Cardinal; seconds: Cardinal; fractions: Cardinal; timeZone: PAnsiChar); begin - UtilVTable(vTable).encodeTimeStampTz(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZone); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 3); + end + else begin + UtilVTable(vTable).encodeTimeStampTz(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZone); + end; FbException.checkException(status); end; function IUtil.getInt128(status: IStatus): IInt128; begin - Result := UtilVTable(vTable).getInt128(Self, status); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 4); + Result := nil; + end + else begin + Result := UtilVTable(vTable).getInt128(Self, status); + end; FbException.checkException(status); end; procedure IUtil.decodeTimeTzEx(status: IStatus; timeTz: ISC_TIME_TZ_EXPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar); begin - UtilVTable(vTable).decodeTimeTzEx(Self, status, timeTz, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 4); + end + else begin + UtilVTable(vTable).decodeTimeTzEx(Self, status, timeTz, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + end; FbException.checkException(status); end; procedure IUtil.decodeTimeStampTzEx(status: IStatus; timeStampTz: ISC_TIMESTAMP_TZ_EXPtr; year: CardinalPtr; month: CardinalPtr; day: CardinalPtr; hours: CardinalPtr; minutes: CardinalPtr; seconds: CardinalPtr; fractions: CardinalPtr; timeZoneBufferLength: Cardinal; timeZoneBuffer: PAnsiChar); begin - UtilVTable(vTable).decodeTimeStampTzEx(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'IUtil', vTable.version, 4); + end + else begin + UtilVTable(vTable).decodeTimeStampTzEx(Self, status, timeStampTz, year, month, day, hours, minutes, seconds, fractions, timeZoneBufferLength, timeZoneBuffer); + end; FbException.checkException(status); end; @@ -7811,12 +8151,22 @@ end; function ITraceTransaction.getInitialID(): Int64; begin - Result := TraceTransactionVTable(vTable).getInitialID(Self); + if (vTable.version < 3) then begin + Result := 0; + end + else begin + Result := TraceTransactionVTable(vTable).getInitialID(Self); + end; end; function ITraceTransaction.getPreviousID(): Int64; begin - Result := TraceTransactionVTable(vTable).getPreviousID(Self); + if (vTable.version < 3) then begin + Result := 0; + end + else begin + Result := TraceTransactionVTable(vTable).getPreviousID(Self); + end; end; function ITraceParams.getCount(): Cardinal; @@ -7831,7 +8181,13 @@ end; function ITraceParams.getTextUTF8(status: IStatus; idx: Cardinal): PAnsiChar; begin - Result := TraceParamsVTable(vTable).getTextUTF8(Self, status, idx); + if (vTable.version < 3) then begin + FbException.setVersionError(status, 'ITraceParams', vTable.version, 3); + Result := nil; + end + else begin + Result := TraceParamsVTable(vTable).getTextUTF8(Self, status, idx); + end; FbException.checkException(status); end; @@ -8042,7 +8398,13 @@ end; function ITraceLogWriter.write_s(status: IStatus; buf: Pointer; size: Cardinal): Cardinal; begin - Result := TraceLogWriterVTable(vTable).write_s(Self, status, buf, size); + if (vTable.version < 4) then begin + FbException.setVersionError(status, 'ITraceLogWriter', vTable.version, 4); + Result := 0; + end + else begin + Result := TraceLogWriterVTable(vTable).write_s(Self, status, buf, size); + end; FbException.checkException(status); end; @@ -9394,19 +9756,19 @@ begin end end; -procedure IBlobImpl_cancel_1Dispatcher(this: IBlob; status: IStatus); cdecl; +procedure IBlobImpl_deprecatedCancelDispatcher(this: IBlob; status: IStatus); cdecl; begin try - IBlobImpl(this).cancel_1(status); + IBlobImpl(this).deprecatedCancel(status); except on e: Exception do FbException.catchException(status, e); end end; -procedure IBlobImpl_close_1Dispatcher(this: IBlob; status: IStatus); cdecl; +procedure IBlobImpl_deprecatedCloseDispatcher(this: IBlob; status: IStatus); cdecl; begin try - IBlobImpl(this).close_1(status); + IBlobImpl(this).deprecatedClose(status); except on e: Exception do FbException.catchException(status, e); end @@ -9483,10 +9845,10 @@ begin end end; -procedure ITransactionImpl_commit_1Dispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_deprecatedCommitDispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).commit_1(status); + ITransactionImpl(this).deprecatedCommit(status); except on e: Exception do FbException.catchException(status, e); end @@ -9501,10 +9863,10 @@ begin end end; -procedure ITransactionImpl_rollback_1Dispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_deprecatedRollbackDispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).rollback_1(status); + ITransactionImpl(this).deprecatedRollback(status); except on e: Exception do FbException.catchException(status, e); end @@ -9519,10 +9881,10 @@ begin end end; -procedure ITransactionImpl_disconnect_1Dispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_deprecatedDisconnectDispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).disconnect_1(status); + ITransactionImpl(this).deprecatedDisconnect(status); except on e: Exception do FbException.catchException(status, e); end @@ -10020,10 +10382,10 @@ begin end end; -procedure IResultSetImpl_close_1Dispatcher(this: IResultSet; status: IStatus); cdecl; +procedure IResultSetImpl_deprecatedCloseDispatcher(this: IResultSet; status: IStatus); cdecl; begin try - IResultSetImpl(this).close_1(status); + IResultSetImpl(this).deprecatedClose(status); except on e: Exception do FbException.catchException(status, e); end @@ -10154,10 +10516,10 @@ begin end end; -procedure IStatementImpl_free_1Dispatcher(this: IStatement; status: IStatus); cdecl; +procedure IStatementImpl_deprecatedFreeDispatcher(this: IStatement; status: IStatus); cdecl; begin try - IStatementImpl(this).free_1(status); + IStatementImpl(this).deprecatedFree(status); except on e: Exception do FbException.catchException(status, e); end @@ -10324,10 +10686,10 @@ begin end end; -procedure IBatchImpl_close_1Dispatcher(this: IBatch; status: IStatus); cdecl; +procedure IBatchImpl_deprecatedCloseDispatcher(this: IBatch; status: IStatus); cdecl; begin try - IBatchImpl(this).close_1(status); + IBatchImpl(this).deprecatedClose(status); except on e: Exception do FbException.catchException(status, e); end @@ -10430,10 +10792,10 @@ begin end end; -procedure IReplicatorImpl_close_1Dispatcher(this: IReplicator; status: IStatus); cdecl; +procedure IReplicatorImpl_deprecatedCloseDispatcher(this: IReplicator; status: IStatus); cdecl; begin try - IReplicatorImpl(this).close_1(status); + IReplicatorImpl(this).deprecatedClose(status); except on e: Exception do FbException.catchException(status, e); end @@ -10528,10 +10890,10 @@ begin end end; -procedure IRequestImpl_free_1Dispatcher(this: IRequest; status: IStatus); cdecl; +procedure IRequestImpl_deprecatedFreeDispatcher(this: IRequest; status: IStatus); cdecl; begin try - IRequestImpl(this).free_1(status); + IRequestImpl(this).deprecatedFree(status); except on e: Exception do FbException.catchException(status, e); end @@ -10572,10 +10934,10 @@ begin end end; -procedure IEventsImpl_cancel_1Dispatcher(this: IEvents; status: IStatus); cdecl; +procedure IEventsImpl_deprecatedCancelDispatcher(this: IEvents; status: IStatus); cdecl; begin try - IEventsImpl(this).cancel_1(status); + IEventsImpl(this).deprecatedCancel(status); except on e: Exception do FbException.catchException(status, e); end @@ -10760,19 +11122,19 @@ begin end end; -procedure IAttachmentImpl_detach_1Dispatcher(this: IAttachment; status: IStatus); cdecl; +procedure IAttachmentImpl_deprecatedDetachDispatcher(this: IAttachment; status: IStatus); cdecl; begin try - IAttachmentImpl(this).detach_1(status); + IAttachmentImpl(this).deprecatedDetach(status); except on e: Exception do FbException.catchException(status, e); end end; -procedure IAttachmentImpl_dropDatabase_1Dispatcher(this: IAttachment; status: IStatus); cdecl; +procedure IAttachmentImpl_deprecatedDropDatabaseDispatcher(this: IAttachment; status: IStatus); cdecl; begin try - IAttachmentImpl(this).dropDatabase_1(status); + IAttachmentImpl(this).deprecatedDropDatabase(status); except on e: Exception do FbException.catchException(status, e); end @@ -10876,10 +11238,10 @@ begin end end; -procedure IServiceImpl_detach_1Dispatcher(this: IService; status: IStatus); cdecl; +procedure IServiceImpl_deprecatedDetachDispatcher(this: IService; status: IStatus); cdecl; begin try - IServiceImpl(this).detach_1(status); + IServiceImpl(this).deprecatedDetach(status); except on e: Exception do FbException.catchException(status, e); end @@ -14993,6 +15355,27 @@ begin status.setErrors(@statusVector); end end; + +class procedure FbException.setVersionError(status: IStatus; interfaceName: string; + currentVersion, expectedVersion: NativeInt); +var + statusVector: array[0..8] of NativeIntPtr; + msg: AnsiString; +begin + msg := interfaceName; + + statusVector[0] := NativeIntPtr(isc_arg_gds); + statusVector[1] := NativeIntPtr(isc_interface_version_too_old); + statusVector[2] := NativeIntPtr(isc_arg_number); + statusVector[3] := NativeIntPtr(expectedVersion); + statusVector[4] := NativeIntPtr(isc_arg_number); + statusVector[5] := NativeIntPtr(currentVersion); + statusVector[6] := NativeIntPtr(isc_arg_string); + statusVector[7] := NativeIntPtr(PAnsiChar(msg)); + statusVector[8] := NativeIntPtr(isc_arg_end); + + status.setErrors(@statusVector); +end; initialization IVersionedImpl_vTable := VersionedVTable.create; IVersionedImpl_vTable.version := 1; @@ -15136,8 +15519,8 @@ initialization IBlobImpl_vTable.getInfo := @IBlobImpl_getInfoDispatcher; IBlobImpl_vTable.getSegment := @IBlobImpl_getSegmentDispatcher; IBlobImpl_vTable.putSegment := @IBlobImpl_putSegmentDispatcher; - IBlobImpl_vTable.cancel_1 := @IBlobImpl_cancel_1Dispatcher; - IBlobImpl_vTable.close_1 := @IBlobImpl_close_1Dispatcher; + IBlobImpl_vTable.deprecatedCancel := @IBlobImpl_deprecatedCancelDispatcher; + IBlobImpl_vTable.deprecatedClose := @IBlobImpl_deprecatedCloseDispatcher; IBlobImpl_vTable.seek := @IBlobImpl_seekDispatcher; IBlobImpl_vTable.cancel := @IBlobImpl_cancelDispatcher; IBlobImpl_vTable.close := @IBlobImpl_closeDispatcher; @@ -15148,11 +15531,11 @@ initialization ITransactionImpl_vTable.release := @ITransactionImpl_releaseDispatcher; ITransactionImpl_vTable.getInfo := @ITransactionImpl_getInfoDispatcher; ITransactionImpl_vTable.prepare := @ITransactionImpl_prepareDispatcher; - ITransactionImpl_vTable.commit_1 := @ITransactionImpl_commit_1Dispatcher; + ITransactionImpl_vTable.deprecatedCommit := @ITransactionImpl_deprecatedCommitDispatcher; ITransactionImpl_vTable.commitRetaining := @ITransactionImpl_commitRetainingDispatcher; - ITransactionImpl_vTable.rollback_1 := @ITransactionImpl_rollback_1Dispatcher; + ITransactionImpl_vTable.deprecatedRollback := @ITransactionImpl_deprecatedRollbackDispatcher; ITransactionImpl_vTable.rollbackRetaining := @ITransactionImpl_rollbackRetainingDispatcher; - ITransactionImpl_vTable.disconnect_1 := @ITransactionImpl_disconnect_1Dispatcher; + ITransactionImpl_vTable.deprecatedDisconnect := @ITransactionImpl_deprecatedDisconnectDispatcher; ITransactionImpl_vTable.join := @ITransactionImpl_joinDispatcher; ITransactionImpl_vTable.validate := @ITransactionImpl_validateDispatcher; ITransactionImpl_vTable.enterDtc := @ITransactionImpl_enterDtcDispatcher; @@ -15214,7 +15597,7 @@ initialization IResultSetImpl_vTable.isEof := @IResultSetImpl_isEofDispatcher; IResultSetImpl_vTable.isBof := @IResultSetImpl_isBofDispatcher; IResultSetImpl_vTable.getMetadata := @IResultSetImpl_getMetadataDispatcher; - IResultSetImpl_vTable.close_1 := @IResultSetImpl_close_1Dispatcher; + IResultSetImpl_vTable.deprecatedClose := @IResultSetImpl_deprecatedCloseDispatcher; IResultSetImpl_vTable.setDelayedOutputFormat := @IResultSetImpl_setDelayedOutputFormatDispatcher; IResultSetImpl_vTable.close := @IResultSetImpl_closeDispatcher; @@ -15231,7 +15614,7 @@ initialization IStatementImpl_vTable.execute := @IStatementImpl_executeDispatcher; IStatementImpl_vTable.openCursor := @IStatementImpl_openCursorDispatcher; IStatementImpl_vTable.setCursorName := @IStatementImpl_setCursorNameDispatcher; - IStatementImpl_vTable.free_1 := @IStatementImpl_free_1Dispatcher; + IStatementImpl_vTable.deprecatedFree := @IStatementImpl_deprecatedFreeDispatcher; IStatementImpl_vTable.getFlags := @IStatementImpl_getFlagsDispatcher; IStatementImpl_vTable.getTimeout := @IStatementImpl_getTimeoutDispatcher; IStatementImpl_vTable.setTimeout := @IStatementImpl_setTimeoutDispatcher; @@ -15252,7 +15635,7 @@ initialization IBatchImpl_vTable.getBlobAlignment := @IBatchImpl_getBlobAlignmentDispatcher; IBatchImpl_vTable.getMetadata := @IBatchImpl_getMetadataDispatcher; IBatchImpl_vTable.setDefaultBpb := @IBatchImpl_setDefaultBpbDispatcher; - IBatchImpl_vTable.close_1 := @IBatchImpl_close_1Dispatcher; + IBatchImpl_vTable.deprecatedClose := @IBatchImpl_deprecatedCloseDispatcher; IBatchImpl_vTable.close := @IBatchImpl_closeDispatcher; IBatchCompletionStateImpl_vTable := BatchCompletionStateVTable.create; @@ -15268,7 +15651,7 @@ initialization IReplicatorImpl_vTable.addRef := @IReplicatorImpl_addRefDispatcher; IReplicatorImpl_vTable.release := @IReplicatorImpl_releaseDispatcher; IReplicatorImpl_vTable.process := @IReplicatorImpl_processDispatcher; - IReplicatorImpl_vTable.close_1 := @IReplicatorImpl_close_1Dispatcher; + IReplicatorImpl_vTable.deprecatedClose := @IReplicatorImpl_deprecatedCloseDispatcher; IReplicatorImpl_vTable.close := @IReplicatorImpl_closeDispatcher; IRequestImpl_vTable := RequestVTable.create; @@ -15281,14 +15664,14 @@ initialization IRequestImpl_vTable.start := @IRequestImpl_startDispatcher; IRequestImpl_vTable.startAndSend := @IRequestImpl_startAndSendDispatcher; IRequestImpl_vTable.unwind := @IRequestImpl_unwindDispatcher; - IRequestImpl_vTable.free_1 := @IRequestImpl_free_1Dispatcher; + IRequestImpl_vTable.deprecatedFree := @IRequestImpl_deprecatedFreeDispatcher; IRequestImpl_vTable.free := @IRequestImpl_freeDispatcher; IEventsImpl_vTable := EventsVTable.create; IEventsImpl_vTable.version := 4; IEventsImpl_vTable.addRef := @IEventsImpl_addRefDispatcher; IEventsImpl_vTable.release := @IEventsImpl_releaseDispatcher; - IEventsImpl_vTable.cancel_1 := @IEventsImpl_cancel_1Dispatcher; + IEventsImpl_vTable.deprecatedCancel := @IEventsImpl_deprecatedCancelDispatcher; IEventsImpl_vTable.cancel := @IEventsImpl_cancelDispatcher; IAttachmentImpl_vTable := AttachmentVTable.create; @@ -15311,8 +15694,8 @@ initialization IAttachmentImpl_vTable.queEvents := @IAttachmentImpl_queEventsDispatcher; IAttachmentImpl_vTable.cancelOperation := @IAttachmentImpl_cancelOperationDispatcher; IAttachmentImpl_vTable.ping := @IAttachmentImpl_pingDispatcher; - IAttachmentImpl_vTable.detach_1 := @IAttachmentImpl_detach_1Dispatcher; - IAttachmentImpl_vTable.dropDatabase_1 := @IAttachmentImpl_dropDatabase_1Dispatcher; + IAttachmentImpl_vTable.deprecatedDetach := @IAttachmentImpl_deprecatedDetachDispatcher; + IAttachmentImpl_vTable.deprecatedDropDatabase := @IAttachmentImpl_deprecatedDropDatabaseDispatcher; IAttachmentImpl_vTable.getIdleTimeout := @IAttachmentImpl_getIdleTimeoutDispatcher; IAttachmentImpl_vTable.setIdleTimeout := @IAttachmentImpl_setIdleTimeoutDispatcher; IAttachmentImpl_vTable.getStatementTimeout := @IAttachmentImpl_getStatementTimeoutDispatcher; @@ -15326,7 +15709,7 @@ initialization IServiceImpl_vTable.version := 4; IServiceImpl_vTable.addRef := @IServiceImpl_addRefDispatcher; IServiceImpl_vTable.release := @IServiceImpl_releaseDispatcher; - IServiceImpl_vTable.detach_1 := @IServiceImpl_detach_1Dispatcher; + IServiceImpl_vTable.deprecatedDetach := @IServiceImpl_deprecatedDetachDispatcher; IServiceImpl_vTable.query := @IServiceImpl_queryDispatcher; IServiceImpl_vTable.start := @IServiceImpl_startDispatcher; IServiceImpl_vTable.detach := @IServiceImpl_detachDispatcher; diff --git a/src/isql/isql.epp b/src/isql/isql.epp index f64edd02bf..9948d3ca0c 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -9249,6 +9249,10 @@ static processing_state process_statement(const TEXT* str2) } curs->close(fbStatus); + if (ISQL_errmsg(fbStatus)) + { + return ps_ERR; + } } // Avoid cancel during cleanup diff --git a/src/jrd/EngineInterface.h b/src/jrd/EngineInterface.h index f53bbbce00..96b2098c9b 100644 --- a/src/jrd/EngineInterface.h +++ b/src/jrd/EngineInterface.h @@ -63,8 +63,8 @@ public: void cancel(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; int seek(Firebird::CheckStatusWrapper* status, int mode, int offset) override; // returns position - void cancel_1(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedCancel(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; public: JBlob(blb* handle, StableAttachmentPart* sa); @@ -110,9 +110,9 @@ public: Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction) override; JTransaction* validate(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* testAtt) override; JTransaction* enterDtc(Firebird::CheckStatusWrapper* status) override; - void commit_1(Firebird::CheckStatusWrapper* status) override; - void rollback_1(Firebird::CheckStatusWrapper* status) override; - void disconnect_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedCommit(Firebird::CheckStatusWrapper* status) override; + void deprecatedRollback(Firebird::CheckStatusWrapper* status) override; + void deprecatedDisconnect(Firebird::CheckStatusWrapper* status) override; public: JTransaction(jrd_tra* handle, StableAttachmentPart* sa); @@ -163,7 +163,7 @@ public: FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status) override; Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebird::IMessageMetadata* format) override; public: @@ -208,7 +208,7 @@ public: Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par) override; void close(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; public: JBatch(DsqlBatch* handle, JStatement* aStatement, Firebird::IMessageMetadata* aMetadata); @@ -241,7 +241,7 @@ public: int release() override; void process(Firebird::CheckStatusWrapper* status, unsigned length, const unsigned char* data) override; void close(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; public: JReplicator(Applier* appl, StableAttachmentPart* sa); @@ -278,7 +278,7 @@ public: unsigned int itemsLength, const unsigned char* items, unsigned int bufferLength, unsigned char* buffer) override; void free(Firebird::CheckStatusWrapper* status) override; - void free_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedFree(Firebird::CheckStatusWrapper* status) override; ISC_UINT64 getAffectedRecords(Firebird::CheckStatusWrapper* userStatus) override; Firebird::IMessageMetadata* getOutputMetadata(Firebird::CheckStatusWrapper* userStatus) override; Firebird::IMessageMetadata* getInputMetadata(Firebird::CheckStatusWrapper* userStatus) override; @@ -337,7 +337,7 @@ public: unsigned int msg_type, unsigned int length, const void* message) override; void unwind(Firebird::CheckStatusWrapper* status, int level) override; void free(Firebird::CheckStatusWrapper* status) override; - void free_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedFree(Firebird::CheckStatusWrapper* status) override; public: JRequest(JrdStatement* handle, StableAttachmentPart* sa); @@ -365,7 +365,7 @@ public: // IEvents implementation int release() override; void cancel(Firebird::CheckStatusWrapper* status) override; - void cancel_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedCancel(Firebird::CheckStatusWrapper* status) override; public: JEvents(int aId, StableAttachmentPart* sa, Firebird::IEventCallback* aCallback); @@ -439,8 +439,8 @@ public: void ping(Firebird::CheckStatusWrapper* status) override; void detach(Firebird::CheckStatusWrapper* status) override; void dropDatabase(Firebird::CheckStatusWrapper* status) override; - void detach_1(Firebird::CheckStatusWrapper* status) override; - void dropDatabase_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedDetach(Firebird::CheckStatusWrapper* status) override; + void deprecatedDropDatabase(Firebird::CheckStatusWrapper* status) override; unsigned int getIdleTimeout(Firebird::CheckStatusWrapper* status) override; void setIdleTimeout(Firebird::CheckStatusWrapper* status, unsigned int timeOut) override; @@ -490,7 +490,7 @@ public: // IService implementation int release() override; void detach(Firebird::CheckStatusWrapper* status) override; - void detach_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedDetach(Firebird::CheckStatusWrapper* status) override; void query(Firebird::CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 430c7fc258..b1611a7b36 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -2318,7 +2318,7 @@ void JBlob::getInfo(CheckStatusWrapper* user_status, } -void JBlob::cancel_1(CheckStatusWrapper* user_status) +void JBlob::deprecatedCancel(CheckStatusWrapper* user_status) { /************************************** * @@ -2380,7 +2380,7 @@ void JBlob::freeEngineData(CheckStatusWrapper* user_status) } -void JEvents::cancel_1(CheckStatusWrapper* user_status) +void JEvents::deprecatedCancel(CheckStatusWrapper* user_status) { /************************************** * @@ -2486,13 +2486,13 @@ void JAttachment::cancelOperation(CheckStatusWrapper* user_status, int option) void JBlob::close(CheckStatusWrapper* user_status) { - close_1(user_status); + deprecatedClose(user_status); if (user_status->isEmpty()) release(); } -void JBlob::close_1(CheckStatusWrapper* user_status) +void JBlob::deprecatedClose(CheckStatusWrapper* user_status) { /************************************** * @@ -2533,13 +2533,13 @@ void JBlob::close_1(CheckStatusWrapper* user_status) void JTransaction::commit(CheckStatusWrapper* user_status) { - commit_1(user_status); + deprecatedCommit(user_status); if (user_status->isEmpty()) release(); } -void JTransaction::commit_1(CheckStatusWrapper* user_status) +void JTransaction::deprecatedCommit(CheckStatusWrapper* user_status) { /************************************** * @@ -3249,7 +3249,7 @@ void JAttachment::executeDyn(CheckStatusWrapper* status, ITransaction* /*tra*/, } -void JAttachment::detach_1(CheckStatusWrapper* user_status) +void JAttachment::deprecatedDetach(CheckStatusWrapper* user_status) { /************************************** * @@ -3280,7 +3280,7 @@ void JAttachment::detach(CheckStatusWrapper* user_status) * Close down a database. * **************************************/ - detach_1(user_status); + deprecatedDetach(user_status); if (user_status->isEmpty()) release(); } @@ -3362,13 +3362,13 @@ void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree void JAttachment::dropDatabase(CheckStatusWrapper* user_status) { - dropDatabase_1(user_status); + deprecatedDropDatabase(user_status); if (user_status->isEmpty()) release(); } -void JAttachment::dropDatabase_1(CheckStatusWrapper* user_status) +void JAttachment::deprecatedDropDatabase(CheckStatusWrapper* user_status) { /************************************** * @@ -3941,7 +3941,7 @@ JTransaction* JAttachment::reconnectTransaction(CheckStatusWrapper* user_status, } -void JRequest::free_1(CheckStatusWrapper* user_status) +void JRequest::deprecatedFree(CheckStatusWrapper* user_status) { /************************************** * @@ -4082,13 +4082,13 @@ void JTransaction::rollbackRetaining(CheckStatusWrapper* user_status) void JTransaction::rollback(CheckStatusWrapper* user_status) { - rollback_1(user_status); + deprecatedRollback(user_status); if (user_status->isEmpty()) release(); } -void JTransaction::rollback_1(CheckStatusWrapper* user_status) +void JTransaction::deprecatedRollback(CheckStatusWrapper* user_status) { /************************************** * @@ -4128,13 +4128,13 @@ void JTransaction::rollback_1(CheckStatusWrapper* user_status) void JTransaction::disconnect(CheckStatusWrapper* user_status) { - disconnect_1(user_status); + deprecatedDisconnect(user_status); if (user_status->isEmpty()) release(); } -void JTransaction::disconnect_1(CheckStatusWrapper* user_status) +void JTransaction::deprecatedDisconnect(CheckStatusWrapper* user_status) { try { @@ -4269,7 +4269,7 @@ JService* JProvider::attachServiceManager(CheckStatusWrapper* user_status, const } -void JService::detach_1(CheckStatusWrapper* user_status) +void JService::deprecatedDetach(CheckStatusWrapper* user_status) { /************************************** * @@ -5471,7 +5471,7 @@ IMessageMetadata* JResultSet::getMetadata(CheckStatusWrapper* user_status) } -void JResultSet::close_1(CheckStatusWrapper* user_status) +void JResultSet::deprecatedClose(CheckStatusWrapper* user_status) { freeEngineData(user_status); } @@ -5513,7 +5513,7 @@ void JStatement::freeEngineData(CheckStatusWrapper* user_status) } -void JStatement::free_1(CheckStatusWrapper* user_status) +void JStatement::deprecatedFree(CheckStatusWrapper* user_status) { freeEngineData(user_status); } @@ -6005,7 +6005,7 @@ int JBatch::release() } -void JBatch::close_1(CheckStatusWrapper* user_status) +void JBatch::deprecatedClose(CheckStatusWrapper* user_status) { freeEngineData(user_status); } @@ -6419,7 +6419,7 @@ void JReplicator::process(CheckStatusWrapper* status, unsigned length, const UCH } -void JReplicator::close_1(CheckStatusWrapper* user_status) +void JReplicator::deprecatedClose(CheckStatusWrapper* user_status) { freeEngineData(user_status); } diff --git a/src/misc/pascal/Pascal.implementation.pas b/src/misc/pascal/Pascal.implementation.pas index a73393adbf..3a25fe54f9 100644 --- a/src/misc/pascal/Pascal.implementation.pas +++ b/src/misc/pascal/Pascal.implementation.pas @@ -41,3 +41,24 @@ begin status.setErrors(@statusVector); end end; + +class procedure FbException.setVersionError(status: IStatus; interfaceName: string; + currentVersion, expectedVersion: NativeInt); +var + statusVector: array[0..8] of NativeIntPtr; + msg: AnsiString; +begin + msg := interfaceName; + + statusVector[0] := NativeIntPtr(isc_arg_gds); + statusVector[1] := NativeIntPtr(isc_interface_version_too_old); + statusVector[2] := NativeIntPtr(isc_arg_number); + statusVector[3] := NativeIntPtr(expectedVersion); + statusVector[4] := NativeIntPtr(isc_arg_number); + statusVector[5] := NativeIntPtr(currentVersion); + statusVector[6] := NativeIntPtr(isc_arg_string); + statusVector[7] := NativeIntPtr(PAnsiChar(msg)); + statusVector[8] := NativeIntPtr(isc_arg_end); + + status.setErrors(@statusVector); +end; diff --git a/src/misc/pascal/Pascal.interface.pas b/src/misc/pascal/Pascal.interface.pas index 637655bfea..a45bb7050c 100644 --- a/src/misc/pascal/Pascal.interface.pas +++ b/src/misc/pascal/Pascal.interface.pas @@ -7,6 +7,8 @@ class procedure checkException(status: IStatus); class procedure catchException(status: IStatus; e: Exception); + class procedure setVersionError(status: IStatus; interfaceName: string; + currentVersion, expectedVersion: NativeInt); private status: IStatus; diff --git a/src/misc/pascal/fb_get_master_interface.pas b/src/misc/pascal/fb_get_master_interface.pas index 08fe06cac4..0c167b31af 100644 --- a/src/misc/pascal/fb_get_master_interface.pas +++ b/src/misc/pascal/fb_get_master_interface.pas @@ -1,3 +1,4 @@ function fb_get_master_interface : IMaster; cdecl; external 'fbclient'; const + FB_UsedInYValve = FALSE; diff --git a/src/remote/client/interface.cpp b/src/remote/client/interface.cpp index bec23544b8..c804bd0f74 100644 --- a/src/remote/client/interface.cpp +++ b/src/remote/client/interface.cpp @@ -173,8 +173,8 @@ public: void cancel(CheckStatusWrapper* status) override; void close(CheckStatusWrapper* status) override; int seek(CheckStatusWrapper* status, int mode, int offset) override; // returns position - void cancel_1(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedCancel(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; public: explicit Blob(Rbl* handle) @@ -225,9 +225,9 @@ public: ITransaction* join(CheckStatusWrapper* status, ITransaction* tra) override; Transaction* validate(CheckStatusWrapper* status, IAttachment* attachment) override; Transaction* enterDtc(CheckStatusWrapper* status) override; - void commit_1(Firebird::CheckStatusWrapper* status) override; - void rollback_1(Firebird::CheckStatusWrapper* status) override; - void disconnect_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedCommit(Firebird::CheckStatusWrapper* status) override; + void deprecatedRollback(Firebird::CheckStatusWrapper* status) override; + void deprecatedDisconnect(Firebird::CheckStatusWrapper* status) override; public: Transaction(Rtr* handle, Attachment* a) @@ -290,7 +290,7 @@ public: FB_BOOLEAN isBof(CheckStatusWrapper* status) override; IMessageMetadata* getMetadata(CheckStatusWrapper* status) override; void close(CheckStatusWrapper* status) override; - void close_1(CheckStatusWrapper* status) override; + void deprecatedClose(CheckStatusWrapper* status) override; void setDelayedOutputFormat(CheckStatusWrapper* status, IMessageMetadata* format) override; ResultSet(Statement* s, IMessageMetadata* outFmt) @@ -348,7 +348,7 @@ public: void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par) override; Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; - void close_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedClose(Firebird::CheckStatusWrapper* status) override; private: void freeClientData(CheckStatusWrapper* status, bool force = false); @@ -572,7 +572,7 @@ public: int release() override; void process(CheckStatusWrapper* status, unsigned length, const unsigned char* data) override; void close(CheckStatusWrapper* status) override; - void close_1(CheckStatusWrapper* status) override; + void deprecatedClose(CheckStatusWrapper* status) override; explicit Replicator(Attachment* att) : attachment(att) {} @@ -620,7 +620,7 @@ public: unsigned int flags) override; void setCursorName(CheckStatusWrapper* status, const char* name) override; void free(CheckStatusWrapper* status) override; - void free_1(CheckStatusWrapper* status) override; + void deprecatedFree(CheckStatusWrapper* status) override; unsigned getFlags(CheckStatusWrapper* status) override; unsigned int getTimeout(CheckStatusWrapper* status) override @@ -721,7 +721,7 @@ public: unsigned int length, const void* message) override; void unwind(CheckStatusWrapper* status, int level) override; void free(CheckStatusWrapper* status) override; - void free_1(CheckStatusWrapper* status) override; + void deprecatedFree(CheckStatusWrapper* status) override; public: Request(Rrq* handle, Attachment* a) @@ -759,7 +759,7 @@ public: // IEvents implementation int release() override; void cancel(CheckStatusWrapper* status) override; - void cancel_1(CheckStatusWrapper* status) override; + void deprecatedCancel(CheckStatusWrapper* status) override; public: Events(Rvnt* handle) @@ -841,8 +841,8 @@ public: void ping(CheckStatusWrapper* status) override; void detach(CheckStatusWrapper* status) override; void dropDatabase(CheckStatusWrapper* status) override; - void detach_1(Firebird::CheckStatusWrapper* status) override; - void dropDatabase_1(Firebird::CheckStatusWrapper* status) override; + void deprecatedDetach(Firebird::CheckStatusWrapper* status) override; + void deprecatedDropDatabase(Firebird::CheckStatusWrapper* status) override; unsigned int getIdleTimeout(CheckStatusWrapper* status) override; void setIdleTimeout(CheckStatusWrapper* status, unsigned int timeOut) override; @@ -907,7 +907,7 @@ public: // IService implementation int release() override; void detach(CheckStatusWrapper* status) override; - void detach_1(CheckStatusWrapper* status) override; + void deprecatedDetach(CheckStatusWrapper* status) override; void query(CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, @@ -1288,7 +1288,7 @@ void Blob::freeClientData(CheckStatusWrapper* status, bool force) } -void Blob::cancel_1(CheckStatusWrapper* status) +void Blob::deprecatedCancel(CheckStatusWrapper* status) { /************************************** * @@ -1307,13 +1307,13 @@ void Blob::cancel_1(CheckStatusWrapper* status) void Blob::cancel(CheckStatusWrapper* status) { - cancel_1(status); + deprecatedCancel(status); if (status->isEmpty()) release(); } -void Blob::close_1(CheckStatusWrapper* status) +void Blob::deprecatedClose(CheckStatusWrapper* status) { /************************************** * @@ -1354,7 +1354,7 @@ void Blob::close_1(CheckStatusWrapper* status) void Blob::close(CheckStatusWrapper* status) { - close_1(status); + deprecatedClose(status); if (status->isEmpty()) release(); } @@ -1442,7 +1442,7 @@ void Events::freeClientData(CheckStatusWrapper* status, bool force) } -void Events::cancel_1(CheckStatusWrapper* status) +void Events::deprecatedCancel(CheckStatusWrapper* status) { /************************************** * @@ -1461,13 +1461,13 @@ void Events::cancel_1(CheckStatusWrapper* status) void Events::cancel(CheckStatusWrapper* status) { - cancel_1(status); + deprecatedCancel(status); if (status->isEmpty()) release(); } -void Transaction::commit_1(CheckStatusWrapper* status) +void Transaction::deprecatedCommit(CheckStatusWrapper* status) { /************************************** * @@ -1504,7 +1504,7 @@ void Transaction::commit_1(CheckStatusWrapper* status) void Transaction::commit(CheckStatusWrapper* status) { - commit_1(status); + deprecatedCommit(status); if (status->isEmpty()) release(); } @@ -2029,7 +2029,7 @@ void Attachment::freeClientData(CheckStatusWrapper* status, bool force) } -void Attachment::detach_1(CheckStatusWrapper* status) +void Attachment::deprecatedDetach(CheckStatusWrapper* status) { /************************************** * @@ -2048,13 +2048,13 @@ void Attachment::detach_1(CheckStatusWrapper* status) void Attachment::detach(CheckStatusWrapper* status) { - detach_1(status); + deprecatedDetach(status); if (status->isEmpty()) release(); } -void Attachment::dropDatabase_1(CheckStatusWrapper* status) +void Attachment::deprecatedDropDatabase(CheckStatusWrapper* status) { /************************************** * @@ -2114,7 +2114,7 @@ void Attachment::dropDatabase_1(CheckStatusWrapper* status) void Attachment::dropDatabase(CheckStatusWrapper* status) { - dropDatabase_1(status); + deprecatedDropDatabase(status); if (status->isEmpty()) release(); } @@ -2943,9 +2943,9 @@ void Batch::close(CheckStatusWrapper* status) } -void Batch::close_1(CheckStatusWrapper* status) +void Batch::deprecatedClose(CheckStatusWrapper* status) { - close_1(status); + deprecatedClose(status); if (status->isEmpty()) release(); } @@ -3042,9 +3042,9 @@ void Replicator::close(CheckStatusWrapper* status) } -void Replicator::close_1(CheckStatusWrapper* status) +void Replicator::deprecatedClose(CheckStatusWrapper* status) { - close_1(status); + deprecatedClose(status); if (status->isEmpty()) release(); } @@ -3700,7 +3700,7 @@ void Statement::freeClientData(CheckStatusWrapper* status, bool force) } -void Statement::free_1(CheckStatusWrapper* status) +void Statement::deprecatedFree(CheckStatusWrapper* status) { /************************************** * @@ -3720,7 +3720,7 @@ void Statement::free_1(CheckStatusWrapper* status) void Statement::free(CheckStatusWrapper* status) { - free_1(status); + deprecatedFree(status); if (status->isEmpty()) release(); } @@ -4713,7 +4713,7 @@ void ResultSet::freeClientData(CheckStatusWrapper* status, bool force) } -void ResultSet::close_1(CheckStatusWrapper* status) +void ResultSet::deprecatedClose(CheckStatusWrapper* status) { /************************************** * @@ -4744,7 +4744,7 @@ void ResultSet::close(CheckStatusWrapper* status) * **************************************/ - close_1(status); + deprecatedClose(status); if (status->isEmpty()) release(); } @@ -5633,7 +5633,7 @@ void Request::freeClientData(CheckStatusWrapper* status, bool force) } -void Request::free_1(CheckStatusWrapper* status) +void Request::deprecatedFree(CheckStatusWrapper* status) { /************************************** * @@ -5652,7 +5652,7 @@ void Request::free_1(CheckStatusWrapper* status) void Request::free(CheckStatusWrapper* status) { - free_1(status); + deprecatedFree(status); if (status->isEmpty()) release(); } @@ -5825,7 +5825,7 @@ void Transaction::freeClientData(CheckStatusWrapper* status, bool force) } -void Transaction::rollback_1(CheckStatusWrapper* status) +void Transaction::deprecatedRollback(CheckStatusWrapper* status) { /************************************** * @@ -5844,13 +5844,13 @@ void Transaction::rollback_1(CheckStatusWrapper* status) void Transaction::rollback(CheckStatusWrapper* status) { - rollback_1(status); + deprecatedRollback(status); if (status->isEmpty()) release(); } -void Transaction::disconnect_1(CheckStatusWrapper* status) +void Transaction::deprecatedDisconnect(CheckStatusWrapper* status) { try { @@ -5872,7 +5872,7 @@ void Transaction::disconnect_1(CheckStatusWrapper* status) void Transaction::disconnect(CheckStatusWrapper* status) { - disconnect_1(status); + deprecatedDisconnect(status); if (status->isEmpty()) release(); } @@ -6130,7 +6130,7 @@ void Service::freeClientData(CheckStatusWrapper* status, bool force) } -void Service::detach_1(CheckStatusWrapper* status) +void Service::deprecatedDetach(CheckStatusWrapper* status) { /************************************** * @@ -6149,7 +6149,7 @@ void Service::detach_1(CheckStatusWrapper* status) void Service::detach(CheckStatusWrapper* status) { - detach_1(status); + deprecatedDetach(status); if (status->isEmpty()) release(); } diff --git a/src/yvalve/DistributedTransaction.cpp b/src/yvalve/DistributedTransaction.cpp index e6f776824e..4fb4ab06f2 100644 --- a/src/yvalve/DistributedTransaction.cpp +++ b/src/yvalve/DistributedTransaction.cpp @@ -61,9 +61,9 @@ public: DTransaction* join(CheckStatusWrapper* status, ITransaction* transaction); ITransaction* validate(CheckStatusWrapper* status, IAttachment* attachment); DTransaction* enterDtc(CheckStatusWrapper* status); - void commit_1(CheckStatusWrapper* status); - void rollback_1(CheckStatusWrapper* status); - void disconnect_1(CheckStatusWrapper* status); + void deprecatedCommit(CheckStatusWrapper* status); + void deprecatedRollback(CheckStatusWrapper* status); + void deprecatedDisconnect(CheckStatusWrapper* status); private: typedef HalfStaticArray SubArray; @@ -390,17 +390,17 @@ void DTransaction::disconnect(CheckStatusWrapper* status) } } -void DTransaction::commit_1(CheckStatusWrapper* status) +void DTransaction::deprecatedCommit(CheckStatusWrapper* status) { commit(status); } -void DTransaction::rollback_1(CheckStatusWrapper* status) +void DTransaction::deprecatedRollback(CheckStatusWrapper* status) { rollback(status); } -void DTransaction::disconnect_1(CheckStatusWrapper* status) +void DTransaction::deprecatedDisconnect(CheckStatusWrapper* status) { disconnect(status); } diff --git a/src/yvalve/YObjects.h b/src/yvalve/YObjects.h index b99b4353cb..31e1a467a3 100644 --- a/src/yvalve/YObjects.h +++ b/src/yvalve/YObjects.h @@ -217,7 +217,7 @@ public: // IEvents implementation void cancel(Firebird::CheckStatusWrapper* status); - void cancel_1(Firebird::CheckStatusWrapper* status); + void deprecatedCancel(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -250,7 +250,7 @@ public: unsigned int msgType, unsigned int length, const void* message); void unwind(Firebird::CheckStatusWrapper* status, int level); void free(Firebird::CheckStatusWrapper* status); - void free_1(Firebird::CheckStatusWrapper* status); + void deprecatedFree(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -281,9 +281,9 @@ public: Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction); Firebird::ITransaction* validate(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* testAtt); YTransaction* enterDtc(Firebird::CheckStatusWrapper* status); - void commit_1(Firebird::CheckStatusWrapper* status); - void rollback_1(Firebird::CheckStatusWrapper* status); - void disconnect_1(Firebird::CheckStatusWrapper* status); + void deprecatedCommit(Firebird::CheckStatusWrapper* status); + void deprecatedRollback(Firebird::CheckStatusWrapper* status); + void deprecatedDisconnect(Firebird::CheckStatusWrapper* status); void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallback* callback); void selfCheck(); @@ -333,8 +333,8 @@ public: void cancel(Firebird::CheckStatusWrapper* status); void close(Firebird::CheckStatusWrapper* status); int seek(Firebird::CheckStatusWrapper* status, int mode, int offset); - void cancel_1(Firebird::CheckStatusWrapper* status); - void close_1(Firebird::CheckStatusWrapper* status); + void deprecatedCancel(Firebird::CheckStatusWrapper* status); + void deprecatedClose(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -364,7 +364,7 @@ public: FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status); Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status); void close(Firebird::CheckStatusWrapper* status); - void close_1(Firebird::CheckStatusWrapper* status); + void deprecatedClose(Firebird::CheckStatusWrapper* status); void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebird::IMessageMetadata* format); public: @@ -396,7 +396,7 @@ public: void cancel(Firebird::CheckStatusWrapper* status); void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par); void close(Firebird::CheckStatusWrapper* status); - void close_1(Firebird::CheckStatusWrapper* status); + void deprecatedClose(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -416,7 +416,7 @@ public: // IReplicator implementation void process(Firebird::CheckStatusWrapper* status, unsigned length, const unsigned char* data); void close(Firebird::CheckStatusWrapper* status); - void close_1(Firebird::CheckStatusWrapper* status); + void deprecatedClose(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -465,7 +465,7 @@ public: unsigned int flags); void setCursorName(Firebird::CheckStatusWrapper* status, const char* name); void free(Firebird::CheckStatusWrapper* status); - void free_1(Firebird::CheckStatusWrapper* status); + void deprecatedFree(Firebird::CheckStatusWrapper* status); unsigned getFlags(Firebird::CheckStatusWrapper* status); unsigned int getTimeout(Firebird::CheckStatusWrapper* status); @@ -555,8 +555,8 @@ public: void ping(Firebird::CheckStatusWrapper* status); void detach(Firebird::CheckStatusWrapper* status); void dropDatabase(Firebird::CheckStatusWrapper* status); - void detach_1(Firebird::CheckStatusWrapper* status); - void dropDatabase_1(Firebird::CheckStatusWrapper* status); + void deprecatedDetach(Firebird::CheckStatusWrapper* status); + void deprecatedDropDatabase(Firebird::CheckStatusWrapper* status); void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallback* callback); YTransaction* getTransaction(Firebird::ITransaction* tra); @@ -604,7 +604,7 @@ public: // IService implementation void detach(Firebird::CheckStatusWrapper* status); - void detach_1(Firebird::CheckStatusWrapper* status); + void deprecatedDetach(Firebird::CheckStatusWrapper* status); void query(Firebird::CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, diff --git a/src/yvalve/why.cpp b/src/yvalve/why.cpp index 7c382056a3..f720597479 100644 --- a/src/yvalve/why.cpp +++ b/src/yvalve/why.cpp @@ -28,7 +28,10 @@ */ #include "firebird.h" + +#define FB_UsedInYValve true #include "firebird/Interface.h" + #include "memory_routines.h" #include "gen/iberror.h" #include "gen/msg_facs.h" @@ -1335,7 +1338,7 @@ namespace Why if (!(status->getState() & IStatus::STATE_ERRORS)) y->destroy(Y::DF_RELEASE | Y::DF_KEEP_NEXT); - else if (status->getErrors()[1] == isc_wish_list) + else if (status->getErrors()[1] == isc_interface_version_too_old) { status->init(); if (entry.next()) @@ -3918,7 +3921,7 @@ void YEvents::cancel(CheckStatusWrapper* status) entry.next()->cancel(status); if (status->getErrors()[1] == isc_att_shutdown) status->init(); - }, [&]{entry.next()->cancel_1(status);}); + }, [&]{entry.next()->deprecatedCancel(status);}); } catch (const Exception& e) { @@ -3926,7 +3929,7 @@ void YEvents::cancel(CheckStatusWrapper* status) } } -void YEvents::cancel_1(CheckStatusWrapper* status) +void YEvents::deprecatedCancel(CheckStatusWrapper* status) { cancel(status); } @@ -4061,7 +4064,7 @@ void YRequest::free(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->free_1(status);}); + done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->deprecatedFree(status);}); } catch (const Exception& e) { @@ -4069,7 +4072,7 @@ void YRequest::free(CheckStatusWrapper* status) } } -void YRequest::free_1(CheckStatusWrapper* status) +void YRequest::deprecatedFree(CheckStatusWrapper* status) { free(status); } @@ -4157,7 +4160,7 @@ void YBlob::cancel(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->cancel(status);}, [&]{entry.next()->cancel_1(status);}); + done(status, entry, this, [&]{entry.next()->cancel(status);}, [&]{entry.next()->deprecatedCancel(status);}); } catch (const Exception& e) { @@ -4165,7 +4168,7 @@ void YBlob::cancel(CheckStatusWrapper* status) } } -void YBlob::cancel_1(CheckStatusWrapper* status) +void YBlob::deprecatedCancel(CheckStatusWrapper* status) { cancel(status); } @@ -4176,7 +4179,7 @@ void YBlob::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->deprecatedClose(status);}); } catch (const Exception& e) { @@ -4184,7 +4187,7 @@ void YBlob::close(CheckStatusWrapper* status) } } -void YBlob::close_1(CheckStatusWrapper* status) +void YBlob::deprecatedClose(CheckStatusWrapper* status) { close(status); } @@ -4456,7 +4459,7 @@ void YStatement::free(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->free_1(status);}); + done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->deprecatedFree(status);}); } catch (const Exception& e) { @@ -4464,7 +4467,7 @@ void YStatement::free(CheckStatusWrapper* status) } } -void YStatement::free_1(CheckStatusWrapper* status) +void YStatement::deprecatedFree(CheckStatusWrapper* status) { free(status); } @@ -4874,7 +4877,7 @@ void YResultSet::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->deprecatedClose(status);}); } catch (const Exception& e) { @@ -4882,7 +4885,7 @@ void YResultSet::close(CheckStatusWrapper* status) } } -void YResultSet::close_1(CheckStatusWrapper* status) +void YResultSet::deprecatedClose(CheckStatusWrapper* status) { close(status); } @@ -5066,7 +5069,7 @@ void YBatch::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->deprecatedClose(status);}); } catch (const Exception& e) { @@ -5075,7 +5078,7 @@ void YBatch::close(CheckStatusWrapper* status) } -void YBatch::close_1(CheckStatusWrapper* status) +void YBatch::deprecatedClose(CheckStatusWrapper* status) { close(status); } @@ -5116,7 +5119,7 @@ void YReplicator::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->deprecatedClose(status);}); } catch (const Exception& e) { @@ -5125,7 +5128,7 @@ void YReplicator::close(CheckStatusWrapper* status) } -void YReplicator::close_1(CheckStatusWrapper* status) +void YReplicator::deprecatedClose(CheckStatusWrapper* status) { close(status); } @@ -5222,7 +5225,7 @@ void YTransaction::commit(CheckStatusWrapper* status) { YEntry entry(status, this); - done(status, entry, this, [&]{entry.next()->commit(status);}, [&]{entry.next()->commit_1(status);}); + done(status, entry, this, [&]{entry.next()->commit(status);}, [&]{entry.next()->deprecatedCommit(status);}); } catch (const Exception& e) { @@ -5254,7 +5257,7 @@ void YTransaction::rollback(CheckStatusWrapper* status) entry.next()->rollback(status); if (isNetworkError(status)) status->init(); - }, [&]{entry.next()->rollback_1(status);}); + }, [&]{entry.next()->deprecatedRollback(status);}); } catch (const Exception& e) { @@ -5305,17 +5308,17 @@ void YTransaction::disconnect(CheckStatusWrapper* status) } } -void YTransaction::commit_1(CheckStatusWrapper* status) +void YTransaction::deprecatedCommit(CheckStatusWrapper* status) { commit(status); } -void YTransaction::rollback_1(CheckStatusWrapper* status) +void YTransaction::deprecatedRollback(CheckStatusWrapper* status) { rollback(status); } -void YTransaction::disconnect_1(CheckStatusWrapper* status) +void YTransaction::deprecatedDisconnect(CheckStatusWrapper* status) { disconnect(status); } @@ -5915,7 +5918,7 @@ void YAttachment::detach(CheckStatusWrapper* status) entry.next()->detach(status); if (isNetworkError(status)) status->init(); - }, [&]{entry.next()->detach_1(status);}); + }, [&]{entry.next()->deprecatedDetach(status);}); } catch (const Exception& e) { @@ -5923,7 +5926,7 @@ void YAttachment::detach(CheckStatusWrapper* status) } } -void YAttachment::detach_1(CheckStatusWrapper* status) +void YAttachment::deprecatedDetach(CheckStatusWrapper* status) { detach(status); } @@ -5934,7 +5937,7 @@ void YAttachment::dropDatabase(CheckStatusWrapper* status) { YEntry entry(status, this); - done(status, entry, this, [&]{entry.next()->dropDatabase(status);}, [&]{entry.next()->dropDatabase_1(status);}); + done(status, entry, this, [&]{entry.next()->dropDatabase(status);}, [&]{entry.next()->deprecatedDropDatabase(status);}); } catch (const Exception& e) { @@ -5942,7 +5945,7 @@ void YAttachment::dropDatabase(CheckStatusWrapper* status) } } -void YAttachment::dropDatabase_1(CheckStatusWrapper* status) +void YAttachment::deprecatedDropDatabase(CheckStatusWrapper* status) { dropDatabase(status); } @@ -6153,7 +6156,7 @@ void YService::detach(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - done(status, entry, this, [&]{entry.next()->detach(status);}, [&]{entry.next()->detach_1(status);}); + done(status, entry, this, [&]{entry.next()->detach(status);}, [&]{entry.next()->deprecatedDetach(status);}); } catch (const Exception& e) { @@ -6161,7 +6164,7 @@ void YService::detach(CheckStatusWrapper* status) } } -void YService::detach_1(CheckStatusWrapper* status) +void YService::deprecatedDetach(CheckStatusWrapper* status) { detach(status); }