#ifndef PHP_ZIP_H
#define PHP_ZIP_H
extern zend_module_entry zip_module_entry;
#define phpext_zip_ptr &zip_module_entry
#ifdef ZTS
#include "TSRM.h"
#endif
#include "lib/zip.h"
#define PHP_ZIP_VERSION_STRING "1.8.11"
#if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6)
# define PHP_ZIP_USE_OO 1
#endif
#ifndef Z_SET_REFCOUNT_P
# if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc
# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
# endif
#endif
#if (PHP_MAJOR_VERSION < 6)
#define OPENBASEDIR_CHECKPATH(filename) \
(PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
#else
#define OPENBASEDIR_CHECKPATH(filename) \
php_check_open_basedir(filename TSRMLS_CC)
#endif
typedef struct _ze_zip_rsrc {
struct zip *za;
int index_current;
int num_files;
} zip_rsrc;
typedef zip_rsrc * zip_rsrc_ptr;
typedef struct _ze_zip_read_rsrc {
struct zip_file *zf;
struct zip_stat sb;
} zip_read_rsrc;
#ifdef PHP_ZIP_USE_OO
#define ZIPARCHIVE_ME(name, arg_info, flags) ZEND_FENTRY(name, c_ziparchive_ ##name, arg_info, flags)
#define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_##name)
typedef struct _ze_zip_object {
zend_object zo;
struct zip *za;
int buffers_cnt;
char **buffers;
HashTable *prop_handler;
char *filename;
int filename_len;
} ze_zip_object;
php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC);
extern php_stream_wrapper php_stream_zip_wrapper;
#endif
#endif