Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.0 KiB

3 years ago
  1. unit ZLibDelphi;
  2. {$IFDEF FPC}
  3. {$MODE OBJFPC}
  4. {$ELSE}
  5. {$DEFINE DCC}
  6. {$ENDIF}
  7. interface
  8. uses
  9. SysUtils;
  10. const
  11. ZLIB_VERSION = '1.2.1';
  12. Z_NO_FLUSH = 0;
  13. Z_FINISH = 4;
  14. Z_OK = 0;
  15. Z_STREAM_END = 1;
  16. type
  17. PRZStream = ^RZStream;
  18. RZStream = record
  19. NextIn: PByte;
  20. AvailIn: Cardinal;
  21. TotalIn: Cardinal;
  22. NextOut: PByte;
  23. AvailOut: Cardinal;
  24. TotalOut: Cardinal;
  25. Msg: PAnsiChar;
  26. State: Pointer;
  27. AllocFunc: Pointer;
  28. FreeFunc: Pointer;
  29. Opaque: Cardinal;
  30. DataType: Integer;
  31. Adler: Cardinal;
  32. Reserved: Cardinal;
  33. end;
  34. function inflateInit_(strm: Pointer; version: Pointer; stream_size: Integer): Integer; cdecl; external;
  35. function inflateReset(strm: Pointer): Integer; cdecl; external;
  36. function inflate(strm: Pointer; flush: Integer): Integer; cdecl; external;
  37. function inflateSync(strm: Pointer): Integer; cdecl; external;
  38. function deflateInit(strm: Pointer; level: Integer): Integer;
  39. function deflateInit_(strm: Pointer; level: Integer; version: Pointer; stream_size: Integer): Integer; cdecl; external;
  40. function deflateReset(strm: Pointer): Integer; cdecl; external;
  41. function deflate(strm: Pointer; flush: Integer): Integer; cdecl; external;
  42. function deflateEnd(strm: Pointer): Integer; cdecl; external;
  43. function inflateEnd(strm: Pointer): Integer; cdecl; external;
  44. function deflateParams(strm: Pointer; level: Integer; strategy: Integer): Integer; cdecl; external;
  45. implementation
  46. uses
  47. LibDelphi;
  48. function deflateInit(strm: Pointer; level: Integer): Integer;
  49. begin
  50. Result:=deflateInit_(strm,level,PAnsiChar(ZLIB_VERSION),SizeOf(RZStream));
  51. end;
  52. {$IF Defined(DCC) and Defined(MSWINDOWS) and not Defined(CPUX64)}
  53. // Windows 32bit Delphi only - OMF object format
  54. {$L Compiled\inflate.obj}
  55. {$L Compiled\crc32.obj}
  56. {$L Compiled\adler32.obj}
  57. {$L Compiled\inftrees.obj}
  58. {$L Compiled\inffast.obj}
  59. {$L Compiled\deflate.obj}
  60. {$L Compiled\zutil.obj}
  61. {$L Compiled\trees.obj}
  62. {$L Compiled\compress.obj}
  63. {$L Compiled\uncompr.obj}
  64. {$IFEND}
  65. end.