cvs: pecl /zip php_zip.c
| From: | Pierre-Alain Joye | Date: | Sun, 12 Mar 2006 19:28:08 +0000 |
| Subject: | cvs: pecl /zip php_zip.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-5430@lists.php.net to get a copy of this message | ||
pajoye Sun Mar 12 19:28:08 2006 UTC
Modified files:
/pecl/zip php_zip.c
Log:
- add archive comment property, read only for now
http://cvs.php.net/viewcvs.cgi/pecl/zip/php_zip.c?r1=1.27&r2=1.28&diff_format=u
Index: pecl/zip/php_zip.c
diff -u pecl/zip/php_zip.c:1.27 pecl/zip/php_zip.c:1.28
--- pecl/zip/php_zip.c:1.27 Sun Mar 12 14:12:34 2006
+++ pecl/zip/php_zip.c Sun Mar 12 19:28:08 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_zip.c,v 1.27 2006/03/12 14:12:34 pajoye Exp $ */
+/* $Id: php_zip.c,v 1.28 2006/03/12 19:28:08 pajoye Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -29,6 +29,7 @@
#include "ext/standard/php_string.h"
#include "php_zip.h"
#include "lib/zip.h"
+#include "lib/zipint.h"
/* {{{ Resource le */
static int le_zip_dir;
@@ -208,6 +209,16 @@
return NULL;
}
/* }}} */
+
+static char * php_zipobj_get_zip_comment(struct zip *za TSRMLS_DC) /* {{{ */
+{
+ if (za->cdir) {
+ return za->cdir->comment;
+ }
+ return NULL;
+}
+/* }}} */
+
#endif
/* {{{ zend_function_entry */
@@ -1245,6 +1256,7 @@
php_zip_register_prop_handler(&zip_prop_handlers, "statusSys", php_zip_status_sys,
NULL, NULL, IS_LONG TSRMLS_CC);
php_zip_register_prop_handler(&zip_prop_handlers, "numFiles",
php_zip_get_num_files, NULL, NULL, IS_LONG TSRMLS_CC);
php_zip_register_prop_handler(&zip_prop_handlers, "filename", NULL, NULL,
php_zipobj_get_filename, IS_STRING TSRMLS_CC);
+ php_zip_register_prop_handler(&zip_prop_handlers, "comment", NULL,
php_zipobj_get_zip_comment, NULL, IS_STRING TSRMLS_CC);
REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);
@@ -1320,7 +1332,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.27 2006/03/12 14:12:34 pajoye Exp $",
"enabled");
+ php_info_print_table_row(2, "$Id: php_zip.c,v 1.28 2006/03/12 19:28:08 pajoye Exp $",
"enabled");
php_info_print_table_row(2, "Libzip version", "0.6.1");
}
php_info_print_table_end();