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