Back to index

php5  5.3.10
file.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                        |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: file.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
00022 
00023 #ifndef FILE_H
00024 #define FILE_H
00025 
00026 PHP_MINIT_FUNCTION(file);
00027 PHP_MSHUTDOWN_FUNCTION(file);
00028 
00029 PHP_FUNCTION(tempnam);
00030 PHP_NAMED_FUNCTION(php_if_tmpfile);
00031 PHP_NAMED_FUNCTION(php_if_fopen);
00032 PHPAPI PHP_FUNCTION(fclose);
00033 PHP_FUNCTION(popen);
00034 PHP_FUNCTION(pclose);
00035 PHPAPI PHP_FUNCTION(feof);
00036 PHPAPI PHP_FUNCTION(fread);
00037 PHPAPI PHP_FUNCTION(fgetc);
00038 PHPAPI PHP_FUNCTION(fgets);
00039 PHP_FUNCTION(fscanf);
00040 PHPAPI PHP_FUNCTION(fgetss);
00041 PHP_FUNCTION(fgetcsv);
00042 PHP_FUNCTION(fputcsv);
00043 PHPAPI PHP_FUNCTION(fwrite);
00044 PHPAPI PHP_FUNCTION(fflush);
00045 PHPAPI PHP_FUNCTION(rewind);
00046 PHPAPI PHP_FUNCTION(ftell);
00047 PHPAPI PHP_FUNCTION(fseek);
00048 PHP_FUNCTION(mkdir);
00049 PHP_FUNCTION(rmdir);
00050 PHPAPI PHP_FUNCTION(fpassthru);
00051 PHP_FUNCTION(readfile);
00052 PHP_FUNCTION(umask);
00053 PHP_FUNCTION(rename);
00054 PHP_FUNCTION(unlink);
00055 PHP_FUNCTION(copy);
00056 PHP_FUNCTION(file);
00057 PHP_FUNCTION(file_get_contents);
00058 PHP_FUNCTION(file_put_contents);
00059 PHP_FUNCTION(get_meta_tags);
00060 PHP_FUNCTION(flock);
00061 PHP_FUNCTION(fd_set);
00062 PHP_FUNCTION(fd_isset);
00063 #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
00064 PHP_FUNCTION(realpath);
00065 #endif
00066 #ifdef HAVE_FNMATCH
00067 PHP_FUNCTION(fnmatch);
00068 #endif
00069 PHP_NAMED_FUNCTION(php_if_ftruncate);
00070 PHP_NAMED_FUNCTION(php_if_fstat);
00071 PHP_FUNCTION(sys_get_temp_dir);
00072 
00073 PHP_MINIT_FUNCTION(user_streams);
00074 
00075 PHPAPI int php_le_stream_context(void);
00076 PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
00077 PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
00078 PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
00079 PHPAPI int php_copy_file_ctx(char *src, char *dest, int src_chk, php_stream_context *context TSRMLS_DC);
00080 PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
00081 PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
00082 PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char escape_char, size_t buf_len, char *buf, zval *return_value TSRMLS_DC);
00083 
00084 #define META_DEF_BUFSIZE 8192
00085 
00086 #define PHP_FILE_USE_INCLUDE_PATH 1
00087 #define PHP_FILE_IGNORE_NEW_LINES 2
00088 #define PHP_FILE_SKIP_EMPTY_LINES 4
00089 #define PHP_FILE_APPEND 8
00090 #define PHP_FILE_NO_DEFAULT_CONTEXT 16
00091 
00092 typedef enum _php_meta_tags_token {
00093        TOK_EOF = 0,
00094        TOK_OPENTAG,
00095        TOK_CLOSETAG,
00096        TOK_SLASH,
00097        TOK_EQUAL,
00098        TOK_SPACE,
00099        TOK_ID,
00100        TOK_STRING,
00101        TOK_OTHER
00102 } php_meta_tags_token;
00103 
00104 typedef struct _php_meta_tags_data {
00105        php_stream *stream;
00106        int ulc;
00107        int lc;
00108        char *input_buffer;
00109        char *token_data;
00110        int token_len;
00111        int in_meta;
00112 } php_meta_tags_data;
00113 
00114 php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC);
00115 
00116 typedef struct {
00117        int pclose_ret;
00118        size_t def_chunk_size;
00119        long auto_detect_line_endings;
00120        long default_socket_timeout;
00121        char *user_agent; /* for the http wrapper */
00122        char *user_stream_current_filename; /* for simple recursion protection */
00123        php_stream_context *default_context;
00124        HashTable *stream_wrappers;               /* per-request copy of url_stream_wrappers_hash */
00125        HashTable *stream_filters;                /* per-request copy of stream_filters_hash */
00126 } php_file_globals;
00127 
00128 #ifdef ZTS
00129 #define FG(v) TSRMG(file_globals_id, php_file_globals *, v)
00130 extern PHPAPI int file_globals_id;
00131 #else
00132 #define FG(v) (file_globals.v)
00133 extern PHPAPI php_file_globals file_globals;
00134 #endif
00135 
00136 
00137 #endif /* FILE_H */
00138