ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBHeader.pas
Revision: 1
Committed: Mon Jul 31 16:43:00 2000 UTC (23 years, 8 months ago) by tony
Content type: text/x-pascal
File size: 133435 byte(s)
Log Message:
Borland IBX Open Source Release

File Contents

# User Rev Content
1 tony 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     {************************************************************************}
28    
29     unit IBHeader;
30    
31     interface
32    
33     uses
34     IBExternals;
35    
36    
37     const
38     ISC_TRUE = 1;
39     ISC_FALSE = 0;
40     DSQL_close = 1;
41     DSQL_drop = 2;
42     IBASE_DLL = 'gds32.dll'; {do not localize}
43    
44     const
45     SQLDA_VERSION1 = 1; (* pre V6.0 SQLDA *)
46     SQLDA_VERSION2 = 2; (* V6.0 SQLDA *)
47     SQL_DIALECT_V5 = 1; (* meaning is same as DIALECT_xsqlda *)
48     SQL_DIALECT_V6_TRANSITION = 2; (* flagging anything that is delimited
49     by double quotes as an error and
50     flagging keyword DATE as an error *)
51     SQL_DIALECT_V6 = 3; (* supports SQL delimited identifier,
52     SQLDATE/DATE, TIME, TIMESTAMP,
53     CURRENT_DATE, CURRENT_TIME,
54     CURRENT_TIMESTAMP, and 64-bit exact
55     numeric type *)
56     SQL_DIALECT_CURRENT = SQL_DIALECT_V6; (* latest IB DIALECT *)
57    
58    
59     type
60     (**********************************)
61     (** InterBase Handle Definitions **)
62     (**********************************)
63     TISC_ATT_HANDLE = PVoid;
64     PISC_ATT_HANDLE = ^TISC_ATT_HANDLE;
65     TISC_BLOB_HANDLE = PVoid;
66     PISC_BLOB_HANDLE = ^TISC_BLOB_HANDLE;
67     TISC_DB_HANDLE = PVoid;
68     PISC_DB_HANDLE = ^TISC_DB_HANDLE;
69     TISC_FORM_HANDLE = PVoid;
70     PISC_FORM_HANDLE = ^TISC_FORM_HANDLE;
71     TISC_REQ_HANDLE = PVoid;
72     PISC_REQ_HANDLE = ^TISC_REQ_HANDLE;
73     TISC_STMT_HANDLE = PVoid;
74     PISC_STMT_HANDLE = ^TISC_STMT_HANDLE;
75     TISC_SVC_HANDLE = PVoid;
76     PISC_SVC_HANDLE = ^TISC_SVC_HANDLE;
77     TISC_TR_HANDLE = PVoid;
78     PISC_TR_HANDLE = ^TISC_TR_HANDLE;
79     TISC_WIN_HANDLE = PVoid;
80     PISC_WIN_HANDLE = ^TISC_WIN_HANDLE;
81     TISC_CALLBACK = procedure;
82     ISC_SVC_HANDLE = ISC_LONG;
83    
84     (*******************************************************************)
85     (* Time & Date Support *)
86     (*******************************************************************)
87     const
88     TIME_SECONDS_PRECISION = 10000;
89     TIME_SECONDS_PRECISION_SCALE = -4;
90    
91     type
92     ISC_DATE = Long;
93     PISC_DATE = ^ISC_DATE;
94     ISC_TIME = ULong;
95     PISC_TIME = ^ISC_TIME;
96     TISC_TIMESTAMP = record
97     timestamp_date: ISC_DATE;
98     timestamp_time: ISC_TIME;
99     end;
100     PISC_TIMESTAMP = ^TISC_TIMESTAMP;
101    
102     (*********************************************************************)
103     (** Blob id structure **)
104     (*********************************************************************)
105     TGDS_QUAD = record
106     gds_quad_high : ISC_LONG;
107     gds_quad_low : UISC_LONG;
108     end;
109     TGDS__QUAD = TGDS_QUAD;
110     TISC_QUAD = TGDS_QUAD;
111     PGDS_QUAD = ^TGDS_QUAD;
112     PGDS__QUAD = ^TGDS__QUAD;
113     PISC_QUAD = ^TISC_QUAD;
114    
115     TISC_ARRAY_BOUND = record
116     array_bound_lower : short;
117     array_bound_upper : short;
118     end;
119     PISC_ARRAY_BOUND = ^TISC_ARRAY_BOUND;
120     TISC_ARRAY_DESC = record
121     array_desc_dtype : UChar;
122     array_desc_scale : Char;
123     array_desc_length : UShort;
124     array_desc_field_name : array[0..31] of Char;
125     array_desc_relation_name : array[0..31] of Char;
126     array_desc_dimensions : Short;
127     array_desc_flags : Short;
128     array_desc_bounds : array[0..15] of TISC_ARRAY_BOUND;
129     end; // TISC_ARRAY_DESC
130     PISC_ARRAY_DESC = ^TISC_ARRAY_DESC;
131    
132     TISC_BLOB_DESC = record
133     blob_desc_subtype : Short;
134     blob_desc_charset : Short;
135     blob_desc_segment_size : Short;
136     blob_desc_field_name : array[0..31] of UChar;
137     blob_desc_relation_name : array[0..31] of UChar;
138     end; // TISC_BLOB_DESC
139     PISC_BLOB_DESC = ^TISC_BLOB_DESC;
140    
141     (*****************************)
142     (** Blob control structure **)
143     (*****************************)
144     TISC_BLOB_CTL_SOURCE_FUNCTION = function: ISC_STATUS; // ISC_FAR
145     PISC_BLOB_CTL = ^TISC_BLOB_CTL; // ISC_FAR
146     TISC_BLOB_CTL = record
147     (** Source filter **)
148     ctl_source : TISC_BLOB_CTL_SOURCE_FUNCTION;
149     (** Argument to pass to source filter **)
150     ctl_source_handle : PISC_BLOB_CTL;
151     ctl_to_sub_type : Short; (** Target type **)
152     ctl_from_sub_type : Short; (** Source type **)
153     ctl_buffer_length : UShort; (** Length of buffer **)
154     ctl_segment_length : UShort; (** Length of current segment **)
155     ctl_bpb_length : UShort; (** Length of blob parameter **)
156     (** block **)
157     ctl_bpb : PChar; (** Address of blob parameter **)
158     (** block **)
159     ctl_buffer : PUChar; (** Address of segment buffer **)
160     ctl_max_segment : ISC_LONG; (** Length of longest segment **)
161     ctl_number_segments : ISC_LONG; (** Total number of segments **)
162     ctl_total_length : ISC_LONG; (** Total length of blob **)
163     ctl_status : PISC_STATUS; (** Address of status vector **)
164     ctl_data : array[0..7] of long; (** Application specific data **)
165     end;
166     (*****************************)
167     (** Blob stream definitions **)
168     (*****************************)
169     TBSTREAM = record
170     bstr_blob : PVoid; (** Blob handle **)
171     bstr_buffer : PChar; (** Address of buffer **)
172     bstr_ptr : PChar; (** Next character **)
173     bstr_length : Short; (** Length of buffer **)
174     bstr_cnt : Short; (** Characters in buffer **)
175     bstr_mode : Char; (** (mode) ? OUTPUT : INPUT **)
176     end;
177     PBSTREAM = ^TBSTREAM;
178    
179     (*****************************)
180     (** Dynamic SQL definitions **)
181     (*****************************)
182     {$IFDEF IB5_ONLY}
183     TSQLVAR = record
184     sqltype : Short;
185     sqllen : Short;
186     sqldata : PChar;
187     sqlind : PShort;
188     sqlname_length : Short;
189     sqlname : array[0..29] of Char;
190     end;
191     PSQLVAR = ^TSQLVAR;
192    
193     TSQLDA = record
194     sqldaid : array[0..7] of Char;
195     sqldabc : ISC_LONG;
196     sqln : Short;
197     sqld : Short;
198     sqlvar : array[0..0] of TSQLVAR;
199     end;
200     PSQLDA = ^TSQLDA;
201     {$ENDIF}
202    
203     (********************************)
204     (** Declare the extended SQLDA **)
205     (********************************)
206     TXSQLVAR = record
207     sqltype : Short; (** datatype of field **)
208     sqlscale : Short; (** scale factor **)
209     sqlsubtype : Short; (** datatype subtype - BLOBs **)
210     (** & text types only **)
211     sqllen : Short; (** length of data area **)
212     sqldata : PChar; (** address of data **)
213     sqlind : PShort; (** address of indicator **)
214     (** variable **)
215     sqlname_length : Short; (** length of sqlname field **)
216     (** name of field, name length + space for NULL **)
217     sqlname : array[0..31] of Char;
218     relname_length : Short; (** length of relation name **)
219     (** field's relation name + space for NULL **)
220     relname : array[0..31] of Char;
221     ownname_length : Short; (** length of owner name **)
222     (** relation's owner name + space for NULL **)
223     ownname : array[0..31] of Char;
224     aliasname_length : Short; (** length of alias name **)
225     (** relation's alias name + space for NULL **)
226     aliasname : array[0..31] of Char;
227     end; // TXSQLVAR
228     PXSQLVAR = ^TXSQLVAR;
229    
230     TXSQLDA = record
231     version : Short; (** version of this XSQLDA **)
232     (** XSQLDA name field **)
233     sqldaid : array[0..7] of Char;
234     sqldabc : ISC_LONG; (** length in bytes of SQLDA **)
235     sqln : Short; (** number of fields allocated **)
236     sqld : Short; (** actual number of fields **)
237     (** first field address **)
238     sqlvar : array[0..0] of TXSQLVAR;
239     end; // TXSQLDA
240     PXSQLDA = ^TXSQLDA;
241    
242     (********************************************************)
243     (** This record type is for passing arguments to **)
244     (** isc_start_transaction (See docs) **)
245     (********************************************************)
246     TISC_START_TRANS = record
247     db_handle : PISC_DB_HANDLE;
248     tpb_length : UShort;
249     tpb_address : PChar;
250     end;
251    
252     (********************************************************)
253     (** This record type is for passing arguments to **)
254     (** isc_start_multiple (see docs) **)
255     (********************************************************)
256     TISC_TEB = record
257     db_handle : PISC_DB_HANDLE;
258     tpb_length : Long;
259     tpb_address : PChar;
260     end;
261     PISC_TEB = ^TISC_TEB;
262     TISC_TEB_ARRAY = array[0..0] of TISC_TEB;
263     PISC_TEB_ARRAY = ^TISC_TEB_ARRAY;
264    
265     (*****************************)
266     (** OSRI database functions **)
267     (*****************************)
268    
269     Tisc_attach_database = function (status_vector : PISC_STATUS;
270     db_name_length : Short;
271     db_name : PChar;
272     db_handle : PISC_DB_HANDLE;
273     parm_buffer_length : Short;
274     parm_buffer : PChar): ISC_STATUS;
275     stdcall;
276    
277     Tisc_array_gen_sdl = function (status_vector : PISC_STATUS;
278     isc_array_desc : PISC_ARRAY_DESC;
279     isc_arg3 : PShort;
280     isc_arg4 : PChar;
281     isc_arg5 : PShort): ISC_STATUS;
282     stdcall;
283    
284     Tisc_array_get_slice = function (status_vector : PISC_STATUS;
285     db_handle : PISC_DB_HANDLE;
286     trans_handle : PISC_TR_HANDLE;
287     array_id : PISC_QUAD;
288     descriptor : PISC_ARRAY_DESC;
289     dest_array : PVoid;
290     slice_length : ISC_LONG): ISC_STATUS;
291     stdcall;
292    
293     Tisc_array_lookup_bounds = function (status_vector : PISC_STATUS;
294     db_handle : PISC_DB_HANDLE;
295     trans_handle : PISC_TR_HANDLE;
296     table_name,
297     column_name : PChar;
298     descriptor : PISC_ARRAY_DESC): ISC_STATUS;
299     stdcall;
300    
301     Tisc_array_lookup_desc = function (status_vector : PISC_STATUS;
302     db_handle : PISC_DB_HANDLE;
303     trans_handle : PISC_TR_HANDLE;
304     table_name,
305     column_name : PChar;
306     descriptor : PISC_ARRAY_DESC): ISC_STATUS;
307     stdcall;
308    
309     Tisc_array_set_desc = function (status_vector : PISC_STATUS;
310     table_name : PChar;
311     column_name : PChar;
312     sql_dtype,
313     sql_length,
314     sql_dimensions : PShort;
315     descriptor : PISC_ARRAY_DESC): ISC_STATUS;
316     stdcall;
317    
318     Tisc_array_put_slice = function (status_vector : PISC_STATUS;
319     db_handle : PISC_DB_HANDLE;
320     trans_handle : PISC_TR_HANDLE;
321     array_id : PISC_QUAD;
322     descriptor : PISC_ARRAY_DESC;
323     source_array : PVoid;
324     slice_length : PISC_LONG): ISC_STATUS;
325     stdcall;
326    
327     Tisc_blob_default_desc = procedure (descriptor : PISC_BLOB_DESC;
328     table_name : PUChar;
329     column_name : PUChar);
330     stdcall;
331    
332     Tisc_blob_gen_bpb = function (status_vector : PISC_STATUS;
333     to_descriptor,
334     from_descriptor : PISC_BLOB_DESC;
335     bpb_buffer_length : UShort;
336     bpb_buffer : PUChar;
337     bpb_length : PUShort): ISC_STATUS;
338     stdcall;
339    
340     Tisc_blob_info = function (status_vector : PISC_STATUS;
341     blob_handle : PISC_BLOB_HANDLE;
342     item_list_buffer_length : Short;
343     item_list_buffer : PChar;
344     result_buffer_length : Short;
345     result_buffer : PChar): ISC_STATUS;
346     stdcall;
347    
348     Tisc_blob_lookup_desc = function (status_vector : PISC_STATUS;
349     db_handle : PISC_DB_HANDLE;
350     trans_handle : PISC_TR_HANDLE;
351     table_name,
352     column_name : PChar;
353     descriptor : PISC_BLOB_DESC;
354     global : PUChar): ISC_STATUS;
355     stdcall;
356    
357     Tisc_blob_set_desc = function (status_vector : PISC_STATUS;
358     table_name,
359     column_name : PChar;
360     subtype,
361     charset,
362     segment_size : Short;
363     descriptor : PISC_BLOB_DESC): ISC_STATUS;
364     stdcall;
365    
366     Tisc_cancel_blob = function (status_vector : PISC_STATUS;
367     blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
368     stdcall;
369    
370     Tisc_cancel_events = function (status_vector : PISC_STATUS;
371     db_handle : PISC_DB_HANDLE;
372     event_id : PISC_LONG): ISC_STATUS;
373     stdcall;
374    
375     Tisc_close_blob = function (status_vector : PISC_STATUS;
376     blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
377     stdcall;
378    
379     Tisc_commit_retaining = function (status_vector : PISC_STATUS;
380     tran_handle : PISC_TR_HANDLE): ISC_STATUS;
381     stdcall;
382    
383     Tisc_commit_transaction = function (status_vector : PISC_STATUS;
384     tran_handle : PISC_TR_HANDLE): ISC_STATUS;
385     stdcall;
386    
387     Tisc_create_blob = function (status_vector : PISC_STATUS;
388     db_handle : PISC_DB_HANDLE;
389     tran_handle : PISC_TR_HANDLE;
390     blob_handle : PISC_BLOB_HANDLE;
391     blob_id : PISC_QUAD): ISC_STATUS;
392     stdcall;
393    
394     Tisc_create_blob2 = function (status_vector : PISC_STATUS;
395     db_handle : PISC_DB_HANDLE;
396     tran_handle : PISC_TR_HANDLE;
397     blob_handle : PISC_BLOB_HANDLE;
398     blob_id : PISC_QUAD;
399     bpb_length : Short;
400     bpb_address : PChar): ISC_STATUS;
401     stdcall;
402    
403     Tisc_create_database = function (status_vector : PISC_STATUS;
404     isc_arg2 : Short;
405     isc_arg3 : PChar;
406     db_handle : PISC_DB_HANDLE;
407     isc_arg5 : Short;
408     isc_arg6 : PChar;
409     isc_arg7 : Short): ISC_STATUS;
410     stdcall;
411    
412     Tisc_database_info = function (status_vector : PISC_STATUS;
413     db_handle : PISC_DB_HANDLE;
414     item_list_buffer_length : Short;
415     item_list_buffer : PChar;
416     result_buffer_length : Short;
417     result_buffer : PChar): ISC_STATUS;
418     stdcall;
419    
420     Tisc_decode_date = procedure (ib_date: PISC_QUAD;
421     tm_date: PCTimeStructure);
422     stdcall;
423    
424     Tisc_decode_sql_date = procedure (ib_date: PISC_DATE;
425     tm_date: PCTimeStructure);
426     stdcall;
427    
428     Tisc_decode_sql_time = procedure (ib_time: PISC_TIME;
429     tm_date: PCTimeStructure);
430     stdcall;
431    
432     Tisc_decode_timestamp = procedure (ib_timestamp: PISC_TIMESTAMP;
433     tm_date: PCTimeStructure);
434     stdcall;
435    
436     Tisc_detach_database = function (status_vector : PISC_STATUS;
437     db_handle : PISC_DB_HANDLE): ISC_STATUS;
438     stdcall;
439    
440     Tisc_drop_database = function (status_vector : PISC_STATUS;
441     db_handle : PISC_DB_HANDLE): ISC_STATUS;
442     stdcall;
443    
444     Tisc_dsql_allocate_statement = function (status_vector : PISC_STATUS;
445     db_handle : PISC_DB_HANDLE;
446     stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
447     stdcall;
448    
449     Tisc_dsql_alloc_statement2 = function (status_vector : PISC_STATUS;
450     db_handle : PISC_DB_HANDLE;
451     stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
452     stdcall;
453    
454     Tisc_dsql_describe = function (status_vector : PISC_STATUS;
455     stmt_handle : PISC_STMT_HANDLE;
456     dialect : UShort;
457     xsqlda : PXSQLDA): ISC_STATUS;
458     stdcall;
459    
460     Tisc_dsql_describe_bind = function (status_vector : PISC_STATUS;
461     stmt_handle : PISC_STMT_HANDLE;
462     dialect : UShort;
463     xsqlda : PXSQLDA): ISC_STATUS;
464     stdcall;
465    
466     Tisc_dsql_exec_immed2 = function (status_vector : PISC_STATUS;
467     db_handle : PISC_DB_HANDLE;
468     tran_handle : PISC_TR_HANDLE;
469     length : UShort;
470     statement : PChar;
471     dialect : UShort;
472     in_xsqlda,
473     out_xsqlda : PXSQLDA): ISC_STATUS;
474     stdcall;
475    
476     Tisc_dsql_execute = function (status_vector : PISC_STATUS;
477     tran_handle : PISC_TR_HANDLE;
478     stmt_handle : PISC_STMT_HANDLE;
479     dialect : UShort;
480     xsqlda : PXSQLDA): ISC_STATUS;
481     stdcall;
482    
483     Tisc_dsql_execute2 = function (status_vector : PISC_STATUS;
484     tran_handle : PISC_TR_HANDLE;
485     stmt_handle : PISC_STMT_HANDLE;
486     dialect : UShort;
487     in_xsqlda,
488     out_xsqlda : PXSQLDA): ISC_STATUS;
489     stdcall;
490    
491     Tisc_dsql_execute_immediate = function (status_vector : PISC_STATUS;
492     db_handle : PISC_DB_HANDLE;
493     tran_handle : PISC_TR_HANDLE;
494     length : UShort;
495     statement : PChar;
496     dialect : UShort;
497     xsqlda : PXSQLDA): ISC_STATUS;
498     stdcall;
499    
500     Tisc_dsql_fetch = function (status_vector : PISC_STATUS;
501     stmt_handle : PISC_STMT_HANDLE;
502     dialect : UShort;
503     xsqlda : PXSQLDA): ISC_STATUS;
504     stdcall;
505    
506     (*$ifdef SCROLLABLE_CURSORS*)
507     Tisc_dsql_fetch2 = function (status_vector : PISC_STATUS;
508     stmt_handle : PISC_STMT_HANDLE;
509     dialect : UShort;
510     xsqlda : PXSQLDA;
511     isc_arg5 : UShort;
512     isc_arg6 : Long): ISC_STATUS;
513     stdcall;
514     (*$endif*)
515    
516     Tisc_dsql_finish = function (db_handle : PISC_DB_HANDLE): ISC_STATUS;
517     stdcall;
518    
519     Tisc_dsql_free_statement = function (status_vector : PISC_STATUS;
520     stmt_handle : PISC_STMT_HANDLE;
521     options : UShort): ISC_STATUS;
522     stdcall;
523    
524     Tisc_dsql_insert = function (status_vector : PISC_STATUS;
525     stmt_handle : PISC_STMT_HANDLE;
526     arg3 : UShort;
527     xsqlda : PXSQLDA): ISC_STATUS;
528     stdcall;
529    
530     Tisc_dsql_prepare = function (status_vector : PISC_STATUS;
531     tran_handle : PISC_TR_HANDLE;
532     stmt_handle : PISC_STMT_HANDLE;
533     length : UShort;
534     statement : PChar;
535     dialect : UShort;
536     xsqlda : PXSQLDA): ISC_STATUS;
537     stdcall;
538    
539     Tisc_dsql_set_cursor_name = function (status_vector : PISC_STATUS;
540     stmt_handle : PISC_STMT_HANDLE;
541     cursor_name : PChar;
542     _type : UShort): ISC_STATUS;
543     stdcall;
544    
545     Tisc_dsql_sql_info = function (status_vector : PISC_STATUS;
546     stmt_handle : PISC_STMT_HANDLE;
547     item_length : Short;
548     items : PChar;
549     buffer_length : Short;
550     buffer : PChar): ISC_STATUS;
551     stdcall;
552    
553     Tisc_encode_date = procedure (tm_date : PCTimeStructure;
554     ib_date : PISC_QUAD);
555     stdcall;
556    
557     Tisc_encode_sql_date = procedure (tm_date : PCTimeStructure;
558     ib_date : PISC_DATE);
559     stdcall;
560    
561     Tisc_encode_sql_time = procedure (tm_date : PCTimeStructure;
562     ib_time : PISC_TIME);
563     stdcall;
564    
565     Tisc_encode_timestamp = procedure (tm_date : PCTimeStructure;
566     ib_timestamp : PISC_TIMESTAMP);
567     stdcall;
568    
569     Tisc_event_block = function (event_buffer : PPChar;
570     result_buffer : PPChar;
571     id_count : UShort;
572     event_list : array of PChar): ISC_LONG;
573     cdecl;
574    
575     Tisc_event_counts = procedure (status_vector : PISC_STATUS;
576     buffer_length : Short;
577     event_buffer : PChar;
578     result_buffer : PChar);
579     stdcall;
580    
581     Tisc_expand_dpb = procedure (dpb : PPChar;
582     dpb_length : PShort;
583     item_list : array of Pointer);
584     cdecl;
585    
586     Tisc_modify_dpb = function (dpb : PPChar;
587     isc_arg2,
588     isc_arg3 : PShort;
589     isc_arg4 : UShort;
590     isc_arg5 : PChar;
591     isc_arg6 : Short): Int;
592     stdcall;
593    
594     Tisc_free = function (isc_arg1 : PChar): ISC_LONG;
595     stdcall;
596    
597     Tisc_get_segment = function (status_vector : PISC_STATUS;
598     blob_handle : PISC_BLOB_HANDLE;
599     actual_seg_length : PUShort;
600     seg_buffer_length : UShort;
601     seg_buffer : PChar): ISC_STATUS;
602     stdcall;
603    
604     Tisc_get_slice = function (status_vector : PISC_STATUS;
605     db_handle : PISC_DB_HANDLE;
606     tran_handle : PISC_TR_HANDLE;
607     isc_arg4 : PISC_QUAD;
608     isc_arg5 : Short;
609     isc_arg6 : PChar;
610     isc_arg7 : Short;
611     isc_arg8 : PISC_LONG;
612     isc_arg9 : ISC_LONG;
613     isc_arg10 : PVoid;
614     isc_arg11 : PISC_LONG): ISC_STATUS;
615     stdcall;
616    
617     Tisc_interprete = function (buffer : PChar;
618     status_vector : PPISC_STATUS): ISC_STATUS;
619     stdcall;
620    
621     Tisc_open_blob = function (status_vector : PISC_STATUS;
622     db_handle : PISC_DB_HANDLE;
623     tran_handle : PISC_TR_HANDLE;
624     blob_handle : PISC_BLOB_HANDLE;
625     blob_id : PISC_QUAD): ISC_STATUS;
626     stdcall;
627    
628     Tisc_open_blob2 = function (status_vector : PISC_STATUS;
629     db_handle : PISC_DB_HANDLE;
630     tran_handle : PISC_TR_HANDLE;
631     blob_handle : PISC_BLOB_HANDLE;
632     blob_id : PISC_QUAD;
633     bpb_length : Short;
634     bpb_buffer : PChar): ISC_STATUS;
635     stdcall;
636    
637     Tisc_prepare_transaction2 = function (status_vector : PISC_STATUS;
638     tran_handle : PISC_TR_HANDLE;
639     msg_length : Short;
640     msg : PChar): ISC_STATUS;
641     stdcall;
642    
643     Tisc_print_sqlerror = procedure (sqlcode : Short;
644     status_vector : PISC_STATUS);
645     stdcall;
646    
647     Tisc_print_status = function (status_vector : PISC_STATUS): ISC_STATUS;
648     stdcall;
649    
650     Tisc_put_segment = function (status_vector : PISC_STATUS;
651     blob_handle : PISC_BLOB_HANDLE;
652     seg_buffer_len : UShort;
653     seg_buffer : PChar): ISC_STATUS;
654     stdcall;
655    
656     Tisc_put_slice = function (status_vector : PISC_STATUS;
657     db_handle : PISC_DB_HANDLE;
658     tran_handle : PISC_TR_HANDLE;
659     isc_arg4 : PISC_QUAD;
660     isc_arg5 : Short;
661     isc_arg6 : PChar;
662     isc_arg7 : Short;
663     isc_arg8 : PISC_LONG;
664     isc_arg9 : ISC_LONG;
665     isc_arg10 : PVoid): ISC_STATUS;
666     stdcall;
667    
668     Tisc_que_events = function (status_vector : PISC_STATUS;
669     db_handle : PISC_DB_HANDLE;
670     event_id : PISC_LONG;
671     length : Short;
672     event_buffer : PChar;
673     event_function : TISC_CALLBACK;
674     event_function_arg : PVoid): ISC_STATUS;
675     stdcall;
676    
677     Tisc_rollback_retaining = function (status_vector : PISC_STATUS;
678     tran_handle : PISC_TR_HANDLE): ISC_STATUS;
679     stdcall;
680    
681     Tisc_rollback_transaction = function (status_vector : PISC_STATUS;
682     tran_handle : PISC_TR_HANDLE): ISC_STATUS;
683     stdcall;
684    
685     Tisc_start_multiple = function (status_vector : PISC_STATUS;
686     tran_handle : PISC_TR_HANDLE;
687     db_handle_count : Short;
688     teb_vector_address : PISC_TEB): ISC_STATUS;
689     stdcall;
690    
691     Tisc_start_transaction = function (status_vector : PISC_STATUS;
692     tran_handle : PISC_TR_HANDLE;
693     db_handle_count : Short;
694     db_handle : PISC_DB_HANDLE;
695     tpb_length : UShort;
696     tpb_address : PChar): ISC_STATUS;
697     cdecl;
698    
699     Tisc_sqlcode = function (status_vector : PISC_STATUS): ISC_LONG;
700     stdcall;
701    
702    
703     Tisc_sql_interprete = procedure (sqlcode : Short;
704     buffer : PChar;
705     buffer_length : Short);
706     stdcall;
707    
708     Tisc_transaction_info = function (status_vector : PISC_STATUS;
709     tran_handle : PISC_TR_HANDLE;
710     item_list_buffer_length : Short;
711     item_list_buffer : PChar;
712     result_buffer_length : Short;
713     result_buffer : PChar): ISC_STATUS;
714     stdcall;
715    
716     Tisc_transact_request = function (status_vector : PISC_STATUS;
717     db_handle : PISC_DB_HANDLE;
718     tran_handle : PISC_TR_HANDLE;
719     isc_arg4 : UShort;
720     isc_arg5 : PChar;
721     isc_arg6 : UShort;
722     isc_arg7 : PChar;
723     isc_arg8 : UShort;
724     isc_arg9 : PChar): ISC_STATUS;
725     stdcall;
726    
727     Tisc_vax_integer = function (buffer : PChar;
728     length : Short): ISC_LONG;
729     stdcall;
730    
731     Tisc_portable_integer = function (buffer : PChar;
732     length : Short): ISC_INT64;
733     stdcall;
734    
735     (***************************************)
736     (** Security Functions and structures **)
737     (***************************************)
738    
739     const
740     sec_uid_spec = $01;
741     sec_gid_spec = $02;
742     sec_server_spec = $04;
743     sec_password_spec = $08;
744     sec_group_name_spec = $10;
745     sec_first_name_spec = $20;
746     sec_middle_name_spec = $40;
747     sec_last_name_spec = $80;
748     sec_dba_user_name_spec = $100;
749     sec_dba_password_spec = $200;
750    
751     sec_protocol_tcpip = 1;
752     sec_protocol_netbeui = 2;
753     sec_protocol_spx = 3;
754     sec_protocol_local = 4;
755    
756     type
757     TUserSecData = record
758     sec_flags: Short; (** which fields are specified **)
759     uid: Int; (** the user's id **)
760     gid: int; (** the user's group id **)
761     protocol: Int; (** protocol to use for connection **)
762     server: PChar; (** server to administer **)
763     user_name: PChar; (** the user's name **)
764     password: PChar; (** the user's password **)
765     group_name: PChar; (** the group name **)
766     first_name: PChar; (** the user's first name **)
767     middle_name: PChar; (** the user's middle name **)
768     last_name: PChar; (** the user's last name **)
769     dba_user_name: PChar; (** the dba user name **)
770     dba_password: PChar; (** the dba password **)
771     end;
772     PUserSecData = ^TUserSecData;
773    
774     Tisc_add_user = function (status_vector : PISC_STATUS;
775     user_sec_data : PUserSecData): ISC_STATUS;
776     stdcall;
777    
778     Tisc_delete_user = function (status_vector : PISC_STATUS;
779     user_sec_data : PUserSecData): ISC_STATUS;
780     stdcall;
781    
782     Tisc_modify_user = function (status_vector : PISC_STATUS;
783     user_sec_data : PUserSecData): ISC_STATUS;
784     stdcall;
785    
786     (************************************)
787     (** Other OSRI functions **)
788     (************************************)
789    
790     Tisc_compile_request = function (status_vector : PISC_STATUS;
791     db_handle : PISC_DB_HANDLE;
792     request_handle : PISC_REQ_HANDLE;
793     isc_arg4 : Short;
794     isc_arg5 : PChar): ISC_STATUS;
795     stdcall;
796    
797     Tisc_compile_request2 = function (status_vector : PISC_STATUS;
798     db_handle : PISC_DB_HANDLE;
799     request_handle : PISC_REQ_HANDLE;
800     isc_arg4 : Short;
801     isc_arg5 : PChar): ISC_STATUS;
802     stdcall;
803    
804     Tisc_ddl = function (status_vector : PISC_STATUS;
805     db_handle : PISC_DB_HANDLE;
806     tran_handle : PISC_TR_HANDLE;
807     isc_arg4 : Short;
808     isc_arg5 : PChar): ISC_STATUS;
809     stdcall;
810    
811     Tisc_prepare_transaction = function (status_vector : PISC_STATUS;
812     tran_handle : PISC_TR_HANDLE): ISC_STATUS;
813     stdcall;
814    
815    
816     Tisc_receive = function (status_vector : PISC_STATUS;
817     request_handle : PISC_REQ_HANDLE;
818     isc_arg3,
819     isc_arg4 : Short;
820     isc_arg5 : PVoid;
821     isc_arg6 : Short): ISC_STATUS;
822     stdcall;
823    
824     Tisc_receive2 = function (status_vector : PISC_STATUS;
825     request_handle : PISC_REQ_HANDLE;
826     isc_arg3,
827     isc_arg4 : Short;
828     isc_arg5 : PVoid;
829     isc_arg6,
830     isc_arg7 : Short;
831     isc_arg8 : Long): ISC_STATUS;
832     stdcall;
833    
834     Tisc_reconnect_transaction = function (status_vector : PISC_STATUS;
835     db_handle : PISC_DB_HANDLE;
836     tran_handle : PISC_TR_HANDLE;
837     isc_arg4 : Short;
838     isc_arg5 : PChar): ISC_STATUS;
839     stdcall;
840    
841     Tisc_release_request = function (status_vector : PISC_STATUS;
842     request_handle : PISC_REQ_HANDLE): ISC_STATUS;
843     stdcall;
844    
845     Tisc_request_info = function (status_vector : PISC_STATUS;
846     request_handle : PISC_REQ_HANDLE;
847     isc_arg3 : Short;
848     isc_arg4 : Short;
849     isc_arg5 : PChar;
850     isc_arg6 : Short;
851     isc_arg7 : PChar): ISC_STATUS;
852     stdcall;
853    
854     Tisc_seek_blob = function (status_vector : PISC_STATUS;
855     blob_handle : PISC_BLOB_HANDLE;
856     isc_arg3 : Short;
857     isc_arg4 : ISC_LONG;
858     isc_arg5 : PISC_LONG): ISC_STATUS;
859     stdcall;
860    
861     Tisc_send = function (status_vector : PISC_STATUS;
862     request_handle : PISC_REQ_HANDLE;
863     isc_arg3,
864     isc_arg4 : Short;
865     isc_arg5 : PVoid;
866     isc_arg6 : Short): ISC_STATUS;
867     stdcall;
868    
869     Tisc_start_and_send = function (status_vector : PISC_STATUS;
870     request_handle : PISC_REQ_HANDLE;
871     tran_handle : PISC_TR_HANDLE;
872     isc_arg4,
873     isc_arg5 : Short;
874     isc_arg6 : PVoid;
875     isc_arg7 : Short): ISC_STATUS;
876     stdcall;
877    
878     Tisc_start_request = function (status_vector : PISC_STATUS;
879     request_handle : PISC_REQ_HANDLE;
880     tran_handle : PISC_TR_HANDLE;
881     isc_arg4 : Short): ISC_STATUS;
882     stdcall;
883    
884     Tisc_unwind_request = function (status_vector : PISC_STATUS;
885     tran_handle : PISC_TR_HANDLE;
886     isc_arg3 : Short): ISC_STATUS;
887     stdcall;
888    
889     Tisc_wait_for_event = function (status_vector : PISC_STATUS;
890     db_handle : PISC_DB_HANDLE;
891     length : Short;
892     event_buffer,
893     result_buffer : PChar): ISC_STATUS;
894     stdcall;
895    
896     (*******************************)
897     (** Other Sql functions **)
898     (*******************************)
899     {$IFDEF IB5_ONLY}
900     Tisc_close = function (status_vector : PISC_STATUS;
901     isc_arg2 : PChar): ISC_STATUS;
902     stdcall;
903    
904     Tisc_declare = function (status_vector : PISC_STATUS;
905     isc_arg2,
906     isc_arg3 : PChar): ISC_STATUS;
907     stdcall;
908    
909     Tisc_describe = function (status_vector : PISC_STATUS;
910     isc_arg2 : PChar;
911     isc_arg3 : PSQLDA): ISC_STATUS;
912     stdcall;
913    
914     Tisc_describe_bind = function (status_vector : PISC_STATUS;
915     isc_arg2 : PChar;
916     isc_arg3 : PSQLDA): ISC_STATUS;
917     stdcall;
918    
919     Tisc_execute = function (status_vector : PISC_STATUS;
920     tran_handle : PISC_TR_HANDLE;
921     isc_arg3 : PChar;
922     isc_arg4 : PSQLDA): ISC_STATUS;
923     stdcall;
924    
925     Tisc_execute_immediate = function (status_vector : PISC_STATUS;
926     db_handle : PISC_DB_HANDLE;
927     tran_handle : PISC_TR_HANDLE;
928     isc_arg4 : PShort;
929     isc_arg5 : PChar): ISC_STATUS;
930     stdcall;
931    
932     Tisc_fetch = function (status_vector : PISC_STATUS;
933     isc_arg2 : PChar;
934     isc_arg3 : PSQLDA): ISC_STATUS;
935     stdcall;
936    
937     Tisc_open = function (status_vector : PISC_STATUS;
938     tran_handle : PISC_TR_HANDLE;
939     isc_arg3 : PChar;
940     isc_arg4 : PSQLDA): ISC_STATUS;
941     stdcall;
942    
943     Tisc_prepare = function (status_vector : PISC_STATUS;
944     db_handle : PISC_DB_HANDLE;
945     tran_handle : PISC_TR_HANDLE;
946     isc_arg4 : PChar;
947     isc_arg5 : PShort;
948     isc_arg6 : PChar;
949     isc_arg7 : PSQLDA): ISC_STATUS;
950     stdcall;
951     {$ELSE}
952     Tisc_close = function (status_vector : PISC_STATUS;
953     isc_arg2 : PChar): ISC_STATUS;
954     stdcall;
955    
956     Tisc_declare = function (status_vector : PISC_STATUS;
957     isc_arg2,
958     isc_arg3 : PChar): ISC_STATUS;
959     stdcall;
960    
961     Tisc_describe = function (status_vector : PISC_STATUS;
962     isc_arg2 : PChar;
963     isc_arg3 : PXSQLDA): ISC_STATUS;
964     stdcall;
965    
966     Tisc_describe_bind = function (status_vector : PISC_STATUS;
967     isc_arg2 : PChar;
968     isc_arg3 : PXSQLDA): ISC_STATUS;
969     stdcall;
970    
971     Tisc_execute = function (status_vector : PISC_STATUS;
972     tran_handle : PISC_TR_HANDLE;
973     isc_arg3 : PChar;
974     isc_arg4 : PXSQLDA): ISC_STATUS;
975     stdcall;
976    
977     Tisc_execute_immediate = function (status_vector : PISC_STATUS;
978     db_handle : PISC_DB_HANDLE;
979     tran_handle : PISC_TR_HANDLE;
980     isc_arg4 : PShort;
981     isc_arg5 : PChar): ISC_STATUS;
982     stdcall;
983    
984     Tisc_fetch = function (status_vector : PISC_STATUS;
985     isc_arg2 : PChar;
986     isc_arg3 : PXSQLDA): ISC_STATUS;
987     stdcall;
988    
989     Tisc_open = function (status_vector : PISC_STATUS;
990     tran_handle : PISC_TR_HANDLE;
991     isc_arg3 : PChar;
992     isc_arg4 : PXSQLDA): ISC_STATUS;
993     stdcall;
994    
995     Tisc_prepare = function (status_vector : PISC_STATUS;
996     db_handle : PISC_DB_HANDLE;
997     tran_handle : PISC_TR_HANDLE;
998     isc_arg4 : PChar;
999     isc_arg5 : PShort;
1000     isc_arg6 : PChar;
1001     isc_arg7 : PXSQLDA): ISC_STATUS;
1002     stdcall;
1003     {$ENDIF}
1004    
1005     (***************************************)
1006     (** Other Dynamic sql functions **)
1007     (***************************************)
1008    
1009     Tisc_dsql_execute_m = function (status_vector : PISC_STATUS;
1010     tran_handle : PISC_TR_HANDLE;
1011     statement_handle : PISC_STMT_HANDLE;
1012     isc_arg4 : UShort;
1013     isc_arg5 : PChar;
1014     isc_arg6 : UShort;
1015     isc_arg7 : UShort;
1016     isc_arg8 : PChar): ISC_STATUS;
1017     stdcall;
1018    
1019     Tisc_dsql_execute2_m = function (status_vector : PISC_STATUS;
1020     tran_handle : PISC_TR_HANDLE;
1021     statement_handle : PISC_STMT_HANDLE;
1022     isc_arg4 : UShort;
1023     isc_arg5 : PChar;
1024     isc_arg6 : UShort;
1025     isc_arg7 : UShort;
1026     isc_arg8 : PChar;
1027     isc_arg9 : UShort;
1028     isc_arg10 : PChar;
1029     isc_arg11 : UShort;
1030     isc_arg12 : UShort;
1031     isc_arg13 : PChar): ISC_STATUS;
1032     stdcall;
1033    
1034     Tisc_dsql_execute_immediate_m = function (status_vector : PISC_STATUS;
1035     db_handle : PISC_DB_HANDLE;
1036     tran_handle : PISC_TR_HANDLE;
1037     isc_arg4 : UShort;
1038     isc_arg5 : PChar;
1039     isc_arg6 : UShort;
1040     isc_arg7 : UShort;
1041     isc_arg8 : PChar;
1042     isc_arg9 : UShort;
1043     isc_arg10 : UShort;
1044     isc_arg11 : PChar): ISC_STATUS;
1045     stdcall;
1046    
1047     Tisc_dsql_exec_immed3_m = function (status_vector : PISC_STATUS;
1048     db_handle : PISC_DB_HANDLE;
1049     tran_handle : PISC_TR_HANDLE;
1050     isc_arg4 : UShort;
1051     isc_arg5 : PChar;
1052     isc_arg6 : UShort;
1053     isc_arg7 : UShort;
1054     isc_arg8 : PChar;
1055     isc_arg9 : UShort;
1056     isc_arg10 : UShort;
1057     isc_arg11 : PChar;
1058     isc_arg12 : UShort;
1059     isc_arg13 : PChar;
1060     isc_arg14 : UShort;
1061     isc_arg15 : UShort;
1062     isc_arg16 : PChar): ISC_STATUS;
1063     stdcall;
1064    
1065     Tisc_dsql_fetch_m = function (status_vector : PISC_STATUS;
1066     statement_handle : PISC_STMT_HANDLE;
1067     isc_arg3 : UShort;
1068     isc_arg4 : PChar;
1069     isc_arg5 : UShort;
1070     isc_arg6 : UShort;
1071     isc_arg7 : PChar): ISC_STATUS;
1072     stdcall;
1073    
1074     (*$ifdef SCROLLABLE_CURSORS*)
1075     Tisc_dsql_fetch2_m = function (status_vector : PISC_STATUS;
1076     statement_handle : PISC_STMT_HANDLE;
1077     isc_arg3 : UShort;
1078     isc_arg4 : PChar;
1079     isc_arg5 : UShort;
1080     isc_arg6 : UShort;
1081     isc_arg7 : PChar;
1082     isc_arg8 : UShort;
1083     isc_arg9 : Long): ISC_STATUS;
1084     stdcall;
1085     (*$endif*)
1086    
1087     Tisc_dsql_insert_m = function (status_vector : PISC_STATUS;
1088     statement_handle : PISC_STMT_HANDLE;
1089     isc_arg3 : UShort;
1090     isc_arg4 : PChar;
1091     isc_arg5 : UShort;
1092     isc_arg6 : UShort;
1093     isc_arg7 : PChar): ISC_STATUS;
1094     stdcall;
1095    
1096     Tisc_dsql_prepare_m = function (status_vector : PISC_STATUS;
1097     tran_handle : PISC_TR_HANDLE;
1098     statement_handle : PISC_STMT_HANDLE;
1099     isc_arg4 : UShort;
1100     isc_arg5 : PChar;
1101     isc_arg6 : UShort;
1102     isc_arg7 : UShort;
1103     isc_arg8 : PChar;
1104     isc_arg9 : UShort;
1105     isc_arg10 : PChar): ISC_STATUS;
1106     stdcall;
1107    
1108     Tisc_dsql_release = function (status_vector : PISC_STATUS;
1109     isc_arg2 : PChar): ISC_STATUS;
1110     stdcall;
1111    
1112     Tisc_embed_dsql_close = function(status_vector : PISC_STATUS;
1113     isc_arg2 : PChar): ISC_STATUS;
1114     stdcall;
1115    
1116     Tisc_embed_dsql_declare = function (status_vector : PISC_STATUS;
1117     isc_arg2 : PChar;
1118     isc_arg3 : PChar): ISC_STATUS;
1119     stdcall;
1120    
1121     Tisc_embed_dsql_describe = function (status_vector : PISC_STATUS;
1122     isc_arg2 : PChar;
1123     isc_arg3 : UShort;
1124     isc_arg4 : PXSQLDA): ISC_STATUS;
1125     stdcall;
1126    
1127     Tisc_embed_dsql_describe_bind = function (status_vector : PISC_STATUS;
1128     isc_arg2 : PChar;
1129     isc_arg3 : UShort;
1130     isc_arg4 : PXSQLDA): ISC_STATUS;
1131     stdcall;
1132    
1133     Tisc_embed_dsql_execute = function (status_vector : PISC_STATUS;
1134     tran_handle : PISC_TR_HANDLE;
1135     isc_arg3 : PChar;
1136     isc_arg4 : UShort;
1137     isc_arg5 : PXSQLDA): ISC_STATUS;
1138     stdcall;
1139    
1140     Tisc_embed_dsql_execute2 = function (status_vector : PISC_STATUS;
1141     tran_handle : PISC_TR_HANDLE;
1142     isc_arg3 : PChar;
1143     isc_arg4 : UShort;
1144     isc_arg5 : PXSQLDA;
1145     isc_arg6 : PXSQLDA): ISC_STATUS;
1146     stdcall;
1147    
1148     Tisc_embed_dsql_execute_immed = function (status_vector : PISC_STATUS;
1149     db_handle : PISC_DB_HANDLE;
1150     tran_handle : PISC_TR_HANDLE;
1151     isc_arg4 : UShort;
1152     isc_arg5 : PChar;
1153     isc_arg6 : UShort;
1154     isc_arg7 : PXSQLDA): ISC_STATUS;
1155     stdcall;
1156    
1157     Tisc_embed_dsql_fetch = function(status_vector : PISC_STATUS;
1158     isc_arg2 : PChar;
1159     isc_arg3 : UShort;
1160     isc_arg4 : PXSQLDA): ISC_STATUS;
1161     stdcall;
1162    
1163     (*$ifdef SCROLLABLE_CURSORS*)
1164     Tisc_embed_dsql_fetch2 = function (status_vector : PISC_STATUS;
1165     isc_arg2 : PChar;
1166     isc_arg3 : UShort;
1167     isc_arg4 : PXSQLDA;
1168     isc_arg5 : UShort;
1169     isc_arg6 : Long): ISC_STATUS;
1170     stdcall;
1171     (*$endif*)
1172    
1173     Tisc_embed_dsql_open = function (status_vector : PISC_STATUS;
1174     tran_handle : PISC_TR_HANDLE;
1175     isc_arg3 : PChar;
1176     isc_arg4 : UShort;
1177     isc_arg5 : PXSQLDA): ISC_STATUS;
1178     stdcall;
1179    
1180     Tisc_embed_dsql_open2 = function (status_vector : PISC_STATUS;
1181     tran_handle : PISC_TR_HANDLE;
1182     isc_arg3 : PChar;
1183     isc_arg4 : UShort;
1184     isc_arg5 : PXSQLDA;
1185     isc_arg6 : PXSQLDA): ISC_STATUS;
1186     stdcall;
1187    
1188     Tisc_embed_dsql_insert = function (status_vector : PISC_STATUS;
1189     isc_arg2 : PChar;
1190     isc_arg3 : UShort;
1191     isc_arg4 : PXSQLDA): ISC_STATUS;
1192     stdcall;
1193    
1194     Tisc_embed_dsql_prepare = function (status_vector : PISC_STATUS;
1195     db_handle : PISC_DB_HANDLE;
1196     tran_handle : PISC_TR_HANDLE;
1197     isc_arg4 : PChar;
1198     isc_arg5 : UShort;
1199     isc_arg6 : PChar;
1200     isc_arg7 : UShort;
1201     isc_arg8 : PXSQLDA): ISC_STATUS;
1202     stdcall;
1203    
1204     Tisc_embed_dsql_release = function (status_vector : PISC_STATUS;
1205     isc_arg2 : PChar): ISC_STATUS;
1206     stdcall;
1207    
1208     (********************************)
1209     (** Other Blob functions **)
1210     (********************************)
1211    
1212     TBLOB_open = function (blob_handle : TISC_BLOB_HANDLE;
1213     isc_arg2 : PChar;
1214     isc_arg3 : int): PBSTREAM;
1215     stdcall;
1216    
1217     TBLOB_put = function (isc_arg1 : char;
1218     isc_arg2 : PBSTREAM): Int;
1219     stdcall;
1220    
1221     TBLOB_close = function (isc_arg1 : PBSTREAM): Int;
1222     stdcall;
1223    
1224     TBLOB_get = function (isc_arg1 : PBSTREAM): Int;
1225     stdcall;
1226    
1227     TBLOB_display = function (isc_arg1 : PISC_QUAD;
1228     db_handle : TISC_DB_HANDLE;
1229     tran_handle : TISC_TR_HANDLE;
1230     isc_arg4 : PChar): Int;
1231     stdcall;
1232    
1233     TBLOB_dump = function (isc_arg1 : PISC_QUAD;
1234     db_handle : TISC_DB_HANDLE;
1235     tran_handle : TISC_TR_HANDLE;
1236     isc_arg4 : PChar): Int;
1237     stdcall;
1238    
1239     TBLOB_edit = function (isc_arg1 : PISC_QUAD;
1240     db_handle : TISC_DB_HANDLE;
1241     tran_handle : TISC_TR_HANDLE;
1242     isc_arg4 : PChar): Int;
1243     stdcall;
1244    
1245     TBLOB_load = function (isc_arg1 : PISC_QUAD;
1246     db_handle : TISC_DB_HANDLE;
1247     tran_handle : TISC_TR_HANDLE;
1248     isc_arg4 : PChar): Int;
1249     stdcall;
1250    
1251     TBLOB_text_dump = function (isc_arg1 : PISC_QUAD;
1252     db_handle : TISC_DB_HANDLE;
1253     tran_handle : TISC_TR_HANDLE;
1254     isc_arg4 : PChar): Int;
1255     stdcall;
1256    
1257     TBLOB_text_load = function (isc_arg1 : PISC_QUAD;
1258     db_handle : TISC_DB_HANDLE;
1259     tran_handle : TISC_TR_HANDLE;
1260     isc_arg4 : PChar): Int;
1261     stdcall;
1262    
1263     TBopen = function (isc_arg1 : PISC_QUAD;
1264     db_handle : TISC_DB_HANDLE;
1265     tran_handle : TISC_TR_HANDLE;
1266     isc_arg4 : PChar): Int;
1267     stdcall;
1268    
1269     TBopen2 = function (isc_arg1 : PISC_QUAD;
1270     db_handle : TISC_DB_HANDLE;
1271     tran_handle : TISC_TR_HANDLE;
1272     isc_arg4 : PChar;
1273     isc_arg5 : UShort): PBSTREAM;
1274     stdcall;
1275    
1276     (********************************)
1277     (** Other Misc functions **)
1278     (********************************)
1279    
1280     Tisc_ftof = function (isc_arg1 : PChar;
1281     isc_arg2 : UShort;
1282     isc_arg3 : PChar;
1283     isc_arg4 : UShort): ISC_LONG;
1284     stdcall;
1285    
1286     Tisc_print_blr = function (isc_arg1 : PChar;
1287     isc_arg2 : TISC_CALLBACK;
1288     isc_arg3 : PVoid;
1289     isc_arg4 : Short): ISC_STATUS;
1290     stdcall;
1291    
1292     Tisc_set_debug = procedure (isc_arg1 : Int);
1293     stdcall;
1294    
1295     Tisc_qtoq = procedure (isc_arg1 : PISC_QUAD;
1296     isc_arg2 : PISC_QUAD);
1297     stdcall;
1298    
1299     Tisc_vtof = procedure (isc_arg1 : PChar;
1300     isc_arg2 : PChar;
1301     isc_arg3 : UShort);
1302     stdcall;
1303    
1304     Tisc_vtov = procedure (isc_arg1 : PChar;
1305     isc_arg2 : PChar;
1306     isc_arg3 : Short);
1307     stdcall;
1308    
1309     Tisc_version = function (db_handle : PISC_DB_HANDLE;
1310     isc_arg2 : TISC_CALLBACK;
1311     isc_arg3 : PVoid): Int;
1312     stdcall;
1313    
1314     Tisc_reset_fpe = function (isc_arg1 : UShort): ISC_LONG;
1315     stdcall;
1316    
1317     (*******************************************)
1318     (** Service manager functions **)
1319     (*******************************************)
1320    
1321     Tisc_service_attach = function (status_vector : PISC_STATUS;
1322     isc_arg2 : UShort;
1323     isc_arg3 : PChar;
1324     service_handle : PISC_SVC_HANDLE;
1325     isc_arg5 : UShort;
1326     isc_arg6 : PChar): ISC_STATUS;
1327     stdcall;
1328    
1329     Tisc_service_detach = function (status_vector : PISC_STATUS;
1330     service_handle : PISC_SVC_HANDLE): ISC_STATUS;
1331     stdcall;
1332    
1333     Tisc_service_query = function (status_vector : PISC_STATUS;
1334     service_handle : PISC_SVC_HANDLE;
1335     recv_handle : PISC_SVC_HANDLE;
1336     isc_arg4 : UShort;
1337     isc_arg5 : PChar;
1338     isc_arg6 : UShort;
1339     isc_arg7 : PChar;
1340     isc_arg8 : UShort;
1341     isc_arg9 : PChar): ISC_STATUS;
1342     stdcall;
1343    
1344     Tisc_service_start = function (status_vector : PISC_STATUS;
1345     service_handle : PISC_SVC_HANDLE;
1346     recv_handle : PISC_SVC_HANDLE;
1347     isc_arg4 : UShort;
1348     isc_arg5 : PChar): ISC_STATUS;
1349     stdcall;
1350    
1351     (*********************************)
1352     (** Forms functions **)
1353     (*********************************)
1354    
1355     Tisc_compile_map = function (status_vector : PISC_STATUS;
1356     form_handle : PISC_FORM_HANDLE;
1357     request_handle : PISC_REQ_HANDLE;
1358     isc_arg4 : PShort;
1359     isc_arg5 : PChar): ISC_STATUS;
1360     stdcall;
1361    
1362     Tisc_compile_menu = function (status_vector : PISC_STATUS;
1363     form_handle : PISC_FORM_HANDLE;
1364     request_handle : PISC_REQ_HANDLE;
1365     isc_arg4 : PShort;
1366     isc_arg5 : PChar): ISC_STATUS;
1367     stdcall;
1368    
1369     Tisc_compile_sub_map = function (status_vector : PISC_STATUS;
1370     win_handle : PISC_WIN_HANDLE;
1371     request_handle : PISC_REQ_HANDLE;
1372     isc_arg4 : PShort;
1373     isc_arg5 : PChar): ISC_STATUS;
1374     stdcall;
1375    
1376     Tisc_create_window = function (status_vector : PISC_STATUS;
1377     win_handle : PISC_WIN_HANDLE;
1378     isc_arg3 : PShort;
1379     isc_arg4 : PChar;
1380     isc_arg5 : PShort;
1381     isc_arg6 : PShort): ISC_STATUS;
1382     stdcall;
1383    
1384     Tisc_delete_window = function (status_vector : PISC_STATUS;
1385     win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1386     stdcall;
1387    
1388     Tisc_drive_form = function (status_vector : PISC_STATUS;
1389     db_handle : PISC_DB_HANDLE;
1390     tran_handle : PISC_TR_HANDLE;
1391     win_handle : PISC_WIN_HANDLE;
1392     request_handle : PISC_REQ_HANDLE;
1393     isc_arg6 : PUChar;
1394     isc_arg7 : PUChar): ISC_STATUS;
1395     stdcall;
1396    
1397     Tisc_drive_menu = function (status_vector : PISC_STATUS;
1398     win_handle : PISC_WIN_HANDLE;
1399     request_handle : PISC_REQ_HANDLE;
1400     isc_arg4 : PShort;
1401     isc_arg5 : PChar;
1402     isc_arg6 : PShort;
1403     isc_arg7 : PChar;
1404     isc_arg8 : PShort;
1405     isc_arg9 : PShort;
1406     isc_arg10 : PChar;
1407     isc_arg11 : PISC_LONG): ISC_STATUS;
1408     stdcall;
1409    
1410     Tisc_form_delete = function (status_vector : PISC_STATUS;
1411     form_handle : PISC_FORM_HANDLE): ISC_STATUS;
1412     stdcall;
1413    
1414     Tisc_form_fetch = function (status_vector : PISC_STATUS;
1415     db_handle : PISC_DB_HANDLE;
1416     tran_handle : PISC_TR_HANDLE;
1417     request_handle : PISC_REQ_HANDLE;
1418     isc_arg5 : PUChar): ISC_STATUS;
1419     stdcall;
1420    
1421     Tisc_form_insert = function (status_vector : PISC_STATUS;
1422     db_handle : PISC_DB_HANDLE;
1423     tran_handle : PISC_TR_HANDLE;
1424     request_handle : PISC_REQ_HANDLE;
1425     isc_arg5 : PUChar): ISC_STATUS;
1426     stdcall;
1427    
1428     Tisc_get_entree = function (status_vector : PISC_STATUS;
1429     request_handle : PISC_REQ_HANDLE;
1430     isc_arg3 : PShort;
1431     isc_arg4 : PChar;
1432     isc_arg5 : PISC_LONG;
1433     isc_arg6 : PShort): ISC_STATUS;
1434     stdcall;
1435    
1436     Tisc_initialize_menu = function (status_vector : PISC_STATUS;
1437     request_handle : PISC_REQ_HANDLE): ISC_STATUS;
1438     stdcall;
1439    
1440     Tisc_menu = function (status_vector : PISC_STATUS;
1441     win_handle : PISC_WIN_HANDLE;
1442     request_handle : PISC_REQ_HANDLE;
1443     isc_arg4 : PShort;
1444     isc_arg5 : PChar): ISC_STATUS;
1445     stdcall;
1446    
1447     Tisc_load_form = function (status_vector : PISC_STATUS;
1448     db_handle : PISC_DB_HANDLE;
1449     tran_handle : PISC_TR_HANDLE;
1450     form_handle : PISC_FORM_HANDLE;
1451     isc_arg5 : PShort;
1452     isc_arg6 : PChar): ISC_STATUS;
1453     stdcall;
1454    
1455     Tisc_pop_window = function (status_vector : PISC_STATUS;
1456     win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1457     stdcall;
1458    
1459     Tisc_put_entree = function (status_vector : PISC_STATUS;
1460     request_handle : PISC_REQ_HANDLE;
1461     isc_arg3 : PShort;
1462     isc_arg4 : PChar;
1463     isc_arg5 : PISC_LONG): ISC_STATUS;
1464     stdcall;
1465    
1466     Tisc_reset_form = function (status_vector : PISC_STATUS;
1467     request_handle : PISC_REQ_HANDLE): ISC_STATUS;
1468     stdcall;
1469    
1470     Tisc_suspend_window = function (status_vector : PISC_STATUS;
1471     win_handle : PISC_WIN_HANDLE): ISC_STATUS;
1472     stdcall;
1473    
1474     (** Constants!!! **)
1475     (*****************************************************)
1476     (** Actions to pass to the blob filter (ctl_source) **)
1477     (*****************************************************)
1478    
1479     const
1480     isc_blob_filter_open = 0;
1481     isc_blob_filter_get_segment = 1;
1482     isc_blob_filter_close = 2;
1483     isc_blob_filter_create = 3;
1484     isc_blob_filter_put_segment = 4;
1485     isc_blob_filter_alloc = 5;
1486     isc_blob_filter_free = 6;
1487     isc_blob_filter_seek = 7;
1488    
1489     (*********************)
1490     (** Blr definitions **)
1491     (*********************)
1492    
1493     // In pascal, how does one deal with the below "#define"?
1494     // blr_word(n) ((n) % 256), ((n) / 256)
1495     blr_text = 14;
1496     blr_text2 = 15;
1497     blr_short = 7;
1498     blr_long = 8;
1499     blr_quad = 9;
1500     blr_float = 10;
1501     blr_double = 27;
1502     blr_d_float = 11;
1503     blr_timestamp = 35;
1504     blr_varying = 37;
1505     blr_varying2 = 38;
1506     blr_blob = 261;
1507     blr_cstring = 40;
1508     blr_cstring2 = 41;
1509     blr_blob_id = 45;
1510     blr_sql_date = 12;
1511     blr_sql_time = 13;
1512     blr_int64 = 16;
1513     blr_date = blr_timestamp;
1514    
1515    
1516     blr_inner = 0;
1517     blr_left = 1;
1518     blr_right = 2;
1519     blr_full = 3;
1520    
1521     blr_gds_code = 0;
1522     blr_sql_code = 1;
1523     blr_exception = 2;
1524     blr_trigger_code = 3;
1525     blr_default_code = 4;
1526    
1527     blr_version4 = 4;
1528     blr_version5 = 5;
1529     blr_eoc = 76;
1530     blr_end = -1;
1531    
1532     blr_assignment = 1;
1533     blr_begin = 2;
1534     blr_dcl_variable = 3;
1535     blr_message = 4;
1536     blr_erase = 5;
1537     blr_fetch = 6;
1538     blr_for = 7;
1539     blr_if = 8;
1540     blr_loop = 9;
1541     blr_modify = 10;
1542     blr_handler = 11;
1543     blr_receive = 12;
1544     blr_select = 13;
1545     blr_send = 14;
1546     blr_store = 15;
1547     blr_label = 17;
1548     blr_leave = 18;
1549     blr_store2 = 19;
1550     blr_post = 20;
1551    
1552     blr_literal = 21;
1553     blr_dbkey = 22;
1554     blr_field = 23;
1555     blr_fid = 24;
1556     blr_parameter = 25;
1557     blr_variable = 26;
1558     blr_average = 27;
1559     blr_count = 28;
1560     blr_maximum = 29;
1561     blr_minimum = 30;
1562     blr_total = 31;
1563     blr_add = 34;
1564     blr_subtract = 35;
1565     blr_multiply = 36;
1566     blr_divide = 37;
1567     blr_negate = 38;
1568     blr_concatenate = 39;
1569     blr_substring = 40;
1570     blr_parameter2 = 41;
1571     blr_from = 42;
1572     blr_via = 43;
1573     blr_user_name = 44;
1574     blr_null = 45;
1575    
1576     blr_eql = 47;
1577     blr_neq = 48;
1578     blr_gtr = 49;
1579     blr_geq = 50;
1580     blr_lss = 51;
1581     blr_leq = 52;
1582     blr_containing = 53;
1583     blr_matching = 54;
1584     blr_starting = 55;
1585     blr_between = 56;
1586     blr_or = 57;
1587     blr_and = 58;
1588     blr_not = 59;
1589     blr_any = 60;
1590     blr_missing = 61;
1591     blr_unique = 62;
1592     blr_like = 63;
1593    
1594     blr_stream = 65;
1595     blr_set_index = 66;
1596     blr_rse = 67;
1597     blr_first = 68;
1598     blr_project = 69;
1599     blr_sort = 70;
1600     blr_boolean = 71;
1601     blr_ascending = 72;
1602     blr_descending = 73;
1603     blr_relation = 74;
1604     blr_rid = 75;
1605     blr_union = 76;
1606     blr_map = 77;
1607     blr_group_by = 78;
1608     blr_aggregate = 79;
1609     blr_join_type = 80;
1610    
1611     blr_agg_count = 83;
1612     blr_agg_max = 84;
1613     blr_agg_min = 85;
1614     blr_agg_total = 86;
1615     blr_agg_average = 87;
1616     blr_parameter3 = 88;
1617     blr_run_count = 118;
1618     blr_run_max = 89;
1619     blr_run_min = 90;
1620     blr_run_total = 91;
1621     blr_run_average = 92;
1622     blr_agg_count2 = 93;
1623     blr_agg_count_distinct = 94;
1624     blr_agg_total_distinct = 95;
1625     blr_agg_average_distinct = 96;
1626    
1627     blr_function = 100;
1628     blr_gen_id = 101;
1629     blr_prot_mask = 102;
1630     blr_upcase = 103;
1631     blr_lock_state = 104;
1632     blr_value_if = 105;
1633     blr_matching2 = 106;
1634     blr_index = 107;
1635     blr_ansi_like = 108;
1636     blr_bookmark = 109;
1637     blr_crack = 110;
1638     blr_force_crack = 111;
1639     blr_seek = 112;
1640     blr_find = 113;
1641    
1642     blr_continue = 0;
1643     blr_forward = 1;
1644     blr_backward = 2;
1645     blr_bof_forward = 3;
1646     blr_eof_backward = 4;
1647    
1648     blr_lock_relation = 114;
1649     blr_lock_record = 115;
1650     blr_set_bookmark = 116;
1651     blr_get_bookmark = 117;
1652     blr_rs_stream = 119;
1653     blr_exec_proc = 120;
1654     blr_begin_range = 121;
1655     blr_end_range = 122;
1656     blr_delete_range = 123;
1657     blr_procedure = 124;
1658     blr_pid = 125;
1659     blr_exec_pid = 126;
1660     blr_singular = 127;
1661     blr_abort = 128;
1662     blr_block = 129;
1663     blr_error_handler = 130;
1664     blr_cast = 131;
1665     blr_release_lock = 132;
1666     blr_release_locks = 133;
1667     blr_start_savepoint = 134;
1668     blr_end_savepoint = 135;
1669     blr_find_dbkey = 136;
1670     blr_range_relation = 137;
1671     blr_delete_ranges = 138;
1672    
1673     blr_plan = 139;
1674     blr_merge = 140;
1675     blr_join = 141;
1676     blr_sequential = 142;
1677     blr_navigational = 143;
1678     blr_indices = 144;
1679     blr_retrieve = 145;
1680    
1681     blr_relation2 = 146;
1682     blr_rid2 = 147;
1683     blr_reset_stream = 148;
1684     blr_release_bookmark = 149;
1685     blr_set_generator = 150;
1686     blr_ansi_any = 151;
1687     blr_exists = 152;
1688     blr_cardinality = 153;
1689    
1690     blr_record_version = 154; (** get tid of record **)
1691     blr_stall = 155; (** fake server stall **)
1692     blr_seek_no_warn = 156;
1693     blr_find_dbkey_version = 157;
1694     blr_ansi_all = 158;
1695    
1696     blr_extract = 159;
1697    
1698     (* sub parameters for blr_extract *)
1699    
1700     blr_extract_year = 0;
1701     blr_extract_month = 1;
1702     blr_extract_day = 2;
1703     blr_extract_hour = 3;
1704     blr_extract_minute = 4;
1705     blr_extract_second = 5;
1706     blr_extract_weekday = 6;
1707     blr_extract_yearday = 7;
1708    
1709     blr_current_date = 160;
1710     blr_current_timestamp = 161;
1711     blr_current_time = 162;
1712    
1713     (* These verbs were added in 6.0,
1714     primarily to support 64-bit integers *)
1715    
1716     blr_add2 = 163;
1717     blr_subtract2 = 164;
1718     blr_multiply2 = 165;
1719     blr_divide2 = 166;
1720     blr_agg_total2 = 167;
1721     blr_agg_total_distinct2 = 168;
1722     blr_agg_average2 = 169;
1723     blr_agg_average_distinct2 = 170;
1724     blr_average2 = 171;
1725     blr_gen_id2 = 172;
1726     blr_set_generator2 = 173;
1727    
1728     (************************************)
1729     (** Database parameter block stuff **)
1730     (************************************)
1731    
1732     isc_dpb_version1 = 1;
1733     isc_dpb_cdd_pathname = 1;
1734     isc_dpb_allocation = 2;
1735     isc_dpb_journal = 3;
1736     isc_dpb_page_size = 4;
1737     isc_dpb_num_buffers = 5;
1738     isc_dpb_buffer_length = 6;
1739     isc_dpb_debug = 7;
1740     isc_dpb_garbage_collect = 8;
1741     isc_dpb_verify = 9;
1742     isc_dpb_sweep = 10;
1743     isc_dpb_enable_journal = 11;
1744     isc_dpb_disable_journal = 12;
1745     isc_dpb_dbkey_scope = 13;
1746     isc_dpb_number_of_users = 14;
1747     isc_dpb_trace = 15;
1748     isc_dpb_no_garbage_collect = 16;
1749     isc_dpb_damaged = 17;
1750     isc_dpb_license = 18;
1751     isc_dpb_sys_user_name = 19;
1752     isc_dpb_encrypt_key = 20;
1753     isc_dpb_activate_shadow = 21;
1754     isc_dpb_sweep_interval = 22;
1755     isc_dpb_delete_shadow = 23;
1756     isc_dpb_force_write = 24;
1757     isc_dpb_begin_log = 25;
1758     isc_dpb_quit_log = 26;
1759     isc_dpb_no_reserve = 27;
1760     isc_dpb_user_name = 28;
1761     isc_dpb_password = 29;
1762     isc_dpb_password_enc = 30;
1763     isc_dpb_sys_user_name_enc = 31;
1764     isc_dpb_interp = 32;
1765     isc_dpb_online_dump = 33;
1766     isc_dpb_old_file_size = 34;
1767     isc_dpb_old_num_files = 35;
1768     isc_dpb_old_file = 36;
1769     isc_dpb_old_start_page = 37;
1770     isc_dpb_old_start_seqno = 38;
1771     isc_dpb_old_start_file = 39;
1772     isc_dpb_drop_walfile = 40;
1773     isc_dpb_old_dump_id = 41;
1774     isc_dpb_wal_backup_dir = 42;
1775     isc_dpb_wal_chkptlen = 43;
1776     isc_dpb_wal_numbufs = 44;
1777     isc_dpb_wal_bufsize = 45;
1778     isc_dpb_wal_grp_cmt_wait = 46;
1779     isc_dpb_lc_messages = 47;
1780     isc_dpb_lc_ctype = 48;
1781     isc_dpb_cache_manager = 49;
1782     isc_dpb_shutdown = 50;
1783     isc_dpb_online = 51;
1784     isc_dpb_shutdown_delay = 52;
1785     isc_dpb_reserved = 53;
1786     isc_dpb_overwrite = 54;
1787     isc_dpb_sec_attach = 55;
1788     isc_dpb_disable_wal = 56;
1789     isc_dpb_connect_timeout = 57;
1790     isc_dpb_dummy_packet_interval = 58;
1791     isc_dpb_gbak_attach = 59;
1792     isc_dpb_sql_role_name = 60;
1793     isc_dpb_set_page_buffers = 61;
1794     isc_dpb_working_directory = 62;
1795     isc_dpb_SQL_dialect = 63;
1796     isc_dpb_set_db_readonly = 64;
1797     isc_dpb_set_db_SQL_dialect = 65;
1798     isc_dpb_gfix_attach = 66;
1799     isc_dpb_gstat_attach = 67;
1800     isc_dpb_last_dpb_constant = isc_dpb_gstat_attach;
1801    
1802    
1803     (***********************************)
1804     (** isc_dpb_verify specific flags **)
1805     (***********************************)
1806    
1807     isc_dpb_pages = 1;
1808     isc_dpb_records = 2;
1809     isc_dpb_indices = 4;
1810     isc_dpb_transactions = 8;
1811     isc_dpb_no_update = 16;
1812     isc_dpb_repair = 32;
1813     isc_dpb_ignore = 64;
1814    
1815     (*************************************)
1816     (** isc_dpb_shutdown specific flags **)
1817     (*************************************)
1818    
1819     isc_dpb_shut_cache = 1;
1820     isc_dpb_shut_attachment = 2;
1821     isc_dpb_shut_transaction = 4;
1822     isc_dpb_shut_force = 8;
1823    
1824     (****************************************)
1825     (** Bit assignments in RDB$SYSTEM_FLAG **)
1826     (****************************************)
1827    
1828     RDB_system = 1;
1829     RDB_id_assigned = 2;
1830    
1831    
1832     (***************************************)
1833     (** Transaction parameter block stuff **)
1834     (***************************************)
1835    
1836     isc_tpb_version1 = 1;
1837     isc_tpb_version3 = 3;
1838     isc_tpb_consistency = 1;
1839     isc_tpb_concurrency = 2;
1840     isc_tpb_shared = 3;
1841     isc_tpb_protected = 4;
1842     isc_tpb_exclusive = 5;
1843     isc_tpb_wait = 6;
1844     isc_tpb_nowait = 7;
1845     isc_tpb_read = 8;
1846     isc_tpb_write = 9;
1847     isc_tpb_lock_read = 10;
1848     isc_tpb_lock_write = 11;
1849     isc_tpb_verb_time = 12;
1850     isc_tpb_commit_time = 13;
1851     isc_tpb_ignore_limbo = 14;
1852     isc_tpb_read_committed = 15;
1853     isc_tpb_autocommit = 16;
1854     isc_tpb_rec_version = 17;
1855     isc_tpb_no_rec_version = 18;
1856     isc_tpb_restart_requests = 19;
1857     isc_tpb_no_auto_undo = 20;
1858     isc_tpb_last_tpb_constant = isc_tpb_no_auto_undo;
1859    
1860    
1861     (**************************)
1862     (** Blob Parameter Block **)
1863     (**************************)
1864    
1865     isc_bpb_version1 = 1;
1866     isc_bpb_source_type = 1;
1867     isc_bpb_target_type = 2;
1868     isc_bpb_type = 3;
1869     isc_bpb_source_interp = 4;
1870     isc_bpb_target_interp = 5;
1871     isc_bpb_filter_parameter = 6;
1872    
1873     isc_bpb_type_segmented = 0;
1874     isc_bpb_type_stream = 1;
1875    
1876    
1877     (***********************************)
1878     (** Service parameter block stuff **)
1879     (***********************************)
1880    
1881     isc_spb_user_name = 1;
1882     isc_spb_sys_user_name = 2;
1883     isc_spb_sys_user_name_enc = 3;
1884     isc_spb_password = 4;
1885     isc_spb_password_enc = 5;
1886     isc_spb_command_line = 6;
1887     isc_spb_dbname = 7;
1888     isc_spb_verbose = 8;
1889     isc_spb_options = 9;
1890     isc_spb_connect_timeout = 10;
1891     isc_spb_dummy_packet_interval = 11;
1892     isc_spb_sql_role_name = 12;
1893     isc_spb_last_spb_constant = isc_spb_sql_role_name;
1894    
1895     isc_spb_version1 = 1;
1896     isc_spb_current_version = 2;
1897     isc_spb_version = isc_spb_current_version;
1898     isc_spb_user_name_mapped_to_server = isc_dpb_user_name;
1899     isc_spb_sys_user_name_mapped_to_server = isc_dpb_sys_user_name;
1900     isc_spb_sys_user_name_enc_mapped_to_server = isc_dpb_sys_user_name_enc;
1901     isc_spb_password_mapped_to_server = isc_dpb_password;
1902     isc_spb_password_enc_mapped_to_server = isc_dpb_password_enc;
1903     isc_spb_command_line_mapped_to_server = 105;
1904     isc_spb_dbname_mapped_to_server = 106;
1905     isc_spb_verbose_mapped_to_server = 107;
1906     isc_spb_options_mapped_to_server = 108;
1907     isc_spb_connect_timeout_mapped_to_server = isc_dpb_connect_timeout;
1908     isc_spb_dummy_packet_interval_mapped_to_server = isc_dpb_dummy_packet_interval;
1909     isc_spb_sql_role_name_mapped_to_server = isc_dpb_sql_role_name;
1910    
1911     (***********************************)
1912     (** Information call declarations **)
1913     (***********************************)
1914    
1915     (******************************)
1916     (** Common, structural codes **)
1917     (******************************)
1918    
1919     isc_info_end = 1;
1920     isc_info_truncated = 2;
1921     isc_info_error = 3;
1922     isc_info_data_not_ready = 4;
1923     isc_info_flag_end = 127;
1924    
1925     (********************************)
1926     (** Database information items **)
1927     (********************************)
1928    
1929     isc_info_db_id = 4;
1930     isc_info_reads = 5;
1931     isc_info_writes = 6;
1932     isc_info_fetches = 7;
1933     isc_info_marks = 8;
1934     isc_info_implementation = 11;
1935     isc_info_version = 12;
1936     isc_info_base_level = 13;
1937     isc_info_page_size = 14;
1938     isc_info_num_buffers = 15;
1939     isc_info_limbo = 16;
1940     isc_info_current_memory = 17;
1941     isc_info_max_memory = 18;
1942     isc_info_window_turns = 19;
1943     isc_info_license = 20;
1944     isc_info_allocation = 21;
1945     isc_info_attachment_id = 22;
1946     isc_info_read_seq_count = 23;
1947     isc_info_read_idx_count = 24;
1948     isc_info_insert_count = 25;
1949     isc_info_update_count = 26;
1950     isc_info_delete_count = 27;
1951     isc_info_backout_count = 28;
1952     isc_info_purge_count = 29;
1953     isc_info_expunge_count = 30;
1954     isc_info_sweep_interval = 31;
1955     isc_info_ods_version = 32;
1956     isc_info_ods_minor_version = 33;
1957     isc_info_no_reserve = 34;
1958     isc_info_logfile = 35;
1959     isc_info_cur_logfile_name = 36;
1960     isc_info_cur_log_part_offset = 37;
1961     isc_info_num_wal_buffers = 38;
1962     isc_info_wal_buffer_size = 39;
1963     isc_info_wal_ckpt_length = 40;
1964     isc_info_wal_cur_ckpt_interval = 41;
1965     isc_info_wal_prv_ckpt_fname = 42;
1966     isc_info_wal_prv_ckpt_poffset = 43;
1967     isc_info_wal_recv_ckpt_fname = 44;
1968     isc_info_wal_recv_ckpt_poffset = 45;
1969     isc_info_wal_grpc_wait_usecs = 47;
1970     isc_info_wal_num_io = 48;
1971     isc_info_wal_avg_io_size = 49;
1972     isc_info_wal_num_commits = 50;
1973     isc_info_wal_avg_grpc_size = 51;
1974     isc_info_forced_writes = 52;
1975     isc_info_user_names = 53;
1976     isc_info_page_errors = 54;
1977     isc_info_record_errors = 55;
1978     isc_info_bpage_errors = 56;
1979     isc_info_dpage_errors = 57;
1980     isc_info_ipage_errors = 58;
1981     isc_info_ppage_errors = 59;
1982     isc_info_tpage_errors = 60;
1983     isc_info_set_page_buffers = 61;
1984     isc_info_db_SQL_dialect = 62;
1985     isc_info_db_read_only = 63;
1986     isc_info_db_size_in_pages = 64;
1987    
1988     (****************************************)
1989     (** Database information return values **)
1990     (****************************************)
1991    
1992     isc_info_db_impl_rdb_vms = 1;
1993     isc_info_db_impl_rdb_eln = 2;
1994     isc_info_db_impl_rdb_eln_dev = 3;
1995     isc_info_db_impl_rdb_vms_y = 4;
1996     isc_info_db_impl_rdb_eln_y = 5;
1997     isc_info_db_impl_jri = 6;
1998     isc_info_db_impl_jsv = 7;
1999     isc_info_db_impl_isc_a = 25;
2000     isc_info_db_impl_isc_u = 26;
2001     isc_info_db_impl_isc_v = 27;
2002     isc_info_db_impl_isc_s = 28;
2003     isc_info_db_impl_isc_apl_68K = 25;
2004     isc_info_db_impl_isc_vax_ultr = 26;
2005     isc_info_db_impl_isc_vms = 27;
2006     isc_info_db_impl_isc_sun_68k = 28;
2007     isc_info_db_impl_isc_os2 = 29;
2008     isc_info_db_impl_isc_sun4 = 30;
2009     isc_info_db_impl_isc_hp_ux = 31;
2010     isc_info_db_impl_isc_sun_386i = 32;
2011     isc_info_db_impl_isc_vms_orcl = 33;
2012     isc_info_db_impl_isc_mac_aux = 34;
2013     isc_info_db_impl_isc_rt_aix = 35;
2014     isc_info_db_impl_isc_mips_ult = 36;
2015     isc_info_db_impl_isc_xenix = 37;
2016     isc_info_db_impl_isc_dg = 38;
2017     isc_info_db_impl_isc_hp_mpexl = 39;
2018     isc_info_db_impl_isc_hp_ux68K = 40;
2019     isc_info_db_impl_isc_sgi = 41;
2020     isc_info_db_impl_isc_sco_unix = 42;
2021     isc_info_db_impl_isc_cray = 43;
2022     isc_info_db_impl_isc_imp = 44;
2023     isc_info_db_impl_isc_delta = 45;
2024     isc_info_db_impl_isc_next = 46;
2025     isc_info_db_impl_isc_dos = 47;
2026     isc_info_db_impl_isc_winnt = 48;
2027     isc_info_db_impl_isc_epson = 49;
2028    
2029     isc_info_db_class_access = 1;
2030     isc_info_db_class_y_valve = 2;
2031     isc_info_db_class_rem_int = 3;
2032     isc_info_db_class_rem_srvr = 4;
2033     isc_info_db_class_pipe_int = 7;
2034     isc_info_db_class_pipe_srvr = 8;
2035     isc_info_db_class_sam_int = 9;
2036     isc_info_db_class_sam_srvr = 10;
2037     isc_info_db_class_gateway = 11;
2038     isc_info_db_class_cache = 12;
2039    
2040     (*******************************)
2041     (** Request information items **)
2042     (*******************************)
2043    
2044     isc_info_number_messages = 4;
2045     isc_info_max_message = 5;
2046     isc_info_max_send = 6;
2047     isc_info_max_receive = 7;
2048     isc_info_state = 8;
2049     isc_info_message_number = 9;
2050     isc_info_message_size = 10;
2051     isc_info_request_cost = 11;
2052     isc_info_access_path = 12;
2053     isc_info_req_select_count = 13;
2054     isc_info_req_insert_count = 14;
2055     isc_info_req_update_count = 15;
2056     isc_info_req_delete_count = 16;
2057    
2058    
2059     (***********************)
2060     (** Access path items **)
2061     (***********************)
2062    
2063     isc_info_rsb_end = 0;
2064     isc_info_rsb_begin = 1;
2065     isc_info_rsb_type = 2;
2066     isc_info_rsb_relation = 3;
2067     isc_info_rsb_plan = 4;
2068    
2069     (***************)
2070     (** Rsb types **)
2071     (***************)
2072    
2073     isc_info_rsb_unknown = 1;
2074     isc_info_rsb_indexed = 2;
2075     isc_info_rsb_navigate = 3;
2076     isc_info_rsb_sequential = 4;
2077     isc_info_rsb_cross = 5;
2078     isc_info_rsb_sort = 6;
2079     isc_info_rsb_first = 7;
2080     isc_info_rsb_boolean = 8;
2081     isc_info_rsb_union = 9;
2082     isc_info_rsb_aggregate = 10;
2083     isc_info_rsb_merge = 11;
2084     isc_info_rsb_ext_sequential = 12;
2085     isc_info_rsb_ext_indexed = 13;
2086     isc_info_rsb_ext_dbkey = 14;
2087     isc_info_rsb_left_cross = 15;
2088     isc_info_rsb_select = 16;
2089     isc_info_rsb_sql_join = 17;
2090     isc_info_rsb_simulate = 18;
2091     isc_info_rsb_sim_cross = 19;
2092     isc_info_rsb_once = 20;
2093     isc_info_rsb_procedure = 21;
2094    
2095     (************************)
2096     (** Bitmap expressions **)
2097     (************************)
2098    
2099     isc_info_rsb_and = 1;
2100     isc_info_rsb_or = 2;
2101     isc_info_rsb_dbkey = 3;
2102     isc_info_rsb_index = 4;
2103    
2104     isc_info_req_active = 2;
2105     isc_info_req_inactive = 3;
2106     isc_info_req_send = 4;
2107     isc_info_req_receive = 5;
2108     isc_info_req_select = 6;
2109     isc_info_req_sql_stall = 7;
2110    
2111     (****************************)
2112     (** Blob information items **)
2113     (****************************)
2114    
2115     isc_info_blob_num_segments = 4;
2116     isc_info_blob_max_segment = 5;
2117     isc_info_blob_total_length = 6;
2118     isc_info_blob_type = 7;
2119    
2120     (***********************************)
2121     (** Transaction information items **)
2122     (***********************************)
2123    
2124     isc_info_tra_id = 4;
2125    
2126     (*******************************)
2127     (** Service information items **)
2128     (*******************************)
2129    
2130     {$IFDEF IB5_ONLY }
2131     (* This defines are not there in version 6.0 *)
2132     { isc_info_svc_version = 4;
2133     isc_info_svc_message = 5;
2134     isc_info_svc_total_length = 6;
2135     isc_info_svc_response = 7;
2136     isc_info_svc_response_more = 8;
2137     isc_info_svc_line = 9;
2138     isc_info_svc_to_eof = 10;
2139     isc_info_svc_timeout = 11;
2140     isc_info_svc_server_version = 12;
2141     isc_info_svc_implementation = 13;
2142     isc_info_svc_capabilities = 14;
2143     isc_info_svc_user_dbpath = 15;
2144     isc_info_svc_svr_db_info = 16;
2145     isc_info_svc_svr_online = 17;
2146     isc_info_svc_svr_offline = 18;
2147     isc_info_svc_get_config = 19;
2148     isc_info_svc_set_config = 20;
2149     isc_info_svc_default_config = 21;
2150     isc_info_svc_get_env = 22;
2151     isc_info_svc_get_env_lock = 23;
2152     isc_info_svc_get_env_msg = 24; }
2153     {$ENDIF}
2154    
2155     (*****************************************)
2156     (* Service action items **)
2157     (*****************************************)
2158    
2159     isc_action_svc_backup = 1; (* Starts database backup process on the server *)
2160     isc_action_svc_restore = 2; (* Starts database restore process on the server *)
2161     isc_action_svc_repair = 3; (* Starts database repair process on the server *)
2162     isc_action_svc_add_user = 4; (* Adds a new user to the security database *)
2163     isc_action_svc_delete_user = 5; (* Deletes a user record from the security database *)
2164     isc_action_svc_modify_user = 6; (* Modifies a user record in the security database *)
2165     isc_action_svc_display_user = 7; (* Displays a user record from the security database *)
2166     isc_action_svc_properties = 8; (* Sets database properties *)
2167     isc_action_svc_add_license = 9; (* Adds a license to the license file *)
2168     isc_action_svc_remove_license = 10; (* Removes a license from the license file *)
2169     isc_action_svc_db_stats = 11; (* Retrieves database statistics *)
2170     isc_action_svc_get_ib_log = 12; (* Retrieves the InterBase log file from the server *)
2171    
2172     (*****************************************)
2173     (** Service information items **)
2174     (*****************************************)
2175    
2176     isc_info_svc_svr_db_info = 50; (* Retrieves the number of attachments and databases *)
2177     isc_info_svc_get_license = 51; (* Retrieves all license keys and IDs from the license file *)
2178     isc_info_svc_get_license_mask = 52; (* Retrieves a bitmask representing licensed options on the server *)
2179     isc_info_svc_get_config = 53; (* Retrieves the parameters and values for IB_CONFIG *)
2180     isc_info_svc_version = 54; (* Retrieves the version of the services manager *)
2181     isc_info_svc_server_version = 55;(* Retrieves the version of the InterBase server *)
2182     isc_info_svc_implementation = 56; (* Retrieves the implementation of the InterBase server *)
2183     isc_info_svc_capabilities = 57; (* Retrieves a bitmask representing the server's capabilities *)
2184     isc_info_svc_user_dbpath = 58; (* Retrieves the path to the security database in use by the server *)
2185     isc_info_svc_get_env = 59; (* Retrieves the setting of $INTERBASE *)
2186     isc_info_svc_get_env_lock = 60; (* Retrieves the setting of $INTERBASE_LCK *)
2187     isc_info_svc_get_env_msg = 61; (* Retrieves the setting of $INTERBASE_MSG *)
2188     isc_info_svc_line = 62; (* Retrieves 1 line of service output per call *)
2189     isc_info_svc_to_eof = 63; (* Retrieves as much of the server output as will fit in the supplied buffer *)
2190     isc_info_svc_timeout = 64; (* Sets / signifies a timeout value for reading service information *)
2191     isc_info_svc_get_licensed_users = 65; (* Retrieves the number of users licensed for accessing the server *)
2192     isc_info_svc_limbo_trans = 66; (* Retrieve the limbo transactions *)
2193     isc_info_svc_running = 67; (* Checks to see if a service is running on an attachment *)
2194     isc_info_svc_get_users = 68; (* Returns the user information from isc_action_svc_display_users *)
2195    
2196     (*****************************************)
2197     (* Parameters for isc_action_{add|delete|modify)_user *)
2198     (*****************************************)
2199    
2200     isc_spb_sec_userid = 5;
2201     isc_spb_sec_groupid = 6;
2202     isc_spb_sec_username = 7;
2203     isc_spb_sec_password = 8;
2204     isc_spb_sec_groupname = 9;
2205     isc_spb_sec_firstname = 10;
2206     isc_spb_sec_middlename = 11;
2207     isc_spb_sec_lastname = 12;
2208    
2209     (*****************************************)
2210     (* Parameters for isc_action_svc_(add|remove)_license, *)
2211     (* isc_info_svc_get_license *)
2212     (*****************************************)
2213    
2214     isc_spb_lic_key = 5;
2215     isc_spb_lic_id = 6;
2216     isc_spb_lic_desc = 7;
2217    
2218    
2219     (*****************************************)
2220     (* Parameters for isc_action_svc_backup *)
2221     (*****************************************)
2222    
2223     isc_spb_bkp_file = 5;
2224     isc_spb_bkp_factor = 6;
2225     isc_spb_bkp_length = 7;
2226     isc_spb_bkp_ignore_checksums = $01;
2227     isc_spb_bkp_ignore_limbo = $02;
2228     isc_spb_bkp_metadata_only = $04;
2229     isc_spb_bkp_no_garbage_collect = $08;
2230     isc_spb_bkp_old_descriptions = $10;
2231     isc_spb_bkp_non_transportable = $20;
2232     isc_spb_bkp_convert = $40;
2233     isc_spb_bkp_expand = $80;
2234    
2235     (*****************************************)
2236     (* Parameters for isc_action_svc_properties *)
2237     (*****************************************)
2238    
2239     isc_spb_prp_page_buffers = 5;
2240     isc_spb_prp_sweep_interval = 6;
2241     isc_spb_prp_shutdown_db = 7;
2242     isc_spb_prp_deny_new_attachments = 9;
2243     isc_spb_prp_deny_new_transactions = 10;
2244     isc_spb_prp_reserve_space = 11;
2245     isc_spb_prp_write_mode = 12;
2246     isc_spb_prp_access_mode = 13;
2247     isc_spb_prp_set_sql_dialect = 14;
2248     isc_spb_prp_activate = $0100;
2249     isc_spb_prp_db_online = $0200;
2250    
2251     (*****************************************)
2252     (* Parameters for isc_spb_prp_reserve_space *)
2253     (*****************************************)
2254    
2255     isc_spb_prp_res_use_full = 35;
2256     isc_spb_prp_res = 36;
2257    
2258     (*****************************************)
2259     (* Parameters for isc_spb_prp_write_mode *)
2260     (*****************************************)
2261    
2262     isc_spb_prp_wm_async = 37;
2263     isc_spb_prp_wm_sync = 38;
2264    
2265     (*****************************************)
2266     (* Parameters for isc_spb_prp_access_mode *)
2267     (*****************************************)
2268    
2269     isc_spb_prp_am_readonly = 39;
2270     isc_spb_prp_am_readwrite = 40;
2271    
2272     (*****************************************)
2273     (* Parameters for isc_action_svc_repair *)
2274     (*****************************************)
2275    
2276     isc_spb_rpr_commit_trans = 15;
2277     isc_spb_rpr_rollback_trans = 34;
2278     isc_spb_rpr_recover_two_phase = 17;
2279     isc_spb_tra_id = 18;
2280     isc_spb_single_tra_id = 19;
2281     isc_spb_multi_tra_id = 20;
2282     isc_spb_tra_state = 21;
2283     isc_spb_tra_state_limbo = 22;
2284     isc_spb_tra_state_commit = 23;
2285     isc_spb_tra_state_rollback = 24;
2286     isc_spb_tra_state_unknown = 25;
2287     isc_spb_tra_host_site = 26;
2288     isc_spb_tra_remote_site = 27;
2289     isc_spb_tra_db_path = 28;
2290     isc_spb_tra_advise = 29;
2291     isc_spb_tra_advise_commit = 30;
2292     isc_spb_tra_advise_rollback = 31;
2293     isc_spb_tra_advise_unknown = 33;
2294     isc_spb_rpr_validate_db = $01;
2295     isc_spb_rpr_sweep_db = $02;
2296     isc_spb_rpr_mend_db = $04;
2297     isc_spb_rpr_list_limbo_trans = $08;
2298     isc_spb_rpr_check_db = $10;
2299     isc_spb_rpr_ignore_checksum = $20;
2300     isc_spb_rpr_kill_shadows = $40;
2301     isc_spb_rpr_full = $80;
2302    
2303     (*****************************************)
2304     (* Parameters for isc_action_svc_restore *)
2305     (*****************************************)
2306    
2307     isc_spb_res_buffers = 9;
2308     isc_spb_res_page_size = 10;
2309     isc_spb_res_length = 11;
2310     isc_spb_res_access_mode = 12;
2311     isc_spb_res_deactivate_idx = $0100;
2312     isc_spb_res_no_shadow = $0200;
2313     isc_spb_res_no_validity = $0400;
2314     isc_spb_res_one_at_a_time = $0800;
2315     isc_spb_res_replace = $1000;
2316     isc_spb_res_create = $2000;
2317     isc_spb_res_use_all_space = $4000;
2318    
2319     (*****************************************)
2320     (* Parameters for isc_spb_res_access_mode *)
2321     (*****************************************)
2322    
2323     isc_spb_res_am_readonly = isc_spb_prp_am_readonly;
2324     isc_spb_res_am_readwrite = isc_spb_prp_am_readwrite;
2325    
2326     (*****************************************)
2327     (* Parameters for isc_info_svc_svr_db_info *)
2328     (*****************************************)
2329    
2330     isc_spb_num_att = 5;
2331     isc_spb_num_db = 6;
2332    
2333     (*****************************************)
2334     (* Parameters for isc_info_svc_db_stats *)
2335     (*****************************************)
2336    
2337     isc_spb_sts_data_pages = $01;
2338     isc_spb_sts_db_log = $02;
2339     isc_spb_sts_hdr_pages = $04;
2340     isc_spb_sts_idx_pages = $08;
2341     isc_spb_sts_sys_relations = $10;
2342    
2343    
2344     (***************************)
2345     (** SQL information items **)
2346     (***************************)
2347    
2348     isc_info_sql_select = 4;
2349     isc_info_sql_bind = 5;
2350     isc_info_sql_num_variables = 6;
2351     isc_info_sql_describe_vars = 7;
2352     isc_info_sql_describe_end = 8;
2353     isc_info_sql_sqlda_seq = 9;
2354     isc_info_sql_message_seq = 10;
2355     isc_info_sql_type = 11;
2356     isc_info_sql_sub_type = 12;
2357     isc_info_sql_scale = 13;
2358     isc_info_sql_length = 14;
2359     isc_info_sql_null_ind = 15;
2360     isc_info_sql_field = 16;
2361     isc_info_sql_relation = 17;
2362     isc_info_sql_owner = 18;
2363     isc_info_sql_alias = 19;
2364     isc_info_sql_sqlda_start = 20;
2365     isc_info_sql_stmt_type = 21;
2366     isc_info_sql_get_plan = 22;
2367     isc_info_sql_records = 23;
2368     isc_info_sql_batch_fetch = 24;
2369    
2370     (***********************************)
2371     (** SQL information return values **)
2372     (***********************************)
2373    
2374     isc_info_sql_stmt_select = 1;
2375     isc_info_sql_stmt_insert = 2;
2376     isc_info_sql_stmt_update = 3;
2377     isc_info_sql_stmt_delete = 4;
2378     isc_info_sql_stmt_ddl = 5;
2379     isc_info_sql_stmt_get_segment = 6;
2380     isc_info_sql_stmt_put_segment = 7;
2381     isc_info_sql_stmt_exec_procedure = 8;
2382     isc_info_sql_stmt_start_trans = 9;
2383     isc_info_sql_stmt_commit = 10;
2384     isc_info_sql_stmt_rollback = 11;
2385     isc_info_sql_stmt_select_for_upd = 12;
2386     isc_info_sql_stmt_set_generator = 13;
2387    
2388    
2389     (*************************************)
2390     (** Server configuration key values **)
2391     (*************************************)
2392    
2393     ISCCFG_LOCKMEM_KEY = 0;
2394     ISCCFG_LOCKSEM_KEY = 1;
2395     ISCCFG_LOCKSIG_KEY = 2;
2396     ISCCFG_EVNTMEM_KEY = 3;
2397     ISCCFG_DBCACHE_KEY = 4;
2398     ISCCFG_PRIORITY_KEY = 5;
2399     ISCCFG_IPCMAP_KEY = 6;
2400     ISCCFG_MEMMIN_KEY = 7;
2401     ISCCFG_MEMMAX_KEY = 8;
2402     ISCCFG_LOCKORDER_KEY = 9;
2403     ISCCFG_ANYLOCKMEM_KEY = 10;
2404     ISCCFG_ANYLOCKSEM_KEY = 11;
2405     ISCCFG_ANYLOCKSIG_KEY = 12;
2406     ISCCFG_ANYEVNTMEM_KEY = 13;
2407     ISCCFG_LOCKHASH_KEY = 14;
2408     ISCCFG_DEADLOCK_KEY = 15;
2409     ISCCFG_LOCKSPIN_KEY = 16;
2410     ISCCFG_CONN_TIMEOUT_KEY = 17;
2411     ISCCFG_DUMMY_INTRVL_KEY = 18;
2412    
2413    
2414     (*****************)
2415     (** Error codes **)
2416     (*****************)
2417    
2418     isc_facility = 20;
2419     isc_err_base = 335544320;
2420     isc_err_factor = 1;
2421     isc_arg_end = 0;
2422     isc_arg_gds = 1;
2423     isc_arg_string = 2;
2424     isc_arg_cstring = 3;
2425     isc_arg_number = 4;
2426     isc_arg_interpreted = 5;
2427     isc_arg_vms = 6;
2428     isc_arg_unix = 7;
2429     isc_arg_domain = 8;
2430     isc_arg_dos = 9;
2431     isc_arg_mpexl = 10;
2432     isc_arg_mpexl_ipc = 11;
2433     isc_arg_next_mach = 15;
2434     isc_arg_netware = 16;
2435     isc_arg_win32 = 17;
2436     isc_arg_warning = 18;
2437    
2438     (************************************************)
2439     (** Dynamic Data Definition Language operators **)
2440     (************************************************)
2441    
2442     (********************)
2443     (** Version number **)
2444     (********************)
2445    
2446     isc_dyn_version_1 = 1;
2447     isc_dyn_eoc = -1;
2448    
2449     (********************************)
2450     (** Operations (may be nested) **)
2451     (********************************)
2452    
2453     isc_dyn_begin = 2;
2454     isc_dyn_end = 3;
2455     isc_dyn_if = 4;
2456     isc_dyn_def_database = 5;
2457     isc_dyn_def_global_fld = 6;
2458     isc_dyn_def_local_fld = 7;
2459     isc_dyn_def_idx = 8;
2460     isc_dyn_def_rel = 9;
2461     isc_dyn_def_sql_fld = 10;
2462     isc_dyn_def_view = 12;
2463     isc_dyn_def_trigger = 15;
2464     isc_dyn_def_security_class = 120;
2465     isc_dyn_def_dimension = 140;
2466     isc_dyn_def_generator = 24;
2467     isc_dyn_def_function = 25;
2468     isc_dyn_def_filter = 26;
2469     isc_dyn_def_function_arg = 27;
2470     isc_dyn_def_shadow = 34;
2471     isc_dyn_def_trigger_msg = 17;
2472     isc_dyn_def_file = 36;
2473     isc_dyn_mod_database = 39;
2474     isc_dyn_mod_rel = 11;
2475     isc_dyn_mod_global_fld = 13;
2476     isc_dyn_mod_idx = 102;
2477     isc_dyn_mod_local_fld = 14;
2478     isc_dyn_mod_sql_fld = 216;
2479     isc_dyn_mod_view = 16;
2480     isc_dyn_mod_security_class = 122;
2481     isc_dyn_mod_trigger = 113;
2482     isc_dyn_mod_trigger_msg = 28;
2483     isc_dyn_delete_database = 18;
2484     isc_dyn_delete_rel = 19;
2485     isc_dyn_delete_global_fld = 20;
2486     isc_dyn_delete_local_fld = 21;
2487     isc_dyn_delete_idx = 22;
2488     isc_dyn_delete_security_class = 123;
2489     isc_dyn_delete_dimensions = 143;
2490     isc_dyn_delete_trigger = 23;
2491     isc_dyn_delete_trigger_msg = 29;
2492     isc_dyn_delete_filter = 32;
2493     isc_dyn_delete_function = 33;
2494     isc_dyn_delete_shadow = 35;
2495     isc_dyn_grant = 30;
2496     isc_dyn_revoke = 31;
2497     isc_dyn_def_primary_key = 37;
2498     isc_dyn_def_foreign_key = 38;
2499     isc_dyn_def_unique = 40;
2500     isc_dyn_def_procedure = 164;
2501     isc_dyn_delete_procedure = 165;
2502     isc_dyn_def_parameter = 135;
2503     isc_dyn_delete_parameter = 136;
2504     isc_dyn_mod_procedure = 175;
2505     isc_dyn_def_log_file = 176;
2506     isc_dyn_def_cache_file = 180;
2507     isc_dyn_def_exception = 181;
2508     isc_dyn_mod_exception = 182;
2509     isc_dyn_del_exception = 183;
2510     isc_dyn_drop_log = 194;
2511     isc_dyn_drop_cache = 195;
2512     isc_dyn_def_default_log = 202;
2513    
2514     (*************************)
2515     (** View specific stuff **)
2516     (*************************)
2517    
2518     isc_dyn_view_blr = 43;
2519     isc_dyn_view_source = 44;
2520     isc_dyn_view_relation = 45;
2521     isc_dyn_view_context = 46;
2522     isc_dyn_view_context_name = 47;
2523    
2524     (************************)
2525     (** Generic attributes **)
2526     (************************)
2527    
2528     isc_dyn_rel_name = 50;
2529     isc_dyn_fld_name = 51;
2530     isc_dyn_new_fld_name = 215;
2531     isc_dyn_idx_name = 52;
2532     isc_dyn_description = 53;
2533     isc_dyn_security_class = 54;
2534     isc_dyn_system_flag = 55;
2535     isc_dyn_update_flag = 56;
2536     isc_dyn_prc_name = 166;
2537     isc_dyn_prm_name = 137;
2538     isc_dyn_sql_object = 196;
2539     isc_dyn_fld_character_set_name = 174;
2540    
2541     (**********************************)
2542     (** Relation specific attributes **)
2543     (**********************************)
2544    
2545     isc_dyn_rel_dbkey_length = 61;
2546     isc_dyn_rel_store_trig = 62;
2547     isc_dyn_rel_modify_trig = 63;
2548     isc_dyn_rel_erase_trig = 64;
2549     isc_dyn_rel_store_trig_source = 65;
2550     isc_dyn_rel_modify_trig_source = 66;
2551     isc_dyn_rel_erase_trig_source = 67;
2552     isc_dyn_rel_ext_file = 68;
2553     isc_dyn_rel_sql_protection = 69;
2554     isc_dyn_rel_constraint = 162;
2555     isc_dyn_delete_rel_constraint = 163;
2556    
2557     (**************************************)
2558     (** Global field specific attributes **)
2559     (**************************************)
2560    
2561     isc_dyn_fld_type = 70;
2562     isc_dyn_fld_length = 71;
2563     isc_dyn_fld_scale = 72;
2564     isc_dyn_fld_sub_type = 73;
2565     isc_dyn_fld_segment_length = 74;
2566     isc_dyn_fld_query_header = 75;
2567     isc_dyn_fld_edit_string = 76;
2568     isc_dyn_fld_validation_blr = 77;
2569     isc_dyn_fld_validation_source = 78;
2570     isc_dyn_fld_computed_blr = 79;
2571     isc_dyn_fld_computed_source = 80;
2572     isc_dyn_fld_missing_value = 81;
2573     isc_dyn_fld_default_value = 82;
2574     isc_dyn_fld_query_name = 83;
2575     isc_dyn_fld_dimensions = 84;
2576     isc_dyn_fld_not_null = 85;
2577     isc_dyn_fld_precision = 86;
2578     isc_dyn_fld_char_length = 172;
2579     isc_dyn_fld_collation = 173;
2580     isc_dyn_fld_default_source = 193;
2581     isc_dyn_del_default = 197;
2582     isc_dyn_del_validation = 198;
2583     isc_dyn_single_validation = 199;
2584     isc_dyn_fld_character_set = 203;
2585    
2586     (*************************************)
2587     (** Local field specific attributes **)
2588     (*************************************)
2589    
2590     isc_dyn_fld_source = 90;
2591     isc_dyn_fld_base_fld = 91;
2592     isc_dyn_fld_position = 92;
2593     isc_dyn_fld_update_flag = 93;
2594    
2595     (*******************************)
2596     (** Index specific attributes **)
2597     (*******************************)
2598    
2599     isc_dyn_idx_unique = 100;
2600     isc_dyn_idx_inactive = 101;
2601     isc_dyn_idx_type = 103;
2602     isc_dyn_idx_foreign_key = 104;
2603     isc_dyn_idx_ref_column = 105;
2604     isc_dyn_idx_statistic = 204;
2605    
2606     (*********************************)
2607     (** Trigger specific attributes **)
2608     (*********************************)
2609    
2610     isc_dyn_trg_type = 110;
2611     isc_dyn_trg_blr = 111;
2612     isc_dyn_trg_source = 112;
2613     isc_dyn_trg_name = 114;
2614     isc_dyn_trg_sequence = 115;
2615     isc_dyn_trg_inactive = 116;
2616     isc_dyn_trg_msg_number = 117;
2617     isc_dyn_trg_msg = 118;
2618    
2619     (****************************************)
2620     (** Security Class specific attributes **)
2621     (****************************************)
2622    
2623     isc_dyn_scl_acl = 121;
2624     isc_dyn_grant_user = 130;
2625     isc_dyn_grant_proc = 186;
2626     isc_dyn_grant_trig = 187;
2627     isc_dyn_grant_view = 188;
2628     isc_dyn_grant_options = 132;
2629     isc_dyn_grant_user_group = 205;
2630    
2631     (************************************)
2632     (** Dimension specific information **)
2633     (************************************)
2634    
2635     isc_dyn_dim_lower = 141;
2636     isc_dyn_dim_upper = 142;
2637    
2638     (******************************)
2639     (** File specific attributes **)
2640     (******************************)
2641    
2642     isc_dyn_file_name = 125;
2643     isc_dyn_file_start = 126;
2644     isc_dyn_file_length = 127;
2645     isc_dyn_shadow_number = 128;
2646     isc_dyn_shadow_man_auto = 129;
2647     isc_dyn_shadow_conditional = 130;
2648    
2649     (**********************************)
2650     (** Log file specific attributes **)
2651     (**********************************)
2652    
2653     isc_dyn_log_file_sequence = 177;
2654     isc_dyn_log_file_partitions = 178;
2655     isc_dyn_log_file_serial = 179;
2656     isc_dyn_log_file_overflow = 200;
2657     isc_dyn_log_file_raw = 201;
2658    
2659     (*****************************)
2660     (** Log specific attributes **)
2661     (*****************************)
2662    
2663     isc_dyn_log_group_commit_wait = 189;
2664     isc_dyn_log_buffer_size = 190;
2665     isc_dyn_log_check_point_length = 191;
2666     isc_dyn_log_num_of_buffers = 192;
2667    
2668     (**********************************)
2669     (** Function specific attributes **)
2670     (**********************************)
2671    
2672     isc_dyn_function_name = 145;
2673     isc_dyn_function_type = 146;
2674     isc_dyn_func_module_name = 147;
2675     isc_dyn_func_entry_point = 148;
2676     isc_dyn_func_return_argument = 149;
2677     isc_dyn_func_arg_position = 150;
2678     isc_dyn_func_mechanism = 151;
2679     isc_dyn_filter_in_subtype = 152;
2680     isc_dyn_filter_out_subtype = 153;
2681    
2682    
2683     isc_dyn_description2 = 154;
2684     isc_dyn_fld_computed_source2 = 155;
2685     isc_dyn_fld_edit_string2 = 156;
2686     isc_dyn_fld_query_header2 = 157;
2687     isc_dyn_fld_validation_source2 = 158;
2688     isc_dyn_trg_msg2 = 159;
2689     isc_dyn_trg_source2 = 160;
2690     isc_dyn_view_source2 = 161;
2691     isc_dyn_xcp_msg2 = 184;
2692    
2693     (***********************************)
2694     (** Generator specific attributes **)
2695     (***********************************)
2696    
2697     isc_dyn_generator_name = 95;
2698     isc_dyn_generator_id = 96;
2699    
2700     (***********************************)
2701     (** Procedure specific attributes **)
2702     (***********************************)
2703    
2704     isc_dyn_prc_inputs = 167;
2705     isc_dyn_prc_outputs = 168;
2706     isc_dyn_prc_source = 169;
2707     isc_dyn_prc_blr = 170;
2708     isc_dyn_prc_source2 = 171;
2709    
2710     (***********************************)
2711     (** Parameter specific attributes **)
2712     (***********************************)
2713    
2714     isc_dyn_prm_number = 138;
2715     isc_dyn_prm_type = 139;
2716    
2717     (**********************************)
2718     (** Relation specific attributes **)
2719     (**********************************)
2720    
2721     isc_dyn_xcp_msg = 185;
2722    
2723     (************************************************)
2724     (** Cascading referential integrity values **)
2725     (************************************************)
2726     isc_dyn_foreign_key_update = 205;
2727     isc_dyn_foreign_key_delete = 206;
2728     isc_dyn_foreign_key_cascade = 207;
2729     isc_dyn_foreign_key_default = 208;
2730     isc_dyn_foreign_key_null = 209;
2731     isc_dyn_foreign_key_none = 210;
2732    
2733     (*************************)
2734     (** SQL role values **)
2735     (*************************)
2736     isc_dyn_def_sql_role = 211;
2737     isc_dyn_sql_role_name = 212;
2738     isc_dyn_grant_admin_options = 213;
2739     isc_dyn_del_sql_role = 214;
2740    
2741     (******************************)
2742     (** Last $dyn value assigned **)
2743     (******************************)
2744    
2745     isc_dyn_last_dyn_value = 216;
2746    
2747     (********************************************)
2748     (** Array slice description language (SDL) **)
2749     (********************************************)
2750    
2751     isc_sdl_version1 = 1;
2752     isc_sdl_eoc = -1;
2753     isc_sdl_relation = 2;
2754     isc_sdl_rid = 3;
2755     isc_sdl_field = 4;
2756     isc_sdl_fid = 5;
2757     isc_sdl_struct = 6;
2758     isc_sdl_variable = 7;
2759     isc_sdl_scalar = 8;
2760     isc_sdl_tiny_integer = 9;
2761     isc_sdl_short_integer = 10;
2762     isc_sdl_long_integer = 11;
2763     isc_sdl_literal = 12;
2764     isc_sdl_add = 13;
2765     isc_sdl_subtract = 14;
2766     isc_sdl_multiply = 15;
2767     isc_sdl_divide = 16;
2768     isc_sdl_negate = 17;
2769     isc_sdl_eql = 18;
2770     isc_sdl_neq = 19;
2771     isc_sdl_gtr = 20;
2772     isc_sdl_geq = 21;
2773     isc_sdl_lss = 22;
2774     isc_sdl_leq = 23;
2775     isc_sdl_and = 24;
2776     isc_sdl_or = 25;
2777     isc_sdl_not = 26;
2778     isc_sdl_while = 27;
2779     isc_sdl_assignment = 28;
2780     isc_sdl_label = 29;
2781     isc_sdl_leave = 30;
2782     isc_sdl_begin = 31;
2783     isc_sdl_end = 32;
2784     isc_sdl_do3 = 33;
2785     isc_sdl_do2 = 34;
2786     isc_sdl_do1 = 35;
2787     isc_sdl_element = 36;
2788    
2789     (**********************************************)
2790     (** International text interpretation values **)
2791     (**********************************************)
2792    
2793     isc_interp_eng_ascii = 0;
2794     isc_interp_jpn_sjis = 5;
2795     isc_interp_jpn_euc = 6;
2796    
2797     (******************************************)
2798     (** Scroll direction for isc_dsql_fetch2 **)
2799     (******************************************)
2800    
2801     isc_fetch_next = 0;
2802     isc_fetch_prior = 1;
2803     isc_fetch_first = 2;
2804     isc_fetch_last = 3;
2805     isc_fetch_absolute = 4;
2806     isc_fetch_relative = 5;
2807    
2808     (*********************)
2809     (** SQL definitions **)
2810     (*********************)
2811     SQL_VARYING = 448;
2812     SQL_TEXT = 452;
2813     SQL_DOUBLE = 480;
2814     SQL_FLOAT = 482;
2815     SQL_LONG = 496;
2816     SQL_SHORT = 500;
2817     SQL_TIMESTAMP = 510;
2818     SQL_BLOB = 520;
2819     SQL_D_FLOAT = 530;
2820     SQL_ARRAY = 540;
2821     SQL_QUAD = 550;
2822     SQL_TYPE_TIME = 560;
2823     SQL_TYPE_DATE = 570;
2824     SQL_INT64 = 580;
2825     SQL_DATE = SQL_TIMESTAMP;
2826    
2827     (*******************)
2828     (** Blob Subtypes **)
2829     (*******************)
2830    
2831     (** types less than zero are reserved for customer use **)
2832    
2833     isc_blob_untyped = 0;
2834    
2835     (** internal subtypes **)
2836    
2837     isc_blob_text = 1;
2838     isc_blob_blr = 2;
2839     isc_blob_acl = 3;
2840     isc_blob_ranges = 4;
2841     isc_blob_summary = 5;
2842     isc_blob_format = 6;
2843     isc_blob_tra = 7;
2844     isc_blob_extfile = 8;
2845    
2846     (** the range 20-30 is reserved for dBASE and Paradox types **)
2847    
2848     isc_blob_formatted_memo = 20;
2849     isc_blob_paradox_ole = 21;
2850     isc_blob_graphic = 22;
2851     isc_blob_dbase_ole = 23;
2852     isc_blob_typed_binary = 24;
2853    
2854     {$IFDEF IB5_ONLY}
2855     (** SQLDA_LENGTH is defined in C as a macro, but in Pascal we must defined it
2856     as a function... **)
2857     function SQLDA_LENGTH(n: Long): Long;
2858     {$ENDIF}
2859    
2860     (** XSQLDA_LENGTH is defined in C as a macro, but in Pascal we must defined it
2861     as a function... **)
2862     function XSQLDA_LENGTH(n: Long): Long;
2863    
2864     (** getb, putb, putbx are all defined in C as macros.
2865     Use functions and procedures for the functionality **)
2866     function getb (p: PBSTREAM): Char;
2867     function putb (x: Char; p: PBSTREAM): Int;
2868     function putbx (x: Char; p: PBSTREAM): Int;
2869    
2870     (*
2871     #define ADD_SPB_LENGTH(p, length) {*(p)++ = (length); \
2872     *(p)++ = (length) >> 8;}
2873    
2874     #define ADD_SPB_NUMERIC(p, data) {*(p)++ = (data); \
2875     *(p)++ = (data) >> 8; \
2876     *(p)++ = (data) >> 16; \
2877     *(p)++ = (data) >> 24;}
2878     *)
2879     procedure add_spb_length(var p: PChar; length: integer);
2880     procedure add_spb_numeric(var p: PChar; data: integer);
2881    
2882    
2883     implementation
2884    
2885     uses IBIntf, IB;
2886    
2887     {$IFDEF IB5_ONLY}
2888     function SQLDA_LENGTH(n: Long): Long;
2889     (* The C-macro reads like this:
2890     SQLDA_LENGTH(n) (sizeof (SQLDA) + (n-1) * sizeof (SQLVAR)) *)
2891     begin
2892     result := sizeof(TSQLDA) + ((n - 1) * sizeof(TSQLVAR));
2893     end;
2894     {$ENDIF}
2895    
2896    
2897     function XSQLDA_LENGTH(n: Long): Long;
2898     (* The C-macro reads like this:
2899     XSQLDA_LENGTH(n) (sizeof (XSQLDA) + (n-1) * sizeof (XSQLVAR)) *)
2900     begin
2901     result := SizeOf(TXSQLDA) + ((n - 1) * SizeOf(TXSQLVAR));
2902     end;
2903    
2904     function getb(p: PBSTREAM): Char;
2905     (* The C-macro reads like this:
2906     getb(p) (--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p)) *)
2907     begin
2908     Dec(p^.bstr_cnt);
2909     if (p^.bstr_cnt >= 0) then begin
2910     result := Char(Int(p^.bstr_ptr^) and Int(0377));
2911     Inc(p^.bstr_ptr);
2912     end else
2913     result := Char(BLOB_get(p));
2914     end;
2915    
2916     function putb(x: Char; p: PBSTREAM): Int;
2917     (* The C-macro reads like this:
2918     putb(x,p) ((x == '\n' || (!(--(p)->bstr_cnt))) ? // then
2919     BLOB_put (x,p) : // else
2920     ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
2921     begin
2922     Dec(p^.bstr_cnt);
2923     if (x = Chr(Int('n') - Int('a'))) or (p^.bstr_cnt = 0) then
2924     result := BLOB_put(x, p)
2925     else begin
2926     p^.bstr_ptr^ := Char(x);
2927     result := UInt(x);
2928     Inc(p^.bstr_ptr^);
2929     end;
2930     end;
2931    
2932     function putbx(x: Char; p: PBSTREAM): Int;
2933     (* The C-macro reads like this:
2934     putbx(x,p) ((!(--(p)->bstr_cnt)) ? // then
2935     BLOB_put (x,p) : // else
2936     ((int) (*(p)->bstr_ptr++ = (unsigned) (x)))) *)
2937     begin
2938     Dec(p^.bstr_cnt);
2939     if (p^.bstr_cnt = 0) then
2940     result := BLOB_put(x, p)
2941     else begin
2942     p^.bstr_ptr^ := Char(x);
2943     Inc(p^.bstr_ptr^);
2944     result := UInt(x);
2945     end;
2946     end;
2947    
2948     (*******************************************)
2949     (** Service manager functions **)
2950     (*******************************************)
2951    
2952    
2953     procedure add_spb_length(var p: PChar; length: integer);
2954     (*
2955     #define ADD_SPB_LENGTH(p, length) {*(p)++ = (length); \
2956     *(p)++ = (length) >> 8;}
2957     *)
2958     begin
2959     p^ := char(length);
2960     Inc (p);
2961     p^ := char(length shr 8);
2962     Inc (p);
2963     end;
2964    
2965     procedure add_spb_numeric(var p: PChar; data: integer);
2966     (*
2967     #define ADD_SPB_NUMERIC(p, data) {*(p)++ = (data); \
2968     *(p)++ = (data) >> 8; \
2969     *(p)++ = (data) >> 16; \
2970     *(p)++ = (data) >> 24;}
2971     *)
2972     begin
2973     p^ := char(data);
2974     Inc (p);
2975     p^ := char(data shr 8);
2976     Inc (p);
2977     p^ := char(data shr 16);
2978     Inc (p);
2979     p^ := char(data shr 24);
2980     Inc (p);
2981     end;
2982    
2983     end.
2984