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

File Contents

# Content
1 {************************************************************************}
2 { }
3 { Borland Delphi Visual Component Library }
4 { InterBase Express core components }
5 { }
6 { Copyright (c) 1998-2000 Inprise Corporation }
7 { }
8 { InterBase Express is based in part on the product }
9 { Free IB Components, written by Gregory H. Deatz for }
10 { Hoagland, Longo, Moran, Dunst & Doukas Company. }
11 { Free IB Components is used under license. }
12 { }
13 { The contents of this file are subject to the InterBase }
14 { Public License Version 1.0 (the "License"); you may not }
15 { use this file except in compliance with the License. You }
16 { may obtain a copy of the License at http://www.Inprise.com/IPL.html }
17 { Software distributed under the License is distributed on }
18 { an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either }
19 { express or implied. See the License for the specific language }
20 { governing rights and limitations under the License. }
21 { The Original Code was created by InterBase Software Corporation }
22 { and its successors. }
23 { Portions created by Inprise Corporation are Copyright (C) Inprise }
24 { Corporation. All Rights Reserved. }
25 { Contributor(s): Jeff Overcash }
26 { }
27 { IBX For Lazarus (Firebird Express) }
28 { Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk }
29 { Portions created by MWA Software are copyright McCallum Whyman }
30 { Associates Ltd 2011 }
31 { }
32 {************************************************************************}
33
34 unit IBExternals;
35
36 { Some structures, declarations that we need for the IB stuff to work, but
37 that aren't really part of the ib header file. }
38 interface
39
40 uses
41 {$IFDEF WINDOWS }
42 Windows
43 {$ELSE}
44 unix
45 {$ENDIF}
46 ;
47 const
48 MaxuShort = 65535;
49 type
50 Int = LongInt; { 32 bit signed }
51 UInt = DWord; { 32 bit unsigned }
52 Long = LongInt; { 32 bit signed }
53 ULong = DWord; { 32 bit unsigned }
54 Short = SmallInt;{ 16 bit signed }
55 UShort = Word; { 16 bit unsigned }
56 Float = Single; { 32 bit }
57 UChar = Byte; { 8 bit unsigned }
58 ISC_LONG = Long; { 32 bit signed }
59 UISC_LONG = ULong; { 32 bit unsigned }
60 ISC_INT64 = Int64; { 64 bit signed }
61 {$IFDEF CPU64}
62 ISC_STATUS = Int64; { 64 bit signed }
63 UISC_STATUS = UInt64; { 64 bit unsigned}
64 {$ELSE}
65 ISC_STATUS = Long; { 32 bit signed }
66 UISC_STATUS = ULong; { 32 bit unsigned}
67 {$ENDIF}
68 FB_API_HANDLE = ^Pointer;
69 Void = Pointer;
70 { Delphi Pointer types }
71 PInt = ^Int;
72 PShort = ^Short;
73 PUShort = ^UShort;
74 PLong = ^Long;
75 PULong = ^ULong;
76 PFloat = ^Float;
77 PUChar = ^UChar;
78 PVoid = ^Pointer;
79 PISC_LONG = ^ISC_LONG;
80 PUISC_LONG = ^UISC_LONG;
81 PISC_STATUS = ^ISC_STATUS;
82 PPISC_STATUS = ^PISC_STATUS;
83 PUISC_STATUS = ^UISC_STATUS;
84
85 type
86 { C Date/Time Structure }
87 TCTimeStructure = record
88 tm_sec : integer; { Seconds }
89 tm_min : integer; { Minutes }
90 tm_hour : integer; { Hour (0--23) }
91 tm_mday : integer; { Day of month (1--31) }
92 tm_mon : integer; { Month (0--11) }
93 tm_year : integer; { Year (calendar year minus 1900) }
94 tm_wday : integer; { Weekday (0--6) Sunday = 0) }
95 tm_yday : integer; { Day of year (0--365) }
96 tm_isdst : integer; { 0 if daylight savings time is not in effect) }
97 tm_gmtoff: longint;
98 tm_zone: PChar;
99 end;
100 PCTimeStructure = ^TCTimeStructure;
101 TM = TCTimeStructure;
102 PTM = ^TM;
103
104 TISC_VARYING = record
105 strlen: Short;
106 str: array[0..0] of Char;
107 end;
108
109 {***************************}
110 {* Some blob ctl structs *}
111 {* from IB help files for *}
112 {* implementing UDFs . *}
113 {* -- Taken from docs, not *}
114 {* in original ibase.h *}
115 {***************************}
116 TISC_BlobGetSegment = function(BlobHandle: PInt;
117 Buffer: PChar;
118 BufferSize: Long;
119 var ResultLength: Long): Short; cdecl;
120 TISC_BlobPutSegment = procedure(BlobHandle: PInt;
121 Buffer: PChar;
122 BufferLength: Short); cdecl;
123 TBlob = record
124 GetSegment : TISC_BlobGetSegment;
125 BlobHandle : PInt;
126 SegmentCount : Long;
127 MaxSegmentLength : Long;
128 TotalSize : Long;
129 PutSegment : TISC_BlobPutSegment;
130 end;
131 PBlob = ^TBlob;
132
133 {$IF FPC_FULLVERSION < 20700 }
134 RawByteString = string; {for backwards compatibility}
135 {$ENDIF}
136
137 const
138 { Delphi consts }
139 { Days of week }
140 dSun = 1; dMon = 2; dTue = 3; dWed = 4; dThu = 5; dFri = 6; dSat = 7;
141 { Months of year }
142 dJan = 1; dFeb = 2; dMar = 3; dApr = 4; dMay = 5; dJun = 6;
143 dJul = 7; dAug = 8; dSep = 9; dOct = 10; dNov = 11; dDec = 12;
144 { C Consts }
145 cYearOffset = 1900;
146 { Days of week }
147 cSun = 0; cMon = 1; cTue = 2; cWed = 3; cThu = 4; cFri = 5; cSat = 6;
148 { Months of year }
149 cJan = 0; cFeb = 1; cMar = 2; cApr = 3; cMay = 4; cJun = 5;
150 cJul = 6; cAug = 7; cSep = 8; cOct = 9; cNov = 10; cDec = 11;
151
152 procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
153
154 implementation
155
156 procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
157 begin
158 with tm_record do begin
159 tm_sec := 0;
160 tm_min := 0;
161 tm_hour := 0;
162 tm_mday := 0;
163 tm_mon := 0;
164 tm_year := 0;
165 tm_wday := 0;
166 tm_yday := 0;
167 tm_isdst := 0;
168 end;
169 end;
170
171
172 end.