ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/IBHeader.pas
Revision: 45
Committed: Tue Dec 6 10:33:46 2016 UTC (7 years, 11 months ago) by tony
Content type: text/x-pascal
Original Path: ibx/trunk/fbintf/client/2.5/IBHeader.pas
File size: 97854 byte(s)
Log Message:
Committing updates for Release R2-0-0

File Contents

# Content
1 {************************************************************************}
2 { }
3 { Borland Delphi Visual Component Library }
4 { InterBase Express core components }
5 { }
6 { Copyright (c) 1998-2000 Inprise Corporation }
7 { }
8 { InterBase Express is based in part on the product }
9 { Free IB Components, written by Gregory H. Deatz for }
10 { Hoagland, Longo, Moran, Dunst & Doukas Company. }
11 { Free IB Components is used under license. }
12 { }
13 { The contents of this file are subject to the InterBase }
14 { Public License Version 1.0 (the "License"); you may not }
15 { use this file except in compliance with the License. You }
16 { may obtain a copy of the License at http://www.Inprise.com/IPL.html }
17 { Software distributed under the License is distributed on }
18 { an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either }
19 { express or implied. See the License for the specific language }
20 { governing rights and limitations under the License. }
21 { The Original Code was created by InterBase Software Corporation }
22 { and its successors. }
23 { Portions created by Inprise Corporation are Copyright (C) Inprise }
24 { Corporation. All Rights Reserved. }
25 { Contributor(s): Jeff Overcash }
26 { }
27 { IBX For Lazarus (Firebird Express) }
28 { Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk }
29 { Portions created by MWA Software are copyright McCallum Whyman }
30 { Associates Ltd 2011 }
31 { }
32 {************************************************************************}
33
34 unit IBHeader;
35
36 {$IFDEF FPC}
37 {$mode objfpc}{$H+}
38 {$ENDIF}
39
40 interface
41
42 uses
43 IBExternals, IB;
44
45
46 const
47 ISC_TRUE = 1;
48 ISC_FALSE = 0;
49 DSQL_close = 1;
50 DSQL_drop = 2;
51
52 const
53 SQLDA_VERSION1 = 1; (* pre V6.0 SQLDA *)
54 SQLDA_VERSION2 = 2; (* V6.0 SQLDA *)
55 SQL_DIALECT_V5 = 1; (* meaning is same as DIALECT_xsqlda *)
56 SQL_DIALECT_V6_TRANSITION = 2; (* flagging anything that is delimited
57 by double quotes as an error and
58 flagging keyword DATE as an error *)
59 SQL_DIALECT_V6 = 3; (* supports SQL delimited identifier,
60 SQLDATE/DATE, TIME, TIMESTAMP,
61 CURRENT_DATE, CURRENT_TIME,
62 CURRENT_TIMESTAMP, and 64-bit exact
63 numeric type *)
64 SQL_DIALECT_CURRENT = SQL_DIALECT_V6; (* latest IB DIALECT *)
65
66
67 type
68 (**********************************)
69 (** InterBase Handle Definitions **)
70 (**********************************)
71 TISC_ATT_HANDLE = FB_API_HANDLE;
72 PISC_ATT_HANDLE = ^TISC_ATT_HANDLE;
73 TISC_BLOB_HANDLE = FB_API_HANDLE;
74 PISC_BLOB_HANDLE = ^TISC_BLOB_HANDLE;
75 TISC_DB_HANDLE = FB_API_HANDLE;
76 PISC_DB_HANDLE = ^TISC_DB_HANDLE;
77 TISC_FORM_HANDLE = FB_API_HANDLE;
78 PISC_FORM_HANDLE = ^TISC_FORM_HANDLE;
79 TISC_REQ_HANDLE = FB_API_HANDLE;
80 PISC_REQ_HANDLE = ^TISC_REQ_HANDLE;
81 TISC_STMT_HANDLE = FB_API_HANDLE;
82 PISC_STMT_HANDLE = ^TISC_STMT_HANDLE;
83 TISC_SVC_HANDLE = FB_API_HANDLE;
84 PISC_SVC_HANDLE = ^TISC_SVC_HANDLE;
85 TISC_TR_HANDLE = FB_API_HANDLE;
86 PISC_TR_HANDLE = ^TISC_TR_HANDLE;
87 TISC_WIN_HANDLE = FB_API_HANDLE;
88 PISC_WIN_HANDLE = ^TISC_WIN_HANDLE;
89 TISC_CALLBACK = procedure;
90 ISC_SVC_HANDLE = ISC_LONG;
91
92 (*******************************************************************)
93 (* Time & Date Support *)
94 (*******************************************************************)
95 const
96 TIME_SECONDS_PRECISION = 10000;
97 TIME_SECONDS_PRECISION_SCALE = -4;
98
99 type
100 ISC_DATE = Long;
101 PISC_DATE = ^ISC_DATE;
102 ISC_TIME = ULong;
103 PISC_TIME = ^ISC_TIME;
104 TISC_TIMESTAMP = record
105 timestamp_date: ISC_DATE;
106 timestamp_time: ISC_TIME;
107 end;
108 PISC_TIMESTAMP = ^TISC_TIMESTAMP;
109
110 TISC_ARRAY_BOUND = record
111 array_bound_lower : short;
112 array_bound_upper : short;
113 end;
114 PISC_ARRAY_BOUND = ^TISC_ARRAY_BOUND;
115 TISC_ARRAY_DESC = record
116 array_desc_dtype : UChar;
117 array_desc_scale : Char;
118 array_desc_length : UShort;
119 array_desc_field_name : array[0..31] of Char;
120 array_desc_relation_name : array[0..31] of Char;
121 array_desc_dimensions : Short;
122 array_desc_flags : Short;
123 array_desc_bounds : array[0..15] of TISC_ARRAY_BOUND;
124 end; // TISC_ARRAY_DESC
125 PISC_ARRAY_DESC = ^TISC_ARRAY_DESC;
126
127 TISC_BLOB_DESC = record
128 blob_desc_subtype : Short;
129 blob_desc_charset : Short;
130 blob_desc_segment_size : Short;
131 blob_desc_field_name : array[0..31] of Char;
132 blob_desc_relation_name : array[0..31] of Char;
133 end; // TISC_BLOB_DESC
134 PISC_BLOB_DESC = ^TISC_BLOB_DESC;
135
136 (*****************************)
137 (** Blob control structure **)
138 (*****************************)
139 TISC_BLOB_CTL_SOURCE_FUNCTION = function: ISC_STATUS; // ISC_FAR
140 PISC_BLOB_CTL = ^TISC_BLOB_CTL; // ISC_FAR
141 TISC_BLOB_CTL = record
142 (** Source filter **)
143 ctl_source : TISC_BLOB_CTL_SOURCE_FUNCTION;
144 (** Argument to pass to source filter **)
145 ctl_source_handle : PISC_BLOB_CTL;
146 ctl_to_sub_type : Short; (** Target type **)
147 ctl_from_sub_type : Short; (** Source type **)
148 ctl_buffer_length : UShort; (** Length of buffer **)
149 ctl_segment_length : UShort; (** Length of current segment **)
150 ctl_bpb_length : UShort; (** Length of blob parameter **)
151 (** block **)
152 ctl_bpb : PChar; (** Address of blob parameter **)
153 (** block **)
154 ctl_buffer : PUChar; (** Address of segment buffer **)
155 ctl_max_segment : ISC_LONG; (** Length of longest segment **)
156 ctl_number_segments : ISC_LONG; (** Total number of segments **)
157 ctl_total_length : ISC_LONG; (** Total length of blob **)
158 ctl_status : PISC_STATUS; (** Address of status vector **)
159 ctl_data : array[0..7] of long; (** Application specific data **)
160 end;
161 (*****************************)
162 (** Blob stream definitions **)
163 (*****************************)
164 TBSTREAM = record
165 bstr_blob : PVoid; (** Blob handle **)
166 bstr_buffer : PChar; (** Address of buffer **)
167 bstr_ptr : PChar; (** Next character **)
168 bstr_length : Short; (** Length of buffer **)
169 bstr_cnt : Short; (** Characters in buffer **)
170 bstr_mode : Char; (** (mode) ? OUTPUT : INPUT **)
171 end;
172 PBSTREAM = ^TBSTREAM;
173
174 (*****************************)
175 (** Dynamic SQL definitions **)
176 (*****************************)
177 {$IFDEF IB5_ONLY}
178 TSQLVAR = record
179 sqltype : Short;
180 sqllen : Short;
181 sqldata : PChar;
182 sqlind : PShort;
183 sqlname_length : Short;
184 sqlname : array[0..29] of Char;
185 end;
186 PSQLVAR = ^TSQLVAR;
187
188 TSQLDA = record
189 sqldaid : array[0..7] of Char;
190 sqldabc : ISC_LONG;
191 sqln : Short;
192 sqld : Short;
193 sqlvar : array[0..0] of TSQLVAR;
194 end;
195 PSQLDA = ^TSQLDA;
196 {$ENDIF}
197
198 (********************************)
199 (** Declare the extended SQLDA **)
200 (********************************)
201 TXSQLVAR = record
202 sqltype : Short; (** datatype of field **)
203 sqlscale : Short; (** scale factor **)
204 sqlsubtype : Short; (** datatype subtype - BLOBs **)
205 (** & text types only **)
206 sqllen : Short; (** length of data area **)
207 sqldata : PChar; (** address of data **)
208 sqlind : PShort; (** address of indicator **)
209 (** variable **)
210 sqlname_length : Short; (** length of sqlname field **)
211 (** name of field, name length + space for NULL **)
212 sqlname : array[0..31] of Char;
213 relname_length : Short; (** length of relation name **)
214 (** field's relation name + space for NULL **)
215 relname : array[0..31] of Char;
216 ownname_length : Short; (** length of owner name **)
217 (** relation's owner name + space for NULL **)
218 ownname : array[0..31] of Char;
219 aliasname_length : Short; (** length of alias name **)
220 (** relation's alias name + space for NULL **)
221 aliasname : array[0..31] of Char;
222 end; // TXSQLVAR
223 PXSQLVAR = ^TXSQLVAR;
224
225 TXSQLDA = record
226 version : Short; (** version of this XSQLDA **)
227 (** XSQLDA name field **)
228 sqldaid : array[0..7] of Char;
229 sqldabc : ISC_LONG; (** length in bytes of SQLDA **)
230 sqln : Short; (** number of fields allocated **)
231 sqld : Short; (** actual number of fields **)
232 (** first field address **)
233 sqlvar : array[0..0] of TXSQLVAR;
234 end; // TXSQLDA
235 PXSQLDA = ^TXSQLDA;
236
237 (********************************************************)
238 (** This record type is for passing arguments to **)
239 (** isc_start_transaction (See docs) **)
240 (********************************************************)
241 TISC_START_TRANS = record
242 db_handle : PISC_DB_HANDLE;
243 tpb_length : UShort;
244 tpb_address : PChar;
245 end;
246
247 (********************************************************)
248 (** This record type is for passing arguments to **)
249 (** isc_start_multiple (see docs) **)
250 (********************************************************)
251 TISC_TEB = record
252 db_handle : PISC_DB_HANDLE;
253 tpb_length : Long;
254 tpb_address : PChar;
255 end;
256 PISC_TEB = ^TISC_TEB;
257 TISC_TEB_ARRAY = array[0..0] of TISC_TEB;
258 PISC_TEB_ARRAY = ^TISC_TEB_ARRAY;
259
260 (*****************************)
261 (** OSRI database functions **)
262 (*****************************)
263
264 Tisc_attach_database = function (status_vector : PISC_STATUS;
265 db_name_length : Short;
266 db_name : PChar;
267 db_handle : PISC_DB_HANDLE;
268 parm_buffer_length : Short;
269 parm_buffer : PChar): ISC_STATUS;
270 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
271
272 Tisc_array_gen_sdl = function (status_vector : PISC_STATUS;
273 isc_array_desc : PISC_ARRAY_DESC;
274 isc_arg3 : PShort;
275 isc_arg4 : PChar;
276 isc_arg5 : PShort): ISC_STATUS;
277 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
278
279 Tisc_array_get_slice = function (status_vector : PISC_STATUS;
280 db_handle : PISC_DB_HANDLE;
281 trans_handle : PISC_TR_HANDLE;
282 array_id : PISC_QUAD;
283 descriptor : PISC_ARRAY_DESC;
284 dest_array : PVoid;
285 slice_length : PISC_LONG): ISC_STATUS;
286 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
287
288 Tisc_array_lookup_bounds = function (status_vector : PISC_STATUS;
289 db_handle : PISC_DB_HANDLE;
290 trans_handle : PISC_TR_HANDLE;
291 table_name,
292 column_name : PChar;
293 descriptor : PISC_ARRAY_DESC): ISC_STATUS;
294 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
295
296 Tisc_array_lookup_desc = function (status_vector : PISC_STATUS;
297 db_handle : PISC_DB_HANDLE;
298 trans_handle : PISC_TR_HANDLE;
299 table_name,
300 column_name : PChar;
301 descriptor : PISC_ARRAY_DESC): ISC_STATUS;
302 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
303
304 Tisc_array_set_desc = function (status_vector : PISC_STATUS;
305 table_name : PChar;
306 column_name : PChar;
307 sql_dtype,
308 sql_length,
309 sql_dimensions : PShort;
310 descriptor : PISC_ARRAY_DESC): ISC_STATUS;
311 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
312
313 Tisc_array_put_slice = function (status_vector : PISC_STATUS;
314 db_handle : PISC_DB_HANDLE;
315 trans_handle : PISC_TR_HANDLE;
316 array_id : PISC_QUAD;
317 descriptor : PISC_ARRAY_DESC;
318 source_array : PVoid;
319 slice_length : PISC_LONG): ISC_STATUS;
320 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
321
322 Tisc_blob_default_desc = procedure (descriptor : PISC_BLOB_DESC;
323 table_name : PUChar;
324 column_name : PUChar);
325 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
326
327 Tisc_blob_gen_bpb = function (status_vector : PISC_STATUS;
328 to_descriptor,
329 from_descriptor : PISC_BLOB_DESC;
330 bpb_buffer_length : UShort;
331 bpb_buffer : PUChar;
332 bpb_length : PUShort): ISC_STATUS;
333 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
334
335 Tisc_blob_info = function (status_vector : PISC_STATUS;
336 blob_handle : PISC_BLOB_HANDLE;
337 item_list_buffer_length : Short;
338 item_list_buffer : PChar;
339 result_buffer_length : Short;
340 result_buffer : PChar): ISC_STATUS;
341 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
342
343 Tisc_blob_lookup_desc = function (status_vector : PISC_STATUS;
344 db_handle : PISC_DB_HANDLE;
345 trans_handle : PISC_TR_HANDLE;
346 table_name,
347 column_name : PChar;
348 descriptor : PISC_BLOB_DESC;
349 global : PUChar): ISC_STATUS;
350 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
351
352 Tisc_blob_set_desc = function (status_vector : PISC_STATUS;
353 table_name,
354 column_name : PChar;
355 subtype,
356 charset,
357 segment_size : Short;
358 descriptor : PISC_BLOB_DESC): ISC_STATUS;
359 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
360
361 Tisc_cancel_blob = function (status_vector : PISC_STATUS;
362 blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
363 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
364
365 Tisc_cancel_events = function (status_vector : PISC_STATUS;
366 db_handle : PISC_DB_HANDLE;
367 event_id : PISC_LONG): ISC_STATUS;
368 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
369
370 Tisc_close_blob = function (status_vector : PISC_STATUS;
371 blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
372 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
373
374 Tisc_commit_retaining = function (status_vector : PISC_STATUS;
375 tran_handle : PISC_TR_HANDLE): ISC_STATUS;
376 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
377
378 Tisc_commit_transaction = function (status_vector : PISC_STATUS;
379 tran_handle : PISC_TR_HANDLE): ISC_STATUS;
380 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
381
382 Tisc_create_blob = function (status_vector : PISC_STATUS;
383 db_handle : PISC_DB_HANDLE;
384 tran_handle : PISC_TR_HANDLE;
385 blob_handle : PISC_BLOB_HANDLE;
386 blob_id : PISC_QUAD): ISC_STATUS;
387 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
388
389 Tisc_create_blob2 = function (status_vector : PISC_STATUS;
390 db_handle : PISC_DB_HANDLE;
391 tran_handle : PISC_TR_HANDLE;
392 blob_handle : PISC_BLOB_HANDLE;
393 blob_id : PISC_QUAD;
394 bpb_length : Short;
395 bpb_address : PChar): ISC_STATUS;
396 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
397
398 Tisc_create_database = function (status_vector : PISC_STATUS;
399 isc_arg2 : Short;
400 isc_arg3 : PChar;
401 db_handle : PISC_DB_HANDLE;
402 isc_arg5 : Short;
403 isc_arg6 : PChar;
404 isc_arg7 : Short): ISC_STATUS;
405 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
406
407 Tisc_database_info = function (status_vector : PISC_STATUS;
408 db_handle : PISC_DB_HANDLE;
409 item_list_buffer_length : Short;
410 item_list_buffer : PChar;
411 result_buffer_length : Short;
412 result_buffer : PChar): ISC_STATUS;
413 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
414
415 Tisc_decode_date = procedure (ib_date: PISC_QUAD;
416 tm_date: PCTimeStructure);
417 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
418
419 Tisc_decode_sql_date = procedure (ib_date: PISC_DATE;
420 tm_date: PCTimeStructure);
421 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
422
423 Tisc_decode_sql_time = procedure (ib_time: PISC_TIME;
424 tm_date: PCTimeStructure);
425 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
426
427 Tisc_decode_timestamp = procedure (ib_timestamp: PISC_TIMESTAMP;
428 tm_date: PCTimeStructure);
429 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
430
431 Tisc_detach_database = function (status_vector : PISC_STATUS;
432 db_handle : PISC_DB_HANDLE): ISC_STATUS;
433 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
434
435 Tisc_drop_database = function (status_vector : PISC_STATUS;
436 db_handle : PISC_DB_HANDLE): ISC_STATUS;
437 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
438
439 Tisc_dsql_allocate_statement = function (status_vector : PISC_STATUS;
440 db_handle : PISC_DB_HANDLE;
441 stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
442 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
443
444 Tisc_dsql_alloc_statement2 = function (status_vector : PISC_STATUS;
445 db_handle : PISC_DB_HANDLE;
446 stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
447 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
448
449 Tisc_dsql_describe = function (status_vector : PISC_STATUS;
450 stmt_handle : PISC_STMT_HANDLE;
451 dialect : UShort;
452 xsqlda : PXSQLDA): ISC_STATUS;
453 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
454
455 Tisc_dsql_describe_bind = function (status_vector : PISC_STATUS;
456 stmt_handle : PISC_STMT_HANDLE;
457 dialect : UShort;
458 xsqlda : PXSQLDA): ISC_STATUS;
459 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
460
461 Tisc_dsql_exec_immed2 = function (status_vector : PISC_STATUS;
462 db_handle : PISC_DB_HANDLE;
463 tran_handle : PISC_TR_HANDLE;
464 length : UShort;
465 statement : PChar;
466 dialect : UShort;
467 in_xsqlda,
468 out_xsqlda : PXSQLDA): ISC_STATUS;
469 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
470
471 Tisc_dsql_execute = function (status_vector : PISC_STATUS;
472 tran_handle : PISC_TR_HANDLE;
473 stmt_handle : PISC_STMT_HANDLE;
474 dialect : UShort;
475 xsqlda : PXSQLDA): ISC_STATUS;
476 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
477
478 Tisc_dsql_execute2 = function (status_vector : PISC_STATUS;
479 tran_handle : PISC_TR_HANDLE;
480 stmt_handle : PISC_STMT_HANDLE;
481 dialect : UShort;
482 in_xsqlda,
483 out_xsqlda : PXSQLDA): ISC_STATUS;
484 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
485
486 Tisc_dsql_execute_immediate = function (status_vector : PISC_STATUS;
487 db_handle : PISC_DB_HANDLE;
488 tran_handle : PISC_TR_HANDLE;
489 length : UShort;
490 statement : PChar;
491 dialect : UShort;
492 xsqlda : PXSQLDA): ISC_STATUS;
493 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
494
495 Tisc_dsql_fetch = function (status_vector : PISC_STATUS;
496 stmt_handle : PISC_STMT_HANDLE;
497 dialect : UShort;
498 xsqlda : PXSQLDA): ISC_STATUS;
499 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
500
501 (*$ifdef SCROLLABLE_CURSORS*)
502 Tisc_dsql_fetch2 = function (status_vector : PISC_STATUS;
503 stmt_handle : PISC_STMT_HANDLE;
504 dialect : UShort;
505 xsqlda : PXSQLDA;
506 isc_arg5 : UShort;
507 isc_arg6 : Long): ISC_STATUS;
508 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
509 (*$endif*)
510
511 Tisc_dsql_finish = function (db_handle : PISC_DB_HANDLE): ISC_STATUS;
512 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
513
514 Tisc_dsql_free_statement = function (status_vector : PISC_STATUS;
515 stmt_handle : PISC_STMT_HANDLE;
516 options : UShort): ISC_STATUS;
517 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
518
519 Tisc_dsql_insert = function (status_vector : PISC_STATUS;
520 stmt_handle : PISC_STMT_HANDLE;
521 arg3 : UShort;
522 xsqlda : PXSQLDA): ISC_STATUS;
523 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
524
525 Tisc_dsql_prepare = function (status_vector : PISC_STATUS;
526 tran_handle : PISC_TR_HANDLE;
527 stmt_handle : PISC_STMT_HANDLE;
528 length : UShort;
529 statement : PChar;
530 dialect : UShort;
531 xsqlda : PXSQLDA): ISC_STATUS;
532 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
533
534 Tisc_dsql_set_cursor_name = function (status_vector : PISC_STATUS;
535 stmt_handle : PISC_STMT_HANDLE;
536 cursor_name : PChar;
537 _type : UShort): ISC_STATUS;
538 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
539
540 Tisc_dsql_sql_info = function (status_vector : PISC_STATUS;
541 stmt_handle : PISC_STMT_HANDLE;
542 item_length : Short;
543 items : PChar;
544 buffer_length : Short;
545 buffer : PChar): ISC_STATUS;
546 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
547
548 Tisc_encode_date = procedure (tm_date : PCTimeStructure;
549 ib_date : PISC_QUAD);
550 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
551
552 Tisc_encode_sql_date = procedure (tm_date : PCTimeStructure;
553 ib_date : PISC_DATE);
554 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
555
556 Tisc_encode_sql_time = procedure (tm_date : PCTimeStructure;
557 ib_time : PISC_TIME);
558 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
559
560 Tisc_encode_timestamp = procedure (tm_date : PCTimeStructure;
561 ib_timestamp : PISC_TIMESTAMP);
562 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
563
564 Tisc_event_block = function (event_buffer : PPChar;
565 result_buffer : PPChar;
566 id_count : UShort):ISC_LONG;
567 varargs; cdecl;
568
569 Tisc_event_counts = procedure (status_vector : PISC_LONG;
570 buffer_length : Short;
571 event_buffer : PChar;
572 result_buffer : PChar);
573 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
574
575 Tisc_expand_dpb = procedure (dpb : PPChar;
576 dpb_length : PShort;
577 item_list : array of Pointer);
578 cdecl;
579
580 Tisc_modify_dpb = function (dpb : PPChar;
581 isc_arg2,
582 isc_arg3 : PShort;
583 isc_arg4 : UShort;
584 isc_arg5 : PChar;
585 isc_arg6 : Short): Int;
586 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
587
588 Tisc_free = function (isc_arg1 : PChar): ISC_LONG;
589 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
590
591 Tisc_get_segment = function (status_vector : PISC_STATUS;
592 blob_handle : PISC_BLOB_HANDLE;
593 actual_seg_length : PUShort;
594 seg_buffer_length : UShort;
595 seg_buffer : PChar): ISC_STATUS;
596 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
597
598 Tisc_get_slice = function (status_vector : PISC_STATUS;
599 db_handle : PISC_DB_HANDLE;
600 tran_handle : PISC_TR_HANDLE;
601 isc_arg4 : PISC_QUAD;
602 isc_arg5 : Short;
603 isc_arg6 : PChar;
604 isc_arg7 : Short;
605 isc_arg8 : PISC_LONG;
606 isc_arg9 : ISC_LONG;
607 isc_arg10 : PVoid;
608 isc_arg11 : PISC_LONG): ISC_STATUS;
609 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
610
611 Tisc_interprete = function (buffer : PChar;
612 status_vector : PPISC_STATUS): ISC_STATUS;
613 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
614
615 Tisc_open_blob = function (status_vector : PISC_STATUS;
616 db_handle : PISC_DB_HANDLE;
617 tran_handle : PISC_TR_HANDLE;
618 blob_handle : PISC_BLOB_HANDLE;
619 blob_id : PISC_QUAD): ISC_STATUS;
620 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
621
622 Tisc_open_blob2 = function (status_vector : PISC_STATUS;
623 db_handle : PISC_DB_HANDLE;
624 tran_handle : PISC_TR_HANDLE;
625 blob_handle : PISC_BLOB_HANDLE;
626 blob_id : PISC_QUAD;
627 bpb_length : Short;
628 bpb_buffer : PChar): ISC_STATUS;
629 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
630
631 Tisc_prepare_transaction2 = function (status_vector : PISC_STATUS;
632 tran_handle : PISC_TR_HANDLE;
633 msg_length : Short;
634 msg : PChar): ISC_STATUS;
635 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
636
637 Tisc_print_sqlerror = procedure (sqlcode : Short;
638 status_vector : PISC_STATUS);
639 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
640
641 Tisc_print_status = function (status_vector : PISC_STATUS): ISC_STATUS;
642 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
643
644 Tisc_put_segment = function (status_vector : PISC_STATUS;
645 blob_handle : PISC_BLOB_HANDLE;
646 seg_buffer_len : UShort;
647 seg_buffer : PChar): ISC_STATUS;
648 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
649
650 Tisc_put_slice = function (status_vector : PISC_STATUS;
651 db_handle : PISC_DB_HANDLE;
652 tran_handle : PISC_TR_HANDLE;
653 isc_arg4 : PISC_QUAD;
654 isc_arg5 : Short;
655 isc_arg6 : PChar;
656 isc_arg7 : Short;
657 isc_arg8 : PISC_LONG;
658 isc_arg9 : ISC_LONG;
659 isc_arg10 : PVoid): ISC_STATUS;
660 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
661
662 Tisc_que_events = function (status_vector : PISC_STATUS;
663 db_handle : PISC_DB_HANDLE;
664 event_id : PISC_LONG;
665 length : Short;
666 event_buffer : PChar;
667 event_function : TISC_CALLBACK;
668 event_function_arg : PVoid): ISC_STATUS;
669 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
670
671 Tisc_rollback_retaining = function (status_vector : PISC_STATUS;
672 tran_handle : PISC_TR_HANDLE): ISC_STATUS;
673 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
674
675 Tisc_rollback_transaction = function (status_vector : PISC_STATUS;
676 tran_handle : PISC_TR_HANDLE): ISC_STATUS;
677 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
678
679 Tisc_start_multiple = function (status_vector : PISC_STATUS;
680 tran_handle : PISC_TR_HANDLE;
681 db_handle_count : Short;
682 teb_vector_address : PISC_TEB): ISC_STATUS;
683 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
684
685 Tisc_start_transaction = function (status_vector : PISC_STATUS;
686 tran_handle : PISC_TR_HANDLE;
687 db_handle_count : Short;
688 db_handle : PISC_DB_HANDLE;
689 tpb_length : UShort;
690 tpb_address : PChar): ISC_STATUS;
691 cdecl;
692
693 Tisc_sqlcode = function (status_vector : PISC_STATUS): ISC_LONG;
694 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
695
696
697 Tisc_sql_interprete = procedure (sqlcode : Short;
698 buffer : PChar;
699 buffer_length : Short);
700 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
701
702 Tisc_transaction_info = function (status_vector : PISC_STATUS;
703 tran_handle : PISC_TR_HANDLE;
704 item_list_buffer_length : Short;
705 item_list_buffer : PChar;
706 result_buffer_length : Short;
707 result_buffer : PChar): ISC_STATUS;
708 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
709
710 Tisc_transact_request = function (status_vector : PISC_STATUS;
711 db_handle : PISC_DB_HANDLE;
712 tran_handle : PISC_TR_HANDLE;
713 isc_arg4 : UShort;
714 isc_arg5 : PChar;
715 isc_arg6 : UShort;
716 isc_arg7 : PChar;
717 isc_arg8 : UShort;
718 isc_arg9 : PChar): ISC_STATUS;
719 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
720
721 Tisc_vax_integer = function (buffer : PChar;
722 length : Short): ISC_LONG;
723 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
724
725 Tisc_portable_integer = function (buffer : PChar;
726 length : Short): ISC_INT64;
727 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
728
729 (***************************************)
730 (** Security Functions and structures **)
731 (***************************************)
732
733 const
734 sec_uid_spec = $01;
735 sec_gid_spec = $02;
736 sec_server_spec = $04;
737 sec_password_spec = $08;
738 sec_group_name_spec = $10;
739 sec_first_name_spec = $20;
740 sec_middle_name_spec = $40;
741 sec_last_name_spec = $80;
742 sec_dba_user_name_spec = $100;
743 sec_dba_password_spec = $200;
744
745 sec_protocol_tcpip = 1;
746 sec_protocol_netbeui = 2;
747 sec_protocol_spx = 3;
748 sec_protocol_local = 4;
749
750 type
751 TUserSecData = record
752 sec_flags: Short; (** which fields are specified **)
753 uid: Int; (** the user's id **)
754 gid: int; (** the user's group id **)
755 protocol: Int; (** protocol to use for connection **)
756 server: PChar; (** server to administer **)
757 user_name: PChar; (** the user's name **)
758 password: PChar; (** the user's password **)
759 group_name: PChar; (** the group name **)
760 first_name: PChar; (** the user's first name **)
761 middle_name: PChar; (** the user's middle name **)
762 last_name: PChar; (** the user's last name **)
763 dba_user_name: PChar; (** the dba user name **)
764 dba_password: PChar; (** the dba password **)
765 end;
766 PUserSecData = ^TUserSecData;
767
768 Tisc_add_user = function (status_vector : PISC_STATUS;
769 user_sec_data : PUserSecData): ISC_STATUS;
770 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
771
772 Tisc_delete_user = function (status_vector : PISC_STATUS;
773 user_sec_data : PUserSecData): ISC_STATUS;
774 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
775
776 Tisc_modify_user = function (status_vector : PISC_STATUS;
777 user_sec_data : PUserSecData): ISC_STATUS;
778 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
779
780 (************************************)
781 (** Other OSRI functions **)
782 (************************************)
783
784 Tisc_compile_request = function (status_vector : PISC_STATUS;
785 db_handle : PISC_DB_HANDLE;
786 request_handle : PISC_REQ_HANDLE;
787 isc_arg4 : Short;
788 isc_arg5 : PChar): ISC_STATUS;
789 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
790
791 Tisc_compile_request2 = function (status_vector : PISC_STATUS;
792 db_handle : PISC_DB_HANDLE;
793 request_handle : PISC_REQ_HANDLE;
794 isc_arg4 : Short;
795 isc_arg5 : PChar): ISC_STATUS;
796 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
797
798 Tisc_ddl = function (status_vector : PISC_STATUS;
799 db_handle : PISC_DB_HANDLE;
800 tran_handle : PISC_TR_HANDLE;
801 isc_arg4 : Short;
802 isc_arg5 : PChar): ISC_STATUS;
803 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
804
805 Tisc_prepare_transaction = function (status_vector : PISC_STATUS;
806 tran_handle : PISC_TR_HANDLE): ISC_STATUS;
807 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
808
809
810 Tisc_receive = function (status_vector : PISC_STATUS;
811 request_handle : PISC_REQ_HANDLE;
812 isc_arg3,
813 isc_arg4 : Short;
814 isc_arg5 : PVoid;
815 isc_arg6 : Short): ISC_STATUS;
816 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
817
818 Tisc_receive2 = function (status_vector : PISC_STATUS;
819 request_handle : PISC_REQ_HANDLE;
820 isc_arg3,
821 isc_arg4 : Short;
822 isc_arg5 : PVoid;
823 isc_arg6,
824 isc_arg7 : Short;
825 isc_arg8 : Long): ISC_STATUS;
826 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
827
828 Tisc_reconnect_transaction = function (status_vector : PISC_STATUS;
829 db_handle : PISC_DB_HANDLE;
830 tran_handle : PISC_TR_HANDLE;
831 isc_arg4 : Short;
832 isc_arg5 : PChar): ISC_STATUS;
833 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
834
835 Tisc_release_request = function (status_vector : PISC_STATUS;
836 request_handle : PISC_REQ_HANDLE): ISC_STATUS;
837 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
838
839 Tisc_request_info = function (status_vector : PISC_STATUS;
840 request_handle : PISC_REQ_HANDLE;
841 isc_arg3 : Short;
842 isc_arg4 : Short;
843 isc_arg5 : PChar;
844 isc_arg6 : Short;
845 isc_arg7 : PChar): ISC_STATUS;
846 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
847
848 Tisc_seek_blob = function (status_vector : PISC_STATUS;
849 blob_handle : PISC_BLOB_HANDLE;
850 isc_arg3 : Short;
851 isc_arg4 : ISC_LONG;
852 isc_arg5 : PISC_LONG): ISC_STATUS;
853 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
854
855 Tisc_send = function (status_vector : PISC_STATUS;
856 request_handle : PISC_REQ_HANDLE;
857 isc_arg3,
858 isc_arg4 : Short;
859 isc_arg5 : PVoid;
860 isc_arg6 : Short): ISC_STATUS;
861 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
862
863 Tisc_start_and_send = function (status_vector : PISC_STATUS;
864 request_handle : PISC_REQ_HANDLE;
865 tran_handle : PISC_TR_HANDLE;
866 isc_arg4,
867 isc_arg5 : Short;
868 isc_arg6 : PVoid;
869 isc_arg7 : Short): ISC_STATUS;
870 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
871
872 Tisc_start_request = function (status_vector : PISC_STATUS;
873 request_handle : PISC_REQ_HANDLE;
874 tran_handle : PISC_TR_HANDLE;
875 isc_arg4 : Short): ISC_STATUS;
876 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
877
878 Tisc_unwind_request = function (status_vector : PISC_STATUS;
879 tran_handle : PISC_TR_HANDLE;
880 isc_arg3 : Short): ISC_STATUS;
881 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
882
883 Tisc_wait_for_event = function (status_vector : PISC_STATUS;
884 db_handle : PISC_DB_HANDLE;
885 length : Short;
886 event_buffer,
887 result_buffer : PChar): ISC_STATUS;
888 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
889
890 (*******************************)
891 (** Other Sql functions **)
892 (*******************************)
893 {$IFDEF IB5_ONLY}
894 Tisc_close = function (status_vector : PISC_STATUS;
895 isc_arg2 : PChar): ISC_STATUS;
896 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
897
898 Tisc_declare = function (status_vector : PISC_STATUS;
899 isc_arg2,
900 isc_arg3 : PChar): ISC_STATUS;
901 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
902
903 Tisc_describe = function (status_vector : PISC_STATUS;
904 isc_arg2 : PChar;
905 isc_arg3 : PSQLDA): ISC_STATUS;
906 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
907
908 Tisc_describe_bind = function (status_vector : PISC_STATUS;
909 isc_arg2 : PChar;
910 isc_arg3 : PSQLDA): ISC_STATUS;
911 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
912
913 Tisc_execute = function (status_vector : PISC_STATUS;
914 tran_handle : PISC_TR_HANDLE;
915 isc_arg3 : PChar;
916 isc_arg4 : PSQLDA): ISC_STATUS;
917 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
918
919 Tisc_execute_immediate = function (status_vector : PISC_STATUS;
920 db_handle : PISC_DB_HANDLE;
921 tran_handle : PISC_TR_HANDLE;
922 isc_arg4 : PShort;
923 isc_arg5 : PChar): ISC_STATUS;
924 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
925
926 Tisc_fetch = function (status_vector : PISC_STATUS;
927 isc_arg2 : PChar;
928 isc_arg3 : PSQLDA): ISC_STATUS;
929 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
930
931 Tisc_open = function (status_vector : PISC_STATUS;
932 tran_handle : PISC_TR_HANDLE;
933 isc_arg3 : PChar;
934 isc_arg4 : PSQLDA): ISC_STATUS;
935 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
936
937 Tisc_prepare = function (status_vector : PISC_STATUS;
938 db_handle : PISC_DB_HANDLE;
939 tran_handle : PISC_TR_HANDLE;
940 isc_arg4 : PChar;
941 isc_arg5 : PShort;
942 isc_arg6 : PChar;
943 isc_arg7 : PSQLDA): ISC_STATUS;
944 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
945 {$ELSE}
946 Tisc_close = function (status_vector : PISC_STATUS;
947 isc_arg2 : PChar): ISC_STATUS;
948 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
949
950 Tisc_declare = function (status_vector : PISC_STATUS;
951 isc_arg2,
952 isc_arg3 : PChar): ISC_STATUS;
953 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
954
955 Tisc_describe = function (status_vector : PISC_STATUS;
956 isc_arg2 : PChar;
957 isc_arg3 : PXSQLDA): ISC_STATUS;
958 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
959
960 Tisc_describe_bind = function (status_vector : PISC_STATUS;
961 isc_arg2 : PChar;
962 isc_arg3 : PXSQLDA): ISC_STATUS;
963 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
964
965 Tisc_execute = function (status_vector : PISC_STATUS;
966 tran_handle : PISC_TR_HANDLE;
967 isc_arg3 : PChar;
968 isc_arg4 : PXSQLDA): ISC_STATUS;
969 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
970
971 Tisc_execute_immediate = function (status_vector : PISC_STATUS;
972 db_handle : PISC_DB_HANDLE;
973 tran_handle : PISC_TR_HANDLE;
974 isc_arg4 : PShort;
975 isc_arg5 : PChar): ISC_STATUS;
976 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
977
978 Tisc_fetch = function (status_vector : PISC_STATUS;
979 isc_arg2 : PChar;
980 isc_arg3 : PXSQLDA): ISC_STATUS;
981 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
982
983 Tisc_open = function (status_vector : PISC_STATUS;
984 tran_handle : PISC_TR_HANDLE;
985 isc_arg3 : PChar;
986 isc_arg4 : PXSQLDA): ISC_STATUS;
987 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
988
989 Tisc_prepare = function (status_vector : PISC_STATUS;
990 db_handle : PISC_DB_HANDLE;
991 tran_handle : PISC_TR_HANDLE;
992 isc_arg4 : PChar;
993 isc_arg5 : PShort;
994 isc_arg6 : PChar;
995 isc_arg7 : PXSQLDA): ISC_STATUS;
996 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
997 {$ENDIF}
998
999 (***************************************)
1000 (** Other Dynamic sql functions **)
1001 (***************************************)
1002
1003 Tisc_dsql_execute_m = function (status_vector : PISC_STATUS;
1004 tran_handle : PISC_TR_HANDLE;
1005 statement_handle : PISC_STMT_HANDLE;
1006 isc_arg4 : UShort;
1007 isc_arg5 : PChar;
1008 isc_arg6 : UShort;
1009 isc_arg7 : UShort;
1010 isc_arg8 : PChar): ISC_STATUS;
1011 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1012
1013 Tisc_dsql_execute2_m = function (status_vector : PISC_STATUS;
1014 tran_handle : PISC_TR_HANDLE;
1015 statement_handle : PISC_STMT_HANDLE;
1016 isc_arg4 : UShort;
1017 isc_arg5 : PChar;
1018 isc_arg6 : UShort;
1019 isc_arg7 : UShort;
1020 isc_arg8 : PChar;
1021 isc_arg9 : UShort;
1022 isc_arg10 : PChar;
1023 isc_arg11 : UShort;
1024 isc_arg12 : UShort;
1025 isc_arg13 : PChar): ISC_STATUS;
1026 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1027
1028 Tisc_dsql_execute_immediate_m = function (status_vector : PISC_STATUS;
1029 db_handle : PISC_DB_HANDLE;
1030 tran_handle : PISC_TR_HANDLE;
1031 isc_arg4 : UShort;
1032 isc_arg5 : PChar;
1033 isc_arg6 : UShort;
1034 isc_arg7 : UShort;
1035 isc_arg8 : PChar;
1036 isc_arg9 : UShort;
1037 isc_arg10 : UShort;
1038 isc_arg11 : PChar): ISC_STATUS;
1039 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1040
1041 Tisc_dsql_exec_immed3_m = function (status_vector : PISC_STATUS;
1042 db_handle : PISC_DB_HANDLE;
1043 tran_handle : PISC_TR_HANDLE;
1044 isc_arg4 : UShort;
1045 isc_arg5 : PChar;
1046 isc_arg6 : UShort;
1047 isc_arg7 : UShort;
1048 isc_arg8 : PChar;
1049 isc_arg9 : UShort;
1050 isc_arg10 : UShort;
1051 isc_arg11 : PChar;
1052 isc_arg12 : UShort;
1053 isc_arg13 : PChar;
1054 isc_arg14 : UShort;
1055 isc_arg15 : UShort;
1056 isc_arg16 : PChar): ISC_STATUS;
1057 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1058
1059 Tisc_dsql_fetch_m = function (status_vector : PISC_STATUS;
1060 statement_handle : PISC_STMT_HANDLE;
1061 isc_arg3 : UShort;
1062 isc_arg4 : PChar;
1063 isc_arg5 : UShort;
1064 isc_arg6 : UShort;
1065 isc_arg7 : PChar): ISC_STATUS;
1066 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1067
1068 (*$ifdef SCROLLABLE_CURSORS*)
1069 Tisc_dsql_fetch2_m = function (status_vector : PISC_STATUS;
1070 statement_handle : PISC_STMT_HANDLE;
1071 isc_arg3 : UShort;
1072 isc_arg4 : PChar;
1073 isc_arg5 : UShort;
1074 isc_arg6 : UShort;
1075 isc_arg7 : PChar;
1076 isc_arg8 : UShort;
1077 isc_arg9 : Long): ISC_STATUS;
1078 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1079 (*$endif*)
1080
1081 Tisc_dsql_insert_m = function (status_vector : PISC_STATUS;
1082 statement_handle : PISC_STMT_HANDLE;
1083 isc_arg3 : UShort;
1084 isc_arg4 : PChar;
1085 isc_arg5 : UShort;
1086 isc_arg6 : UShort;
1087 isc_arg7 : PChar): ISC_STATUS;
1088 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1089
1090 Tisc_dsql_prepare_m = function (status_vector : PISC_STATUS;
1091 tran_handle : PISC_TR_HANDLE;
1092 statement_handle : PISC_STMT_HANDLE;
1093 isc_arg4 : UShort;
1094 isc_arg5 : PChar;
1095 isc_arg6 : UShort;
1096 isc_arg7 : UShort;
1097 isc_arg8 : PChar;
1098 isc_arg9 : UShort;
1099 isc_arg10 : PChar): ISC_STATUS;
1100 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1101
1102 Tisc_dsql_release = function (status_vector : PISC_STATUS;
1103 isc_arg2 : PChar): ISC_STATUS;
1104 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1105
1106 Tisc_embed_dsql_close = function(status_vector : PISC_STATUS;
1107 isc_arg2 : PChar): ISC_STATUS;
1108 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1109
1110 Tisc_embed_dsql_declare = function (status_vector : PISC_STATUS;
1111 isc_arg2 : PChar;
1112 isc_arg3 : PChar): ISC_STATUS;
1113 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1114
1115 Tisc_embed_dsql_describe = function (status_vector : PISC_STATUS;
1116 isc_arg2 : PChar;
1117 isc_arg3 : UShort;
1118 isc_arg4 : PXSQLDA): ISC_STATUS;
1119 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1120
1121 Tisc_embed_dsql_describe_bind = function (status_vector : PISC_STATUS;
1122 isc_arg2 : PChar;
1123 isc_arg3 : UShort;
1124 isc_arg4 : PXSQLDA): ISC_STATUS;
1125 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1126
1127 Tisc_embed_dsql_execute = function (status_vector : PISC_STATUS;
1128 tran_handle : PISC_TR_HANDLE;
1129 isc_arg3 : PChar;
1130 isc_arg4 : UShort;
1131 isc_arg5 : PXSQLDA): ISC_STATUS;
1132 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1133
1134 Tisc_embed_dsql_execute2 = function (status_vector : PISC_STATUS;
1135 tran_handle : PISC_TR_HANDLE;
1136 isc_arg3 : PChar;
1137 isc_arg4 : UShort;
1138 isc_arg5 : PXSQLDA;
1139 isc_arg6 : PXSQLDA): ISC_STATUS;
1140 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1141
1142 Tisc_embed_dsql_execute_immed = function (status_vector : PISC_STATUS;
1143 db_handle : PISC_DB_HANDLE;
1144 tran_handle : PISC_TR_HANDLE;
1145 isc_arg4 : UShort;
1146 isc_arg5 : PChar;
1147 isc_arg6 : UShort;
1148 isc_arg7 : PXSQLDA): ISC_STATUS;
1149 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1150
1151 Tisc_embed_dsql_fetch = function(status_vector : PISC_STATUS;
1152 isc_arg2 : PChar;
1153 isc_arg3 : UShort;
1154 isc_arg4 : PXSQLDA): ISC_STATUS;
1155 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1156
1157 (*$ifdef SCROLLABLE_CURSORS*)
1158 Tisc_embed_dsql_fetch2 = function (status_vector : PISC_STATUS;
1159 isc_arg2 : PChar;
1160 isc_arg3 : UShort;
1161 isc_arg4 : PXSQLDA;
1162 isc_arg5 : UShort;
1163 isc_arg6 : Long): ISC_STATUS;
1164 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1165 (*$endif*)
1166
1167 Tisc_embed_dsql_open = function (status_vector : PISC_STATUS;
1168 tran_handle : PISC_TR_HANDLE;
1169 isc_arg3 : PChar;
1170 isc_arg4 : UShort;
1171 isc_arg5 : PXSQLDA): ISC_STATUS;
1172 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1173
1174 Tisc_embed_dsql_open2 = function (status_vector : PISC_STATUS;
1175 tran_handle : PISC_TR_HANDLE;
1176 isc_arg3 : PChar;
1177 isc_arg4 : UShort;
1178 isc_arg5 : PXSQLDA;
1179 isc_arg6 : PXSQLDA): ISC_STATUS;
1180 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1181
1182 Tisc_embed_dsql_insert = function (status_vector : PISC_STATUS;
1183 isc_arg2 : PChar;
1184 isc_arg3 : UShort;
1185 isc_arg4 : PXSQLDA): ISC_STATUS;
1186 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1187
1188 Tisc_embed_dsql_prepare = function (status_vector : PISC_STATUS;
1189 db_handle : PISC_DB_HANDLE;
1190 tran_handle : PISC_TR_HANDLE;
1191 isc_arg4 : PChar;
1192 isc_arg5 : UShort;
1193 isc_arg6 : PChar;
1194 isc_arg7 : UShort;
1195 isc_arg8 : PXSQLDA): ISC_STATUS;
1196 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1197
1198 Tisc_embed_dsql_release = function (status_vector : PISC_STATUS;
1199 isc_arg2 : PChar): ISC_STATUS;
1200 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1201
1202 (********************************)
1203 (** Other Blob functions **)
1204 (********************************)
1205
1206 TBLOB_open = function (blob_handle : TISC_BLOB_HANDLE;
1207 isc_arg2 : PChar;
1208 isc_arg3 : int): PBSTREAM;
1209 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1210
1211 TBLOB_put = function (isc_arg1 : char;
1212 isc_arg2 : PBSTREAM): Int;
1213 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1214
1215 TBLOB_close = function (isc_arg1 : PBSTREAM): Int;
1216 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1217
1218 TBLOB_get = function (isc_arg1 : PBSTREAM): Int;
1219 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1220
1221 TBLOB_display = function (isc_arg1 : PISC_QUAD;
1222 db_handle : TISC_DB_HANDLE;
1223 tran_handle : TISC_TR_HANDLE;
1224 isc_arg4 : PChar): Int;
1225 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1226
1227 TBLOB_dump = function (isc_arg1 : PISC_QUAD;
1228 db_handle : TISC_DB_HANDLE;
1229 tran_handle : TISC_TR_HANDLE;
1230 isc_arg4 : PChar): Int;
1231 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1232
1233 TBLOB_edit = function (isc_arg1 : PISC_QUAD;
1234 db_handle : TISC_DB_HANDLE;
1235 tran_handle : TISC_TR_HANDLE;
1236 isc_arg4 : PChar): Int;
1237 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1238
1239 TBLOB_load = function (isc_arg1 : PISC_QUAD;
1240 db_handle : TISC_DB_HANDLE;
1241 tran_handle : TISC_TR_HANDLE;
1242 isc_arg4 : PChar): Int;
1243 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1244
1245 TBLOB_text_dump = function (isc_arg1 : PISC_QUAD;
1246 db_handle : TISC_DB_HANDLE;
1247 tran_handle : TISC_TR_HANDLE;
1248 isc_arg4 : PChar): Int;
1249 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1250
1251 TBLOB_text_load = function (isc_arg1 : PISC_QUAD;
1252 db_handle : TISC_DB_HANDLE;
1253 tran_handle : TISC_TR_HANDLE;
1254 isc_arg4 : PChar): Int;
1255 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1256
1257 TBopen = function (isc_arg1 : PISC_QUAD;
1258 db_handle : TISC_DB_HANDLE;
1259 tran_handle : TISC_TR_HANDLE;
1260 isc_arg4 : PChar): Int;
1261 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1262
1263 TBopen2 = function (isc_arg1 : PISC_QUAD;
1264 db_handle : TISC_DB_HANDLE;
1265 tran_handle : TISC_TR_HANDLE;
1266 isc_arg4 : PChar;
1267 isc_arg5 : UShort): PBSTREAM;
1268 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1269
1270 (********************************)
1271 (** Other Misc functions **)
1272 (********************************)
1273
1274 Tisc_ftof = function (isc_arg1 : PChar;
1275 isc_arg2 : UShort;
1276 isc_arg3 : PChar;
1277 isc_arg4 : UShort): ISC_LONG;
1278 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1279
1280 Tisc_print_blr = function (isc_arg1 : PChar;
1281 isc_arg2 : TISC_CALLBACK;
1282 isc_arg3 : PVoid;
1283 isc_arg4 : Short): ISC_STATUS;
1284 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1285
1286 Tisc_set_debug = procedure (isc_arg1 : Int);
1287 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1288
1289 Tisc_qtoq = procedure (isc_arg1 : PISC_QUAD;
1290 isc_arg2 : PISC_QUAD);
1291 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1292
1293 Tisc_vtof = procedure (isc_arg1 : PChar;
1294 isc_arg2 : PChar;
1295 isc_arg3 : UShort);
1296 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1297
1298 Tisc_vtov = procedure (isc_arg1 : PChar;
1299 isc_arg2 : PChar;
1300 isc_arg3 : Short);
1301 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1302
1303 Tisc_version = function (db_handle : PISC_DB_HANDLE;
1304 isc_arg2 : TISC_CALLBACK;
1305 isc_arg3 : PVoid): Int;
1306 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1307
1308 Tisc_reset_fpe = function (isc_arg1 : UShort): ISC_LONG;
1309 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1310
1311 (*******************************************)
1312 (** Service manager functions **)
1313 (*******************************************)
1314
1315 Tisc_service_attach = function (status_vector : PISC_STATUS;
1316 isc_arg2 : UShort;
1317 isc_arg3 : PChar;
1318 service_handle : PISC_SVC_HANDLE;
1319 isc_arg5 : UShort;
1320 isc_arg6 : PChar): ISC_STATUS;
1321 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1322
1323 Tisc_service_detach = function (status_vector : PISC_STATUS;
1324 service_handle : PISC_SVC_HANDLE): ISC_STATUS;
1325 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1326
1327 Tisc_service_query = function (status_vector : PISC_STATUS;
1328 service_handle : PISC_SVC_HANDLE;
1329 recv_handle : PISC_SVC_HANDLE;
1330 isc_arg4 : UShort;
1331 isc_arg5 : PChar;
1332 isc_arg6 : UShort;
1333 isc_arg7 : PChar;
1334 isc_arg8 : UShort;
1335 isc_arg9 : PChar): ISC_STATUS;
1336 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1337
1338 Tisc_service_start = function (status_vector : PISC_STATUS;
1339 service_handle : PISC_SVC_HANDLE;
1340 recv_handle : PISC_SVC_HANDLE;
1341 isc_arg4 : UShort;
1342 isc_arg5 : PChar): ISC_STATUS;
1343 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1344
1345 (*********************************)
1346 (** Forms functions **)
1347 (*********************************)
1348
1349 Tisc_compile_map = function (status_vector : PISC_STATUS;
1350 form_handle : PISC_FORM_HANDLE;
1351 request_handle : PISC_REQ_HANDLE;
1352 isc_arg4 : PShort;
1353 isc_arg5 : PChar): ISC_STATUS;
1354 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1355
1356 Tisc_compile_menu = function (status_vector : PISC_STATUS;
1357 form_handle : PISC_FORM_HANDLE;
1358 request_handle : PISC_REQ_HANDLE;
1359 isc_arg4 : PShort;
1360 isc_arg5 : PChar): ISC_STATUS;
1361 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1362
1363 Tisc_compile_sub_map = function (status_vector : PISC_STATUS;
1364 win_handle : PISC_WIN_HANDLE;
1365 request_handle : PISC_REQ_HANDLE;
1366 isc_arg4 : PShort;
1367 isc_arg5 : PChar): ISC_STATUS;
1368 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1369
1370 Tisc_create_window = function (status_vector : PISC_STATUS;
1371 win_handle : PISC_WIN_HANDLE;
1372 isc_arg3 : PShort;
1373 isc_arg4 : PChar;
1374 isc_arg5 : PShort;
1375 isc_arg6 : PShort): ISC_STATUS;
1376 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1377
1378 Tisc_delete_window = function (status_vector : PISC_STATUS;
1379 win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1380 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1381
1382 Tisc_drive_form = function (status_vector : PISC_STATUS;
1383 db_handle : PISC_DB_HANDLE;
1384 tran_handle : PISC_TR_HANDLE;
1385 win_handle : PISC_WIN_HANDLE;
1386 request_handle : PISC_REQ_HANDLE;
1387 isc_arg6 : PUChar;
1388 isc_arg7 : PUChar): ISC_STATUS;
1389 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1390
1391 Tisc_drive_menu = function (status_vector : PISC_STATUS;
1392 win_handle : PISC_WIN_HANDLE;
1393 request_handle : PISC_REQ_HANDLE;
1394 isc_arg4 : PShort;
1395 isc_arg5 : PChar;
1396 isc_arg6 : PShort;
1397 isc_arg7 : PChar;
1398 isc_arg8 : PShort;
1399 isc_arg9 : PShort;
1400 isc_arg10 : PChar;
1401 isc_arg11 : PISC_LONG): ISC_STATUS;
1402 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1403
1404 Tisc_form_delete = function (status_vector : PISC_STATUS;
1405 form_handle : PISC_FORM_HANDLE): ISC_STATUS;
1406 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1407
1408 Tisc_form_fetch = function (status_vector : PISC_STATUS;
1409 db_handle : PISC_DB_HANDLE;
1410 tran_handle : PISC_TR_HANDLE;
1411 request_handle : PISC_REQ_HANDLE;
1412 isc_arg5 : PUChar): ISC_STATUS;
1413 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1414
1415 Tisc_form_insert = function (status_vector : PISC_STATUS;
1416 db_handle : PISC_DB_HANDLE;
1417 tran_handle : PISC_TR_HANDLE;
1418 request_handle : PISC_REQ_HANDLE;
1419 isc_arg5 : PUChar): ISC_STATUS;
1420 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1421
1422 Tisc_get_entree = function (status_vector : PISC_STATUS;
1423 request_handle : PISC_REQ_HANDLE;
1424 isc_arg3 : PShort;
1425 isc_arg4 : PChar;
1426 isc_arg5 : PISC_LONG;
1427 isc_arg6 : PShort): ISC_STATUS;
1428 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1429
1430 Tisc_initialize_menu = function (status_vector : PISC_STATUS;
1431 request_handle : PISC_REQ_HANDLE): ISC_STATUS;
1432 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1433
1434 Tisc_menu = function (status_vector : PISC_STATUS;
1435 win_handle : PISC_WIN_HANDLE;
1436 request_handle : PISC_REQ_HANDLE;
1437 isc_arg4 : PShort;
1438 isc_arg5 : PChar): ISC_STATUS;
1439 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1440
1441 Tisc_load_form = function (status_vector : PISC_STATUS;
1442 db_handle : PISC_DB_HANDLE;
1443 tran_handle : PISC_TR_HANDLE;
1444 form_handle : PISC_FORM_HANDLE;
1445 isc_arg5 : PShort;
1446 isc_arg6 : PChar): ISC_STATUS;
1447 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1448
1449 Tisc_pop_window = function (status_vector : PISC_STATUS;
1450 win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1451 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1452
1453 Tisc_put_entree = function (status_vector : PISC_STATUS;
1454 request_handle : PISC_REQ_HANDLE;
1455 isc_arg3 : PShort;
1456 isc_arg4 : PChar;
1457 isc_arg5 : PISC_LONG): ISC_STATUS;
1458 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1459
1460 Tisc_reset_form = function (status_vector : PISC_STATUS;
1461 request_handle : PISC_REQ_HANDLE): ISC_STATUS;
1462 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1463
1464 Tisc_suspend_window = function (status_vector : PISC_STATUS;
1465 win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1466 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1467
1468 (** Constants!!! **)
1469 (*****************************************************)
1470 (** Actions to pass to the blob filter (ctl_source) **)
1471 (*****************************************************)
1472
1473 const
1474 isc_blob_filter_open = 0;
1475 isc_blob_filter_get_segment = 1;
1476 isc_blob_filter_close = 2;
1477 isc_blob_filter_create = 3;
1478 isc_blob_filter_put_segment = 4;
1479 isc_blob_filter_alloc = 5;
1480 isc_blob_filter_free = 6;
1481 isc_blob_filter_seek = 7;
1482
1483 (*********************)
1484 (** Blr definitions **)
1485 (*********************)
1486
1487 // In pascal, how does one deal with the below "#define"?
1488 // blr_word(n) ((n) % 256), ((n) / 256)
1489 blr_text = 14;
1490 blr_text2 = 15;
1491 blr_short = 7;
1492 blr_long = 8;
1493 blr_quad = 9;
1494 blr_float = 10;
1495 blr_double = 27;
1496 blr_d_float = 11;
1497 blr_timestamp = 35;
1498 blr_varying = 37;
1499 blr_varying2 = 38;
1500 blr_blob = 261;
1501 blr_cstring = 40;
1502 blr_cstring2 = 41;
1503 blr_blob_id = 45;
1504 blr_sql_date = 12;
1505 blr_sql_time = 13;
1506 blr_int64 = 16;
1507 blr_date = blr_timestamp;
1508 blr_bool = 23;
1509
1510
1511 blr_inner = 0;
1512 blr_left = 1;
1513 blr_right = 2;
1514 blr_full = 3;
1515
1516 blr_gds_code = 0;
1517 blr_sql_code = 1;
1518 blr_exception = 2;
1519 blr_trigger_code = 3;
1520 blr_default_code = 4;
1521
1522 blr_version4 = 4;
1523 blr_version5 = 5;
1524 blr_eoc = 76;
1525 blr_end = -1;
1526
1527 blr_assignment = 1;
1528 blr_begin = 2;
1529 blr_dcl_variable = 3;
1530 blr_message = 4;
1531 blr_erase = 5;
1532 blr_fetch = 6;
1533 blr_for = 7;
1534 blr_if = 8;
1535 blr_loop = 9;
1536 blr_modify = 10;
1537 blr_handler = 11;
1538 blr_receive = 12;
1539 blr_select = 13;
1540 blr_send = 14;
1541 blr_store = 15;
1542 blr_label = 17;
1543 blr_leave = 18;
1544 blr_store2 = 19;
1545 blr_post = 20;
1546
1547 blr_literal = 21;
1548 blr_dbkey = 22;
1549 blr_field = 23;
1550 blr_fid = 24;
1551 blr_parameter = 25;
1552 blr_variable = 26;
1553 blr_average = 27;
1554 blr_count = 28;
1555 blr_maximum = 29;
1556 blr_minimum = 30;
1557 blr_total = 31;
1558 blr_add = 34;
1559 blr_subtract = 35;
1560 blr_multiply = 36;
1561 blr_divide = 37;
1562 blr_negate = 38;
1563 blr_concatenate = 39;
1564 blr_substring = 40;
1565 blr_parameter2 = 41;
1566 blr_from = 42;
1567 blr_via = 43;
1568 blr_user_name = 44;
1569 blr_null = 45;
1570
1571 blr_eql = 47;
1572 blr_neq = 48;
1573 blr_gtr = 49;
1574 blr_geq = 50;
1575 blr_lss = 51;
1576 blr_leq = 52;
1577 blr_containing = 53;
1578 blr_matching = 54;
1579 blr_starting = 55;
1580 blr_between = 56;
1581 blr_or = 57;
1582 blr_and = 58;
1583 blr_not = 59;
1584 blr_any = 60;
1585 blr_missing = 61;
1586 blr_unique = 62;
1587 blr_like = 63;
1588
1589 blr_stream = 65;
1590 blr_set_index = 66;
1591 blr_rse = 67;
1592 blr_first = 68;
1593 blr_project = 69;
1594 blr_sort = 70;
1595 blr_boolean = 71;
1596 blr_ascending = 72;
1597 blr_descending = 73;
1598 blr_relation = 74;
1599 blr_rid = 75;
1600 blr_union = 76;
1601 blr_map = 77;
1602 blr_group_by = 78;
1603 blr_aggregate = 79;
1604 blr_join_type = 80;
1605
1606 blr_agg_count = 83;
1607 blr_agg_max = 84;
1608 blr_agg_min = 85;
1609 blr_agg_total = 86;
1610 blr_agg_average = 87;
1611 blr_parameter3 = 88;
1612 blr_run_count = 118;
1613 blr_run_max = 89;
1614 blr_run_min = 90;
1615 blr_run_total = 91;
1616 blr_run_average = 92;
1617 blr_agg_count2 = 93;
1618 blr_agg_count_distinct = 94;
1619 blr_agg_total_distinct = 95;
1620 blr_agg_average_distinct = 96;
1621
1622 blr_function = 100;
1623 blr_gen_id = 101;
1624 blr_prot_mask = 102;
1625 blr_upcase = 103;
1626 blr_lock_state = 104;
1627 blr_value_if = 105;
1628 blr_matching2 = 106;
1629 blr_index = 107;
1630 blr_ansi_like = 108;
1631 blr_bookmark = 109;
1632 blr_crack = 110;
1633 blr_force_crack = 111;
1634 blr_seek = 112;
1635 blr_find = 113;
1636
1637 blr_continue = 0;
1638 blr_forward = 1;
1639 blr_backward = 2;
1640 blr_bof_forward = 3;
1641 blr_eof_backward = 4;
1642
1643 blr_lock_relation = 114;
1644 blr_lock_record = 115;
1645 blr_set_bookmark = 116;
1646 blr_get_bookmark = 117;
1647 blr_rs_stream = 119;
1648 blr_exec_proc = 120;
1649 blr_begin_range = 121;
1650 blr_end_range = 122;
1651 blr_delete_range = 123;
1652 blr_procedure = 124;
1653 blr_pid = 125;
1654 blr_exec_pid = 126;
1655 blr_singular = 127;
1656 blr_abort = 128;
1657 blr_block = 129;
1658 blr_error_handler = 130;
1659 blr_cast = 131;
1660 blr_release_lock = 132;
1661 blr_release_locks = 133;
1662 blr_start_savepoint = 134;
1663 blr_end_savepoint = 135;
1664 blr_find_dbkey = 136;
1665 blr_range_relation = 137;
1666 blr_delete_ranges = 138;
1667
1668 blr_plan = 139;
1669 blr_merge = 140;
1670 blr_join = 141;
1671 blr_sequential = 142;
1672 blr_navigational = 143;
1673 blr_indices = 144;
1674 blr_retrieve = 145;
1675
1676 blr_relation2 = 146;
1677 blr_rid2 = 147;
1678 blr_reset_stream = 148;
1679 blr_release_bookmark = 149;
1680 blr_set_generator = 150;
1681 blr_ansi_any = 151;
1682 blr_exists = 152;
1683 blr_cardinality = 153;
1684
1685 blr_record_version = 154; (** get tid of record **)
1686 blr_stall = 155; (** fake server stall **)
1687 blr_seek_no_warn = 156;
1688 blr_find_dbkey_version = 157;
1689 blr_ansi_all = 158;
1690
1691 blr_extract = 159;
1692
1693 (* sub parameters for blr_extract *)
1694
1695 blr_extract_year = 0;
1696 blr_extract_month = 1;
1697 blr_extract_day = 2;
1698 blr_extract_hour = 3;
1699 blr_extract_minute = 4;
1700 blr_extract_second = 5;
1701 blr_extract_weekday = 6;
1702 blr_extract_yearday = 7;
1703
1704 blr_current_date = 160;
1705 blr_current_timestamp = 161;
1706 blr_current_time = 162;
1707
1708 (* These verbs were added in 6.0,
1709 primarily to support 64-bit integers *)
1710
1711 blr_add2 = 163;
1712 blr_subtract2 = 164;
1713 blr_multiply2 = 165;
1714 blr_divide2 = 166;
1715 blr_agg_total2 = 167;
1716 blr_agg_total_distinct2 = 168;
1717 blr_agg_average2 = 169;
1718 blr_agg_average_distinct2 = 170;
1719 blr_average2 = 171;
1720 blr_gen_id2 = 172;
1721 blr_set_generator2 = 173;
1722
1723 (****************************************)
1724 (** Bit assignments in RDB$SYSTEM_FLAG **)
1725 (****************************************)
1726
1727 RDB_system = 1;
1728 RDB_id_assigned = 2;
1729
1730
1731 (*******************************)
1732 (** Service information items **)
1733 (*******************************)
1734
1735 {$IFDEF IB5_ONLY }
1736 (* This defines are not there in version 6.0 *)
1737 { isc_info_svc_version = 4;
1738 isc_info_svc_message = 5;
1739 isc_info_svc_total_length = 6;
1740 isc_info_svc_response = 7;
1741 isc_info_svc_response_more = 8;
1742 isc_info_svc_line = 9;
1743 isc_info_svc_to_eof = 10;
1744 isc_info_svc_timeout = 11;
1745 isc_info_svc_server_version = 12;
1746 isc_info_svc_implementation = 13;
1747 isc_info_svc_capabilities = 14;
1748 isc_info_svc_user_dbpath = 15;
1749 isc_info_svc_svr_db_info = 16;
1750 isc_info_svc_svr_online = 17;
1751 isc_info_svc_svr_offline = 18;
1752 isc_info_svc_get_config = 19;
1753 isc_info_svc_set_config = 20;
1754 isc_info_svc_default_config = 21;
1755 isc_info_svc_get_env = 22;
1756 isc_info_svc_get_env_lock = 23;
1757 isc_info_svc_get_env_msg = 24; }
1758 {$ENDIF}
1759
1760
1761
1762 (*****************)
1763 (** Error codes **)
1764 (*****************)
1765
1766 isc_facility = 20;
1767 isc_err_base = 335544320;
1768 isc_err_factor = 1;
1769 isc_arg_end = 0;
1770 isc_arg_gds = 1;
1771 isc_arg_string = 2;
1772 isc_arg_cstring = 3;
1773 isc_arg_number = 4;
1774 isc_arg_interpreted = 5;
1775 isc_arg_vms = 6;
1776 isc_arg_unix = 7;
1777 isc_arg_domain = 8;
1778 isc_arg_dos = 9;
1779 isc_arg_mpexl = 10;
1780 isc_arg_mpexl_ipc = 11;
1781 isc_arg_next_mach = 15;
1782 isc_arg_netware = 16;
1783 isc_arg_win32 = 17;
1784 isc_arg_warning = 18;
1785
1786 (**********************************************)
1787 (** International text interpretation values **)
1788 (**********************************************)
1789
1790 isc_interp_eng_ascii = 0;
1791 isc_interp_jpn_sjis = 5;
1792 isc_interp_jpn_euc = 6;
1793
1794 (******************************************)
1795 (** Scroll direction for isc_dsql_fetch2 **)
1796 (******************************************)
1797
1798 isc_fetch_next = 0;
1799 isc_fetch_prior = 1;
1800 isc_fetch_first = 2;
1801 isc_fetch_last = 3;
1802 isc_fetch_absolute = 4;
1803 isc_fetch_relative = 5;
1804
1805
1806
1807 {$IFDEF IB5_ONLY}
1808 (** SQLDA_LENGTH is defined in C as a macro, but in Pascal we must defined it
1809 as a function... **)
1810 function SQLDA_LENGTH(n: Long): Long;
1811 {$ENDIF}
1812
1813 (** XSQLDA_LENGTH is defined in C as a macro, but in Pascal we must defined it
1814 as a function... **)
1815 function XSQLDA_LENGTH(n: Long): Long;
1816
1817 (** getb, putb, putbx are all defined in C as macros.
1818 Use functions and procedures for the functionality **)
1819 {function getb (p: PBSTREAM): Char;
1820 function putb (x: Char; p: PBSTREAM): Int;
1821 function putbx (x: Char; p: PBSTREAM): Int;}
1822
1823 (*
1824 #define ADD_SPB_LENGTH(p, length) {*(p)++ = (length); \
1825 *(p)++ = (length) >> 8;}
1826
1827 #define ADD_SPB_NUMERIC(p, data) {*(p)++ = (data); \
1828 *(p)++ = (data) >> 8; \
1829 *(p)++ = (data) >> 16; \
1830 *(p)++ = (data) >> 24;}
1831 *)
1832 procedure add_spb_length(var p: PChar; length: integer);
1833 procedure add_spb_numeric(var p: PChar; data: integer);
1834
1835
1836 implementation
1837
1838
1839 {$IFDEF IB5_ONLY}
1840 function SQLDA_LENGTH(n: Long): Long;
1841 (* The C-macro reads like this:
1842 SQLDA_LENGTH(n) (sizeof (SQLDA) + (n-1) * sizeof (SQLVAR)) *)
1843 begin
1844 result := sizeof(TSQLDA) + ((n - 1) * sizeof(TSQLVAR));
1845 end;
1846 {$ENDIF}
1847
1848
1849 function XSQLDA_LENGTH(n: Long): Long;
1850 (* The C-macro reads like this:
1851 XSQLDA_LENGTH(n) (sizeof (XSQLDA) + (n-1) * sizeof (XSQLVAR)) *)
1852 begin
1853 result := SizeOf(TXSQLDA) + ((n - 1) * SizeOf(TXSQLVAR));
1854 end;
1855
1856 {function getb(p: PBSTREAM): Char;
1857 (* The C-macro reads like this:
1858 getb(p) (--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p)) *)
1859 begin
1860 Dec(p^.bstr_cnt);
1861 if (p^.bstr_cnt >= 0) then begin
1862 result := Char(Int(p^.bstr_ptr^) and Int(0377));
1863 Inc(p^.bstr_ptr);
1864 end else
1865 result := Char(BLOB_get(p));
1866 end;}
1867
1868 //function putb(x: Char; p: PBSTREAM): Int;
1869 (* The C-macro reads like this:
1870 putb(x,p) ((x == '\n' || (!(--(p)->bstr_cnt))) ? // then
1871 BLOB_put (x,p) : // else
1872 ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
1873 begin
1874 Dec(p^.bstr_cnt);
1875 if (x = Chr(Int('n') - Int('a'))) or (p^.bstr_cnt = 0) then
1876 result := BLOB_put(x, p)
1877 else begin
1878 p^.bstr_ptr^ := Char(x);
1879 result := UInt(x);
1880 Inc(p^.bstr_ptr^);
1881 end;
1882 end;
1883
1884 function putbx(x: Char; p: PBSTREAM): Int;
1885 (* The C-macro reads like this:
1886 putbx(x,p) ((!(--(p)->bstr_cnt)) ? // then
1887 BLOB_put (x,p) : // else
1888 ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
1889 begin
1890 Dec(p^.bstr_cnt);
1891 if (p^.bstr_cnt = 0) then
1892 result := BLOB_put(x, p)
1893 else begin
1894 p^.bstr_ptr^ := Char(x);
1895 Inc(p^.bstr_ptr^);
1896 result := UInt(x);
1897 end;
1898 end;
1899
1900 (*******************************************)
1901 (** Service manager functions **)
1902 (*******************************************)
1903
1904
1905 procedure add_spb_length(var p: PChar; length: integer);
1906 (*
1907 #define ADD_SPB_LENGTH(p, length) {*(p)++ = (length); \
1908 *(p)++ = (length) >> 8;}
1909 *)
1910 begin
1911 p^ := char(length);
1912 Inc (p);
1913 p^ := char(length shr 8);
1914 Inc (p);
1915 end;
1916
1917 procedure add_spb_numeric(var p: PChar; data: integer);
1918 (*
1919 #define ADD_SPB_NUMERIC(p, data) {*(p)++ = (data); \
1920 *(p)++ = (data) >> 8; \
1921 *(p)++ = (data) >> 16; \
1922 *(p)++ = (data) >> 24;}
1923 *)
1924 begin
1925 p^ := char(data);
1926 Inc (p);
1927 p^ := char(data shr 8);
1928 Inc (p);
1929 p^ := char(data shr 16);
1930 Inc (p);
1931 p^ := char(data shr 24);
1932 Inc (p);
1933 end;
1934
1935 end.
1936