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

Comparing:
ibx/trunk/fbintf/client/2.5/FB25Events.pas (file contents), Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC vs.
ibx/branches/udr/client/2.5/FB25Events.pas (file contents), Revision 381 by tony, Sat Jan 15 00:06:22 2022 UTC

# Line 60 | Line 60
60   {                                                                        }
61   {************************************************************************}
62   unit FB25Events;
63 + {$IFDEF MSWINDOWS}
64 + {$DEFINE WINDOWS}
65 + {$ENDIF}
66  
67   {$IFDEF FPC}
68 < {$mode objfpc}{$H+}
68 > {$mode delphi}
69   {$interfaces COM}
70   {$ENDIF}
71  
# Line 90 | Line 93 | type
93    public
94      constructor Create(aOwner: TFB25Events);
95      destructor Destroy; override;
96 <    procedure eventCallbackFunction(length: short; updated: PChar);
96 >    procedure eventCallbackFunction(length: short; updated: PAnsiChar);
97      procedure WaitForEvent;
98      procedure CancelWait;
99   end;
# Line 103 | Line 106 | type
106      FDBHandle: TISC_DB_HANDLE;
107      FEventHandlerThread: TObject;
108      FAsyncEventCallback: TEventhandlerInterface;
109 +    FFirebird25ClientAPI: TFB25ClientAPI;
110    protected
111      procedure CancelEvents(Force: boolean = false); override;
112      function GetIEvents: IEvents; override;
# Line 111 | Line 115 | type
115      destructor Destroy; override;
116  
117      {IEvents}
118 <    procedure WaitForEvent;
118 >    procedure WaitForEvent; override;
119      procedure AsyncWaitForEvent(EventHandler: TEventHandler); override;
120    end;
121  
# Line 150 | Line 154 | type
154   constructor TEventHandlerThread.Create(Owner: TFB25Events;
155     EventHandler: TEventhandlerInterface);
156   begin
157 <   inherited Create(true);
157 >   inherited Create(false);
158     FOwner := Owner;
159     FEventHandler := EventHandler;
160     FreeOnTerminate := true;
157   Start;
161   end;
162  
163   procedure TEventHandlerThread.Terminate;
# Line 165 | Line 168 | type
168  
169    {This procedure is used for the event call back - note the cdecl }
170  
171 < procedure IBEventCallback( ptr: pointer; length: short; updated: PChar); cdecl;
171 > procedure IBEventCallback( ptr: pointer; length: short; updated: PAnsiChar); cdecl;
172   begin
173     if (ptr = nil) or (length = 0) or (updated = nil) then
174       Exit;
# Line 214 | Line 217 | begin
217   end;
218  
219   procedure TEventhandlerInterface.eventCallbackFunction(length: short;
220 <  updated: PChar);
220 >  updated: PAnsiChar);
221   begin
222    FOwner.FCriticalSection.Enter;
223    try
# Line 258 | Line 261 | begin
261    FCriticalSection.Enter;
262    try
263      if not FInWaitState then Exit;
264 <    with Firebird25ClientAPI do
264 >    with FFirebird25ClientAPI do
265        if (Call(isc_Cancel_events( StatusVector, @FDBHandle, @FEventID),false) > 0) and not Force then
266          IBDatabaseError;
267  
# Line 278 | Line 281 | constructor TFB25Events.Create(DBAttachm
281   begin
282    inherited Create(DBAttachment,DBAttachment,Events);
283    FDBHandle := DBAttachment.Handle;
284 +  FFirebird25ClientAPI := DBAttachment.Firebird25ClientAPI;
285 +  OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError;
286    FAsyncEventCallback := TEventhandlerInterface.Create(self);
287    FEventHandlerThread := TEventHandlerThread.Create(self,FAsyncEventCallback);
288   end;
# Line 302 | Line 307 | begin
307  
308      FEventHandler := EventHandler;
309      callback := @IBEventCallback;
310 <    with Firebird25ClientAPI do
310 >    with FFirebird25ClientAPI do
311        Call(isc_que_events( StatusVector, @FDBHandle, @FEventID, FEventBufferLen,
312                       FEventBuffer, TISC_CALLBACK(callback), PVoid(FAsyncEventCallback)));
313      FInWaitState := true;
# Line 318 | Line 323 | begin
323  
324    FInWaitState := true;
325    try
326 <    with Firebird25ClientAPI do
326 >    with FFirebird25ClientAPI do
327         Call(isc_wait_for_event(StatusVector,@FDBHandle, FEventBufferlen,FEventBuffer,FResultBuffer));
328    finally
329      FInWaitState := false;

Comparing:
ibx/trunk/fbintf/client/2.5/FB25Events.pas (property svn:eol-style), Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC vs.
ibx/branches/udr/client/2.5/FB25Events.pas (property svn:eol-style), Revision 381 by tony, Sat Jan 15 00:06:22 2022 UTC

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines