2003-05-02 07:28:28 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2003-06-13 03:30:54 +08:00
|
|
|
| PHP Version 5 |
|
2003-05-02 07:28:28 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2005-08-03 22:08:58 +08:00
|
|
|
| Copyright (c) 1997-2005 The PHP Group |
|
2003-05-02 07:28:28 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2003-06-13 03:30:54 +08:00
|
|
|
| This source file is subject to version 3.0 of the PHP license, |
|
2003-05-02 07:28:28 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-13 03:30:54 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
|
|
|
| http://www.php.net/license/3_0.txt. |
|
2003-05-02 07:28:28 +08:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Marcus Boerger <helly@php.net> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2004-01-21 04:59:45 +08:00
|
|
|
/* $Id$ */
|
|
|
|
|
2003-11-09 22:05:36 +08:00
|
|
|
#ifndef SPL_DIRECTORY_H
|
|
|
|
#define SPL_DIRECTORY_H
|
2003-05-02 07:28:28 +08:00
|
|
|
|
|
|
|
#include "php.h"
|
|
|
|
#include "php_spl.h"
|
|
|
|
|
2005-10-08 23:55:04 +08:00
|
|
|
extern PHPAPI zend_class_entry *spl_ce_SplFileInfo;
|
2004-11-02 04:57:23 +08:00
|
|
|
extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator;
|
|
|
|
extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator;
|
2005-09-15 22:07:39 +08:00
|
|
|
extern PHPAPI zend_class_entry *spl_ce_SplFileObject;
|
2005-10-29 23:15:22 +08:00
|
|
|
extern PHPAPI zend_class_entry *spl_ce_SplTempFileObject;
|
2003-05-02 07:28:28 +08:00
|
|
|
|
2003-11-09 22:05:36 +08:00
|
|
|
PHP_MINIT_FUNCTION(spl_directory);
|
|
|
|
|
2005-10-08 23:55:04 +08:00
|
|
|
typedef enum {
|
|
|
|
SPL_FS_INFO,
|
|
|
|
SPL_FS_DIR,
|
|
|
|
SPL_FS_FILE,
|
|
|
|
} SPL_FS_OBJ_TYPE;
|
2003-12-02 15:13:53 +08:00
|
|
|
|
2005-10-08 23:55:04 +08:00
|
|
|
typedef struct _spl_filesystem_object {
|
2005-03-07 08:40:57 +08:00
|
|
|
zend_object std;
|
2005-10-08 23:55:04 +08:00
|
|
|
char *path;
|
|
|
|
int path_len;
|
2005-03-07 08:40:57 +08:00
|
|
|
char *file_name;
|
2005-10-08 23:55:04 +08:00
|
|
|
int file_name_len;
|
|
|
|
SPL_FS_OBJ_TYPE type;
|
2005-10-09 02:57:17 +08:00
|
|
|
long flags;
|
2005-11-02 00:54:44 +08:00
|
|
|
zend_class_entry *file_class;
|
|
|
|
zend_class_entry *info_class;
|
2005-10-08 23:55:04 +08:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
php_stream *dirp;
|
|
|
|
php_stream_dirent entry;
|
|
|
|
char *sub_path;
|
|
|
|
int sub_path_len;
|
|
|
|
int index;
|
|
|
|
int is_recursive;
|
|
|
|
} dir;
|
|
|
|
struct {
|
|
|
|
php_stream *stream;
|
|
|
|
php_stream_context *context;
|
|
|
|
zval *zcontext;
|
|
|
|
char *open_mode;
|
|
|
|
int open_mode_len;
|
|
|
|
zval *current_zval;
|
|
|
|
char *current_line;
|
|
|
|
size_t current_line_len;
|
|
|
|
size_t max_line_len;
|
|
|
|
long current_line_num;
|
|
|
|
zval zresource;
|
|
|
|
zend_function *func_getCurr;
|
|
|
|
} file;
|
|
|
|
} u;
|
|
|
|
} spl_filesystem_object;
|
2005-03-07 08:40:57 +08:00
|
|
|
|
|
|
|
#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */
|
2005-10-09 02:57:17 +08:00
|
|
|
#define SPL_FILE_DIR_CURRENT_AS_FILEINFO 0x00000010 /* make RecursiveDirectoryTree::current() return SplFileInfo */
|
|
|
|
#define SPL_FILE_DIR_KEY_AS_FILENAME 0x00000020 /* make RecursiveDirectoryTree::key() return getFilename() */
|
2005-03-07 08:40:57 +08:00
|
|
|
|
2003-11-09 22:05:36 +08:00
|
|
|
#endif /* SPL_DIRECTORY_H */
|
2003-05-02 07:28:28 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 4
|
|
|
|
* End:
|
|
|
|
* vim600: fdm=marker
|
|
|
|
* vim: noet sw=4 ts=4
|
|
|
|
*/
|