@@ -30,12 +30,7 @@ extern PHPAPI zend_class_entry *spl_ce_SplTempFileObject;
30
30
31
31
PHP_MINIT_FUNCTION (spl_directory );
32
32
33
- typedef enum {
34
- SPL_FS_INFO , /* must be 0 */
35
- SPL_FS_DIR ,
36
- SPL_FS_FILE
37
- } SPL_FS_OBJ_TYPE ;
38
-
33
+ /* Internal objecte structure and helpers for Directory and File SPL objects */
39
34
typedef struct _spl_filesystem_object spl_filesystem_object ;
40
35
41
36
typedef void (* spl_foreign_dtor_t )(spl_filesystem_object * object );
@@ -48,12 +43,11 @@ typedef struct _spl_other_handler {
48
43
spl_foreign_clone_t clone ;
49
44
} spl_other_handler ;
50
45
51
- /* define an overloaded iterator structure */
52
- typedef struct {
53
- zend_object_iterator intern ;
54
- zval current ;
55
- void * object ;
56
- } spl_filesystem_iterator ;
46
+ typedef enum {
47
+ SPL_FS_INFO , /* must be 0 */
48
+ SPL_FS_DIR ,
49
+ SPL_FS_FILE
50
+ } SPL_FS_OBJ_TYPE ;
57
51
58
52
struct _spl_filesystem_object {
59
53
void * oth ;
@@ -96,28 +90,6 @@ struct _spl_filesystem_object {
96
90
zend_object std ;
97
91
};
98
92
99
- static inline spl_filesystem_object * spl_filesystem_from_obj (zend_object * obj ) /* {{{ */ {
100
- return (spl_filesystem_object * )((char * )(obj ) - XtOffsetOf (spl_filesystem_object , std ));
101
- }
102
- /* }}} */
103
-
104
- #define Z_SPLFILESYSTEM_P (zv ) spl_filesystem_from_obj(Z_OBJ_P((zv)))
105
-
106
- static inline spl_filesystem_iterator * spl_filesystem_object_to_iterator (spl_filesystem_object * obj )
107
- {
108
- spl_filesystem_iterator * it ;
109
-
110
- it = ecalloc (1 , sizeof (spl_filesystem_iterator ));
111
- it -> object = (void * )obj ;
112
- zend_iterator_init (& it -> intern );
113
- return it ;
114
- }
115
-
116
- static inline spl_filesystem_object * spl_filesystem_iterator_to_object (spl_filesystem_iterator * it )
117
- {
118
- return (spl_filesystem_object * )it -> object ;
119
- }
120
-
121
93
#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */
122
94
#define SPL_FILE_OBJECT_READ_AHEAD 0x00000002 /* read on rewind/next */
123
95
#define SPL_FILE_OBJECT_SKIP_EMPTY 0x00000004 /* skip empty lines */
0 commit comments