helly Wed Mar 8 20:06:16 2006 UTC
Modified files:
/php-src/ext/spl spl_directory.c spl_directory.h
Log:
- Something that uses void* oth might want to deinitialize it in the dtor
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.82&r2=1.83&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.82
php-src/ext/spl/spl_directory.c:1.83
--- php-src/ext/spl/spl_directory.c:1.82 Wed Mar 8 00:43:28 2006
+++ php-src/ext/spl/spl_directory.c Wed Mar 8 20:06:16 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.82 2006/03/08 00:43:28 pajoye Exp $ */
+/* $Id: spl_directory.c,v 1.83 2006/03/08 20:06:16 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -70,6 +70,9 @@
{
spl_filesystem_object *intern = (spl_filesystem_object*)object;
+ if (intern->oth_dtor) {
+ intern->oth_dtor(intern TSRMLS_CC);
+ }
zend_hash_destroy(intern->std.properties);
FREE_HASHTABLE(intern->std.properties);
@@ -1330,7 +1333,6 @@
{
char *buf;
size_t line_len;
- int len;
long line_add = (intern->u.file.current_line ||
intern->u.file.current_zval) ? 1 : 0;
spl_filesystem_file_free_line(intern TSRMLS_CC);
@@ -1823,7 +1825,6 @@
spl_filesystem_object *intern =
(spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
char *str;
int str_len;
- int ret;
long length = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str,
&str_len, &length) == FAILURE) {
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.h?r1=1.20&r2=1.21&diff_format=u
Index: php-src/ext/spl/spl_directory.h
diff -u php-src/ext/spl/spl_directory.h:1.20
php-src/ext/spl/spl_directory.h:1.21
--- php-src/ext/spl/spl_directory.h:1.20 Mon Feb 27 18:15:29 2006
+++ php-src/ext/spl/spl_directory.h Wed Mar 8 20:06:16 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.h,v 1.20 2006/02/27 18:15:29 helly Exp $ */
+/* $Id: spl_directory.h,v 1.21 2006/03/08 20:06:16 helly Exp $ */
#ifndef SPL_DIRECTORY_H
#define SPL_DIRECTORY_H
@@ -38,9 +38,14 @@
SPL_FS_FILE,
} SPL_FS_OBJ_TYPE;
-typedef struct _spl_filesystem_object {
+typedef struct _spl_filesystem_object spl_filesystem_object;
+
+typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC);
+
+struct _spl_filesystem_object {
zend_object std;
void *oth;
+ spl_foreign_dtor_t oth_dtor;
char *path;
int path_len;
char *file_name;
@@ -73,7 +78,7 @@
zend_function *func_getCurr;
} file;
} u;
-} spl_filesystem_object;
+};
#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php