PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LTP GCOV extension - code coverage report
Current view: directory - spl - spl_directory.h
Test: PHP Code Coverage
Date: 2009-11-23 Instrumented lines: 4
Code covered: 100.0 % Executed lines: 4
Legend: not executed executed

       1                 : /*
       2                 :    +----------------------------------------------------------------------+
       3                 :    | PHP Version 6                                                        |
       4                 :    +----------------------------------------------------------------------+
       5                 :    | Copyright (c) 1997-2009 The PHP Group                                |
       6                 :    +----------------------------------------------------------------------+
       7                 :    | This source file is subject to version 3.01 of the PHP license,      |
       8                 :    | that is bundled with this package in the file LICENSE, and is        |
       9                 :    | available through the world-wide-web at the following url:           |
      10                 :    | http://www.php.net/license/3_01.txt                                  |
      11                 :    | If you did not receive a copy of the PHP license and are unable to   |
      12                 :    | obtain it through the world-wide-web, please send a note to          |
      13                 :    | license@php.net so we can mail you a copy immediately.               |
      14                 :    +----------------------------------------------------------------------+
      15                 :    | Authors: Marcus Boerger <helly@php.net>                              |
      16                 :    +----------------------------------------------------------------------+
      17                 :  */
      18                 : 
      19                 : /* $Id: spl_directory.h 283691 2009-07-08 03:09:58Z iliaa $ */
      20                 : 
      21                 : #ifndef SPL_DIRECTORY_H
      22                 : #define SPL_DIRECTORY_H
      23                 : 
      24                 : #include "php.h"
      25                 : #include "php_spl.h"
      26                 : 
      27                 : extern PHPAPI zend_class_entry *spl_ce_SplFileInfo;
      28                 : extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator;
      29                 : extern PHPAPI zend_class_entry *spl_ce_FilesystemIterator;
      30                 : extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator;
      31                 : extern PHPAPI zend_class_entry *spl_ce_GlobIterator;
      32                 : extern PHPAPI zend_class_entry *spl_ce_SplFileObject;
      33                 : extern PHPAPI zend_class_entry *spl_ce_SplTempFileObject;
      34                 : 
      35                 : PHP_MINIT_FUNCTION(spl_directory);
      36                 : 
      37                 : typedef enum {
      38                 :         SPL_FS_INFO, /* must be 0 */
      39                 :         SPL_FS_DIR,
      40                 :         SPL_FS_FILE
      41                 : } SPL_FS_OBJ_TYPE;
      42                 : 
      43                 : typedef struct _spl_filesystem_object  spl_filesystem_object;
      44                 : 
      45                 : typedef void (*spl_foreign_dtor_t)(spl_filesystem_object *object TSRMLS_DC);
      46                 : typedef void (*spl_foreign_clone_t)(spl_filesystem_object *src, spl_filesystem_object *dst TSRMLS_DC);
      47                 : 
      48                 : PHPAPI zstr spl_filesystem_object_get_path(spl_filesystem_object *intern, int *len, zend_uchar *type TSRMLS_DC);
      49                 : 
      50                 : typedef struct _spl_other_handler {
      51                 :         spl_foreign_dtor_t     dtor;
      52                 :         spl_foreign_clone_t    clone;
      53                 : } spl_other_handler;
      54                 : 
      55                 : /* define an overloaded iterator structure */
      56                 : typedef struct {
      57                 :         zend_object_iterator  intern;
      58                 :         zval                  *current;
      59                 : } spl_filesystem_iterator;
      60                 : 
      61                 : struct _spl_filesystem_object {
      62                 :         zend_object        std;
      63                 :         void               *oth;
      64                 :         spl_other_handler  *oth_handler;
      65                 :         zend_uchar         _path_type;
      66                 :         zstr               _path;
      67                 :         int                _path_len;
      68                 :         char               *orig_path;
      69                 :         zend_uchar         file_name_type;
      70                 :         zstr               file_name;
      71                 :         int                file_name_len;
      72                 :         SPL_FS_OBJ_TYPE    type;
      73                 :         long               flags;
      74                 :         zend_class_entry   *file_class;
      75                 :         zend_class_entry   *info_class;
      76                 :         union {
      77                 :                 struct {
      78                 :                         php_stream         *dirp;
      79                 :                         php_stream_dirent  entry;
      80                 :                         zend_uchar         sub_path_type;
      81                 :                         zstr               sub_path;
      82                 :                         int                sub_path_len;
      83                 :                         int                index;
      84                 :                         int                is_recursive;
      85                 :                         zend_function      *func_rewind;
      86                 :                         zend_function      *func_next;
      87                 :                         zend_function      *func_valid;
      88                 :                 } dir;
      89                 :                 struct {
      90                 :                         php_stream         *stream;
      91                 :                         php_stream_context *context;
      92                 :                         zval               *zcontext;
      93                 :                         char               *open_mode;
      94                 :                         int                open_mode_len;
      95                 :                         zval               *current_zval;
      96                 :                         char               *current_line;
      97                 :                         size_t             current_line_len;
      98                 :                         size_t             max_line_len;
      99                 :                         long               current_line_num;
     100                 :                         zval               zresource;
     101                 :                         zend_function      *func_getCurr;
     102                 :                         char               delimiter;
     103                 :                         char               enclosure;
     104                 :                         char               escape;
     105                 :                 } file;
     106                 :         } u;
     107                 :         spl_filesystem_iterator    it;
     108                 : };
     109                 : 
     110                 : static inline spl_filesystem_iterator* spl_filesystem_object_to_iterator(spl_filesystem_object *obj)
     111               6 : {
     112               6 :         return &obj->it;
     113                 : }
     114                 : 
     115                 : static inline spl_filesystem_object* spl_filesystem_iterator_to_object(spl_filesystem_iterator *it)
     116            7891 : {
     117            7891 :         return (spl_filesystem_object*)((char*)it - XtOffsetOf(spl_filesystem_object, it));
     118                 : }
     119                 : 
     120                 : #define SPL_FILE_OBJECT_DROP_NEW_LINE      0x00000001 /* drop new lines */
     121                 : #define SPL_FILE_OBJECT_READ_AHEAD         0x00000002 /* read on rewind/next */
     122                 : #define SPL_FILE_OBJECT_SKIP_EMPTY         0x00000006 /* skip empty lines */
     123                 : #define SPL_FILE_OBJECT_READ_CSV           0x00000008 /* read via fgetcsv */
     124                 : #define SPL_FILE_OBJECT_MASK               0x0000000F /* mask */
     125                 : 
     126                 : #define SPL_FILE_DIR_CURRENT_AS_FILEINFO   0x00000000 /* make RecursiveDirectoryTree::current() return SplFileInfo */
     127                 : #define SPL_FILE_DIR_CURRENT_AS_SELF       0x00000010 /* make RecursiveDirectoryTree::current() return getSelf() */
     128                 : #define SPL_FILE_DIR_CURRENT_AS_PATHNAME   0x00000020 /* make RecursiveDirectoryTree::current() return getPathname() */
     129                 : #define SPL_FILE_DIR_CURRENT_MODE_MASK     0x000000F0 /* mask RecursiveDirectoryTree::current() */
     130                 : #define SPL_FILE_DIR_CURRENT(intern,mode)  ((intern->flags&SPL_FILE_DIR_CURRENT_MODE_MASK)==mode)
     131                 : 
     132                 : #define SPL_FILE_DIR_KEY_AS_PATHNAME       0x00000000 /* make RecursiveDirectoryTree::key() return getPathname() */
     133                 : #define SPL_FILE_DIR_KEY_AS_FILENAME       0x00000100 /* make RecursiveDirectoryTree::key() return getFilename() */
     134                 : #define SPL_FILE_DIR_FOLLOW_SYMLINKS       0x00000200 /* make RecursiveDirectoryTree::hasChildren() follow symlinks */
     135                 : #define SPL_FILE_DIR_KEY_MODE_MASK         0x00000F00 /* mask RecursiveDirectoryTree::key() */
     136                 : #define SPL_FILE_DIR_KEY(intern,mode)      ((intern->flags&SPL_FILE_DIR_KEY_MODE_MASK)==mode)
     137                 : 
     138                 : 
     139                 : #define SPL_FILE_DIR_SKIPDOTS              0x00001000 /* Tells whether it should skip dots or not */
     140                 : #define SPL_FILE_DIR_UNIXPATHS             0x00002000 /* Whether to unixify path separators */
     141                 : #define SPL_FILE_DIR_OTHERS_MASK           0x00003000 /* mask used for get/setFlags */
     142                 : 
     143                 : #endif /* SPL_DIRECTORY_H */
     144                 : 
     145                 : /*
     146                 :  * Local Variables:
     147                 :  * c-basic-offset: 4
     148                 :  * tab-width: 4
     149                 :  * End:
     150                 :  * vim600: fdm=marker
     151                 :  * vim: noet sw=4 ts=4
     152                 :  */

Generated by: LTP GCOV extension version 1.5

Generated at Mon, 23 Nov 2009 17:39:39 +0000 (34 hours ago)

Copyright © 2005-2009 The PHP Group
All rights reserved.