--- ibx/trunk/fbintf/client/2.5/FB25ClientAPI.pas 2020/07/17 22:57:55 307 +++ ibx/trunk/fbintf/client/2.5/FB25ClientAPI.pas 2020/07/18 10:26:30 308 @@ -166,6 +166,7 @@ type isc_array_put_slice: Tisc_array_put_slice; isc_prepare_transaction: Tisc_prepare_transaction; isc_version: Tisc_Version; + isc_interprete: Tisc_interprete; public {Helper Functions} @@ -176,7 +177,7 @@ type function SQLDecodeTime(bufptr: PByte): TDateTime; override; procedure SQLEncodeDateTime(aDateTime: TDateTime; bufptr: PByte); override; function SQLDecodeDateTime(bufptr: PByte): TDateTime; override; - + function FormatStatus(Status: TFBStatus): AnsiString; override; public {IFirebirdAPI} @@ -203,7 +204,8 @@ type function GetStatus: IStatus; override; function HasRollbackRetaining: boolean; function IsEmbeddedServer: boolean; override; - function GetImplementationVersion: AnsiString; + function GetClientMajor: integer; override; + function GetClientMinor: integer; override; {Firebird 3 API} function HasMasterIntf: boolean; @@ -386,6 +388,7 @@ begin isc_array_put_slice := GetProcAddr('isc_array_put_slice'); {do not localize} isc_prepare_transaction := GetProcAddr('isc_prepare_transaction'); {do not localize} isc_version := GetProcAddr('isc_version'); {do not localize} + isc_interprete := GetProcAddr('isc_interprete'); {do not localize} FIBServiceAPIPresent := true; isc_rollback_retaining := GetProcAddress(FFBLibrary.IBLibrary, 'isc_rollback_retaining'); {do not localize} @@ -538,6 +541,16 @@ begin {$ENDIF} end; +function TFB25ClientAPI.GetClientMajor: integer; +begin + Result := 2; +end; + +function TFB25ClientAPI.GetClientMinor: integer; +begin + Result := 5; +end; + function TFB25ClientAPI.HasMasterIntf: boolean; begin Result := false; @@ -548,11 +561,6 @@ begin Result := nil; end; -function TFB25ClientAPI.GetImplementationVersion: AnsiString; -begin - Result := FBClientInterfaceVersion; -end; - function TFB25ClientAPI.DecodeInteger(bufptr: PByte; len: short): integer; begin Result := isc_portable_integer(bufptr,len); @@ -669,6 +677,20 @@ begin end; end; +function TFB25ClientAPI.FormatStatus(Status: TFBStatus): AnsiString; +var psb: PStatusVector; + local_buffer: array[0..IBHugeLocalBufferLength - 1] of AnsiChar; +begin + psb := Status.StatusVector; + Result := ''; + while isc_interprete(@local_buffer,@psb) > 0 do + begin + if (Result <> '') and (Result[Length(Result)] <> LF) then + Result := Result + LineEnding + '-'; + Result := Result + strpas(local_buffer); + end; +end; + end.