12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #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
- #if defined(HAVE_LIBZIP)
- #include <zip.h>
- #else
- #include "lib/zip.h"
- #endif
- #ifndef ZIP_OVERWRITE
- #define ZIP_OVERWRITE ZIP_TRUNCATE
- #endif
- #define PHP_ZIP_VERSION "1.15.4"
- #define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
- 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;
- #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)
- typedef struct _ze_zip_object {
- struct zip *za;
- char **buffers;
- HashTable *prop_handler;
- char *filename;
- int filename_len;
- int buffers_cnt;
- zend_object zo;
- } ze_zip_object;
- 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 const php_stream_wrapper php_stream_zip_wrapper;
- #endif
|