php_bz2.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Sterling Hughes <sterling@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_BZ2_H
  19. #define PHP_BZ2_H
  20. #if HAVE_BZ2
  21. extern zend_module_entry bz2_module_entry;
  22. #define phpext_bz2_ptr &bz2_module_entry
  23. /* Bzip2 includes */
  24. #include <bzlib.h>
  25. #else
  26. #define phpext_bz2_ptr NULL
  27. #endif
  28. #ifdef PHP_WIN32
  29. # ifdef PHP_BZ2_EXPORTS
  30. # define PHP_BZ2_API __declspec(dllexport)
  31. # elif defined(COMPILE_DL_BZ2)
  32. # define PHP_BZ2_API __declspec(dllimport)
  33. # else
  34. # define PHP_BZ2_API /* nothing special */
  35. # endif
  36. #elif defined(__GNUC__) && __GNUC__ >= 4
  37. # define PHP_BZ2_API __attribute__ ((visibility("default")))
  38. #else
  39. # define PHP_BZ2_API
  40. #endif
  41. #include "php_version.h"
  42. #define PHP_BZ2_VERSION PHP_VERSION
  43. PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
  44. PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC);
  45. #define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC)
  46. #define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC)
  47. extern const php_stream_filter_factory php_bz2_filter_factory;
  48. extern const php_stream_ops php_stream_bz2io_ops;
  49. #define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops
  50. /* 400kb */
  51. #define PHP_BZ2_FILTER_DEFAULT_BLOCKSIZE 4
  52. /* BZ2 Internal Default */
  53. #define PHP_BZ2_FILTER_DEFAULT_WORKFACTOR 0
  54. #endif
  55. /*
  56. * Local variables:
  57. * tab-width: 4
  58. * c-basic-offset: 4
  59. * End:
  60. */