32 |
|
{************************************************************************} |
33 |
|
|
34 |
|
unit IBExternals; |
35 |
+ |
{$IFDEF MSWINDOWS} |
36 |
+ |
{$DEFINE WINDOWS} |
37 |
+ |
{$ENDIF} |
38 |
+ |
|
39 |
+ |
{$IFDEF FPC} |
40 |
+ |
{$mode delphi} |
41 |
+ |
{$codepage UTF8} |
42 |
+ |
{$ENDIF} |
43 |
|
|
44 |
|
{ Some structures, declarations that we need for the IB stuff to work, but |
45 |
|
that aren't really part of the ib header file. } |
46 |
|
interface |
47 |
|
|
40 |
– |
uses |
41 |
– |
{$IFDEF WINDOWS } |
42 |
– |
Windows |
43 |
– |
{$ELSE} |
44 |
– |
unix |
45 |
– |
{$ENDIF} |
46 |
– |
; |
48 |
|
const |
49 |
|
MaxuShort = 65535; |
50 |
+ |
ISC_TRUE = 1; |
51 |
+ |
ISC_FALSE = 0; |
52 |
+ |
|
53 |
|
type |
54 |
< |
Int = LongInt; { 32 bit signed } |
55 |
< |
UInt = DWord; { 32 bit unsigned } |
56 |
< |
Long = LongInt; { 32 bit signed } |
57 |
< |
ULong = DWord; { 32 bit unsigned } |
54 |
> |
{$IF not declared(FixedInt)} |
55 |
> |
FixedInt = LongInt; |
56 |
> |
FixedUInt = LongWord; |
57 |
> |
{$IFEND} |
58 |
> |
Int = FixedInt; { 32 bit signed } |
59 |
> |
UInt = FixedUInt; { 32 bit unsigned } |
60 |
> |
Long = FixedInt; { 32 bit signed } |
61 |
> |
ULong = FixedUInt; { 32 bit unsigned } |
62 |
|
Short = SmallInt;{ 16 bit signed } |
63 |
|
UShort = Word; { 16 bit unsigned } |
64 |
|
Float = Single; { 32 bit } |
65 |
|
UChar = Byte; { 8 bit unsigned } |
66 |
|
ISC_LONG = Long; { 32 bit signed } |
67 |
|
UISC_LONG = ULong; { 32 bit unsigned } |
68 |
+ |
ISC_USHORT = UShort; { 16 bit unsigned } |
69 |
|
ISC_INT64 = Int64; { 64 bit signed } |
70 |
|
{$IFDEF CPU64} |
71 |
|
ISC_STATUS = Int64; { 64 bit signed } |
90 |
|
PISC_STATUS = ^ISC_STATUS; |
91 |
|
PPISC_STATUS = ^PISC_STATUS; |
92 |
|
PUISC_STATUS = ^UISC_STATUS; |
93 |
+ |
ISC_SHORT = SmallInt; |
94 |
+ |
|
95 |
+ |
FB_DEC16 = array [1..1] of Int64; |
96 |
+ |
FB_DEC34 = array [1..2] of Int64; |
97 |
+ |
FB_DEC_FIXED = array [1..2] of Int64; {FB4 Beta 1 only} |
98 |
+ |
FB_I128 = array [1..2] of Int64; |
99 |
+ |
|
100 |
+ |
ISC_DATE = Integer; |
101 |
+ |
ISC_TIME = Integer; |
102 |
+ |
|
103 |
+ |
PISC_TIME_TZ = ^ISC_TIME_TZ; |
104 |
+ |
ISC_TIME_TZ = record |
105 |
+ |
utc_time: ISC_TIME; |
106 |
+ |
time_zone: ISC_USHORT; |
107 |
+ |
end; |
108 |
+ |
|
109 |
+ |
PISC_TIMESTAMP = ^ISC_TIMESTAMP; |
110 |
+ |
ISC_TIMESTAMP = record |
111 |
+ |
timestamp_date: ISC_DATE; |
112 |
+ |
timestamp_time: ISC_TIME; |
113 |
+ |
end; |
114 |
+ |
|
115 |
+ |
PISC_TIMESTAMP_TZ = ^ISC_TIMESTAMP_TZ; |
116 |
+ |
ISC_TIMESTAMP_TZ = record |
117 |
+ |
utc_timestamp: ISC_TIMESTAMP; |
118 |
+ |
time_zone: ISC_USHORT; |
119 |
+ |
end; |
120 |
+ |
|
121 |
+ |
PISC_TIME_TZ_EX = ^ISC_TIME_TZ_EX; |
122 |
+ |
ISC_TIME_TZ_EX = record |
123 |
+ |
utc_time: ISC_TIME; |
124 |
+ |
time_zone: ISC_USHORT; |
125 |
+ |
ext_offset: ISC_SHORT; |
126 |
+ |
end; |
127 |
+ |
|
128 |
+ |
PISC_TIMESTAMP_TZ_EX = ^ISC_TIMESTAMP_TZ_EX; |
129 |
+ |
ISC_TIMESTAMP_TZ_EX = record |
130 |
+ |
utc_timestamp: ISC_TIMESTAMP; |
131 |
+ |
time_zone: ISC_USHORT; |
132 |
+ |
ext_offset: ISC_SHORT; |
133 |
+ |
end; |
134 |
|
|
135 |
|
type |
136 |
+ |
|
137 |
|
{ C Date/Time Structure } |
138 |
|
TCTimeStructure = record |
139 |
|
tm_sec : integer; { Seconds } |
146 |
|
tm_yday : integer; { Day of year (0--365) } |
147 |
|
tm_isdst : integer; { 0 if daylight savings time is not in effect) } |
148 |
|
tm_gmtoff: longint; |
149 |
< |
tm_zone: PChar; |
149 |
> |
tm_zone: PAnsiChar; |
150 |
|
end; |
151 |
|
PCTimeStructure = ^TCTimeStructure; |
152 |
|
TM = TCTimeStructure; |
154 |
|
|
155 |
|
TISC_VARYING = record |
156 |
|
strlen: Short; |
157 |
< |
str: array[0..0] of Char; |
157 |
> |
str: array[0..0] of AnsiChar; |
158 |
|
end; |
159 |
|
|
160 |
|
{***************************} |
165 |
|
{* in original ibase.h *} |
166 |
|
{***************************} |
167 |
|
TISC_BlobGetSegment = function(BlobHandle: PInt; |
168 |
< |
Buffer: PChar; |
168 |
> |
Buffer: PAnsiChar; |
169 |
|
BufferSize: Long; |
170 |
|
var ResultLength: Long): Short; cdecl; |
171 |
|
TISC_BlobPutSegment = procedure(BlobHandle: PInt; |
172 |
< |
Buffer: PChar; |
172 |
> |
Buffer: PAnsiChar; |
173 |
|
BufferLength: Short); cdecl; |
174 |
|
TBlob = record |
175 |
|
GetSegment : TISC_BlobGetSegment; |
181 |
|
end; |
182 |
|
PBlob = ^TBlob; |
183 |
|
|
133 |
– |
{$IF FPC_FULLVERSION < 20700 } |
134 |
– |
RawByteString = string; {for backwards compatibility} |
135 |
– |
{$ENDIF} |
136 |
– |
|
184 |
|
const |
185 |
|
{ Delphi consts } |
186 |
|
{ Days of week } |