-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathfbapi.py
More file actions
2270 lines (2178 loc) · 106 KB
/
fbapi.py
File metadata and controls
2270 lines (2178 loc) · 106 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SPDX-FileCopyrightText: 2020-present The Firebird Projects <www.firebirdsql.org>
#
# SPDX-License-Identifier: MIT
#
# PROGRAM/MODULE: firebird-driver
# FILE: firebird/driver/fbapi.py
# DESCRIPTION: New Firebird API
# CREATED: 4.3.2020
#
# The contents of this file are subject to the MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Copyright (c) 2020 Firebird Project (www.firebirdsql.org)
# All Rights Reserved.
#
# Contributor(s): Pavel Císař (original code)
# ______________________________________
"""firebird-driver - New Firebird API
"""
from __future__ import annotations
import ctypes
import decimal
import platform
import sys
from contextlib import suppress
from ctypes import (
CFUNCTYPE,
POINTER,
Structure,
addressof,
c_bool,
c_byte,
c_char,
c_char_p,
c_int,
c_long,
c_longlong,
c_short,
c_ubyte,
c_uint,
c_ulong,
c_ulonglong,
c_ushort,
c_void_p,
cast,
create_string_buffer,
)
from ctypes.util import find_library
from locale import getpreferredencoding
from pathlib import Path
from typing import ClassVar
from .config import driver_config
from .hooks import APIHook, get_callbacks, register_class
# Constants
OCTETS = 1 # Character set ID
# Blob Subtypes
isc_blob_untyped = 0
# internal subtypes
isc_blob_text = 1
isc_blob_blr = 2
isc_blob_acl = 3
isc_blob_ranges = 4
isc_blob_summary = 5
isc_blob_format = 6
isc_blob_tra = 7
isc_blob_extfile = 8
isc_blob_debug_info = 9
isc_blob_max_predefined_subtype = 10
# Type codes
SQL_TEXT = 452
SQL_VARYING = 448
SQL_SHORT = 500
SQL_LONG = 496
SQL_FLOAT = 482
SQL_DOUBLE = 480
SQL_D_FLOAT = 530
SQL_TIMESTAMP = 510
SQL_BLOB = 520
SQL_ARRAY = 540
SQL_QUAD = 550
SQL_TYPE_TIME = 560
SQL_TYPE_DATE = 570
SQL_INT64 = 580
SQL_BOOLEAN = 32764 # Firebird 3
SQL_NULL = 32766
SUBTYPE_NUMERIC = 1
SUBTYPE_DECIMAL = 2
# Internal type codes (for example used by ARRAY descriptor)
blr_text = 14
blr_text2 = 15
blr_short = 7
blr_long = 8
blr_quad = 9
blr_float = 10
blr_double = 27
blr_d_float = 11
blr_timestamp = 35
blr_varying = 37
blr_varying2 = 38
blr_blob = 261
blr_cstring = 40
blr_cstring2 = 41
blr_blob_id = 45
blr_sql_date = 12
blr_sql_time = 13
blr_int64 = 16
blr_blob2 = 17
blr_domain_name = 18
blr_domain_name2 = 19
blr_not_nullable = 20
blr_column_name = 21
blr_column_name2 = 22
blr_bool = 23
# Added in FB 4.0
blr_dec64 = 24 # DECFLOAT(16)
blr_dec128 = 25 # DECFLOAT(34)
blr_int128 = 26 # INT128
blr_sql_time_tz = 28
blr_timestamp_tz = 29
blr_ex_time_tz = 30
blr_ex_timestamp_tz = 31
# Masks for fb_shutdown_callback
fb_shut_confirmation = 1
fb_shut_preproviders = 2
fb_shut_postproviders = 4
fb_shut_finish = 8
fb_shut_exit = 16
# Shutdown reasons, used by engine
fb_shutrsn_svc_stopped = -1
fb_shutrsn_no_connection = -2
fb_shutrsn_app_stopped = -3
fb_shutrsn_signal = -5
fb_shutrsn_services = -6
fb_shutrsn_exit_called = -7
fb_shutrsn_emergency = -8
if platform.architecture() == ('64bit', 'WindowsPE'): # pragma: no cover
intptr_t = c_longlong
uintptr_t = c_ulonglong
else:
intptr_t = c_long
uintptr_t = c_ulong
# Firebird configuration parameters (for use in iFirebirdConf.get_key())
config_items: dict[str, type] = {
'DatabaseAccess': str,
'RemoteAccess': bool,
'ExternalFileAccess': str,
'UdfAccess': str,
'TempDirectories': str,
'AuditTraceConfigFile': str,
'MaxUserTraceLogSize': int,
'DefaultDbCachePages': int,
'DatabaseGrowthIncrement': int,
'FileSystemCacheThreshold': int,
'FileSystemCacheSize': int,
'RemoteFileOpenAbility': bool,
'TempBlockSize': int,
'TempCacheLimit': int,
'AuthServer': str,
'AuthClient': str,
'UserManager': str,
'TracePlugin': str,
'WireCryptPlugin': str,
'KeyHolderPlugin': str,
'AllowEncryptedSecurityDatabase': bool,
'Providers': str,
'DeadlockTimeout': int,
'MaxUnflushedWrites': int,
'MaxUnflushedWriteTime': int,
'BugcheckAbort': bool,
'RelaxedAliasChecking': bool,
'ConnectionTimeout': int,
'WireCrypt': str,
'WireCompression': bool,
'DummyPacketInterval': int,
'RemoteServiceName': str,
'RemoteServicePort': int,
'RemoteAuxPort': int,
'TcpRemoteBufferSize': int,
'TcpNoNagle': bool,
'IPv6V6Only': bool,
'RemoteBindAddress': str,
'LockMemSize': int,
'LockAcquireSpins': int,
'LockHashSlots': int,
'EventMemSize': int,
'CpuAffinityMask': int,
'GCPolicy': str,
'SecurityDatabase': str,
'GuardianOption': bool,
'ProcessPriorityLevel': int,
'IpcName': str,
'RemotePipeName': str,
'Redirection': bool,
'ServerMode': str,
'MaxIdentifierByteLength': int, # This and next are for Firebird 4
'MaxIdentifierCharLength': int,
'StatementTimeout': int,
'ConnectionIdleTimeout': int,
'ReadConsistency': bool,
'DefaultTimeZone': str,
'SnapshotsMemSize': int,
'TipCacheBlockSize': int,
'OutputRedirectionFile': str,
'ExtConnPoolSize': int,
'ExtConnPoolLifeTime': int,
'ClientBatchBuffer': int,
'DataTypeCompatibility': str,
'InlineSortThreshold': int,
'OnDisconnectTriggerTimeout': int,
'TempTableDirectory': str,
'UseFileSystemCache': bool,
'DefaultProfilerPlugin': str, # This and next are for Firebird 5
'ParallelWorkers': int,
'MaxParallelWorkers': int,
'MaxStatementCacheSize': int,
'OptimizeForFirstRows': bool,
}
# Types
Int = c_int
IntPtr = POINTER(Int)
Int64 = c_long
Int64Ptr = POINTER(Int64)
QWord = c_ulong
STRING = c_char_p
ISC_DATE = c_int
ISC_TIME = c_uint
ISC_UCHAR = c_ubyte
ISC_SHORT = c_short
ISC_USHORT = c_ushort
ISC_LONG = c_int
ISC_LONG_PTR = POINTER(ISC_LONG)
ISC_ULONG = c_uint
ISC_INT64 = c_longlong
ISC_UINT64 = c_ulonglong
# >>> Firebird 4
FB_DEC16 = c_ulonglong
FB_DEC16Ptr = POINTER(FB_DEC16)
FB_DEC34 = c_ulonglong * 2
FB_DEC34Ptr = POINTER(FB_DEC34)
FB_I128 = c_ulonglong * 2
FB_I128Ptr = POINTER(FB_I128)
# <<< FB4
class ISC_QUAD(Structure):
"ISC_QUAD"
_fields_: ClassVar = [('high', ISC_LONG), ('low', ISC_ULONG)]
ISC_QUAD_PTR = POINTER(ISC_QUAD)
ISC_STATUS = intptr_t
ISC_STATUS_PTR = POINTER(ISC_STATUS)
ISC_STATUS_ARRAY = ISC_STATUS * 20
ISC_STATUS_ARRAY_PTR = POINTER(ISC_STATUS_ARRAY)
FB_API_HANDLE = c_uint
FB_API_HANDLE_PTR = POINTER(FB_API_HANDLE)
RESULT_VECTOR = ISC_ULONG * 15
ISC_EVENT_CALLBACK = CFUNCTYPE(None, POINTER(ISC_UCHAR), c_ushort, POINTER(ISC_UCHAR))
FB_SHUTDOWN_CALLBACK = CFUNCTYPE(c_int, c_int, c_int, c_void_p)
# >>> Firebird 4
class ISC_TIME_TZ(Structure):
"ISC_TIME_TZ"
_fields_: ClassVar = [('utc_time', ISC_TIME), ('time_zone', ISC_USHORT)]
ISC_TIME_TZ_PTR = POINTER(ISC_TIME_TZ)
class ISC_TIME_TZ_EX(Structure):
"ISC_TIME_TZ_EX"
_fields_: ClassVar = [('utc_time', ISC_TIME), ('time_zone', ISC_USHORT), ('ext_offset', ISC_SHORT)]
ISC_TIME_TZ_EX_PTR = POINTER(ISC_TIME_TZ_EX)
class ISC_TIMESTAMP(Structure):
"ISC_TIMESTAMP"
_fields_: ClassVar = [('timestamp_date', ISC_DATE), ('timestamp_time', ISC_TIME)]
ISC_TIMESTAMP_PTR = POINTER(ISC_TIMESTAMP)
class ISC_TIMESTAMP_TZ(Structure):
"ISC_TIMESTAMP_TZ"
_fields_: ClassVar = [('utc_timestamp', ISC_TIMESTAMP), ('time_zone', ISC_USHORT)]
ISC_TIMESTAMP_TZ_PTR = POINTER(ISC_TIMESTAMP_TZ)
class ISC_TIMESTAMP_TZ_EX(Structure):
"ISC_TIMESTAMP_TZ_EX"
_fields_: ClassVar = [('utc_timestamp', ISC_TIMESTAMP), ('time_zone', ISC_USHORT), ('ext_offset', ISC_SHORT)]
ISC_TIMESTAMP_TZ_EX_PTR = POINTER(ISC_TIMESTAMP_TZ_EX)
# <<< Firebird 4
class ISC_ARRAY_BOUND(Structure):
"ISC_ARRAY_BOUND"
_fields_: ClassVar = [('array_bound_lower', c_short), ('array_bound_upper', c_short)]
class ISC_ARRAY_DESC(Structure):
"ISC_ARRAY_DESC"
_fields_: ClassVar = [
('array_desc_dtype', c_ubyte),
('array_desc_scale', c_byte), # was ISC_SCHAR),
('array_desc_length', c_ushort),
('array_desc_field_name', c_char * 32),
('array_desc_relation_name', c_char * 32),
('array_desc_dimensions', c_short),
('array_desc_flags', c_short),
('array_desc_bounds', ISC_ARRAY_BOUND * 16)]
ISC_ARRAY_DESC_PTR = POINTER(ISC_ARRAY_DESC)
class TraceCounts(Structure):
"Trace counters for table"
_fields_: ClassVar = [('relation_id', c_int), ('relation_name', c_char_p), ('counters', Int64Ptr)]
TraceCountsPtr = POINTER(TraceCounts)
class PerformanceInfo(Structure):
"Performance info"
_fields_: ClassVar = [
('time', c_long),
('counters', Int64Ptr),
('count', c_uint),
('tables', TraceCountsPtr),
('records_fetched', c_long)]
#class Dsc(Structure):
#"Field descriptor"
#Dsc._fields_: ClassVar = [
#('dtype', c_byte),
#('scale', c_byte),
#('length', c_short),
#('sub_type', c_short),
#('flags', c_short),
#('address', POINTER(c_byte)),
#]
BooleanPtr = POINTER(c_byte)
BytePtr = POINTER(c_char)
Cardinal = c_uint
CardinalPtr = POINTER(Cardinal)
NativeInt = intptr_t
NativeIntPtr = POINTER(NativeInt)
PerformanceInfoPtr = POINTER(PerformanceInfo)
#dscPtr = POINTER(Dsc)
func_ptr = c_ulong
# ------------------------------------------------------------------------------
# Interface - Forward definitions
# ------------------------------------------------------------------------------
# IVersioned(1)
class IVersioned_VTable(Structure):
"Interface virtual method table"
IVersioned_VTablePtr = POINTER(IVersioned_VTable)
class IVersioned_struct(Structure):
"Fiebird Interface data structure"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IVersioned_VTablePtr)]
IVersioned = POINTER(IVersioned_struct)
# IReferenceCounted(2)
class IReferenceCounted_VTable(Structure):
"IReferenceCounted virtual method table"
IReferenceCounted_VTablePtr = POINTER(IReferenceCounted_VTable)
class IReferenceCounted_struct(Structure):
"IReferenceCounted data structure"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IReferenceCounted_VTablePtr)]
IReferenceCounted = POINTER(IReferenceCounted_struct)
# IDisposable(2)
class IDisposable_VTable(Structure):
"IDisposable virtual method table"
IDisposable_VTablePtr = POINTER(IDisposable_VTable)
class IDisposable_struct(Structure):
"IDisposable data structure"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IDisposable_VTablePtr)]
IDisposable = POINTER(IDisposable_struct)
# IStatus(3) : Disposable
class IStatus_VTable(Structure):
"IStatus VTable"
IStatus_VTablePtr = POINTER(IStatus_VTable)
class IStatus_struct(Structure):
"IStatus interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IStatus_VTablePtr)]
IStatus = POINTER(IStatus_struct)
# IMaster(2) : Versioned
class IMaster_VTable(Structure):
"IMaster virtual method table"
IMaster_VTablePtr = POINTER(IMaster_VTable)
class IMaster_struct(Structure):
"IMaster interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IMaster_VTablePtr)]
IMaster = POINTER(IMaster_struct)
# IPluginBase(3) : ReferenceCounted
class IPluginBase_VTable(Structure):
"IPluginBase virtual method table"
IPluginBase_VTablePtr = POINTER(IPluginBase_VTable)
class IPluginBase_struct(Structure):
"IPluginBase interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IPluginBase_VTablePtr)]
IPluginBase = POINTER(IPluginBase_struct)
# IPluginSet(3) : ReferenceCounted
class IPluginSet_VTable(Structure):
"IPluginSet virtual method table"
IPluginSet_VTablePtr = POINTER(IPluginSet_VTable)
class IPluginSet_struct(Structure):
"IPluginSet interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IPluginSet_VTablePtr)]
IPluginSet = POINTER(IPluginSet_struct)
# IConfigEntry(3) : ReferenceCounted
class IConfigEntry_VTable(Structure):
"IConfigEntry virtual method table"
IConfigEntry_VTablePtr = POINTER(IConfigEntry_VTable)
class IConfigEntry_struct(Structure):
"IConfigEntry interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IConfigEntry_VTablePtr)]
IConfigEntry = POINTER(IConfigEntry_struct)
# IConfig(3) : ReferenceCounted
class IConfig_VTable(Structure):
"IConfig virtual method table"
IConfig_VTablePtr = POINTER(IConfig_VTable)
class IConfig_struct(Structure):
"IConfig interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IConfig_VTablePtr)]
IConfig = POINTER(IConfig_struct)
# IFirebirdConf(3) : ReferenceCounted
class IFirebirdConf_VTable(Structure):
"IFirebirdConf virtual method table"
IFirebirdConf_VTablePtr = POINTER(IFirebirdConf_VTable)
class IFirebirdConf_struct(Structure):
"IFirebirdConf interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IFirebirdConf_VTablePtr)]
IFirebirdConf = POINTER(IFirebirdConf_struct)
# IPluginConfig(3) : ReferenceCounted
# IPluginFactory(2) : Versioned
# IPluginModule(3) : Versioned
# IPluginManager(2) : Versioned
class IPluginManager_VTable(Structure):
"IPluginManager virtual method table"
IPluginManager_VTablePtr = POINTER(IPluginManager_VTable)
class IPluginManager_struct(Structure):
"IPluginManager interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IPluginManager_VTablePtr)]
IPluginManager = POINTER(IPluginManager_struct)
# ICryptKey(2) : Versioned
# IConfigManager(2) : Versioned
class IConfigManager_VTable(Structure):
"IConfigManager virtual method table"
IConfigManager_VTablePtr = POINTER(IConfigManager_VTable)
class IConfigManager_struct(Structure):
"IConfigManager interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IConfigManager_VTablePtr)]
IConfigManager = POINTER(IConfigManager_struct)
# IEventCallback(3) : ReferenceCounted
class IEventCallback_VTable(Structure):
"IEventCallback virtual method table"
IEventCallback_VTablePtr = POINTER(IEventCallback_VTable)
class IEventCallback_struct(Structure):
"IEventCallback interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IEventCallback_VTablePtr)]
IEventCallback = POINTER(IEventCallback_struct)
# IBlob(3) : ReferenceCounted
class IBlob_VTable(Structure):
"IBlob virtual method table"
IBlob_VTablePtr = POINTER(IBlob_VTable)
class IBlob_struct(Structure):
"IBlob interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IBlob_VTablePtr)]
IBlob = POINTER(IBlob_struct)
# ITransaction(3) : ReferenceCounted
class ITransaction_VTable(Structure):
"ITransaction virtual method table"
ITransaction_VTablePtr = POINTER(ITransaction_VTable)
class ITransaction_struct(Structure):
"ITransaction interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', ITransaction_VTablePtr)]
ITransaction = POINTER(ITransaction_struct)
# IMessageMetadata(3) : ReferenceCounted
class IMessageMetadata_VTable(Structure):
"IMessageMetadata virtual method table"
IMessageMetadata_VTablePtr = POINTER(IMessageMetadata_VTable)
class IMessageMetadata_struct(Structure):
"IMessageMetadata interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IMessageMetadata_VTablePtr)]
IMessageMetadata = POINTER(IMessageMetadata_struct)
# IMetadataBuilder(3) : ReferenceCounted
class IMetadataBuilder_VTable(Structure):
"IMetadataBuilder virtual method table"
IMetadataBuilder_VTablePtr = POINTER(IMetadataBuilder_VTable)
class IMetadataBuilder_struct(Structure):
"IMetadataBuilder interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IMetadataBuilder_VTablePtr)]
IMetadataBuilder = POINTER(IMetadataBuilder_struct)
# IResultSet(3) : ReferenceCounted
class IResultSet_VTable(Structure):
"IResultSet virtual method table"
IResultSet_VTablePtr = POINTER(IResultSet_VTable)
class IResultSet_struct(Structure):
"IResultSet interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IResultSet_VTablePtr)]
IResultSet = POINTER(IResultSet_struct)
# IStatement(3) : ReferenceCounted
class IStatement_VTable(Structure):
"IStatement virtual method table"
IStatement_VTablePtr = POINTER(IStatement_VTable)
class IStatement_struct(Structure):
"IStatement interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IStatement_VTablePtr)]
IStatement = POINTER(IStatement_struct)
# >>> Firebird 4
# IBatch(3) : ReferenceCounted
class IBatch_VTable(Structure):
"IBatch virtual method table"
IBatch_VTablePtr = POINTER(IBatch_VTable)
class IBatch_struct(Structure):
"IBatch interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IBatch_VTablePtr)]
IBatch = POINTER(IBatch_struct)
# IBatchCompletionState(3) : Disposable
class IBatchCompletionState_VTable(Structure):
"IBatchCompletionState virtual method table"
IBatchCompletionState_VTablePtr = POINTER(IBatchCompletionState_VTable)
class IBatchCompletionState_struct(Structure):
"IBatchCompletionState interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IBatchCompletionState_VTablePtr)]
IBatchCompletionState = POINTER(IBatchCompletionState_struct)
# IReplicator(3) : ReferenceCounted
# <<< Firebird 4
# IRequest(3) : ReferenceCounted
class IRequest_VTable(Structure):
"IRequest virtual method table"
IRequest_VTablePtr = POINTER(IRequest_VTable)
class IRequest_struct(Structure):
"IRequest interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IRequest_VTablePtr)]
IRequest = POINTER(IRequest_struct)
# IEvents(3) : ReferenceCounted
class IEvents_VTable(Structure):
"IEvents virtual method table"
IEvents_VTablePtr = POINTER(IEvents_VTable)
class IEvents_struct(Structure):
"IEvents interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IEvents_VTablePtr)]
IEvents = POINTER(IEvents_struct)
# IAttachment(3) : ReferenceCounted
class IAttachment_VTable(Structure):
"IAttachment virtual method table"
IAttachment_VTablePtr = POINTER(IAttachment_VTable)
class IAttachment_struct(Structure):
"IAttachment interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IAttachment_VTablePtr)]
IAttachment = POINTER(IAttachment_struct)
# IService(3) : ReferenceCounted
class IService_VTable(Structure):
"IService virtual method table"
IService_VTablePtr = POINTER(IService_VTable)
class IService_struct(Structure):
"IService interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IService_VTablePtr)]
IService = POINTER(IService_struct)
# IProvider(4) : PluginBase
class IProvider_VTable(Structure):
"IProvider virtual method table"
IProvider_VTablePtr = POINTER(IProvider_VTable)
class IProvider_struct(Structure):
"IProvider interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IProvider_VTablePtr)]
IProvider = POINTER(IProvider_struct)
# IDtcStart(3) : Disposable
class IDtcStart_VTable(Structure):
"IDtcStart virtual method table"
IDtcStart_VTablePtr = POINTER(IDtcStart_VTable)
class IDtcStart_struct(Structure):
"IDtcStart interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IDtcStart_VTablePtr)]
IDtcStart = POINTER(IDtcStart_struct)
# IDtc(2) : Versioned
class IDtc_VTable(Structure):
"IDtc virtual method table"
IDtc_VTablePtr = POINTER(IDtc_VTable)
class IDtc_struct(Structure):
"IDtc interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IDtc_VTablePtr)]
IDtc = POINTER(IDtc_struct)
# IAuth(4) : PluginBase
# IWriter(2) : Versioned
# IServerBlock(2) : Versioned
# IClientBlock(4) : ReferenceCounted
# IServer(6) : Auth
# IClient(5) : Auth
# IUserField(2) : Versioned
# ICharUserField(3) : IUserField
# IIntUserField(3) : IUserField
# IUser(2) : Versioned
# IListUsers(2) : Versioned
# ILogonInfo(2) : Versioned
# IManagement(4) : PluginBase
# IAuthBlock(2) : Versioned
# IWireCryptPlugin(4) : PluginBase
# ICryptKeyCallback(2) : Versioned
class ICryptKeyCallback_VTable(Structure):
"ICryptKeyCallback virtual method table"
ICryptKeyCallback_VTablePtr = POINTER(ICryptKeyCallback_VTable)
class ICryptKeyCallback_struct(Structure):
"ICryptKeyCallback interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', ICryptKeyCallback_VTablePtr)]
ICryptKeyCallback = POINTER(ICryptKeyCallback_struct)
# IKeyHolderPlugin(5) : PluginBase
# IDbCryptInfo(3) : ReferenceCounted
# IDbCryptPlugin(5) : PluginBase
# IExternalContext(2) : Versioned
# IExternalResultSet(3) : Disposable
# IExternalFunction(3) : Disposable
# IExternalProcedure(3) : Disposable
# IExternalTrigger(3) : Disposable
# IRoutineMetadata(2) : Versioned
# IExternalEngine(4) : PluginBase
# ITimer(3) : ReferenceCounted
class ITimer_VTable(Structure):
"ITimer virtual method table"
ITimer_VTablePtr = POINTER(ITimer_VTable)
class ITimer_struct(Structure):
"ITimer interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', ITimer_VTablePtr)]
ITimer = POINTER(ITimer_struct)
# ITimerControl(2) : Versioned
class ITimerControl_VTable(Structure):
"ITimerControl virtual method table"
ITimerControl_VTablePtr = POINTER(ITimerControl_VTable)
class ITimerControl_struct(Structure):
"ITimerControl interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', ITimerControl_VTablePtr)]
ITimerControl = POINTER(ITimerControl_struct)
# IVersionCallback(2) : Versioned
class IVersionCallback_VTable(Structure):
"IVersionCallback virtual method table"
IVersionCallback_VTablePtr = POINTER(IVersionCallback_VTable)
class IVersionCallback_struct(Structure):
"IVersionCallback interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IVersionCallback_VTablePtr)]
IVersionCallback = POINTER(IVersionCallback_struct)
# IUtil(2) : Versioned
class IUtil_VTable(Structure):
"IUtil virtual method table"
IUtil_VTablePtr = POINTER(IUtil_VTable)
class IUtil_struct(Structure):
"IUtil interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IUtil_VTablePtr)]
IUtil = POINTER(IUtil_struct)
# IOffsetsCallback(2) : Versioned
class IOffsetsCallback_VTable(Structure):
"IOffsetsCallback virtual method table"
IOffsetsCallback_VTablePtr = POINTER(IOffsetsCallback_VTable)
class IOffsetsCallback_struct(Structure):
"IOffsetsCallback interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IOffsetsCallback_VTablePtr)]
IOffsetsCallback = POINTER(IOffsetsCallback_struct)
# IXpbBuilder(3) : Disposable
class IXpbBuilder_VTable(Structure):
"IXpbBuilder virtual method table"
IXpbBuilder_VTablePtr = POINTER(IXpbBuilder_VTable)
class IXpbBuilder_struct(Structure):
"IXpbBuilder interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IXpbBuilder_VTablePtr)]
IXpbBuilder = POINTER(IXpbBuilder_struct)
# ITraceConnection(2) : Versioned
# ITraceDatabaseConnection(3) : TraceConnection
# ITraceTransaction(3) : Versioned
# ITraceParams(3) : Versioned
# ITraceStatement(2) : Versioned
# ITraceSQLStatement(3) : TraceStatement
# ITraceBLRStatement(3) : TraceStatement
# ITraceDYNRequest(2) : Versioned
# ITraceContextVariable(2) : Versioned
# ITraceProcedure(2) : Versioned
# ITraceFunction(2) : Versioned
# ITraceTrigger(2) : Versioned
# ITraceServiceConnection(3) : TraceConnection
# ITraceStatusVector(2) : Versioned
# ITraceSweepInfo(2) : Versioned
# ITraceLogWriter(4) : ReferenceCounted
# ITraceInitInfo(2) : Versioned
# ITracePlugin(3) : ReferenceCounted
# ITraceFactory(4) : PluginBase
# IUdrFunctionFactory(3) : Disposable
# IUdrProcedureFactory(3) : Disposable
# IUdrTriggerFactory(3) : Disposable
# IUdrPlugin(2) : Versioned
# >>> Firebird 4
# IDecFloat16(2) : Versioned
class IDecFloat16_VTable(Structure):
"IDecFloat16 virtual method table"
IDecFloat16_VTablePtr = POINTER(IDecFloat16_VTable)
class IDecFloat16_struct(Structure):
"IDecFloat16 interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IDecFloat16_VTablePtr)]
IDecFloat16 = POINTER(IDecFloat16_struct)
# IDecFloat34(2) : Versioned
class IDecFloat34_VTable(Structure):
"IDecFloat34 virtual method table"
IDecFloat34_VTablePtr = POINTER(IDecFloat34_VTable)
class IDecFloat34_struct(Structure):
"IDecFloat34 interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IDecFloat34_VTablePtr)]
IDecFloat34 = POINTER(IDecFloat34_struct)
# IInt128(2) : Versioned
class IInt128_VTable(Structure):
"IInt128 virtual method table"
IInt128_VTablePtr = POINTER(IInt128_VTable)
class IInt128_struct(Structure):
"IInt128 interface"
_fields_: ClassVar = [('dummy', c_void_p), ('vtable', IInt128_VTablePtr)]
IInt128 = POINTER(IInt128_struct)
# IReplicatedRecord(2) : Versioned
# IReplicatedBlob(2) : Versioned
# IReplicatedTransaction(3) : Disposable
# IReplicatedSession(3) : Disposable
# ====================
# Interfaces - Methods
# ====================
#
# IReferenceCounted(2)
# --------------------
# procedure addRef(this: IReferenceCounted)
IReferenceCounted_addRef = CFUNCTYPE(None, IReferenceCounted)
# function release(this: IReferenceCounted): Integer
IReferenceCounted_release = CFUNCTYPE(c_int, IReferenceCounted)
#
# IDisposable(2)
# --------------
# procedure dispose(this: IDisposable)
IDisposable_dispose = CFUNCTYPE(None, IDisposable)
#
# IStatus(3) : Disposable
# -----------------------
# procedure init(this: IStatus)
IStatus_init = CFUNCTYPE(None, IStatus)
# function getState(this: IStatus): Cardinal
IStatus_getState = CFUNCTYPE(Cardinal, IStatus)
# procedure setErrors2(this: IStatus; length: Cardinal; value: NativeIntPtr)
IStatus_setErrors2 = CFUNCTYPE(None, IStatus, Cardinal, NativeIntPtr)
# procedure setWarnings2(this: IStatus; length: Cardinal; value: NativeIntPtr)
IStatus_setWarnings2 = CFUNCTYPE(None, IStatus, Cardinal, NativeIntPtr)
# procedure setErrors(this: IStatus; value: NativeIntPtr)
IStatus_setErrors = CFUNCTYPE(None, IStatus, NativeIntPtr)
# procedure setWarnings(this: IStatus; value: NativeIntPtr)
IStatus_setWarnings = CFUNCTYPE(None, IStatus, NativeIntPtr)
# function getErrors(this: IStatus): NativeIntPtr
IStatus_getErrors = CFUNCTYPE(NativeIntPtr, IStatus)
# function getWarnings(this: IStatus): NativeIntPtr
IStatus_getWarnings = CFUNCTYPE(NativeIntPtr, IStatus)
# function clone(this: IStatus): IStatus
IStatus_clone = CFUNCTYPE(IStatus, IStatus)
#
# IMaster(2) : Versioned
# ----------------------
# function getStatus(this: IMaster): IStatus
IMaster_getStatus = CFUNCTYPE(IStatus, IMaster)
# function getDispatcher(this: IMaster): IProvider
IMaster_getDispatcher = CFUNCTYPE(IProvider, IMaster)
# function getPluginManager(this: IMaster): IPluginManager
IMaster_getPluginManager = CFUNCTYPE(IPluginManager, IMaster)
# function getTimerControl(this: IMaster): ITimerControl
IMaster_getTimerControl = CFUNCTYPE(ITimerControl, IMaster)
# function getDtc(this: IMaster): IDtc
IMaster_getDtc = CFUNCTYPE(IDtc, IMaster)
# function registerAttachment(this: IMaster; provider: IProvider; attachment: IAttachment): IAttachment
IMaster_registerAttachment = CFUNCTYPE(IAttachment, IMaster, IProvider, IAttachment)
# function registerTransaction(this: IMaster; attachment: IAttachment; transaction: ITransaction): ITransaction
IMaster_registerTransaction = CFUNCTYPE(ITransaction, IMaster, IAttachment, ITransaction)
# function getMetadataBuilder(this: IMaster; status: IStatus; fieldCount: Cardinal): IMetadataBuilder
IMaster_getMetadataBuilder = CFUNCTYPE(IMetadataBuilder, IMaster, IStatus, c_uint)
# function serverMode(this: IMaster; mode: Integer): Integer
IMaster_serverMode = CFUNCTYPE(c_int, IMaster, c_int)
# function getUtilInterface(this: IMaster): IUtil
IMaster_getUtilInterface = CFUNCTYPE(IUtil, IMaster)
# function getConfigManager(this: IMaster): IConfigManager
IMaster_getConfigManager = CFUNCTYPE(IConfigManager, IMaster)
# function getProcessExiting(this: IMaster): Boolean
IMaster_getProcessExiting = CFUNCTYPE(c_bool, IMaster)
#
# IPluginBase(3) : ReferenceCounted
# ---------------------------------
# procedure setOwner(this: IPluginBase; r: IReferenceCounted)
IPluginBase_setOwner = CFUNCTYPE(None, IPluginBase, IReferenceCounted)
# function getOwner(this: IPluginBase): IReferenceCounted
IPluginBase_getOwner = CFUNCTYPE(IReferenceCounted, IPluginBase)
#
# IConfigEntry(3) : ReferenceCounted
# ----------------------------------
# function getName(this: IConfigEntry): PAnsiChar
IConfigEntry_getName = CFUNCTYPE(c_char_p, IConfigEntry)
# function getValue(this: IConfigEntry): PAnsiChar
IConfigEntry_getValue = CFUNCTYPE(c_char_p, IConfigEntry)
# function getIntValue(this: IConfigEntry): Int64
IConfigEntry_getIntValue = CFUNCTYPE(Int64, IConfigEntry)
# function getBoolValue(this: IConfigEntry): Boolean
IConfigEntry_getBoolValue = CFUNCTYPE(c_bool, IConfigEntry)
# function getSubConfig(this: IConfigEntry; status: IStatus): IConfig
IConfigEntry_getSubConfig = CFUNCTYPE(IConfig, IConfigEntry, IStatus)
#
# IConfig(3) : ReferenceCounted
# -----------------------------
# function find(this: IConfig; status: IStatus; name: PAnsiChar): IConfigEntry
IConfig_find = CFUNCTYPE(IConfigEntry, IConfig, IStatus, c_char_p)
# function findValue(this: IConfig; status: IStatus; name: PAnsiChar; value: PAnsiChar): IConfigEntry
IConfig_findValue = CFUNCTYPE(IConfigEntry, IConfig, IStatus, c_char_p, c_char_p)
# function findPos(this: IConfig; status: IStatus; name: PAnsiChar; pos: Cardinal): IConfigEntry
IConfig_findPos = CFUNCTYPE(IConfigEntry, IConfig, IStatus, c_char_p, Cardinal)
#
# IFirebirdConf(3) : ReferenceCounted
# -----------------------------------
# function getKey(this: IFirebirdConf; name: PAnsiChar): Cardinal
IFirebirdConf_getKey = CFUNCTYPE(Cardinal, IFirebirdConf, c_char_p)
# function asInteger(this: IFirebirdConf; key: Cardinal): Int64
IFirebirdConf_asInteger = CFUNCTYPE(Int64, IFirebirdConf, Cardinal)
# function asString(this: IFirebirdConf; key: Cardinal): PAnsiChar
IFirebirdConf_asString = CFUNCTYPE(c_char_p, IFirebirdConf, Cardinal)
# function asBoolean(this: IFirebirdConf; key: Cardinal): Boolean
IFirebirdConf_asBoolean = CFUNCTYPE(c_bool, IFirebirdConf, Cardinal)
# >>> Firebird 4
# IFirebirdConf(4)
# function getVersion(this: IFirebirdConf; status: IStatus): Cardinal
IFirebirdConf_getVersion = CFUNCTYPE(Cardinal, IFirebirdConf, IStatus)
#
# IConfigManager(2) : Versioned
# -----------------------------
# function getDirectory(this: IConfigManager; code: Cardinal): PAnsiChar
IConfigManager_getDirectory = CFUNCTYPE(c_char_p, IConfigManager, Cardinal)
# function getFirebirdConf(this: IConfigManager): IFirebirdConf
IConfigManager_getFirebirdConf = CFUNCTYPE(IFirebirdConf, IConfigManager)
# function getDatabaseConf(this: IConfigManager; dbName: PAnsiChar): IFirebirdConf
IConfigManager_getDatabaseConf = CFUNCTYPE(IFirebirdConf, IConfigManager, c_char_p)
# function getPluginConfig(this: IConfigManager; configuredPlugin: PAnsiChar): IConfig
IConfigManager_getPluginConfig = CFUNCTYPE(IConfig, IConfigManager, c_char_p)
# function getInstallDirectory(this: IConfigManager): PAnsiChar
IConfigManager_getInstallDirectory = CFUNCTYPE(c_char_p, IConfigManager)
# function getRootDirectory(this: IConfigManager): PAnsiChar
IConfigManager_getRootDirectory = CFUNCTYPE(c_char_p, IConfigManager)
# >>> Firebird 4
# IConfigManager(3) : IConfigManager(2)
# function getDefaultSecurityDb(this: IConfigManager): PAnsiChar
IConfigManager_getDefaultSecurityDb = CFUNCTYPE(c_char_p, IConfigManager)
#
# IEventCallback(3) : ReferenceCounted
# ------------------------------------
# procedure eventCallbackFunction(this: IEventCallback; length: Cardinal; events: BytePtr)
IEventCallback_eventCallbackFunction = CFUNCTYPE(None, IEventCallback, Cardinal, BytePtr)
#
# IBlob(3) : ReferenceCounted
# ---------------------------
# procedure getInfo(this: IBlob; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr)
IBlob_getInfo = CFUNCTYPE(None, IBlob, IStatus, Cardinal, BytePtr, Cardinal, BytePtr)
# function getSegment(this: IBlob; status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer
IBlob_getSegment = CFUNCTYPE(c_int, IBlob, IStatus, Cardinal, c_void_p, CardinalPtr)
# procedure putSegment(this: IBlob; status: IStatus; length: Cardinal; buffer: Pointer)
IBlob_putSegment = CFUNCTYPE(None, IBlob, IStatus, Cardinal, c_void_p)
# procedure deprecatedCancel(this: IBlob; status: IStatus); cdecl;
IBlob_deprecatedCancel = CFUNCTYPE(None, IBlob, IStatus)
# procedure deprecatedClose(this: IBlob; status: IStatus); cdecl;
IBlob_deprecatedClose = CFUNCTYPE(None, IBlob, IStatus)
# function seek(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer
IBlob_seek = CFUNCTYPE(c_int, IBlob, IStatus, c_int, c_int)
# procedure cancel(this: IBlob; status: IStatus)
IBlob_cancel = CFUNCTYPE(None, IBlob, IStatus)
# procedure close(this: IBlob; status: IStatus)
IBlob_close = CFUNCTYPE(None, IBlob, IStatus)
#
# ITransaction(3) : ReferenceCounted
# ----------------------------------
# procedure getInfo(this: ITransaction; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr)
ITransaction_getInfo = CFUNCTYPE(None, ITransaction, IStatus, Cardinal, BytePtr, Cardinal, BytePtr)
# procedure prepare(this: ITransaction; status: IStatus; msgLength: Cardinal; message: BytePtr)
ITransaction_prepare = CFUNCTYPE(None, ITransaction, IStatus, Cardinal, BytePtr)
# procedure deprecatedCommit(this: ITransaction; status: IStatus); cdecl;
ITransaction_deprecatedCommit = CFUNCTYPE(None, ITransaction, IStatus)
# procedure commitRetaining(this: ITransaction; status: IStatus)
ITransaction_commitRetaining = CFUNCTYPE(None, ITransaction, IStatus)
# procedure deprecatedRollback(this: ITransaction; status: IStatus); cdecl;
ITransaction_deprecatedRollback = CFUNCTYPE(None, ITransaction, IStatus)
# procedure rollbackRetaining(this: ITransaction; status: IStatus)
ITransaction_rollbackRetaining = CFUNCTYPE(None, ITransaction, IStatus)
# procedure deprecatedDisconnect(this: ITransaction; status: IStatus); cdecl;
ITransaction_deprecatedDisconnect = CFUNCTYPE(None, ITransaction, IStatus)
# function join(this: ITransaction; status: IStatus; transaction: ITransaction): ITransaction
ITransaction_join = CFUNCTYPE(ITransaction, ITransaction, IStatus, ITransaction)
# function validate(this: ITransaction; status: IStatus; attachment: IAttachment): ITransaction
ITransaction_validate = CFUNCTYPE(ITransaction, ITransaction, IStatus, IAttachment)
# function enterDtc(this: ITransaction; status: IStatus): ITransaction
ITransaction_enterDtc = CFUNCTYPE(ITransaction, ITransaction, IStatus)
# procedure commit(this: ITransaction; status: IStatus)
ITransaction_commit = CFUNCTYPE(None, ITransaction, IStatus)
# procedure rollback(this: ITransaction; status: IStatus)
ITransaction_rollback = CFUNCTYPE(None, ITransaction, IStatus)
# procedure disconnect(this: ITransaction; status: IStatus)
ITransaction_disconnect = CFUNCTYPE(None, ITransaction, IStatus)
#
# IMessageMetadata(3) : ReferenceCounted
# --------------------------------------
# function getCount(this: IMessageMetadata; status: IStatus): Cardinal
IMessageMetadata_getCount = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus)
# function getField(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar
IMessageMetadata_getField = CFUNCTYPE(c_char_p, IMessageMetadata, IStatus, Cardinal)
# function getRelation(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar
IMessageMetadata_getRelation = CFUNCTYPE(c_char_p, IMessageMetadata, IStatus, Cardinal)
# function getOwner(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar
IMessageMetadata_getOwner = CFUNCTYPE(c_char_p, IMessageMetadata, IStatus, Cardinal)
# function getAlias(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar
IMessageMetadata_getAlias = CFUNCTYPE(c_char_p, IMessageMetadata, IStatus, Cardinal)
# function getType(this: IMessageMetadata; status: IStatus; index: Cardinal): Cardinal
IMessageMetadata_getType = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus, Cardinal)
# function isNullable(this: IMessageMetadata; status: IStatus; index: Cardinal): Boolean
IMessageMetadata_isNullable = CFUNCTYPE(c_bool, IMessageMetadata, IStatus, Cardinal)
# function getSubType(this: IMessageMetadata; status: IStatus; index: Cardinal): Integer
IMessageMetadata_getSubType = CFUNCTYPE(c_int, IMessageMetadata, IStatus, Cardinal)
# function getLength(this: IMessageMetadata; status: IStatus; index: Cardinal): Cardinal
IMessageMetadata_getLength = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus, Cardinal)
# function getScale(this: IMessageMetadata; status: IStatus; index: Cardinal): Integer
IMessageMetadata_getScale = CFUNCTYPE(c_int, IMessageMetadata, IStatus, Cardinal)
# function getCharSet(this: IMessageMetadata; status: IStatus; index: Cardinal): Cardinal
IMessageMetadata_getCharSet = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus, Cardinal)
# function getOffset(this: IMessageMetadata; status: IStatus; index: Cardinal): Cardinal
IMessageMetadata_getOffset = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus, Cardinal)
# function getNullOffset(this: IMessageMetadata; status: IStatus; index: Cardinal): Cardinal
IMessageMetadata_getNullOffset = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus, Cardinal)
# function getBuilder(this: IMessageMetadata; status: IStatus): IMetadataBuilder
IMessageMetadata_getBuilder = CFUNCTYPE(IMetadataBuilder, IMessageMetadata, IStatus)
# function getMessageLength(this: IMessageMetadata; status: IStatus): Cardinal
IMessageMetadata_getMessageLength = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus)
# >>> Firebird 4
# IMessageMetadata(4) : IMessageMetadata(3)
# function getAlignment(this: IMessageMetadata; status: IStatus): Cardinal
IMessageMetadata_getAlignment = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus)
# function getAlignedLength(this: IMessageMetadata; status: IStatus): Cardinal
IMessageMetadata_getAlignedLength = CFUNCTYPE(Cardinal, IMessageMetadata, IStatus)
#
# IMetadataBuilder(3) : ReferenceCounted
# --------------------------------------
# procedure setType(this: IMetadataBuilder; status: IStatus; index: Cardinal; type_: Cardinal)
IMetadataBuilder_setType = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, Cardinal)
# procedure setSubType(this: IMetadataBuilder; status: IStatus; index: Cardinal; subType: Integer)
IMetadataBuilder_setSubType = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_int)
# procedure setLength(this: IMetadataBuilder; status: IStatus; index: Cardinal; length: Cardinal)
IMetadataBuilder_setLength = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, Cardinal)
# procedure setCharSet(this: IMetadataBuilder; status: IStatus; index: Cardinal; charSet: Cardinal)
IMetadataBuilder_setCharSet = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, Cardinal)
# procedure setScale(this: IMetadataBuilder; status: IStatus; index: Cardinal; scale: Integer)
IMetadataBuilder_setScale = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_int)
# procedure truncate(this: IMetadataBuilder; status: IStatus; count: Cardinal)
IMetadataBuilder_truncate = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal)
# procedure moveNameToIndex(this: IMetadataBuilder; status: IStatus; name: PAnsiChar; index: Cardinal)
IMetadataBuilder_moveNameToIndex = CFUNCTYPE(None, IMetadataBuilder, IStatus, c_char_p, Cardinal)
# procedure remove(this: IMetadataBuilder; status: IStatus; index: Cardinal)
IMetadataBuilder_remove = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal)
# function addField(this: IMetadataBuilder; status: IStatus): Cardinal
IMetadataBuilder_addField = CFUNCTYPE(Cardinal, IMetadataBuilder, IStatus)
# function getMetadata(this: IMetadataBuilder; status: IStatus): IMessageMetadata
IMetadataBuilder_getMetadata = CFUNCTYPE(IMessageMetadata, IMetadataBuilder, IStatus)
# >>> Firebird 4
# IMetadataBuilder(4) : IMetadataBuilder(3)
# procedure setField(this: IMetadataBuilder; status: IStatus; index: Cardinal; field: PAnsiChar)
IMetadataBuilder_setField = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_char_p)
# procedure setRelation(this: IMetadataBuilder; status: IStatus; index: Cardinal; relation: PAnsiChar)
IMetadataBuilder_setRelation = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_char_p)
# procedure setOwner(this: IMetadataBuilder; status: IStatus; index: Cardinal; owner: PAnsiChar)
IMetadataBuilder_setOwner = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_char_p)
# procedure setAlias(this: IMetadataBuilder; status: IStatus; index: Cardinal; alias: PAnsiChar)
IMetadataBuilder_setAlias = CFUNCTYPE(None, IMetadataBuilder, IStatus, Cardinal, c_char_p)
#
# IResultSet(3) : ReferenceCounted
# --------------------------------
# function fetchNext(this: IResultSet; status: IStatus; message: Pointer): Integer
IResultSet_fetchNext = CFUNCTYPE(c_int, IResultSet, IStatus, c_void_p)
# function fetchPrior(this: IResultSet; status: IStatus; message: Pointer): Integer
IResultSet_fetchPrior = CFUNCTYPE(c_int, IResultSet, IStatus, c_void_p)