summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/php_zlib.h17
-rw-r--r--ext/zlib/zlib.c51
-rw-r--r--ext/zlib/zlib_fopen_wrapper.c2
3 files changed, 35 insertions, 35 deletions
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 1e9c0b5cff..44610dc979 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -39,26 +39,9 @@ extern php_stream_filter_factory php_zlib_filter_factory;
extern zend_module_entry php_zlib_module_entry;
#define zlib_module_ptr &php_zlib_module_entry
-PHP_MINIT_FUNCTION(zlib);
-PHP_MSHUTDOWN_FUNCTION(zlib);
-PHP_RINIT_FUNCTION(zlib);
-PHP_MINFO_FUNCTION(zlib);
-PHP_FUNCTION(gzopen);
-PHP_FUNCTION(readgzfile);
-PHP_FUNCTION(gzfile);
-PHP_FUNCTION(gzcompress);
-PHP_FUNCTION(gzuncompress);
-PHP_FUNCTION(gzdeflate);
-PHP_FUNCTION(gzinflate);
-PHP_FUNCTION(gzencode);
-PHP_FUNCTION(ob_gzhandler);
-PHP_FUNCTION(zlib_get_coding_type);
-
-int php_enable_output_compression(int buffer_size TSRMLS_DC);
int php_ob_gzhandler_check(TSRMLS_D);
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);
-extern php_stream_ops php_stream_gzio_ops;
extern php_stream_wrapper php_stream_gzip_wrapper;
#ifdef ZTS
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index e9bea6cf0f..21d9034192 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -82,11 +82,28 @@
#define GZIP_FOOTER_LENGTH 8
/* True globals, no need for thread safety */
-static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+static const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+static int php_enable_output_compression(int buffer_size TSRMLS_DC);
+
+static PHP_MINIT_FUNCTION(zlib);
+static PHP_MSHUTDOWN_FUNCTION(zlib);
+static PHP_RINIT_FUNCTION(zlib);
+static PHP_MINFO_FUNCTION(zlib);
+static PHP_FUNCTION(gzopen);
+static PHP_FUNCTION(readgzfile);
+static PHP_FUNCTION(gzfile);
+static PHP_FUNCTION(gzcompress);
+static PHP_FUNCTION(gzuncompress);
+static PHP_FUNCTION(gzdeflate);
+static PHP_FUNCTION(gzinflate);
+static PHP_FUNCTION(gzencode);
+static PHP_FUNCTION(ob_gzhandler);
+static PHP_FUNCTION(zlib_get_coding_type);
/* {{{ php_zlib_functions[]
*/
-zend_function_entry php_zlib_functions[] = {
+static zend_function_entry php_zlib_functions[] = {
PHP_FE(readgzfile, NULL)
PHP_FALIAS(gzrewind, rewind, NULL)
PHP_FALIAS(gzclose, fclose, NULL)
@@ -205,7 +222,7 @@ PHP_INI_END()
/* {{{ PHP_MINIT_FUNCTION
*/
-PHP_MINIT_FUNCTION(zlib)
+static PHP_MINIT_FUNCTION(zlib)
{
php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC);
@@ -221,7 +238,7 @@ PHP_MINIT_FUNCTION(zlib)
/* {{{ PHP_RINIT_FUNCTION
*/
-PHP_RINIT_FUNCTION(zlib)
+static PHP_RINIT_FUNCTION(zlib)
{
uint chunk_size = ZLIBG(output_compression);
@@ -240,7 +257,7 @@ PHP_RINIT_FUNCTION(zlib)
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
-PHP_MSHUTDOWN_FUNCTION(zlib)
+static PHP_MSHUTDOWN_FUNCTION(zlib)
{
php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
@@ -253,7 +270,7 @@ PHP_MSHUTDOWN_FUNCTION(zlib)
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(zlib)
+static PHP_MINFO_FUNCTION(zlib)
{
php_info_print_table_start();
php_info_print_table_row(2, "ZLib Support", "enabled");
@@ -269,7 +286,7 @@ PHP_MINFO_FUNCTION(zlib)
/* {{{ proto array gzfile(string filename [, int use_include_path])
Read und uncompress entire .gz-file into an array */
-PHP_FUNCTION(gzfile)
+static PHP_FUNCTION(gzfile)
{
char *filename;
int filename_len;
@@ -314,7 +331,7 @@ PHP_FUNCTION(gzfile)
/* {{{ proto resource gzopen(string filename, string mode [, int use_include_path])
Open a .gz-file and return a .gz-file pointer */
-PHP_FUNCTION(gzopen)
+static PHP_FUNCTION(gzopen)
{
char *filename, *mode;
int filename_len, mode_len;
@@ -342,7 +359,7 @@ PHP_FUNCTION(gzopen)
*/
/* {{{ proto int readgzfile(string filename [, int use_include_path])
Output a .gz-file */
-PHP_FUNCTION(readgzfile)
+static PHP_FUNCTION(readgzfile)
{
char *filename;
int filename_len;
@@ -369,7 +386,7 @@ PHP_FUNCTION(readgzfile)
/* {{{ proto string gzcompress(string data [, int level])
Gzip-compress a string */
-PHP_FUNCTION(gzcompress)
+static PHP_FUNCTION(gzcompress)
{
int data_len, status;
long level = Z_DEFAULT_COMPRESSION;
@@ -411,7 +428,7 @@ PHP_FUNCTION(gzcompress)
/* {{{ proto string gzuncompress(string data [, int length])
Unzip a gzip-compressed string */
-PHP_FUNCTION(gzuncompress)
+static PHP_FUNCTION(gzuncompress)
{
int data_len, status;
unsigned int factor=1, maxfactor=16;
@@ -457,7 +474,7 @@ PHP_FUNCTION(gzuncompress)
/* {{{ proto string gzdeflate(string data [, int level])
Gzip-compress a string */
-PHP_FUNCTION(gzdeflate)
+static PHP_FUNCTION(gzdeflate)
{
int data_len,status;
long level = Z_DEFAULT_COMPRESSION;
@@ -518,7 +535,7 @@ PHP_FUNCTION(gzdeflate)
/* {{{ proto string gzinflate(string data [, int length])
Unzip a gzip-compressed string */
-PHP_FUNCTION(gzinflate)
+static PHP_FUNCTION(gzinflate)
{
int data_len, status;
unsigned int factor=1, maxfactor=16;
@@ -598,7 +615,7 @@ PHP_FUNCTION(gzinflate)
/* {{{ proto string zlib_get_coding_type(void)
Returns the coding type used for output compression */
-PHP_FUNCTION(zlib_get_coding_type)
+static PHP_FUNCTION(zlib_get_coding_type)
{
switch (ZLIBG(compression_coding)) {
case CODING_GZIP:
@@ -732,7 +749,7 @@ static int php_deflate_string(const char *str, uint str_length, char **newstr, u
/* {{{ proto string gzencode(string data [, int level [, int encoding_mode]])
GZ encode a string */
-PHP_FUNCTION(gzencode)
+static PHP_FUNCTION(gzencode)
{
char *data, *s2;
int data_len;
@@ -862,7 +879,7 @@ int php_ob_gzhandler_check(TSRMLS_D)
/* {{{ proto string ob_gzhandler(string str, int mode)
Encode str based on accept-encoding setting - designed to be called from ob_start() */
-PHP_FUNCTION(ob_gzhandler)
+static PHP_FUNCTION(ob_gzhandler)
{
char *string;
int string_len;
@@ -963,7 +980,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
/* {{{ php_enable_output_compression
*/
-int php_enable_output_compression(int buffer_size TSRMLS_DC)
+static int php_enable_output_compression(int buffer_size TSRMLS_DC)
{
zval **a_encoding;
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index a7718a9b02..631db81819 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -92,7 +92,7 @@ static int php_gziop_flush(php_stream *stream TSRMLS_DC)
return gzflush(self->gz_file, Z_SYNC_FLUSH);
}
-php_stream_ops php_stream_gzio_ops = {
+static php_stream_ops php_stream_gzio_ops = {
php_gziop_write, php_gziop_read,
php_gziop_close, php_gziop_flush,
"ZLIB",