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 |
type
|
51 |
{$IF not declared(FixedInt)}
|
52 |
FixedInt = LongInt;
|
53 |
FixedUInt = LongWord;
|
54 |
{$IFEND}
|
55 |
Int = FixedInt; { 32 bit signed }
|
56 |
UInt = FixedUInt; { 32 bit unsigned }
|
57 |
Long = FixedInt; { 32 bit signed }
|
58 |
ULong = FixedUInt; { 32 bit unsigned }
|
59 |
Short = SmallInt;{ 16 bit signed }
|
60 |
UShort = Word; { 16 bit unsigned }
|
61 |
Float = Single; { 32 bit }
|
62 |
UChar = Byte; { 8 bit unsigned }
|
63 |
ISC_LONG = Long; { 32 bit signed }
|
64 |
UISC_LONG = ULong; { 32 bit unsigned }
|
65 |
ISC_INT64 = Int64; { 64 bit signed }
|
66 |
{$IFDEF CPU64}
|
67 |
ISC_STATUS = Int64; { 64 bit signed }
|
68 |
UISC_STATUS = UInt64; { 64 bit unsigned}
|
69 |
{$ELSE}
|
70 |
ISC_STATUS = Long; { 32 bit signed }
|
71 |
UISC_STATUS = ULong; { 32 bit unsigned}
|
72 |
{$ENDIF}
|
73 |
FB_API_HANDLE = ^Pointer;
|
74 |
Void = Pointer;
|
75 |
{ Delphi Pointer types }
|
76 |
PInt = ^Int;
|
77 |
PShort = ^Short;
|
78 |
PUShort = ^UShort;
|
79 |
PLong = ^Long;
|
80 |
PULong = ^ULong;
|
81 |
PFloat = ^Float;
|
82 |
PUChar = ^UChar;
|
83 |
PVoid = ^Pointer;
|
84 |
PISC_LONG = ^ISC_LONG;
|
85 |
PUISC_LONG = ^UISC_LONG;
|
86 |
PISC_STATUS = ^ISC_STATUS;
|
87 |
PPISC_STATUS = ^PISC_STATUS;
|
88 |
PUISC_STATUS = ^UISC_STATUS;
|
89 |
|
90 |
type
|
91 |
{ C Date/Time Structure }
|
92 |
TCTimeStructure = record
|
93 |
tm_sec : integer; { Seconds }
|
94 |
tm_min : integer; { Minutes }
|
95 |
tm_hour : integer; { Hour (0--23) }
|
96 |
tm_mday : integer; { Day of month (1--31) }
|
97 |
tm_mon : integer; { Month (0--11) }
|
98 |
tm_year : integer; { Year (calendar year minus 1900) }
|
99 |
tm_wday : integer; { Weekday (0--6) Sunday = 0) }
|
100 |
tm_yday : integer; { Day of year (0--365) }
|
101 |
tm_isdst : integer; { 0 if daylight savings time is not in effect) }
|
102 |
tm_gmtoff: longint;
|
103 |
tm_zone: PAnsiChar;
|
104 |
end;
|
105 |
PCTimeStructure = ^TCTimeStructure;
|
106 |
TM = TCTimeStructure;
|
107 |
PTM = ^TM;
|
108 |
|
109 |
TISC_VARYING = record
|
110 |
strlen: Short;
|
111 |
str: array[0..0] of AnsiChar;
|
112 |
end;
|
113 |
|
114 |
{***************************}
|
115 |
{* Some blob ctl structs *}
|
116 |
{* from IB help files for *}
|
117 |
{* implementing UDFs . *}
|
118 |
{* -- Taken from docs, not *}
|
119 |
{* in original ibase.h *}
|
120 |
{***************************}
|
121 |
TISC_BlobGetSegment = function(BlobHandle: PInt;
|
122 |
Buffer: PAnsiChar;
|
123 |
BufferSize: Long;
|
124 |
var ResultLength: Long): Short; cdecl;
|
125 |
TISC_BlobPutSegment = procedure(BlobHandle: PInt;
|
126 |
Buffer: PAnsiChar;
|
127 |
BufferLength: Short); cdecl;
|
128 |
TBlob = record
|
129 |
GetSegment : TISC_BlobGetSegment;
|
130 |
BlobHandle : PInt;
|
131 |
SegmentCount : Long;
|
132 |
MaxSegmentLength : Long;
|
133 |
TotalSize : Long;
|
134 |
PutSegment : TISC_BlobPutSegment;
|
135 |
end;
|
136 |
PBlob = ^TBlob;
|
137 |
|
138 |
const
|
139 |
{ Delphi consts }
|
140 |
{ Days of week }
|
141 |
dSun = 1; dMon = 2; dTue = 3; dWed = 4; dThu = 5; dFri = 6; dSat = 7;
|
142 |
{ Months of year }
|
143 |
dJan = 1; dFeb = 2; dMar = 3; dApr = 4; dMay = 5; dJun = 6;
|
144 |
dJul = 7; dAug = 8; dSep = 9; dOct = 10; dNov = 11; dDec = 12;
|
145 |
{ C Consts }
|
146 |
cYearOffset = 1900;
|
147 |
{ Days of week }
|
148 |
cSun = 0; cMon = 1; cTue = 2; cWed = 3; cThu = 4; cFri = 5; cSat = 6;
|
149 |
{ Months of year }
|
150 |
cJan = 0; cFeb = 1; cMar = 2; cApr = 3; cMay = 4; cJun = 5;
|
151 |
cJul = 6; cAug = 7; cSep = 8; cOct = 9; cNov = 10; cDec = 11;
|
152 |
|
153 |
procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
|
154 |
|
155 |
implementation
|
156 |
|
157 |
procedure InitializeTCTimeStructure(var tm_record: TCTimeStructure);
|
158 |
begin
|
159 |
with tm_record do begin
|
160 |
tm_sec := 0;
|
161 |
tm_min := 0;
|
162 |
tm_hour := 0;
|
163 |
tm_mday := 0;
|
164 |
tm_mon := 0;
|
165 |
tm_year := 0;
|
166 |
tm_wday := 0;
|
167 |
tm_yday := 0;
|
168 |
tm_isdst := 0;
|
169 |
end;
|
170 |
end;
|
171 |
|
172 |
|
173 |
end.
|