ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBExternals.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBExternals.pas (file contents):
Revision 5 by tony, Fri Feb 18 16:26:16 2011 UTC vs.
Revision 17 by tony, Sat Dec 28 19:22:24 2013 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines