php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
file.c File Reference
#include "php.h"
#include "ext/standard/flock_compat.h"
#include "ext/standard/php_filestat.h"
#include "php_open_temporary_file.h"
#include "ext/standard/basic_functions.h"
#include "php_ini.h"
#include "zend_smart_str.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <wchar.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include "php_string.h"
#include "file.h"
#include "fsock.h"
#include "fopen_wrappers.h"
#include "streamsfuncs.h"
#include "scanf.h"
#include "zend_API.h"
#include "file_arginfo.h"

Go to the source code of this file.

Macros

#define PHP_STREAM_FROM_ZVAL(stream, arg)
 
#define PHP_META_UNSAFE   ".\\+*?[^]$() "
 
#define PHP_FILE_BUF_SIZE   80
 
#define FPUTCSV_FLD_CHK(c)
 
#define PHP_META_HTML401_CHARS   "-_.:"
 

Functions

PHPAPI int php_le_stream_context (void)
 
 PHP_MINIT_FUNCTION (file)
 
PHPAPI void php_flock_common (php_stream *stream, zend_long operation, uint32_t operation_arg_num, zval *wouldblock, zval *return_value)
 
 PHP_FUNCTION (flock)
 
 PHP_FUNCTION (get_meta_tags)
 
 PHP_FUNCTION (file_get_contents)
 
 PHP_FUNCTION (file_put_contents)
 
 PHP_FUNCTION (file)
 
 PHP_FUNCTION (tempnam)
 
 PHP_FUNCTION (tmpfile)
 
 PHP_FUNCTION (fopen)
 
PHPAPI PHP_FUNCTION (fclose)
 
 PHP_FUNCTION (popen)
 
 PHP_FUNCTION (pclose)
 
PHPAPI PHP_FUNCTION (feof)
 
PHPAPI PHP_FUNCTION (fgets)
 
PHPAPI PHP_FUNCTION (fgetc)
 
 PHP_FUNCTION (fscanf)
 
PHPAPI PHP_FUNCTION (fwrite)
 
PHPAPI PHP_FUNCTION (fflush)
 
PHPAPI PHP_FUNCTION (rewind)
 
PHPAPI PHP_FUNCTION (ftell)
 
PHPAPI PHP_FUNCTION (fseek)
 
 PHP_FUNCTION (mkdir)
 
 PHP_FUNCTION (rmdir)
 
 PHP_FUNCTION (readfile)
 
 PHP_FUNCTION (umask)
 
PHPAPI PHP_FUNCTION (fpassthru)
 
 PHP_FUNCTION (rename)
 
 PHP_FUNCTION (unlink)
 
 PHP_FUNCTION (fsync)
 
 PHP_FUNCTION (fdatasync)
 
 PHP_FUNCTION (ftruncate)
 
PHPAPI void php_fstat (php_stream *stream, zval *return_value)
 
 PHP_FUNCTION (fstat)
 
 PHP_FUNCTION (copy)
 
PHPAPI zend_result php_copy_file (const char *src, const char *dest)
 
PHPAPI zend_result php_copy_file_ex (const char *src, const char *dest, int src_flags)
 
PHPAPI zend_result php_copy_file_ctx (const char *src, const char *dest, int src_flags, php_stream_context *ctx)
 
PHPAPI PHP_FUNCTION (fread)
 
PHPAPI int php_csv_handle_escape_argument (const zend_string *escape_str, uint32_t arg_num)
 
 PHP_FUNCTION (fputcsv)
 
PHPAPI ssize_t php_fputcsv (php_stream *stream, zval *fields, char delimiter, char enclosure, int escape_char, zend_string *eol_str)
 
 PHP_FUNCTION (fgetcsv)
 
PHPAPI HashTablephp_bc_fgetcsv_empty_line (void)
 
PHPAPI HashTablephp_fgetcsv (php_stream *stream, char delimiter, char enclosure, int escape_char, size_t buf_len, char *buf)
 
 PHP_FUNCTION (realpath)
 
php_meta_tags_token php_next_meta_token (php_meta_tags_data *md)
 
 PHP_FUNCTION (sys_get_temp_dir)
 

Variables

php_file_globals file_globals
 
return SUCCESS
 

Macro Definition Documentation

◆ FPUTCSV_FLD_CHK

#define FPUTCSV_FLD_CHK ( c)
Value:
memchr(ZSTR_VAL(field_str), c, ZSTR_LEN(field_str))
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define ZSTR_LEN(zstr)
Definition zend_string.h:69

Definition at line 1678 of file file.c.

◆ PHP_FILE_BUF_SIZE

#define PHP_FILE_BUF_SIZE   80

Definition at line 583 of file file.c.

◆ PHP_META_HTML401_CHARS

#define PHP_META_HTML401_CHARS   "-_.:"

Definition at line 2191 of file file.c.

◆ PHP_META_UNSAFE

#define PHP_META_UNSAFE   ".\\+*?[^]$() "

Definition at line 235 of file file.c.

◆ PHP_STREAM_FROM_ZVAL

#define PHP_STREAM_FROM_ZVAL ( stream,
arg )
Value:
php_stream_from_res(stream, Z_RES_P(arg));
zval * arg
Definition ffi.c:3975
#define ZEND_ASSERT(c)
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define IS_RESOURCE
Definition zend_types.h:609
#define Z_RES_P(zval_p)

Definition at line 105 of file file.c.

Function Documentation

◆ php_bc_fgetcsv_empty_line()

PHPAPI HashTable * php_bc_fgetcsv_empty_line ( void )

Definition at line 1886 of file file.c.

◆ php_copy_file()

PHPAPI zend_result php_copy_file ( const char * src,
const char * dest )

Definition at line 1483 of file file.c.

◆ php_copy_file_ctx()

PHPAPI zend_result php_copy_file_ctx ( const char * src,
const char * dest,
int src_flags,
php_stream_context * ctx )

Definition at line 1497 of file file.c.

◆ php_copy_file_ex()

PHPAPI zend_result php_copy_file_ex ( const char * src,
const char * dest,
int src_flags )

Definition at line 1490 of file file.c.

◆ php_csv_handle_escape_argument()

PHPAPI int php_csv_handle_escape_argument ( const zend_string * escape_str,
uint32_t arg_num )

Definition at line 1656 of file file.c.

◆ php_fgetcsv()

PHPAPI HashTable * php_fgetcsv ( php_stream * stream,
char delimiter,
char enclosure,
int escape_char,
size_t buf_len,
char * buf )

Definition at line 1895 of file file.c.

◆ php_flock_common()

PHPAPI void php_flock_common ( php_stream * stream,
zend_long operation,
uint32_t operation_arg_num,
zval * wouldblock,
zval * return_value )

Definition at line 188 of file file.c.

◆ php_fputcsv()

PHPAPI ssize_t php_fputcsv ( php_stream * stream,
zval * fields,
char delimiter,
char enclosure,
int escape_char,
zend_string * eol_str )

Definition at line 1739 of file file.c.

◆ php_fstat()

PHPAPI void php_fstat ( php_stream * stream,
zval * return_value )

Definition at line 1369 of file file.c.

◆ PHP_FUNCTION() [1/37]

PHP_FUNCTION ( copy )

Definition at line 1458 of file file.c.

◆ PHP_FUNCTION() [2/37]

PHPAPI PHP_FUNCTION ( fclose )

Definition at line 757 of file file.c.

◆ PHP_FUNCTION() [3/37]

PHP_FUNCTION ( fdatasync )

Definition at line 1323 of file file.c.

◆ PHP_FUNCTION() [4/37]

PHPAPI PHP_FUNCTION ( feof )

Definition at line 856 of file file.c.

◆ PHP_FUNCTION() [5/37]

PHPAPI PHP_FUNCTION ( fflush )

Definition at line 1032 of file file.c.

◆ PHP_FUNCTION() [6/37]

PHPAPI PHP_FUNCTION ( fgetc )

Definition at line 927 of file file.c.

◆ PHP_FUNCTION() [7/37]

PHP_FUNCTION ( fgetcsv )

Definition at line 1804 of file file.c.

◆ PHP_FUNCTION() [8/37]

PHPAPI PHP_FUNCTION ( fgets )

Definition at line 876 of file file.c.

◆ PHP_FUNCTION() [9/37]

PHP_FUNCTION ( file )

Definition at line 586 of file file.c.

◆ PHP_FUNCTION() [10/37]

PHP_FUNCTION ( file_get_contents )

Definition at line 382 of file file.c.

◆ PHP_FUNCTION() [11/37]

PHP_FUNCTION ( file_put_contents )

