home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Source / Vcl / ibexternals.pas < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  5KB  |  139 lines

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