1999-04-17 00:37:12 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 17:33:29 +00:00
|
|
|
| PHP Version 5 |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 13:10:10 +00:00
|
|
|
| Copyright (c) 1997-2006 The PHP Group |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 13:10:10 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2000-07-24 01:40:02 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 13:10:10 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2000-07-24 01:40:02 +00: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. |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 08:29:35 +00:00
|
|
|
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
*/
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1999-12-18 04:01:20 +00:00
|
|
|
/* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef FILE_H
|
|
|
|
#define FILE_H
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2001-01-13 23:49:44 +00:00
|
|
|
PHP_MINIT_FUNCTION(file);
|
|
|
|
PHP_MSHUTDOWN_FUNCTION(file);
|
1999-07-26 20:09:08 +00:00
|
|
|
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(tempnam);
|
2000-12-07 12:09:38 +00:00
|
|
|
PHP_NAMED_FUNCTION(php_if_tmpfile);
|
|
|
|
PHP_NAMED_FUNCTION(php_if_fopen);
|
2002-04-05 11:51:43 +00:00
|
|
|
PHPAPI PHP_FUNCTION(fclose);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(popen);
|
|
|
|
PHP_FUNCTION(pclose);
|
2002-04-05 11:51:43 +00:00
|
|
|
PHPAPI PHP_FUNCTION(feof);
|
|
|
|
PHPAPI PHP_FUNCTION(fread);
|
|
|
|
PHPAPI PHP_FUNCTION(fgetc);
|
|
|
|
PHPAPI PHP_FUNCTION(fgets);
|
2000-06-06 18:58:15 +00:00
|
|
|
PHP_FUNCTION(fscanf);
|
2002-04-05 11:51:43 +00:00
|
|
|
PHPAPI PHP_FUNCTION(fgetss);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(fgetcsv);
|
2004-09-26 21:55:22 +00:00
|
|
|
PHP_FUNCTION(fputcsv);
|
2002-04-05 11:51:43 +00:00
|
|
|
PHPAPI PHP_FUNCTION(fwrite);
|
|
|
|
PHPAPI PHP_FUNCTION(fflush);
|
|
|
|
PHPAPI PHP_FUNCTION(rewind);
|
|
|
|
PHPAPI PHP_FUNCTION(ftell);
|
|
|
|
PHPAPI PHP_FUNCTION(fseek);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(mkdir);
|
|
|
|
PHP_FUNCTION(rmdir);
|
2002-04-05 11:51:43 +00:00
|
|
|
PHPAPI PHP_FUNCTION(fpassthru);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(readfile);
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
PHP_FUNCTION(umask);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(rename);
|
2000-07-02 15:12:34 +00:00
|
|
|
PHP_FUNCTION(unlink);
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
PHP_FUNCTION(copy);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(file);
|
2002-03-16 16:52:24 +00:00
|
|
|
PHP_FUNCTION(file_get_contents);
|
2003-04-08 14:12:52 +00:00
|
|
|
PHP_FUNCTION(file_put_contents);
|
1999-06-15 21:51:00 +00:00
|
|
|
PHP_FUNCTION(get_meta_tags);
|
|
|
|
PHP_FUNCTION(flock);
|
1999-11-24 03:05:10 +00:00
|
|
|
PHP_FUNCTION(fd_set);
|
1999-11-24 03:47:58 +00:00
|
|
|
PHP_FUNCTION(fd_isset);
|
2005-07-15 12:35:12 +00:00
|
|
|
#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
|
2000-02-01 06:06:03 +00:00
|
|
|
PHP_FUNCTION(realpath);
|
2002-03-21 19:18:13 +00:00
|
|
|
PHP_FUNCTION(fnmatch);
|
2001-10-23 11:14:51 +00:00
|
|
|
#endif
|
2000-12-07 12:09:38 +00:00
|
|
|
PHP_NAMED_FUNCTION(php_if_ftruncate);
|
|
|
|
PHP_NAMED_FUNCTION(php_if_fstat);
|
2006-05-06 09:59:02 +00:00
|
|
|
PHP_FUNCTION(php_get_tmpdir);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2002-03-19 14:35:55 +00:00
|
|
|
PHP_MINIT_FUNCTION(user_streams);
|
2001-04-17 17:06:06 +00:00
|
|
|
|
2003-02-27 22:23:39 +00:00
|
|
|
PHPAPI int php_le_stream_context(void);
|
2002-07-08 18:44:05 +00:00
|
|
|
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
|
2001-08-05 01:43:02 +00:00
|
|
|
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
|
2006-01-13 04:10:32 +00:00
|
|
|
PHPAPI int php_mkdir_ex(char *dir, long mode, int options TSRMLS_DC);
|
2003-12-14 18:23:15 +00:00
|
|
|
PHPAPI int php_mkdir(char *dir, long mode TSRMLS_DC);
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
|
2001-02-11 02:38:40 +00:00
|
|
|
#define META_DEF_BUFSIZE 8192
|
|
|
|
|
2003-02-10 22:26:53 +00:00
|
|
|
#define PHP_FILE_USE_INCLUDE_PATH 1
|
|
|
|
#define PHP_FILE_IGNORE_NEW_LINES 2
|
|
|
|
#define PHP_FILE_SKIP_EMPTY_LINES 4
|
2003-04-08 23:24:53 +00:00
|
|
|
#define PHP_FILE_APPEND 8
|
2003-05-21 04:04:50 +00:00
|
|
|
#define PHP_FILE_NO_DEFAULT_CONTEXT 16
|
2003-02-10 22:26:53 +00:00
|
|
|
|
2005-08-11 23:36:07 +00:00
|
|
|
/* Specified as explicit values so that file_put_contents() can override context param default mode */
|
|
|
|
#define PHP_FILE_TEXT 32
|
|
|
|
#define PHP_FILE_BINARY 64
|
|
|
|
|
2001-02-11 02:38:40 +00:00
|
|
|
typedef enum _php_meta_tags_token {
|
|
|
|
TOK_EOF = 0,
|
|
|
|
TOK_OPENTAG,
|
|
|
|
TOK_CLOSETAG,
|
|
|
|
TOK_SLASH,
|
|
|
|
TOK_EQUAL,
|
|
|
|
TOK_SPACE,
|
|
|
|
TOK_ID,
|
|
|
|
TOK_STRING,
|
|
|
|
TOK_OTHER
|
|
|
|
} php_meta_tags_token;
|
|
|
|
|
2001-06-30 20:07:12 +00:00
|
|
|
typedef struct _php_meta_tags_data {
|
2002-09-23 18:13:31 +00:00
|
|
|
php_stream *stream;
|
|
|
|
int ulc;
|
|
|
|
int lc;
|
|
|
|
char *input_buffer;
|
|
|
|
char *token_data;
|
|
|
|
int token_len;
|
|
|
|
int in_meta;
|
2001-06-30 20:07:12 +00:00
|
|
|
} php_meta_tags_data;
|
|
|
|
|
2002-03-18 18:54:32 +00:00
|
|
|
php_meta_tags_token php_next_meta_token(php_meta_tags_data * TSRMLS_DC);
|
2001-02-11 02:38:40 +00:00
|
|
|
|
2001-01-13 13:59:22 +00:00
|
|
|
typedef struct {
|
2002-09-23 18:13:31 +00:00
|
|
|
int pclose_ret;
|
|
|
|
size_t def_chunk_size;
|
2002-11-30 18:36:17 +00:00
|
|
|
long auto_detect_line_endings;
|
|
|
|
long default_socket_timeout;
|
2002-09-23 18:12:39 +00:00
|
|
|
char *user_agent;
|
2002-09-26 12:12:27 +00:00
|
|
|
char *user_stream_current_filename; /* for simple recursion protection */
|
2003-05-21 04:04:50 +00:00
|
|
|
php_stream_context *default_context;
|
2004-06-21 18:58:55 +00:00
|
|
|
HashTable *stream_wrappers; /* per-request copy of url_stream_wrappers_hash */
|
2004-06-21 21:08:05 +00:00
|
|
|
HashTable *stream_filters; /* per-request copy of stream_filters_hash */
|
2001-01-13 13:59:22 +00:00
|
|
|
} php_file_globals;
|
|
|
|
|
|
|
|
#ifdef ZTS
|
2001-07-28 11:36:37 +00:00
|
|
|
#define FG(v) TSRMG(file_globals_id, php_file_globals *, v)
|
2003-06-15 23:27:05 +00:00
|
|
|
extern PHPAPI int file_globals_id;
|
2001-01-13 13:59:22 +00:00
|
|
|
#else
|
|
|
|
#define FG(v) (file_globals.v)
|
2004-07-30 22:49:02 +00:00
|
|
|
extern PHPAPI php_file_globals file_globals;
|
2001-01-13 13:59:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* FILE_H */
|
2001-06-30 20:07:12 +00:00
|
|
|
|