File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / zlib / php_zlib.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:37 2012 UTC (12 years, 2 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_17p0, HEAD
php 5.4.3+patches

    1: /*
    2:    +----------------------------------------------------------------------+
    3:    | PHP Version 5                                                        |
    4:    +----------------------------------------------------------------------+
    5:    | Copyright (c) 1997-2012 The PHP Group                                |
    6:    +----------------------------------------------------------------------+
    7:    | This source file is subject to version 3.01 of the PHP license,      |
    8:    | that is bundled with this package in the file LICENSE, and is        |
    9:    | available through the world-wide-web at the following url:           |
   10:    | http://www.php.net/license/3_01.txt                                  |
   11:    | If you did not receive a copy of the PHP license and are unable to   |
   12:    | obtain it through the world-wide-web, please send a note to          |
   13:    | license@php.net so we can mail you a copy immediately.               |
   14:    +----------------------------------------------------------------------+
   15:    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
   16:    |          Stefan R�hrich <sr@linux.de>                                |
   17:    |          Michael Wallner <mike@php.net>                              |
   18:    +----------------------------------------------------------------------+
   19: */
   20: 
   21: /* $Id: php_zlib.h,v 1.1.1.2 2012/05/29 12:34:37 misho Exp $ */
   22: 
   23: #ifndef PHP_ZLIB_H
   24: #define PHP_ZLIB_H
   25: 
   26: #include <zlib.h>
   27: 
   28: #define PHP_ZLIB_ENCODING_RAW		-0xf
   29: #define PHP_ZLIB_ENCODING_GZIP		0x1f
   30: #define PHP_ZLIB_ENCODING_DEFLATE	0x0f
   31: 
   32: #define PHP_ZLIB_ENCODING_ANY		0x2f
   33: 
   34: #define PHP_ZLIB_OUTPUT_HANDLER_NAME "zlib output compression"
   35: #define PHP_ZLIB_BUFFER_SIZE_GUESS(in_len) (((size_t) ((double) in_len * (double) 1.015)) + 10 + 8 + 4 + 1)
   36: 
   37: typedef struct _php_zlib_buffer {
   38: 	char *data;
   39: 	char *aptr;
   40: 	size_t used;
   41: 	size_t free;
   42: 	size_t size;
   43: } php_zlib_buffer;
   44: 
   45: typedef struct _php_zlib_context {
   46: 	z_stream Z;
   47: 	php_zlib_buffer buffer;
   48: } php_zlib_context;
   49: 
   50: ZEND_BEGIN_MODULE_GLOBALS(zlib)
   51: 	/* variables for transparent gzip encoding */
   52: 	int compression_coding;
   53: 	long output_compression;
   54: 	long output_compression_level;
   55: 	char *output_handler;
   56: 	php_zlib_context *ob_gzhandler;
   57: ZEND_END_MODULE_GLOBALS(zlib);
   58: 
   59: php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
   60: extern php_stream_ops php_stream_gzio_ops;
   61: extern php_stream_wrapper php_stream_gzip_wrapper;
   62: extern php_stream_filter_factory php_zlib_filter_factory;
   63: extern zend_module_entry php_zlib_module_entry;
   64: #define zlib_module_ptr &php_zlib_module_entry
   65: #define phpext_zlib_ptr zlib_module_ptr
   66: 
   67: #ifdef ZTS
   68: # include "TSRM.h"
   69: # define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
   70: #else
   71: # define ZLIBG(v) (zlib_globals.v)
   72: #endif
   73: 
   74: #endif /* PHP_ZLIB_H */
   75: 
   76: /*
   77:  * Local variables:
   78:  * tab-width: 4
   79:  * c-basic-offset: 4
   80:  * indent-tabs-mode: t
   81:  * End:
   82:  */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>