summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/php_zip.h')
-rw-r--r--ext/zip/php_zip.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index d5ec6f6a0c..1ac775eebf 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2015 The PHP Group |
+----------------------------------------------------------------------+
@@ -38,26 +38,22 @@ extern zend_module_entry zip_module_entry;
#define ZIP_OVERWRITE ZIP_TRUNCATE
#endif
-#define PHP_ZIP_VERSION "1.12.5"
-
-#if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6)
-# define PHP_ZIP_USE_OO 1
-#endif
+#define PHP_ZIP_VERSION "1.13.0dev"
#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
+# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc
+# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
# endif
#endif
/* {{{ ZIP_OPENBASEDIR_CHECKPATH(filename) */
#if PHP_API_VERSION < 20100412
# define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
+ (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
#else
#define ZIP_OPENBASEDIR_CHECKPATH(filename) \
- php_check_open_basedir(filename TSRMLS_CC)
+ php_check_open_basedir(filename)
#endif
/* }}} */
@@ -74,27 +70,30 @@ typedef struct _ze_zip_read_rsrc {
struct zip_stat sb;
} zip_read_rsrc;
-#ifdef PHP_ZIP_USE_OO
-#define ZIPARCHIVE_ME(name, arg_info, flags) {#name, c_ziparchive_ ##name, arg_info,(zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
+#define ZIPARCHIVE_ME(name, arg_info, flags) {#name, c_ziparchive_ ##name, arg_info,(uint32_t) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
#define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_ ##name)
-
/* Extends zend object */
typedef struct _ze_zip_object {
- zend_object zo;
struct zip *za;
- int buffers_cnt;
char **buffers;
HashTable *prop_handler;
char *filename;
int filename_len;
+ int buffers_cnt;
+ zend_object zo;
} ze_zip_object;
-php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
-php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC TSRMLS_DC);
+static inline ze_zip_object *php_zip_fetch_object(zend_object *obj) {
+ return (ze_zip_object *)((char*)(obj) - XtOffsetOf(ze_zip_object, zo));
+}
+
+#define Z_ZIP_P(zv) php_zip_fetch_object(Z_OBJ_P((zv)))
+
+php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, zend_string **opened_path, php_stream_context *context STREAMS_DC);
+php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC);
extern php_stream_wrapper php_stream_zip_wrapper;
-#endif
#endif /* PHP_ZIP_H */