ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/IBExternals.pas
Revision: 370
Committed: Wed Jan 5 14:59:15 2022 UTC (2 years, 10 months ago) by tony
Content type: text/x-pascal
File size: 7832 byte(s)
Log Message:
Initialise UDR branch

File Contents

# Content
1 {************************************************************************}
2 { }
3 { Borland Delphi Visual Component Library }
4 { InterBase Express core components }
5 { }
6 { Copyright (c) 1998-2000 Inprise Corporation }
7 { }
8 { InterBase Express is based in part on the product }
9 { Free IB Components, written by Gregory H. Deatz for }
10 { Hoagland, Longo, Moran, Dunst & Doukas Company. }
11 { Free IB Components is used under license. }
12 { }
13 { The contents of this file are subject to the InterBase }
14 { Public License Version 1.0 (the "License"); you may not }
15 { use this file except in compliance with the License. You }
16 { may obtain a copy of the License at http://www.Inprise.com/IPL.html }
17 { Software distributed under the License is distributed on }
18 { an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either }
19 { express or implied. See the License for the specific language }
20 { governing rights and limitations under the License. }
21 { The Original Code was created by InterBase Software Corporation }
22 { and its successors. }
23 { Portions created by Inprise Corporation are Copyright (C) Inprise }
24 { Corporation. All Rights Reserved. }
25 { Contributor(s): Jeff Overcash }
26 { }
27 { IBX For Lazarus (Firebird Express) }
28 { Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk }
29 { Portions created by MWA Software are copyright McCallum Whyman }
30 { Associates Ltd 2011 }
31 { }
32 {************************************************************************}
33
34 unit 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
48 const
49 MaxuShort = 65535;
50 ISC_TRUE = 1;
51 ISC_FALSE = 0;
52
53 type
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 }
72 UISC_STATUS = UInt64; { 64 bit unsigned}
73 {$ELSE}
74 ISC_STATUS = Long; { 32 bit signed }
75 UISC_STATUS = ULong; { 32 bit unsigned}
76 {$ENDIF}
77 FB_API_HANDLE = ^Pointer;
78 Void = Pointer;
79 { Delphi Pointer types }
80 PInt = ^Int;
81 PShort = ^Short;
82 PUShort = ^UShort;
83 PLong = ^Long;
84 PULong = ^ULong;
85 PFloat = ^Float;
86 PUChar = ^UChar;
87 PVoid = ^Pointer;
88 PISC_LONG = ^ISC_LONG;
89 PUISC_LONG = ^UISC_LONG;
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 }
140 tm_min : integer; { Minutes }
141 tm_hour : integer; { Hour (0--23) }
142 tm_mday : integer; { Day of month (1--31) }
143 tm_mon : integer; { Month (0--11) }
144 tm_year : integer; { Year (calendar year minus 1900) }
145 tm_wday : integer; { Weekday (0--6) Sunday = 0) }
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: PAnsiChar;
150 end;
151 PCTimeStructure = ^TCTimeStructure;
152 TM = TCTimeStructure;
153 PTM = ^TM;
154
155 TISC_VARYING = record
156 strlen: Short;
157 str: array[0..0] of AnsiChar;
158 end;
159
160 {***************************}
161 {* Some blob ctl structs *}
162 {* from IB help files for *}
163 {* implementing UDFs . *}
164 {* -- Taken from docs, not *}
165 {* in original ibase.h *}
166 {***************************}
167 TISC_BlobGetSegment = function(BlobHandle: PInt;
168 Buffer: PAnsiChar;
169 BufferSize: Long;
170 var ResultLength: Long): Short; cdecl;
171 TISC_BlobPutSegment = procedure(BlobHandle: PInt;
172 Buffer: PAnsiChar;
173 BufferLength: Short); cdecl;
174 TBlob = record
175 GetSegment : TISC_BlobGetSegment;
176 BlobHandle : PInt;
177 SegmentCount : Long;
178 MaxSegmentLength : Long;
179 TotalSize : Long;
180 PutSegment : TISC_BlobPutSegment;
181 end;
182 PBlob = ^TBlob;
183
184 const
185 { Delphi consts }
186 { Days of week }
187 dSun = 1; dMon = 2; dTue = 3; dWed = 4; dThu = 5; dFri = 6; dSat = 7;
188 { Months of year }
189 dJan = 1; dFeb = 2; dMar = 3; dApr = 4; dMay = 5; dJun = 6;
190 dJul = 7; dAug = 8; dSep = 9; dOct = 10; dNov = 11; dDec = 12;
191 { C Consts }
192 cYearOffset = 1900;
193 { Days of week }
194 cSun = 0; cMon = 1; cTue = 2; cWed = 3; cThu = 4; cFri = 5; cSat = 6;
195 { Months of year }
196 cJan = 0; cFeb = 1; cMar = 2; cApr = 3; cMay = 4; cJun = 5;
197 cJul = 6; cAug = 7; cSep = 8; cOct = 9; cNov = 10; cDec = 11;
198
199 procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
200
201 implementation
202
203 procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
204 begin
205 with tm_record do begin
206 tm_sec := 0;
207 tm_min := 0;
208 tm_hour := 0;
209 tm_mday := 0;
210 tm_mon := 0;
211 tm_year := 0;
212 tm_wday := 0;
213 tm_yday := 0;
214 tm_isdst := 0;
215 end;
216 end;
217
218
219 end.