Back to index

php5  5.3.10
php_zip.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt.                                 |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author: Pierre-Alain Joye <pajoye@php.net>                           |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_zip.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_ZIP_H
00022 #define PHP_ZIP_H
00023 
00024 extern zend_module_entry zip_module_entry;
00025 #define phpext_zip_ptr &zip_module_entry
00026 
00027 #ifdef ZTS
00028 #include "TSRM.h"
00029 #endif
00030 
00031 #include "lib/zip.h"
00032 
00033 #define PHP_ZIP_VERSION_STRING "1.9.1"
00034 
00035 #if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6)
00036 # define PHP_ZIP_USE_OO 1
00037 #endif
00038 
00039 #ifndef  Z_SET_REFCOUNT_P
00040 # if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
00041 #  define Z_SET_REFCOUNT_P(pz, rc)  pz->refcount = rc 
00042 #  define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 
00043 # endif
00044 #endif
00045 
00046 /* {{{ ZIP_OPENBASEDIR_CHECKPATH(filename) */
00047 #if PHP_API_VERSION < 20100412
00048 # define ZIP_OPENBASEDIR_CHECKPATH(filename) \
00049        (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
00050 #else
00051 #define ZIP_OPENBASEDIR_CHECKPATH(filename) \
00052        php_check_open_basedir(filename TSRMLS_CC)
00053 #endif
00054 /* }}} */
00055 
00056 typedef struct _ze_zip_rsrc {
00057        struct zip *za;
00058        int index_current;
00059        int num_files;
00060 } zip_rsrc;
00061 
00062 typedef zip_rsrc * zip_rsrc_ptr;
00063 
00064 typedef struct _ze_zip_read_rsrc {
00065        struct zip_file *zf;
00066        struct zip_stat sb;
00067 } zip_read_rsrc;
00068 
00069 #ifdef PHP_ZIP_USE_OO 
00070 #define ZIPARCHIVE_ME(name, arg_info, flags)     ZEND_FENTRY(name, c_ziparchive_ ##name, arg_info, flags)
00071 #define ZIPARCHIVE_METHOD(name)    ZEND_NAMED_FUNCTION(c_ziparchive_##name)
00072 
00073 /* Extends zend object */
00074 typedef struct _ze_zip_object {
00075        zend_object zo;
00076        struct zip *za;
00077        int buffers_cnt;
00078        char **buffers;
00079        HashTable *prop_handler;
00080        char *filename;
00081        int filename_len;
00082 } ze_zip_object;
00083 
00084 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);
00085 php_stream *php_stream_zip_open(char *filename, char *path, char *mode STREAMS_DC TSRMLS_DC);
00086 
00087 extern php_stream_wrapper php_stream_zip_wrapper;
00088 #endif
00089 
00090 #endif /* PHP_ZIP_H */
00091 
00092 /*
00093  * Local variables:
00094  * tab-width: 4
00095  * c-basic-offset: 4
00096  * End:
00097  * vim600: noet sw=4 ts=4 fdm=marker
00098  * vim<600: noet sw=4 ts=4
00099  */