summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/zip/config.w323
-rw-r--r--ext/zip/lib/zip.h99
-rw-r--r--ext/zip/lib/zip_add.c2
-rw-r--r--ext/zip/lib/zip_add_dir.c2
-rw-r--r--ext/zip/lib/zip_close.c2
-rw-r--r--ext/zip/lib/zip_delete.c2
-rw-r--r--ext/zip/lib/zip_dirent.c18
-rw-r--r--ext/zip/lib/zip_entry_free.c2
-rw-r--r--ext/zip/lib/zip_entry_new.c2
-rw-r--r--ext/zip/lib/zip_error.c12
-rw-r--r--ext/zip/lib/zip_error_clear.c2
-rw-r--r--ext/zip/lib/zip_error_get.c2
-rw-r--r--ext/zip/lib/zip_error_get_sys_type.c2
-rw-r--r--ext/zip/lib/zip_error_strerror.c2
-rw-r--r--ext/zip/lib/zip_error_to_str.c2
-rw-r--r--ext/zip/lib/zip_fclose.c2
-rw-r--r--ext/zip/lib/zip_file_error_clear.c2
-rw-r--r--ext/zip/lib/zip_file_error_get.c2
-rw-r--r--ext/zip/lib/zip_file_get_offset.c2
-rw-r--r--ext/zip/lib/zip_file_strerror.c2
-rw-r--r--ext/zip/lib/zip_fopen.c2
-rw-r--r--ext/zip/lib/zip_fopen_index.c4
-rw-r--r--ext/zip/lib/zip_fread.c2
-rw-r--r--ext/zip/lib/zip_free.c2
-rw-r--r--ext/zip/lib/zip_get_archive_comment.c2
-rw-r--r--ext/zip/lib/zip_get_file_comment.c2
-rw-r--r--ext/zip/lib/zip_get_name.c4
-rw-r--r--ext/zip/lib/zip_get_num_files.c2
-rw-r--r--ext/zip/lib/zip_memdup.c2
-rw-r--r--ext/zip/lib/zip_name_locate.c11
-rw-r--r--ext/zip/lib/zip_new.c2
-rw-r--r--ext/zip/lib/zip_open.c2
-rw-r--r--ext/zip/lib/zip_rename.c2
-rw-r--r--ext/zip/lib/zip_replace.c4
-rw-r--r--ext/zip/lib/zip_set_archive_comment.c2
-rw-r--r--ext/zip/lib/zip_set_file_comment.c2
-rw-r--r--ext/zip/lib/zip_set_name.c2
-rw-r--r--ext/zip/lib/zip_source_buffer.c2
-rw-r--r--ext/zip/lib/zip_source_file.c2
-rw-r--r--ext/zip/lib/zip_source_filep.c2
-rw-r--r--ext/zip/lib/zip_source_free.c2
-rw-r--r--ext/zip/lib/zip_source_function.c2
-rw-r--r--ext/zip/lib/zip_source_zip.c2
-rw-r--r--ext/zip/lib/zip_stat.c2
-rw-r--r--ext/zip/lib/zip_stat_index.c2
-rw-r--r--ext/zip/lib/zip_stat_init.c2
-rw-r--r--ext/zip/lib/zip_strerror.c2
-rw-r--r--ext/zip/lib/zip_unchange.c4
-rw-r--r--ext/zip/lib/zip_unchange_all.c2
-rw-r--r--ext/zip/lib/zip_unchange_archive.c2
-rw-r--r--ext/zip/lib/zip_unchange_data.c2
-rw-r--r--ext/zip/lib/zip_win32.h7
-rw-r--r--ext/zip/lib/zipint.h74
53 files changed, 160 insertions, 164 deletions
diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
index e698f94f3a..2880f6b216 100644
--- a/ext/zip/config.w32
+++ b/ext/zip/config.w32
@@ -31,9 +31,6 @@ if (PHP_ZIP != "no") {
AC_DEFINE('HAVE_ZLIB', 1);
AC_DEFINE('HAVE_ZIP', 1);
- if (PHP_ZIP_SHARED) {
- ADD_FLAG("CFLAGS_ZIP", "/D PHP_ZIP_EXPORTS ");
- }
} else {
WARNING("zip not enabled; libraries and headers not found");
}
diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h
index fe025ef75b..b59610bfef 100644
--- a/ext/zip/lib/zip.h
+++ b/ext/zip/lib/zip.h
@@ -37,22 +37,16 @@
*/
-#include "main/php.h"
-#ifdef PHP_WIN32
-#include "zip_win32.h"
-# ifdef PHP_ZIP_EXPORTS
-# define PHPZIPAPI __declspec(dllexport)
-# elif defined(COMPILE_DL_ZIP)
-# define PHPZIPAPI __declspec(dllimport)
-# endif
-#else
-#define PHPZIPAPI
+
+#ifdef __cplusplus
+extern "C" {
#endif
-BEGIN_EXTERN_C()
+
#include <sys/types.h>
#include <stdio.h>
#include <time.h>
+#include "zip_win32.h"
/* flags for zip_open */
@@ -168,46 +162,49 @@ struct zip_source;
-PHPZIPAPI int zip_add(struct zip *, const char *, struct zip_source *);
-PHPZIPAPI int zip_add_dir(struct zip *, const char *);
-PHPZIPAPI int zip_close(struct zip *);
-PHPZIPAPI int zip_delete(struct zip *, int);
-PHPZIPAPI void zip_error_clear(struct zip *);
-PHPZIPAPI void zip_error_get(struct zip *, int *, int *);
-PHPZIPAPI int zip_error_get_sys_type(int);
-PHPZIPAPI int zip_error_to_str(char *, size_t, int, int);
-PHPZIPAPI int zip_fclose(struct zip_file *);
-PHPZIPAPI void zip_file_error_clear(struct zip_file *);
-PHPZIPAPI void zip_file_error_get(struct zip_file *, int *, int *);
-PHPZIPAPI const char *zip_file_strerror(struct zip_file *);
-PHPZIPAPI struct zip_file *zip_fopen(struct zip *, const char *, int);
-PHPZIPAPI struct zip_file *zip_fopen_index(struct zip *, int, int);
-PHPZIPAPI ssize_t zip_fread(struct zip_file *, void *, size_t);
-PHPZIPAPI const char *zip_get_archive_comment(struct zip *, int *, int);
-PHPZIPAPI const char *zip_get_file_comment(struct zip *, int, int *, int);
-PHPZIPAPI const char *zip_get_name(struct zip *, int, int);
-PHPZIPAPI int zip_get_num_files(struct zip *);
-PHPZIPAPI int zip_name_locate(struct zip *, const char *, int);
-PHPZIPAPI struct zip *zip_open(const char *, int, int *);
-PHPZIPAPI int zip_rename(struct zip *, int, const char *);
-PHPZIPAPI int zip_replace(struct zip *, int, struct zip_source *);
-PHPZIPAPI int zip_set_archive_comment(struct zip *, const char *, int);
-PHPZIPAPI int zip_set_file_comment(struct zip *, int, const char *, int);
-PHPZIPAPI struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
-PHPZIPAPI struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
-PHPZIPAPI struct zip_source *zip_source_filep(struct zip *, FILE *, off_t, off_t);
-PHPZIPAPI void zip_source_free(struct zip_source *);
-PHPZIPAPI struct zip_source *zip_source_function(struct zip *,
+int zip_add(struct zip *, const char *, struct zip_source *);
+int zip_add_dir(struct zip *, const char *);
+int zip_close(struct zip *);
+int zip_delete(struct zip *, int);
+void zip_error_clear(struct zip *);
+void zip_error_get(struct zip *, int *, int *);
+int zip_error_get_sys_type(int);
+int zip_error_to_str(char *, size_t, int, int);
+int zip_fclose(struct zip_file *);
+void zip_file_error_clear(struct zip_file *);
+void zip_file_error_get(struct zip_file *, int *, int *);
+const char *zip_file_strerror(struct zip_file *);
+struct zip_file *zip_fopen(struct zip *, const char *, int);
+struct zip_file *zip_fopen_index(struct zip *, int, int);
+ssize_t zip_fread(struct zip_file *, void *, size_t);
+const char *zip_get_archive_comment(struct zip *, int *, int);
+const char *zip_get_file_comment(struct zip *, int, int *, int);
+const char *zip_get_name(struct zip *, int, int);
+int zip_get_num_files(struct zip *);
+int zip_name_locate(struct zip *, const char *, int);
+struct zip *zip_open(const char *, int, int *);
+int zip_rename(struct zip *, int, const char *);
+int zip_replace(struct zip *, int, struct zip_source *);
+int zip_set_archive_comment(struct zip *, const char *, int);
+int zip_set_file_comment(struct zip *, int, const char *, int);
+struct zip_source *zip_source_buffer(struct zip *, const void *, off_t, int);
+struct zip_source *zip_source_file(struct zip *, const char *, off_t, off_t);
+struct zip_source *zip_source_filep(struct zip *, FILE *, off_t, off_t);
+void zip_source_free(struct zip_source *);
+struct zip_source *zip_source_function(struct zip *,
zip_source_callback, void *);
-PHPZIPAPI struct zip_source *zip_source_zip(struct zip *, struct zip *, int, int,
+struct zip_source *zip_source_zip(struct zip *, struct zip *, int, int,
off_t, off_t);
-PHPZIPAPI int zip_stat(struct zip *, const char *, int, struct zip_stat *);
-PHPZIPAPI int zip_stat_index(struct zip *, int, int, struct zip_stat *);
-PHPZIPAPI void zip_stat_init(struct zip_stat *);
-PHPZIPAPI const char *zip_strerror(struct zip *);
-PHPZIPAPI int zip_unchange(struct zip *, int);
-PHPZIPAPI int zip_unchange_all(struct zip *);
-PHPZIPAPI int zip_unchange_archive(struct zip *);
-
-END_EXTERN_C();
+int zip_stat(struct zip *, const char *, int, struct zip_stat *);
+int zip_stat_index(struct zip *, int, int, struct zip_stat *);
+void zip_stat_init(struct zip_stat *);
+const char *zip_strerror(struct zip *);
+int zip_unchange(struct zip *, int);
+int zip_unchange_all(struct zip *);
+int zip_unchange_archive(struct zip *);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _HAD_ZIP_H */
diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c
index 70d1162f7f..535d6e4689 100644
--- a/ext/zip/lib/zip_add.c
+++ b/ext/zip/lib/zip_add.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_add(struct zip *za, const char *name, struct zip_source *source)
{
if (name == NULL || source == NULL) {
diff --git a/ext/zip/lib/zip_add_dir.c b/ext/zip/lib/zip_add_dir.c
index d4da559ecd..287ec4bab2 100644
--- a/ext/zip/lib/zip_add_dir.c
+++ b/ext/zip/lib/zip_add_dir.c
@@ -43,7 +43,7 @@
-PHPZIPAPI int
+int
zip_add_dir(struct zip *za, const char *name)
{
int len, ret;
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index 11ba8e2231..e701321a81 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -56,7 +56,7 @@ static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *);
static int _zip_changed(struct zip *, int *);
static char *_zip_create_temp_output(struct zip *, FILE **);
-PHPZIPAPI int
+int
zip_close(struct zip *za)
{
int survivors;
diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c
index eb5055b687..7244e612f7 100644
--- a/ext/zip/lib/zip_delete.c
+++ b/ext/zip/lib/zip_delete.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_delete(struct zip *za, int idx)
{
if (idx < 0 || idx >= za->nentry) {
diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c
index f796f8d669..8423ad5343 100644
--- a/ext/zip/lib/zip_dirent.c
+++ b/ext/zip/lib/zip_dirent.c
@@ -56,7 +56,7 @@ static void _zip_write4(unsigned int, FILE *);
-PHPZIPAPI void
+void
_zip_cdir_free(struct zip_cdir *cd)
{
int i;
@@ -73,7 +73,7 @@ _zip_cdir_free(struct zip_cdir *cd)
-PHPZIPAPI struct zip_cdir *
+struct zip_cdir *
_zip_cdir_new(int nentry, struct zip_error *error)
{
struct zip_cdir *cd;
@@ -102,7 +102,7 @@ _zip_cdir_new(int nentry, struct zip_error *error)
-PHPZIPAPI int
+int
_zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
{
int i;
@@ -136,7 +136,7 @@ _zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error)
-PHPZIPAPI void
+void
_zip_dirent_finalize(struct zip_dirent *zde)
{
free(zde->filename);
@@ -149,7 +149,7 @@ _zip_dirent_finalize(struct zip_dirent *zde)
-PHPZIPAPI void
+void
_zip_dirent_init(struct zip_dirent *de)
{
de->version_madeby = 0;
@@ -188,7 +188,7 @@ _zip_dirent_init(struct zip_dirent *de)
returned.
*/
-PHPZIPAPI int
+int
_zip_dirent_read(struct zip_dirent *zde, FILE *fp,
unsigned char **bufp, unsigned int left, int localp,
struct zip_error *error)
@@ -333,7 +333,7 @@ _zip_dirent_read(struct zip_dirent *zde, FILE *fp,
returned.
*/
-PHPZIPAPI int
+int
_zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp,
struct zip_error *error)
{
@@ -409,7 +409,7 @@ _zip_d2u_time(int dtime, int ddate)
-PHPZIPAPI unsigned short
+unsigned short
_zip_read2(unsigned char **a)
{
unsigned short ret;
@@ -422,7 +422,7 @@ _zip_read2(unsigned char **a)
-PHPZIPAPI unsigned int
+unsigned int
_zip_read4(unsigned char **a)
{
unsigned int ret;
diff --git a/ext/zip/lib/zip_entry_free.c b/ext/zip/lib/zip_entry_free.c
index 1bab313ed5..48443cefd5 100644
--- a/ext/zip/lib/zip_entry_free.c
+++ b/ext/zip/lib/zip_entry_free.c
@@ -42,7 +42,7 @@
-PHPZIPAPI void
+void
_zip_entry_free(struct zip_entry *ze)
{
free(ze->ch_filename);
diff --git a/ext/zip/lib/zip_entry_new.c b/ext/zip/lib/zip_entry_new.c
index 67e13fd84a..390b72ad70 100644
--- a/ext/zip/lib/zip_entry_new.c
+++ b/ext/zip/lib/zip_entry_new.c
@@ -42,7 +42,7 @@
-PHPZIPAPI struct zip_entry *
+struct zip_entry *
_zip_entry_new(struct zip *za)
{
struct zip_entry *ze;
diff --git a/ext/zip/lib/zip_error.c b/ext/zip/lib/zip_error.c
index 4816b73aea..fe04778691 100644
--- a/ext/zip/lib/zip_error.c
+++ b/ext/zip/lib/zip_error.c
@@ -42,7 +42,7 @@
-PHPZIPAPI void
+void
_zip_error_clear(struct zip_error *err)
{
err->zip_err = ZIP_ER_OK;
@@ -51,7 +51,7 @@ _zip_error_clear(struct zip_error *err)
-PHPZIPAPI void
+void
_zip_error_copy(struct zip_error *dst, struct zip_error *src)
{
dst->zip_err = src->zip_err;
@@ -60,7 +60,7 @@ _zip_error_copy(struct zip_error *dst, struct zip_error *src)
-PHPZIPAPI void
+void
_zip_error_fini(struct zip_error *err)
{
free(err->str);
@@ -69,7 +69,7 @@ _zip_error_fini(struct zip_error *err)
-PHPZIPAPI void
+void
_zip_error_get(struct zip_error *err, int *zep, int *sep)
{
if (zep)
@@ -84,7 +84,7 @@ _zip_error_get(struct zip_error *err, int *zep, int *sep)
-PHPZIPAPI void
+void
_zip_error_init(struct zip_error *err)
{
err->zip_err = ZIP_ER_OK;
@@ -94,7 +94,7 @@ _zip_error_init(struct zip_error *err)
-PHPZIPAPI void
+void
_zip_error_set(struct zip_error *err, int ze, int se)
{
if (err) {
diff --git a/ext/zip/lib/zip_error_clear.c b/ext/zip/lib/zip_error_clear.c
index 8a76f44400..337335b6cb 100644
--- a/ext/zip/lib/zip_error_clear.c
+++ b/ext/zip/lib/zip_error_clear.c
@@ -40,7 +40,7 @@
-PHPZIPAPI void
+void
zip_error_clear(struct zip *za)
{
_zip_error_clear(&za->error);
diff --git a/ext/zip/lib/zip_error_get.c b/ext/zip/lib/zip_error_get.c
index 888b545693..712575a864 100644
--- a/ext/zip/lib/zip_error_get.c
+++ b/ext/zip/lib/zip_error_get.c
@@ -40,7 +40,7 @@
-PHPZIPAPI void
+void
zip_error_get(struct zip *za, int *zep, int *sep)
{
_zip_error_get(&za->error, zep, sep);
diff --git a/ext/zip/lib/zip_error_get_sys_type.c b/ext/zip/lib/zip_error_get_sys_type.c
index bfe6423836..613ec94328 100644
--- a/ext/zip/lib/zip_error_get_sys_type.c
+++ b/ext/zip/lib/zip_error_get_sys_type.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_error_get_sys_type(int ze)
{
if (ze < 0 || ze >= _zip_nerr_str)
diff --git a/ext/zip/lib/zip_error_strerror.c b/ext/zip/lib/zip_error_strerror.c
index 06e98c76d8..e6eee081df 100644
--- a/ext/zip/lib/zip_error_strerror.c
+++ b/ext/zip/lib/zip_error_strerror.c
@@ -45,7 +45,7 @@
-PHPZIPAPI const char *
+const char *
_zip_error_strerror(struct zip_error *err)
{
const char *zs, *ss;
diff --git a/ext/zip/lib/zip_error_to_str.c b/ext/zip/lib/zip_error_to_str.c
index 665803472e..e566192255 100644
--- a/ext/zip/lib/zip_error_to_str.c
+++ b/ext/zip/lib/zip_error_to_str.c
@@ -45,7 +45,7 @@
-PHPZIPAPI int
+int
zip_error_to_str(char *buf, size_t len, int ze, int se)
{
const char *zs, *ss;
diff --git a/ext/zip/lib/zip_fclose.c b/ext/zip/lib/zip_fclose.c
index 91f30b7bb9..c0105a9290 100644
--- a/ext/zip/lib/zip_fclose.c
+++ b/ext/zip/lib/zip_fclose.c
@@ -42,7 +42,7 @@
-PHPZIPAPI int
+int
zip_fclose(struct zip_file *zf)
{
int i, ret;
diff --git a/ext/zip/lib/zip_file_error_clear.c b/ext/zip/lib/zip_file_error_clear.c
index dca33b35f7..e5359114a9 100644
--- a/ext/zip/lib/zip_file_error_clear.c
+++ b/ext/zip/lib/zip_file_error_clear.c
@@ -40,7 +40,7 @@
-PHPZIPAPI void
+void
zip_file_error_clear(struct zip_file *zf)
{
_zip_error_clear(&zf->error);
diff --git a/ext/zip/lib/zip_file_error_get.c b/ext/zip/lib/zip_file_error_get.c
index 05516703c6..2ab3a73a4c 100644
--- a/ext/zip/lib/zip_file_error_get.c
+++ b/ext/zip/lib/zip_file_error_get.c
@@ -40,7 +40,7 @@
-PHPZIPAPI void
+void
zip_file_error_get(struct zip_file *zf, int *zep, int *sep)
{
_zip_error_get(&zf->error, zep, sep);
diff --git a/ext/zip/lib/zip_file_get_offset.c b/ext/zip/lib/zip_file_get_offset.c
index 4930040235..8bcc64934d 100644
--- a/ext/zip/lib/zip_file_get_offset.c
+++ b/ext/zip/lib/zip_file_get_offset.c
@@ -56,7 +56,7 @@
On error, fills in za->error and returns 0.
*/
-PHPZIPAPI unsigned int
+unsigned int
_zip_file_get_offset(struct zip *za, int idx)
{
struct zip_dirent de;
diff --git a/ext/zip/lib/zip_file_strerror.c b/ext/zip/lib/zip_file_strerror.c
index 2cc79c1333..aaff189996 100644
--- a/ext/zip/lib/zip_file_strerror.c
+++ b/ext/zip/lib/zip_file_strerror.c
@@ -40,7 +40,7 @@
-PHPZIPAPI const char *
+const char *
zip_file_strerror(struct zip_file *zf)
{
return _zip_error_strerror(&zf->error);
diff --git a/ext/zip/lib/zip_fopen.c b/ext/zip/lib/zip_fopen.c
index c05ad45bd6..850a8d835a 100644
--- a/ext/zip/lib/zip_fopen.c
+++ b/ext/zip/lib/zip_fopen.c
@@ -40,7 +40,7 @@
-PHPZIPAPI struct zip_file *
+struct zip_file *
zip_fopen(struct zip *za, const char *fname, int flags)
{
int idx;
diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c
index 105cefe738..5da9230b2e 100644
--- a/ext/zip/lib/zip_fopen_index.c
+++ b/ext/zip/lib/zip_fopen_index.c
@@ -46,7 +46,7 @@ static struct zip_file *_zip_file_new(struct zip *za);
-PHPZIPAPI struct zip_file *
+struct zip_file *
zip_fopen_index(struct zip *za, int fileno, int flags)
{
int len, ret;
@@ -141,7 +141,7 @@ zip_fopen_index(struct zip *za, int fileno, int flags)
-PHPZIPAPI int
+int
_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf)
{
int i, j;
diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c
index 064d2b97fb..aeb64c90fa 100644
--- a/ext/zip/lib/zip_fread.c
+++ b/ext/zip/lib/zip_fread.c
@@ -40,7 +40,7 @@
-PHPZIPAPI ssize_t
+ssize_t
zip_fread(struct zip_file *zf, void *outbuf, size_t toread)
{
int ret;
diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c
index 534c58eb07..c78697d254 100644
--- a/ext/zip/lib/zip_free.c
+++ b/ext/zip/lib/zip_free.c
@@ -45,7 +45,7 @@
frees the space allocated to a zipfile struct, and closes the
corresponding file. */
-PHPZIPAPI void
+void
_zip_free(struct zip *za)
{
int i;
diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c
index c23597c096..7844c5e191 100644
--- a/ext/zip/lib/zip_get_archive_comment.c
+++ b/ext/zip/lib/zip_get_archive_comment.c
@@ -40,7 +40,7 @@
-PHPZIPAPI const char *
+const char *
zip_get_archive_comment(struct zip *za, int *lenp, int flags)
{
if ((flags & ZIP_FL_UNCHANGED)
diff --git a/ext/zip/lib/zip_get_file_comment.c b/ext/zip/lib/zip_get_file_comment.c
index 476ac7da0b..79a5c236bc 100644
--- a/ext/zip/lib/zip_get_file_comment.c
+++ b/ext/zip/lib/zip_get_file_comment.c
@@ -40,7 +40,7 @@
-PHPZIPAPI const char *
+const char *
zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags)
{
if (idx < 0 || idx >= za->nentry) {
diff --git a/ext/zip/lib/zip_get_name.c b/ext/zip/lib/zip_get_name.c
index c2cae2518e..c45dd0333f 100644
--- a/ext/zip/lib/zip_get_name.c
+++ b/ext/zip/lib/zip_get_name.c
@@ -40,7 +40,7 @@
-PHPZIPAPI const char *
+const char *
zip_get_name(struct zip *za, int idx, int flags)
{
return _zip_get_name(za, idx, flags, &za->error);
@@ -48,7 +48,7 @@ zip_get_name(struct zip *za, int idx, int flags)
-PHPZIPAPI const char *
+const char *
_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error)
{
if (idx < 0 || idx >= za->nentry) {
diff --git a/ext/zip/lib/zip_get_num_files.c b/ext/zip/lib/zip_get_num_files.c
index 05a54fcb6c..0cc81edb06 100644
--- a/ext/zip/lib/zip_get_num_files.c
+++ b/ext/zip/lib/zip_get_num_files.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_get_num_files(struct zip *za)
{
if (za == NULL)
diff --git a/ext/zip/lib/zip_memdup.c b/ext/zip/lib/zip_memdup.c
index ebb7426dd2..c4ecf4a69f 100644
--- a/ext/zip/lib/zip_memdup.c
+++ b/ext/zip/lib/zip_memdup.c
@@ -41,7 +41,7 @@
-PHPZIPAPI void *
+void *
_zip_memdup(const void *mem, size_t len, struct zip_error *error)
{
void *ret;
diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c
index 108db4f609..a2fce2d034 100644
--- a/ext/zip/lib/zip_name_locate.c
+++ b/ext/zip/lib/zip_name_locate.c
@@ -42,7 +42,7 @@
-PHPZIPAPI int
+int
zip_name_locate(struct zip *za, const char *fname, int flags)
{
return _zip_name_locate(za, fname, flags, &za->error);
@@ -50,7 +50,7 @@ zip_name_locate(struct zip *za, const char *fname, int flags)
-PHPZIPAPI int
+int
_zip_name_locate(struct zip *za, const char *fname, int flags,
struct zip_error *error)
{
@@ -62,11 +62,8 @@ _zip_name_locate(struct zip *za, const char *fname, int flags,
_zip_error_set(error, ZIP_ER_INVAL, 0);
return -1;
}
-#ifdef PHP_WIN32
- cmp = (flags & ZIP_FL_NOCASE) ? stricmp : strcmp;
-#else
- cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
-#endif
+
+ cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry;
for (i=0; i<n; i++) {
diff --git a/ext/zip/lib/zip_new.c b/ext/zip/lib/zip_new.c
index 378513b6cf..660183a15c 100644
--- a/ext/zip/lib/zip_new.c
+++ b/ext/zip/lib/zip_new.c
@@ -45,7 +45,7 @@
creates a new zipfile struct, and sets the contents to zero; returns
the new struct. */
-PHPZIPAPI struct zip *
+struct zip *
_zip_new(struct zip_error *error)
{
struct zip *za;
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 711dcb1cac..e9d4667ab3 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -58,7 +58,7 @@ static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *,
-PHPZIPAPI struct zip *
+struct zip *
zip_open(const char *fn, int flags, int *zep)
{
FILE *fp;
diff --git a/ext/zip/lib/zip_rename.c b/ext/zip/lib/zip_rename.c
index 8141dc46a6..f35291893f 100644
--- a/ext/zip/lib/zip_rename.c
+++ b/ext/zip/lib/zip_rename.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_rename(struct zip *za, int idx, const char *name)
{
if (idx >= za->nentry || idx < 0) {
diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c
index 12db005f28..ae78e62b80 100644
--- a/ext/zip/lib/zip_replace.c
+++ b/ext/zip/lib/zip_replace.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_replace(struct zip *za, int idx, struct zip_source *source)
{
if (idx < 0 || idx >= za->nentry || source == NULL) {
@@ -57,7 +57,7 @@ zip_replace(struct zip *za, int idx, struct zip_source *source)
-PHPZIPAPI int
+int
_zip_replace(struct zip *za, int idx, const char *name,
struct zip_source *source)
{
diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c
index 7649a80de9..b0929e56b6 100644
--- a/ext/zip/lib/zip_set_archive_comment.c
+++ b/ext/zip/lib/zip_set_archive_comment.c
@@ -42,7 +42,7 @@
-PHPZIPAPI int
+int
zip_set_archive_comment(struct zip *za, const char *comment, int len)
{
char *tmpcom;
diff --git a/ext/zip/lib/zip_set_file_comment.c b/ext/zip/lib/zip_set_file_comment.c
index 5454aa21da..cbf71db5c2 100644
--- a/ext/zip/lib/zip_set_file_comment.c
+++ b/ext/zip/lib/zip_set_file_comment.c
@@ -42,7 +42,7 @@
-PHPZIPAPI int
+int
zip_set_file_comment(struct zip *za, int idx, const char *comment, int len)
{
char *tmpcom;
diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c
index 8a401faaca..46dca56466 100644
--- a/ext/zip/lib/zip_set_name.c
+++ b/ext/zip/lib/zip_set_name.c
@@ -42,7 +42,7 @@
-PHPZIPAPI int
+int
_zip_set_name(struct zip *za, int idx, const char *name)
{
char *s;
diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c
index 95875b74c1..6f8ac640e9 100644
--- a/ext/zip/lib/zip_source_buffer.c
+++ b/ext/zip/lib/zip_source_buffer.c
@@ -52,7 +52,7 @@ static ssize_t read_data(void *state, void *data, size_t len,
-PHPZIPAPI struct zip_source *
+struct zip_source *
zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
{
struct read_data *f;
diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c
index 486e1900d9..d635da3421 100644
--- a/ext/zip/lib/zip_source_file.c
+++ b/ext/zip/lib/zip_source_file.c
@@ -43,7 +43,7 @@
-PHPZIPAPI struct zip_source *
+struct zip_source *
zip_source_file(struct zip *za, const char *fname, off_t start, off_t len)
{
struct zip_source *zs;
diff --git a/ext/zip/lib/zip_source_filep.c b/ext/zip/lib/zip_source_filep.c
index 8a33042655..60b994e161 100644
--- a/ext/zip/lib/zip_source_filep.c
+++ b/ext/zip/lib/zip_source_filep.c
@@ -57,7 +57,7 @@ static ssize_t read_file(void *state, void *data, size_t len,
-PHPZIPAPI struct zip_source *
+struct zip_source *
zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len)
{
struct read_file *f;
diff --git a/ext/zip/lib/zip_source_free.c b/ext/zip/lib/zip_source_free.c
index 707309c913..33e36eaf43 100644
--- a/ext/zip/lib/zip_source_free.c
+++ b/ext/zip/lib/zip_source_free.c
@@ -42,7 +42,7 @@
-PHPZIPAPI void
+void
zip_source_free(struct zip_source *source)
{
if (source == NULL)
diff --git a/ext/zip/lib/zip_source_function.c b/ext/zip/lib/zip_source_function.c
index 4ab1109244..4f01a43c51 100644
--- a/ext/zip/lib/zip_source_function.c
+++ b/ext/zip/lib/zip_source_function.c
@@ -42,7 +42,7 @@
-PHPZIPAPI struct zip_source *
+struct zip_source *
zip_source_function(struct zip *za, zip_source_callback zcb, void *ud)
{
struct zip_source *zs;
diff --git a/ext/zip/lib/zip_source_zip.c b/ext/zip/lib/zip_source_zip.c
index 75e6564021..a31fd2787e 100644
--- a/ext/zip/lib/zip_source_zip.c
+++ b/ext/zip/lib/zip_source_zip.c
@@ -52,7 +52,7 @@ static ssize_t read_zip(void *st, void *data, size_t len,
-PHPZIPAPI struct zip_source *
+struct zip_source *
zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
off_t start, off_t len)
{
diff --git a/ext/zip/lib/zip_stat.c b/ext/zip/lib/zip_stat.c
index 7c6cbf00d2..bea153d157 100644
--- a/ext/zip/lib/zip_stat.c
+++ b/ext/zip/lib/zip_stat.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_stat(struct zip *za, const char *fname, int flags, struct zip_stat *st)
{
int idx;
diff --git a/ext/zip/lib/zip_stat_index.c b/ext/zip/lib/zip_stat_index.c
index cf55565ef5..bab79a74ba 100644
--- a/ext/zip/lib/zip_stat_index.c
+++ b/ext/zip/lib/zip_stat_index.c
@@ -40,7 +40,7 @@
-PHPZIPAPI int
+int
zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
{
const char *name;
diff --git a/ext/zip/lib/zip_stat_init.c b/ext/zip/lib/zip_stat_init.c
index e9c056dfc5..7ab0f4da75 100644
--- a/ext/zip/lib/zip_stat_init.c
+++ b/ext/zip/lib/zip_stat_init.c
@@ -39,7 +39,7 @@
-PHPZIPAPI void
+void
zip_stat_init(struct zip_stat *st)
{
st->name = NULL;
diff --git a/ext/zip/lib/zip_strerror.c b/ext/zip/lib/zip_strerror.c
index f3e5aa9fe8..83e2985068 100644
--- a/ext/zip/lib/zip_strerror.c
+++ b/ext/zip/lib/zip_strerror.c
@@ -40,7 +40,7 @@
-PHPZIPAPI const char *
+const char *
zip_strerror(struct zip *za)
{
return _zip_error_strerror(&za->error);
diff --git a/ext/zip/lib/zip_unchange.c b/ext/zip/lib/zip_unchange.c
index 80070e7a3b..34e7f2d367 100644
--- a/ext/zip/lib/zip_unchange.c
+++ b/ext/zip/lib/zip_unchange.c
@@ -41,7 +41,7 @@
-PHPZIPAPI int
+int
zip_unchange(struct zip *za, int idx)
{
return _zip_unchange(za, idx, 0);
@@ -49,7 +49,7 @@ zip_unchange(struct zip *za, int idx)
-PHPZIPAPI int
+int
_zip_unchange(struct zip *za, int idx, int allow_duplicates)
{
int i;
diff --git a/ext/zip/lib/zip_unchange_all.c b/ext/zip/lib/zip_unchange_all.c
index 2d4459c823..f1e27da045 100644
--- a/ext/zip/lib/zip_unchange_all.c
+++ b/ext/zip/lib/zip_unchange_all.c
@@ -41,7 +41,7 @@
-PHPZIPAPI int
+int
zip_unchange_all(struct zip *za)
{
int ret, i;
diff --git a/ext/zip/lib/zip_unchange_archive.c b/ext/zip/lib/zip_unchange_archive.c
index 6c2bc6dcb3..7418aaf6ac 100644
--- a/ext/zip/lib/zip_unchange_archive.c
+++ b/ext/zip/lib/zip_unchange_archive.c
@@ -41,7 +41,7 @@
-PHPZIPAPI int
+int
zip_unchange_archive(struct zip *za)
{
free(za->ch_comment);
diff --git a/ext/zip/lib/zip_unchange_data.c b/ext/zip/lib/zip_unchange_data.c
index dfa2ea545f..2526769261 100644
--- a/ext/zip/lib/zip_unchange_data.c
+++ b/ext/zip/lib/zip_unchange_data.c
@@ -39,7 +39,7 @@
#include "zipint.h"
-PHPZIPAPI void
+void
_zip_unchange_data(struct zip_entry *ze)
{
if (ze->source) {
diff --git a/ext/zip/lib/zip_win32.h b/ext/zip/lib/zip_win32.h
index ea3860d602..a33347ba0c 100644
--- a/ext/zip/lib/zip_win32.h
+++ b/ext/zip/lib/zip_win32.h
@@ -1,3 +1,6 @@
+
+#ifdef _MSC_VER
+
#define _POSIX_
#include <windows.h>
#include <io.h>
@@ -9,6 +12,9 @@
#ifndef mode_t
# define mode_t int
#endif
+#ifndef strcasecmp
+# define strcasecmp stricmp
+#endif
#ifndef snprintf
# define snprintf _snprintf
#endif
@@ -20,3 +26,4 @@
# define fseeko fseek
#endif
*/
+#endif
diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h
index 706f693d91..ebf2743f99 100644
--- a/ext/zip/lib/zipint.h
+++ b/ext/zip/lib/zipint.h
@@ -39,7 +39,6 @@
#include <zlib.h>
#include "zip.h"
-BEGIN_EXTERN_C()
#ifndef HAVE_FSEEKO
#define fseeko(s, o, w) (fseek((s), (long int)(o), (w)))
#endif
@@ -186,43 +185,42 @@ extern const int _zip_err_type[];
-PHPZIPAPI void _zip_cdir_free(struct zip_cdir *);
-PHPZIPAPI struct zip_cdir *_zip_cdir_new(int, struct zip_error *);
-PHPZIPAPI int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *);
+void _zip_cdir_free(struct zip_cdir *);
+struct zip_cdir *_zip_cdir_new(int, struct zip_error *);
+int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *);
-PHPZIPAPI void _zip_dirent_finalize(struct zip_dirent *);
-PHPZIPAPI void _zip_dirent_init(struct zip_dirent *);
-PHPZIPAPI int _zip_dirent_read(struct zip_dirent *, FILE *,
+void _zip_dirent_finalize(struct zip_dirent *);
+void _zip_dirent_init(struct zip_dirent *);
+int _zip_dirent_read(struct zip_dirent *, FILE *,
unsigned char **, unsigned int, int, struct zip_error *);
-PHPZIPAPI int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *);
-
-PHPZIPAPI void _zip_entry_free(struct zip_entry *);
-PHPZIPAPI void _zip_entry_init(struct zip *, int);
-PHPZIPAPI struct zip_entry *_zip_entry_new(struct zip *);
-
-PHPZIPAPI void _zip_error_clear(struct zip_error *);
-PHPZIPAPI void _zip_error_copy(struct zip_error *, struct zip_error *);
-PHPZIPAPI void _zip_error_fini(struct zip_error *);
-PHPZIPAPI void _zip_error_get(struct zip_error *, int *, int *);
-PHPZIPAPI void _zip_error_init(struct zip_error *);
-PHPZIPAPI void _zip_error_set(struct zip_error *, int, int);
-PHPZIPAPI const char *_zip_error_strerror(struct zip_error *);
-
-PHPZIPAPI int _zip_file_fillbuf(void *, size_t, struct zip_file *);
-PHPZIPAPI unsigned int _zip_file_get_offset(struct zip *, int);
-
-PHPZIPAPI void _zip_free(struct zip *);
-PHPZIPAPI const char *_zip_get_name(struct zip *, int, int, struct zip_error *);
-PHPZIPAPI int _zip_local_header_read(struct zip *, int);
-PHPZIPAPI void *_zip_memdup(const void *, size_t, struct zip_error *);
-PHPZIPAPI int _zip_name_locate(struct zip *, const char *, int, struct zip_error *);
-PHPZIPAPI struct zip *_zip_new(struct zip_error *);
-PHPZIPAPI unsigned short _zip_read2(unsigned char **);
-PHPZIPAPI unsigned int _zip_read4(unsigned char **);
-PHPZIPAPI int _zip_replace(struct zip *, int, const char *, struct zip_source *);
-PHPZIPAPI int _zip_set_name(struct zip *, int, const char *);
-PHPZIPAPI int _zip_unchange(struct zip *, int, int);
-PHPZIPAPI void _zip_unchange_data(struct zip_entry *);
-
-END_EXTERN_C();
+int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *);
+
+void _zip_entry_free(struct zip_entry *);
+void _zip_entry_init(struct zip *, int);
+struct zip_entry *_zip_entry_new(struct zip *);
+
+void _zip_error_clear(struct zip_error *);
+void _zip_error_copy(struct zip_error *, struct zip_error *);
+void _zip_error_fini(struct zip_error *);
+void _zip_error_get(struct zip_error *, int *, int *);
+void _zip_error_init(struct zip_error *);
+void _zip_error_set(struct zip_error *, int, int);
+const char *_zip_error_strerror(struct zip_error *);
+
+int _zip_file_fillbuf(void *, size_t, struct zip_file *);
+unsigned int _zip_file_get_offset(struct zip *, int);
+
+void _zip_free(struct zip *);
+const char *_zip_get_name(struct zip *, int, int, struct zip_error *);
+int _zip_local_header_read(struct zip *, int);
+void *_zip_memdup(const void *, size_t, struct zip_error *);
+int _zip_name_locate(struct zip *, const char *, int, struct zip_error *);
+struct zip *_zip_new(struct zip_error *);
+unsigned short _zip_read2(unsigned char **);
+unsigned int _zip_read4(unsigned char **);
+int _zip_replace(struct zip *, int, const char *, struct zip_source *);
+int _zip_set_name(struct zip *, int, const char *);
+int _zip_unchange(struct zip *, int, int);
+void _zip_unchange_data(struct zip_entry *);
+
#endif /* zipint.h */