[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] cvs: pecl /zip php_zip.c php_zip.h
From:       "Pierre-Alain Joye" <pajoye () php ! net>
Date:       2006-02-27 16:19:50
Message-ID: cvspajoye1141057190 () cvsserver
[Download RAW message or body]

pajoye		Mon Feb 27 16:19:50 2006 UTC

  Modified files:              
    /pecl/zip	php_zip.c php_zip.h 
  Log:
  - add ZIP_ME and ZIP_METHOD macros
   - allows to use both zip_foo and zip::foo
     and adding back the old API
  
  
http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.c?r1=1.14&r2=1.15&diff_format=u
Index: pecl/zip/php_zip.c
diff -u pecl/zip/php_zip.c:1.14 pecl/zip/php_zip.c:1.15
--- pecl/zip/php_zip.c:1.14	Mon Feb 27 13:26:52 2006
+++ pecl/zip/php_zip.c	Mon Feb 27 16:19:50 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $ */
+/* $Id: php_zip.c,v 1.15 2006/02/27 16:19:50 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -413,7 +413,7 @@
 
 /* {{{ proto resource open(resource zip, string source)
 Create new zip using source uri for output */
-PHP_METHOD(zip, open)
+ZIP_METHOD(zip, open)
 {
 	struct zip *intern;
 	char *filename;
@@ -451,7 +451,7 @@
 
 /* {{{ proto resource close()
 close the zip archive */
-PHP_METHOD(zip, close)
+ZIP_METHOD(zip, close)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -480,7 +480,7 @@
 
 /* {{{ proto bool addFile(string filepath[, string entryname[, int start [, int length]]])
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, addFile)
+ZIP_METHOD(zip, addFile)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -527,7 +527,7 @@
 
 /* {{{ proto resource addFromString(string name, string content)
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, addFromString)
+ZIP_METHOD(zip, addFromString)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -575,7 +575,7 @@
 
 /* {{{ proto resource statFile(string filename[, int flags])
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, statPath)
+ZIP_METHOD(zip, statPath)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -609,7 +609,7 @@
 
 /* {{{ proto resource statIndex(int index[, int flags])
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, statIndex)
+ZIP_METHOD(zip, statIndex)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -638,7 +638,7 @@
 
 /* {{{ proto resource delete(int index)
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, delete)
+ZIP_METHOD(zip, delete)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -668,7 +668,7 @@
 
 /* {{{ proto resource rename(int index, string new_name)
 Add a file in a Zip archive using nama and content */
-PHP_METHOD(zip, rename)
+ZIP_METHOD(zip, rename)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -710,7 +710,7 @@
  * - replace path
  * - patterns
  */
-PHP_METHOD(zip, extractTo)
+ZIP_METHOD(zip, extractTo)
 {
 	struct zip *intern;
 
@@ -803,7 +803,7 @@
 
 /* {{{ proto resource getStream(string entryname)
 get a stream for the given entry */
-PHP_METHOD(zip, getStream)
+ZIP_METHOD(zip, getStream)
 {
 	struct zip *intern;
 	zval *this = getThis();
@@ -841,16 +841,16 @@
 
 /* {{{ ze_zip_object_class_functions */
 static zend_function_entry zip_class_functions[] = {
-	PHP_ME(zip, open,			NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, close,			NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, addFromString,	NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, addFile,		NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, rename,			NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, delete,			NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, statPath,		NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, statIndex,		NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, extractTo,		NULL, ZEND_ACC_PUBLIC)
-	PHP_ME(zip, getStream,		NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, open,			NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, close,			NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, addFromString,	NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, addFile,		NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, rename,			NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, delete,			NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, statPath,		NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, statIndex,		NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, extractTo,		NULL, ZEND_ACC_PUBLIC)
+	ZIP_ME(zip, getStream,		NULL, ZEND_ACC_PUBLIC)
 	{NULL, NULL, NULL}
 };
 /* }}} */
@@ -948,7 +948,7 @@
 	php_info_print_table_start();
 	{
 		php_info_print_table_row(2, "Zip", "enabled");
-		php_info_print_table_row(2, "$Id: php_zip.c,v 1.14 2006/02/27 13:26:52 helly Exp $", "enabled");
+		php_info_print_table_row(2, "$Id: php_zip.c,v 1.15 2006/02/27 16:19:50 pajoye Exp $", "enabled");
 		php_info_print_table_row(2, "Libzip version", "0.6.1");
 	}
 	php_info_print_table_end();
http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.h?r1=1.6&r2=1.7&diff_format=u
Index: pecl/zip/php_zip.h
diff -u pecl/zip/php_zip.h:1.6 pecl/zip/php_zip.h:1.7
--- pecl/zip/php_zip.h:1.6	Mon Feb 27 13:26:52 2006
+++ pecl/zip/php_zip.h	Mon Feb 27 16:19:50 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_zip.h,v 1.6 2006/02/27 13:26:52 helly Exp $ */
+/* $Id: php_zip.h,v 1.7 2006/02/27 16:19:50 pajoye Exp $ */
 
 #ifndef PHP_ZIP_H
 #define PHP_ZIP_H
@@ -35,7 +35,10 @@
 #endif
 
 #include "lib/zip.h"
-	
+
+#define ZIP_ME(classname, name, arg_info, flags)	ZEND_FENTRY(name, c_zip_ ##name, arg_info, flags)
+#define ZIP_METHOD(classname, name)	ZEND_NAMED_FUNCTION(c_zip_##name)
+
 /* Extends zend object */
 typedef struct _ze_zip_object {
 	zend_object zo;

-- 
PECL CVS Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic