inde.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* zpipe.c: example of proper use of zlib's inflate() and deflate()
  2. Not copyrighted -- provided to the public domain
  3. Version 1.4 11 December 2005 Mark Adler */
  4. /* Version history:
  5. 1.0 30 Oct 2004 First version
  6. 1.1 8 Nov 2004 Add void casting for unused return values
  7. Use switch statement for inflate() return values
  8. 1.2 9 Nov 2004 Add assertions to document zlib guarantees
  9. 1.3 6 Apr 2005 Remove incorrect assertion in inf()
  10. 1.4 11 Dec 2005 Add hack to avoid MSDOS end-of-line conversions
  11. Avoid some compiler warnings for input and output buffers
  12. */
  13. #include "stdafx.h"
  14. /* compress or decompress from stdin to stdout */
  15. //int main(int argc, char **argv)
  16. //{
  17. // int ret;
  18. //
  19. // /* avoid end-of-line conversions */
  20. // SET_BINARY_MODE(stdin);
  21. // SET_BINARY_MODE(stdout);
  22. //
  23. // /* do compression if no arguments */
  24. // if (argc == 1) {
  25. // ret = def(stdin, stdout, Z_DEFAULT_COMPRESSION);
  26. // if (ret != Z_OK)
  27. // zerr(ret);
  28. // return ret;
  29. // }
  30. //
  31. // /* do decompression if -d specified */
  32. // else if (argc == 2 && strcmp(argv[1], "-d") == 0) {
  33. // ret = inf(stdin, stdout);
  34. // if (ret != Z_OK)
  35. // zerr(ret);
  36. // return ret;
  37. // }
  38. //
  39. // /* otherwise, report usage */
  40. // else {
  41. // fputs("zpipe usage: zpipe [-d] < source > dest\n", stderr);
  42. // return 1;
  43. // }
  44. //}