ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/fbintf/client/2.5/FB25ClientAPI.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/2.5/FB25ClientAPI.pas (file contents):
Revision 308 by tony, Sat Jul 18 10:26:30 2020 UTC vs.
Revision 350 by tony, Wed Oct 20 14:58:56 2021 UTC

# Line 74 | Line 74 | interface
74   uses
75    Classes, SysUtils, FBClientAPI, IBHeader, IBExternals, IB;
76  
77 const
78  FBClientInterfaceVersion = '2.5';
79
77   type
78  
79    { TFB25Status }
# Line 114 | Line 111 | type
111      BLOB_put: TBLOB_put;
112      isc_wait_for_event: Tisc_wait_for_event;
113      isc_vax_integer: Tisc_vax_integer;
117    isc_portable_integer: Tisc_portable_integer;
114      isc_blob_info: Tisc_blob_info;
115      isc_blob_lookup_desc: Tisc_blob_lookup_desc;
116      isc_open_blob2: Tisc_open_blob2;
# Line 170 | Line 166 | type
166  
167    public
168      {Helper Functions}
173    function DecodeInteger(bufptr: PByte; len: short): integer; override;
169      procedure SQLEncodeDate(aDate: TDateTime; bufptr: PByte); override;
170      function SQLDecodeDate(bufptr: PByte): TDateTime; override;
171      procedure SQLEncodeTime(aTime: TDateTime; bufptr: PByte); override;
# Line 206 | Line 201 | type
201      function IsEmbeddedServer: boolean; override;
202      function GetClientMajor: integer; override;
203      function GetClientMinor: integer; override;
204 +    function HasScollableCursors: boolean;
205  
206      {Firebird 3 API}
207      function HasMasterIntf: boolean;
# Line 218 | Line 214 | implementation
214   uses FBMessages,
215      {$IFDEF WINDOWS}Windows, {$ENDIF}
216      {$IFDEF FPC} Dynlibs, {$ENDIF}
217 <  FB25Attachment, FB25Transaction, FB25Services, FBParamBlock,
218 <  IBUtils;
217 >  FB25Attachment, FB25Transaction, FB25Services,
218 >  IBUtils, FBAttachment, FBTransaction, FBServices;
219  
220   { Stubs for 6.0 only functions }
221   function isc_rollback_retaining_stub(status_vector   : PISC_STATUS;
# Line 347 | Line 343 | begin
343    BLOB_put := GetProcAddr('BLOB_put'); {do not localize}
344    isc_wait_for_event := GetProcAddr('isc_wait_for_event'); {do not localize}
345    isc_vax_integer := GetProcAddr('isc_vax_integer'); {do not localize}
350  isc_portable_integer := GetProcAddr('isc_portable_integer'); {do not localize}
346    isc_blob_info := GetProcAddr('isc_blob_info'); {do not localize}
347    isc_blob_lookup_desc := GetProcAddr('isc_blob_lookup_desc');  {do not localize}
348    isc_open_blob2 := GetProcAddr('isc_open_blob2'); {do not localize}
# Line 551 | Line 546 | begin
546    Result := 5;
547   end;
548  
549 < function TFB25ClientAPI.HasMasterIntf: boolean;
549 > function TFB25ClientAPI.HasScollableCursors: boolean;
550   begin
551    Result := false;
552   end;
553  
554 < function TFB25ClientAPI.GetIMaster: TObject;
554 > function TFB25ClientAPI.HasMasterIntf: boolean;
555   begin
556 <  Result := nil;
556 >  Result := false;
557   end;
558  
559 < function TFB25ClientAPI.DecodeInteger(bufptr: PByte; len: short): integer;
559 > function TFB25ClientAPI.GetIMaster: TObject;
560   begin
561 <  Result := isc_portable_integer(bufptr,len);
561 >  Result := nil;
562   end;
563  
564   procedure TFB25ClientAPI.SQLEncodeDate(aDate: TDateTime; bufptr: PByte);
# Line 601 | Line 596 | end;
596   procedure TFB25ClientAPI.SQLEncodeTime(aTime: TDateTime; bufptr: PByte);
597   var
598    tm_date: TCTimeStructure;
599 <  Hr, Mt, S, Ms: Word;
599 >  Hr, Mt, S: Word;
600 >  DMs: cardinal; {DMs = decimilliseconds}
601   begin
602 <  DecodeTime(aTime, Hr, Mt, S, Ms);
602 >  FBDecodeTime(aTime, Hr, Mt, S, DMs);
603    with tm_date do begin
604      tm_sec := S;
605      tm_min := Mt;
# Line 613 | Line 609 | begin
609      tm_year := 0;
610    end;
611    isc_encode_sql_time(@tm_date, PISC_TIME(bufptr));
612 <  if Ms > 0 then
613 <    Inc(PISC_TIME(bufptr)^,Ms*10);
612 >  if DMs > 0 then
613 >    Inc(PISC_TIME(bufptr)^,DMs);
614   end;
615  
616   function TFB25ClientAPI.SQLDecodeTime(bufptr: PByte): TDateTime;
617   var
618    tm_date: TCTimeStructure;
619 <  msecs: Word;
619 >  DMs: cardinal; {DMs = decimilliseconds}
620   begin
621    isc_decode_sql_time(PISC_TIME(bufptr), @tm_date);
622    try
623 <    msecs :=  (PISC_TIME(bufptr)^ mod 10000) div 10;
624 <    result := EncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
625 <                         Word(tm_date.tm_sec), msecs)
623 >    DMs :=  PISC_TIME(bufptr)^ mod 10000;
624 >    result := FBEncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
625 >                         Word(tm_date.tm_sec), DMs)
626    except
627      on E: EConvertError do begin
628        IBError(ibxeInvalidDataConversion, [nil]);
# Line 638 | Line 634 | procedure TFB25ClientAPI.SQLEncodeDateTi
634   var
635    tm_date: TCTimeStructure;
636    Yr, Mn, Dy, Hr, Mt, S, Ms: Word;
637 +  DMs: cardinal;
638   begin
639    DecodeDate(aDateTime, Yr, Mn, Dy);
640 <  DecodeTime(aDateTime, Hr, Mt, S, Ms);
640 >  FBDecodeTime(aDateTime, Hr, Mt, S, DMs);
641    with tm_date do begin
642      tm_sec := S;
643      tm_min := Mt;
# Line 650 | Line 647 | begin
647      tm_year := Yr - 1900;
648    end;
649    isc_encode_date(@tm_date, PISC_QUAD(bufptr));
650 <  if Ms > 0 then
651 <    Inc(PISC_TIMESTAMP(bufptr)^.timestamp_time,Ms*10);
650 >  if DMs > 0 then
651 >    Inc(PISC_TIMESTAMP(bufptr)^.timestamp_time,DMs);
652   end;
653  
654   function TFB25ClientAPI.SQLDecodeDateTime(bufptr: PByte): TDateTime;
655   var
656    tm_date: TCTimeStructure;
657 <  msecs: Word;
657 >  Dmsecs: Word;
658   begin
659    isc_decode_date(PISC_QUAD(bufptr), @tm_date);
660    try
661      result := EncodeDate(Word(tm_date.tm_year + 1900), Word(tm_date.tm_mon + 1),
662                          Word(tm_date.tm_mday));
663 <    msecs := (PISC_TIMESTAMP(bufptr)^.timestamp_time mod 10000) div 10;
663 >    Dmsecs := PISC_TIMESTAMP(bufptr)^.timestamp_time mod 10000;
664      if result >= 0 then
665 <      result := result + EncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
666 <                                    Word(tm_date.tm_sec), msecs)
665 >      result := result + FBEncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
666 >                                    Word(tm_date.tm_sec), Dmsecs)
667      else
668 <      result := result - EncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
669 <                                    Word(tm_date.tm_sec), msecs)
668 >      result := result - FBEncodeTime(Word(tm_date.tm_hour), Word(tm_date.tm_min),
669 >                                    Word(tm_date.tm_sec), Dmsecs)
670    except
671      on E: EConvertError do begin
672        IBError(ibxeInvalidDataConversion, [nil]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines