php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
file.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
14 +----------------------------------------------------------------------+
15*/
16
17#ifndef FILE_H
18#define FILE_H
19
20#include "php_network.h"
21
24
36
37PHP_MINIT_FUNCTION(user_streams);
38
40PHPAPI zend_result php_copy_file(const char *src, const char *dest);
41PHPAPI zend_result php_copy_file_ex(const char *src, const char *dest, int src_flags);
42PHPAPI zend_result php_copy_file_ctx(const char *src, const char *dest, int src_flags, php_stream_context *ctx);
44PHPAPI void php_flock_common(php_stream *stream, zend_long operation, uint32_t operation_arg_num,
45 zval *wouldblock, zval *return_value);
46
47#define PHP_CSV_NO_ESCAPE EOF
48#define PHP_CSV_ESCAPE_ERROR -500
49
51PHPAPI int php_csv_handle_escape_argument(const zend_string *escape_str, uint32_t arg_num);
52PHPAPI HashTable *php_fgetcsv(php_stream *stream, char delimiter, char enclosure, int escape_char, size_t buf_len, char *buf);
53PHPAPI ssize_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, int escape_char, zend_string *eol_str);
54
55#define META_DEF_BUFSIZE 8192
56
57#define PHP_FILE_USE_INCLUDE_PATH (1 << 0)
58#define PHP_FILE_IGNORE_NEW_LINES (1 << 1)
59#define PHP_FILE_SKIP_EMPTY_LINES (1 << 2)
60#define PHP_FILE_APPEND (1 << 3)
61#define PHP_FILE_NO_DEFAULT_CONTEXT (1 << 4)
62
63#ifndef _WIN32
64#define PHP_TIMEOUT_ULL_MAX ULLONG_MAX
65#else
66#define PHP_TIMEOUT_ULL_MAX UINT64_MAX
67#endif
68
80
90
92
93typedef struct {
98 char *user_agent; /* for the http wrapper */
99 char *from_address; /* for the ftp and http wrappers */
100 const char *user_stream_current_filename; /* for simple recursion protection */
102 HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */
103 HashTable *stream_filters; /* per-request copy of stream_filters_hash */
104 HashTable *wrapper_errors; /* key: wrapper address; value: linked list of char* */
106#ifdef HAVE_GETHOSTBYNAME_R
107 struct hostent tmp_host_info;
108 char *tmp_host_buf;
109 size_t tmp_host_buf_len;
110#endif
112
113#ifdef ZTS
114#define FG(v) ZEND_TSRMG(file_globals_id, php_file_globals *, v)
115extern PHPAPI int file_globals_id;
116#else
117#define FG(v) (file_globals.v)
119#endif
120
121
122#endif /* FILE_H */
rewind($stream)
fgetc($stream)
file(string $filename, int $flags=0, $context=null)
feof($stream)
fseek($stream, int $offset, int $whence=SEEK_SET)
fwrite($stream, string $data, ?int $length=null)
fclose($stream)
ftell($stream)
fread($stream, int $length)
fflush($stream)
fpassthru($stream)
fgets($stream, ?int $length=null)
zend_ffi_ctype_name_buf buf
Definition ffi.c:4685
php_file_globals file_globals
Definition file.c:91
#define PHP_FUNCTION
Definition php.h:364
#define PHP_MSHUTDOWN_FUNCTION
Definition php.h:401
#define PHP_MINIT_FUNCTION
Definition php.h:400
#define PHPAPI
Definition php.h:71
struct _php_stream php_stream
Definition php_streams.h:96
struct _php_stream_context php_stream_context
Definition php_streams.h:98
PHPAPI void php_fstat(php_stream *stream, zval *return_value)
Definition file.c:1369
PHPAPI HashTable * php_bc_fgetcsv_empty_line(void)
Definition file.c:1886
_php_meta_tags_token
Definition file.h:69
@ TOK_SLASH
Definition file.h:73
@ TOK_CLOSETAG
Definition file.h:72
@ TOK_OTHER
Definition file.h:78
@ TOK_OPENTAG
Definition file.h:71
@ TOK_EQUAL
Definition file.h:74
@ TOK_STRING
Definition file.h:77
@ TOK_ID
Definition file.h:76
@ TOK_SPACE
Definition file.h:75
@ TOK_EOF
Definition file.h:70
PHPAPI zend_result php_copy_file(const char *src, const char *dest)
Definition file.c:1483
PHPAPI int php_le_stream_context(void)
Definition file.c:114
PHPAPI HashTable * php_fgetcsv(php_stream *stream, char delimiter, char enclosure, int escape_char, size_t buf_len, char *buf)
Definition file.c:1895
PHPAPI int php_csv_handle_escape_argument(const zend_string *escape_str, uint32_t arg_num)
Definition file.c:1656
PHPAPI ssize_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, char enclosure, int escape_char, zend_string *eol_str)
Definition file.c:1739
PHPAPI zend_result php_copy_file_ex(const char *src, const char *dest, int src_flags)
Definition file.c:1490
PHPAPI void php_flock_common(php_stream *stream, zend_long operation, uint32_t operation_arg_num, zval *wouldblock, zval *return_value)
Definition file.c:188
PHPAPI zend_result php_copy_file_ctx(const char *src, const char *dest, int src_flags, php_stream_context *ctx)
Definition file.c:1497
php_meta_tags_token php_next_meta_token(php_meta_tags_data *)
Definition file.c:2195
enum _php_meta_tags_token php_meta_tags_token
struct _php_meta_tags_data php_meta_tags_data
char * token_data
Definition file.h:86
php_stream * stream
Definition file.h:82
char * input_buffer
Definition file.h:85
HashTable * wrapper_errors
Definition file.h:104
char * user_agent
Definition file.h:98
php_stream_context * default_context
Definition file.h:101
const char * user_stream_current_filename
Definition file.h:100
zend_long default_socket_timeout
Definition file.h:97
int pclose_ret
Definition file.h:94
char * from_address
Definition file.h:99
int pclose_wait
Definition file.h:105
size_t def_chunk_size
Definition file.h:95
HashTable * stream_filters
Definition file.h:103
bool auto_detect_line_endings
Definition file.h:96
HashTable * stream_wrappers
Definition file.h:102
struct _zval_struct zval
int32_t zend_long
Definition zend_long.h:42
struct _zend_string zend_string
struct _zend_array HashTable
Definition zend_types.h:386
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
zval * return_value
uint32_t arg_num