Definition at line 444 of file file.c.

◆ PHP_FUNCTION() [12/37]

PHP_FUNCTION ( flock )

Definition at line 216 of file file.c.

◆ PHP_FUNCTION() [13/37]

PHP_FUNCTION ( fopen )

Definition at line 727 of file file.c.

◆ PHP_FUNCTION() [14/37]

PHPAPI PHP_FUNCTION ( fpassthru )

Definition at line 1216 of file file.c.

◆ PHP_FUNCTION() [15/37]

PHP_FUNCTION ( fputcsv )

Definition at line 1681 of file file.c.

◆ PHP_FUNCTION() [16/37]

PHPAPI PHP_FUNCTION ( fread )

Definition at line 1589 of file file.c.

◆ PHP_FUNCTION() [17/37]

PHP_FUNCTION ( fscanf )

Definition at line 949 of file file.c.

◆ PHP_FUNCTION() [18/37]

PHPAPI PHP_FUNCTION ( fseek )

Definition at line 1093 of file file.c.

◆ PHP_FUNCTION() [19/37]

PHP_FUNCTION ( fstat )

Definition at line 1442 of file file.c.

◆ PHP_FUNCTION() [20/37]

PHP_FUNCTION ( fsync )

Definition at line 1304 of file file.c.

◆ PHP_FUNCTION() [21/37]

PHPAPI PHP_FUNCTION ( ftell )

Definition at line 1072 of file file.c.

◆ PHP_FUNCTION() [22/37]

PHP_FUNCTION ( ftruncate )

Definition at line 1343 of file file.c.

◆ PHP_FUNCTION() [23/37]

PHPAPI PHP_FUNCTION ( fwrite )

Definition at line 990 of file file.c.

◆ PHP_FUNCTION() [24/37]

PHP_FUNCTION ( get_meta_tags )

Definition at line 238 of file file.c.

◆ PHP_FUNCTION() [25/37]

PHP_FUNCTION ( mkdir )

Definition at line 1113 of file file.c.

◆ PHP_FUNCTION() [26/37]

PHP_FUNCTION ( pclose )

Definition at line 837 of file file.c.

◆ PHP_FUNCTION() [27/37]

PHP_FUNCTION ( popen )

Definition at line 782 of file file.c.

◆ PHP_FUNCTION() [28/37]

PHP_FUNCTION ( readfile )

Definition at line 1157 of file file.c.

◆ PHP_FUNCTION() [29/37]

PHP_FUNCTION ( realpath )

Definition at line 2163 of file file.c.

◆ PHP_FUNCTION() [30/37]

PHP_FUNCTION ( rename )

Definition at line 1234 of file file.c.

◆ PHP_FUNCTION() [31/37]

PHPAPI PHP_FUNCTION ( rewind )

Definition at line 1053 of file file.c.

◆ PHP_FUNCTION() [32/37]

PHP_FUNCTION ( rmdir )

Definition at line 1137 of file file.c.

◆ PHP_FUNCTION() [33/37]

PHP_FUNCTION ( sys_get_temp_dir )

Definition at line 2327 of file file.c.

◆ PHP_FUNCTION() [34/37]

PHP_FUNCTION ( tempnam )

Definition at line 681 of file file.c.

◆ PHP_FUNCTION() [35/37]

PHP_FUNCTION ( tmpfile )

Definition at line 710 of file file.c.

◆ PHP_FUNCTION() [36/37]

PHP_FUNCTION ( umask )

Definition at line 1188 of file file.c.

◆ PHP_FUNCTION() [37/37]

PHP_FUNCTION ( unlink )

Definition at line 1273 of file file.c.

◆ php_le_stream_context()

PHPAPI int php_le_stream_context ( void )

Definition at line 114 of file file.c.

◆ PHP_MINIT_FUNCTION()

PHP_MINIT_FUNCTION ( file )

Definition at line 161 of file file.c.

◆ php_next_meta_token()

php_meta_tags_token php_next_meta_token ( php_meta_tags_data * md)

Definition at line 2195 of file file.c.

Variable Documentation

◆ file_globals

php_file_globals file_globals

Definition at line 91 of file file.c.

◆ SUCCESS

return SUCCESS
Initial value:
{
file_globals_dtor(&file_globals)
php_file_globals file_globals
Definition file.c:91

Definition at line 184 of file file.c.