home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / LZEXPAND.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  4KB  |  88 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 LZ compression Interface Unit             }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit LZExpand;
  14.  
  15. {$WEAKPACKAGEUNIT}
  16.  
  17. {$HPPEMIT '#include <lzexpand.h>'}
  18.  
  19. interface
  20.  
  21. uses Windows;
  22.  
  23. { Error Return Codes }
  24.  
  25. const
  26.   {$EXTERNALSYM LZERROR_BADINHANDLE}
  27.   LZERROR_BADINHANDLE = -1;         { invalid input handle }
  28.   {$EXTERNALSYM LZERROR_BADOUTHANDLE}
  29.   LZERROR_BADOUTHANDLE = -2;        { invalid output handle }
  30.   {$EXTERNALSYM LZERROR_READ}
  31.   LZERROR_READ = -3;                { corrupt compressed file format }
  32.   {$EXTERNALSYM LZERROR_WRITE}
  33.   LZERROR_WRITE = -4;               { out of space for output file }
  34.   {$EXTERNALSYM LZERROR_GLOBALLOC}
  35.   LZERROR_GLOBALLOC = -5;           { insufficient memory for LZFile struct }
  36.   {$EXTERNALSYM LZERROR_GLOBLOCK}
  37.   LZERROR_GLOBLOCK = -6;            { bad global handle }
  38.   {$EXTERNALSYM LZERROR_BADVALUE}
  39.   LZERROR_BADVALUE = -7;            { input parameter out of acceptable range }
  40.   {$EXTERNALSYM LZERROR_UNKNOWNALG}
  41.   LZERROR_UNKNOWNALG = -8;          { compression algorithm not recognized }
  42.  
  43.  
  44. { Prototypes }
  45.  
  46. {$EXTERNALSYM LZCopy}
  47. function LZCopy(Source, Dest: Integer): Longint; stdcall;
  48. {$EXTERNALSYM LZInit}
  49. function LZInit(Source: Integer): Integer; stdcall;
  50. {$EXTERNALSYM GetExpandedNameA}
  51. function GetExpandedNameA(Source, Buffer: PAnsiChar): Integer; stdcall;
  52. {$EXTERNALSYM GetExpandedNameW}
  53. function GetExpandedNameW(Source, Buffer: PWideChar): Integer; stdcall;
  54. {$EXTERNALSYM GetExpandedName}
  55. function GetExpandedName(Source, Buffer: PChar): Integer; stdcall;
  56. {$EXTERNALSYM LZOpenFileA}
  57. function LZOpenFileA(Filename: PAnsiChar; var ReOpenBuff: TOFStruct; Style: Word): Integer; stdcall;
  58. {$EXTERNALSYM LZOpenFileW}
  59. function LZOpenFileW(Filename: PWideChar; var ReOpenBuff: TOFStruct; Style: Word): Integer; stdcall;
  60. {$EXTERNALSYM LZOpenFile}
  61. function LZOpenFile(Filename: PChar; var ReOpenBuff: TOFStruct; Style: Word): Integer; stdcall;
  62. {$EXTERNALSYM LZSeek}
  63. function LZSeek(hFile: Integer; Offset: Longint; Origin: Integer): Longint; stdcall;
  64. {$EXTERNALSYM LZRead}
  65. function LZRead(hFile: Integer; Buffer: LPSTR; Count: Integer): Integer; stdcall;
  66. {$EXTERNALSYM LZClose}
  67. procedure LZClose(hFile: Integer); stdcall;
  68.  
  69.  
  70. implementation
  71.  
  72. const
  73.   lz32 = 'LZ32.DLL';
  74.  
  75. function GetExpandedNameA;    external lz32 name 'GetExpandedNameA';
  76. function GetExpandedNameW;    external lz32 name 'GetExpandedNameW';
  77. function GetExpandedName;    external lz32 name 'GetExpandedNameA';
  78. procedure LZClose;              external lz32 name 'LZClose';
  79. function LZCopy;                external lz32 name 'LZCopy';
  80. function LZInit;                external lz32 name 'LZInit';
  81. function LZOpenFileA;         external lz32 name 'LZOpenFileA';
  82. function LZOpenFileW;         external lz32 name 'LZOpenFileW';
  83. function LZOpenFile;         external lz32 name 'LZOpenFileA';
  84. function LZRead;                external lz32 name 'LZRead';
  85. function LZSeek;                external lz32 name 'LZSeek';
  86.  
  87. end.
  88.