This source file includes following definitions.
- php_zip_fetch_object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef PHP_ZIP_H
21 #define PHP_ZIP_H
22
23 extern zend_module_entry zip_module_entry;
24 #define phpext_zip_ptr &zip_module_entry
25
26 #ifdef ZTS
27 #include "TSRM.h"
28 #endif
29
30 #if defined(HAVE_LIBZIP)
31 #include <zip.h>
32 #else
33 #include "lib/zip.h"
34 #endif
35
36 #ifndef ZIP_OVERWRITE
37 #define ZIP_OVERWRITE ZIP_TRUNCATE
38 #endif
39
40 #define PHP_ZIP_VERSION "1.13.2"
41
42 #ifndef Z_SET_REFCOUNT_P
43 # if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
44 # define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc
45 # define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
46 # endif
47 #endif
48
49
50 #if PHP_API_VERSION < 20100412
51 # define ZIP_OPENBASEDIR_CHECKPATH(filename) \
52 (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
53 #else
54 #define ZIP_OPENBASEDIR_CHECKPATH(filename) \
55 php_check_open_basedir(filename)
56 #endif
57
58
59 typedef struct _ze_zip_rsrc {
60 struct zip *za;
61 int index_current;
62 int num_files;
63 } zip_rsrc;
64
65 typedef zip_rsrc * zip_rsrc_ptr;
66
67 typedef struct _ze_zip_read_rsrc {
68 struct zip_file *zf;
69 struct zip_stat sb;
70 } zip_read_rsrc;
71
72 #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 },
73 #define ZIPARCHIVE_METHOD(name) ZEND_NAMED_FUNCTION(c_ziparchive_ ##name)
74
75
76 typedef struct _ze_zip_object {
77 struct zip *za;
78 char **buffers;
79 HashTable *prop_handler;
80 char *filename;
81 int filename_len;
82 int buffers_cnt;
83 zend_object zo;
84 } ze_zip_object;
85
86 static inline ze_zip_object *php_zip_fetch_object(zend_object *obj) {
87 return (ze_zip_object *)((char*)(obj) - XtOffsetOf(ze_zip_object, zo));
88 }
89
90 #define Z_ZIP_P(zv) php_zip_fetch_object(Z_OBJ_P((zv)))
91
92 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);
93 php_stream *php_stream_zip_open(const char *filename, const char *path, const char *mode STREAMS_DC);
94
95 extern php_stream_wrapper php_stream_zip_wrapper;
96
97 #endif
98
99
100
101
102
103
104
105
106