php_bz2.h 2.5 KB

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