1999-04-17 00:37:12 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
| PHP version 4.0 |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
| This source file is subject to version 2.02 of the PHP license, |
|
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
|
|
|
| http://www.php.net/license/2_02.txt. |
|
|
|
|
| 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
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
*/
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef BASIC_FUNCTIONS_H
|
|
|
|
#define BASIC_FUNCTIONS_H
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-12-12 16:48:54 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#include "zend_highlight.h"
|
|
|
|
|
2000-08-01 07:45:14 +00:00
|
|
|
#ifdef TRANS_SID
|
|
|
|
# include "url_scanner.h"
|
|
|
|
#endif
|
|
|
|
|
1999-12-17 20:55:31 +00:00
|
|
|
extern zend_module_entry basic_functions_module;
|
1999-04-17 00:37:12 +00:00
|
|
|
#define basic_functions_module_ptr &basic_functions_module
|
|
|
|
|
1999-07-26 20:09:08 +00:00
|
|
|
PHP_MINIT_FUNCTION(basic);
|
|
|
|
PHP_MSHUTDOWN_FUNCTION(basic);
|
|
|
|
PHP_RINIT_FUNCTION(basic);
|
|
|
|
PHP_RSHUTDOWN_FUNCTION(basic);
|
2000-03-06 20:37:11 +00:00
|
|
|
PHP_MINFO_FUNCTION(basic);
|
|
|
|
PHP_GINIT_FUNCTION(basic);
|
1999-07-26 20:09:08 +00:00
|
|
|
|
1999-07-24 22:16:54 +00:00
|
|
|
PHP_FUNCTION(intval);
|
|
|
|
PHP_FUNCTION(doubleval);
|
|
|
|
PHP_FUNCTION(strval);
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(toggle_short_open_tag);
|
|
|
|
PHP_FUNCTION(sleep);
|
|
|
|
PHP_FUNCTION(usleep);
|
|
|
|
PHP_FUNCTION(flush);
|
|
|
|
PHP_FUNCTION(gettype);
|
|
|
|
PHP_FUNCTION(settype);
|
2000-03-04 17:28:16 +00:00
|
|
|
PHP_FUNCTION(ip2long);
|
|
|
|
PHP_FUNCTION(long2ip);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
/* system functions */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(getenv);
|
|
|
|
PHP_FUNCTION(putenv);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(get_current_user);
|
|
|
|
PHP_FUNCTION(set_time_limit);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(get_cfg_var);
|
|
|
|
PHP_FUNCTION(set_magic_quotes_runtime);
|
|
|
|
PHP_FUNCTION(get_magic_quotes_runtime);
|
|
|
|
PHP_FUNCTION(get_magic_quotes_gpc);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-12-17 20:55:31 +00:00
|
|
|
void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type);
|
1999-10-15 18:15:02 +00:00
|
|
|
PHP_FUNCTION(is_resource);
|
|
|
|
PHP_FUNCTION(is_bool);
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(is_long);
|
|
|
|
PHP_FUNCTION(is_double);
|
2000-03-16 16:02:23 +00:00
|
|
|
PHP_FUNCTION(is_numeric);
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(is_string);
|
|
|
|
PHP_FUNCTION(is_array);
|
|
|
|
PHP_FUNCTION(is_object);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(error_log);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(call_user_func);
|
|
|
|
PHP_FUNCTION(call_user_method);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
PHP_FUNCTION(register_shutdown_function);
|
|
|
|
PHP_FUNCTION(highlight_file);
|
|
|
|
PHP_FUNCTION(highlight_string);
|
1999-04-26 14:00:49 +00:00
|
|
|
ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
PHP_FUNCTION(ini_get);
|
2000-02-26 14:53:18 +00:00
|
|
|
PHP_FUNCTION(ini_set);
|
1999-04-17 00:37:12 +00:00
|
|
|
PHP_FUNCTION(ini_restore);
|
|
|
|
|
|
|
|
PHP_FUNCTION(print_r);
|
|
|
|
|
1999-09-04 21:10:39 +00:00
|
|
|
PHP_FUNCTION(connection_aborted);
|
|
|
|
PHP_FUNCTION(connection_timeout);
|
|
|
|
PHP_FUNCTION(connection_status);
|
|
|
|
PHP_FUNCTION(ignore_user_abort);
|
|
|
|
|
1999-11-01 01:07:51 +00:00
|
|
|
PHP_FUNCTION(getservbyname);
|
|
|
|
PHP_FUNCTION(getservbyport);
|
1999-11-02 03:47:09 +00:00
|
|
|
PHP_FUNCTION(getprotobyname);
|
|
|
|
PHP_FUNCTION(getprotobynumber);
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2000-06-21 22:51:29 +00:00
|
|
|
PHP_NAMED_FUNCTION(php_if_crc32);
|
|
|
|
|
1999-12-16 23:47:10 +00:00
|
|
|
PHP_FUNCTION(get_loaded_extensions);
|
|
|
|
PHP_FUNCTION(extension_loaded);
|
|
|
|
PHP_FUNCTION(get_extension_funcs);
|
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
PHP_FUNCTION(register_tick_function);
|
|
|
|
PHP_FUNCTION(unregister_tick_function);
|
2000-05-29 16:13:38 +00:00
|
|
|
|
2000-09-08 22:26:07 +00:00
|
|
|
PHP_FUNCTION(is_uploaded_file);
|
2000-09-09 11:41:14 +00:00
|
|
|
PHP_FUNCTION(move_uploaded_file);
|
2000-09-08 21:56:47 +00:00
|
|
|
|
2000-03-04 02:59:14 +00:00
|
|
|
/* From the INI parser */
|
|
|
|
PHP_FUNCTION(parse_ini_file);
|
|
|
|
|
2000-02-11 15:59:30 +00:00
|
|
|
#ifdef PHP_WIN32
|
1999-12-12 16:48:54 +00:00
|
|
|
typedef unsigned int php_stat_len;
|
|
|
|
#else
|
|
|
|
typedef int php_stat_len;
|
|
|
|
#endif
|
|
|
|
|
2000-08-21 09:50:53 +00:00
|
|
|
PHPAPI int _php_error_log(int opt_err,char *message,char *opt,char *headers);
|
|
|
|
|
1999-12-13 18:31:29 +00:00
|
|
|
#if SIZEOF_INT == 4
|
|
|
|
/* Most 32-bit and 64-bit systems have 32-bit ints */
|
1999-12-26 00:18:44 +00:00
|
|
|
typedef unsigned int php_uint32;
|
1999-12-13 18:31:29 +00:00
|
|
|
#elif SIZEOF_LONG == 4
|
|
|
|
/* 16-bit systems? */
|
1999-12-26 00:18:44 +00:00
|
|
|
typedef unsigned long php_uint32;
|
1999-12-13 18:31:29 +00:00
|
|
|
#else
|
|
|
|
#error Need type which holds 32 bits
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MT_N (624)
|
|
|
|
|
1999-11-28 00:31:02 +00:00
|
|
|
typedef struct {
|
|
|
|
HashTable *user_shutdown_function_names;
|
|
|
|
HashTable putenv_ht;
|
|
|
|
char *strtok_string;
|
|
|
|
char *locale_string;
|
|
|
|
char *strtok_pos1;
|
|
|
|
char *strtok_pos2;
|
|
|
|
char str_ebuf[40];
|
1999-12-01 17:21:52 +00:00
|
|
|
zval **array_walk_func_name;
|
|
|
|
zval **user_compare_func_name;
|
2000-09-01 16:10:17 +00:00
|
|
|
zend_llist *user_tick_functions;
|
1999-12-12 16:48:54 +00:00
|
|
|
|
2000-01-31 22:31:00 +00:00
|
|
|
HashTable sm_protected_env_vars;
|
|
|
|
char *sm_allowed_env_vars;
|
2000-01-30 20:31:41 +00:00
|
|
|
|
1999-12-12 16:48:54 +00:00
|
|
|
/* pageinfo.c */
|
1999-12-12 16:14:40 +00:00
|
|
|
long page_uid;
|
|
|
|
long page_inode;
|
|
|
|
long page_mtime;
|
1999-12-12 16:48:54 +00:00
|
|
|
|
|
|
|
/* filestat.c */
|
|
|
|
char *CurrentStatFile;
|
|
|
|
php_stat_len CurrentStatLength;
|
|
|
|
struct stat sb;
|
|
|
|
struct stat lsb;
|
1999-12-13 18:31:29 +00:00
|
|
|
|
|
|
|
/* rand.c */
|
1999-12-26 00:18:44 +00:00
|
|
|
php_uint32 state[MT_N+1]; /* state vector + 1 extra to not violate ANSI C */
|
|
|
|
php_uint32 *next; /* next random value is computed from here */
|
1999-12-13 18:31:29 +00:00
|
|
|
int left; /* can *next++ this many times before reloading */
|
2000-05-28 16:19:45 +00:00
|
|
|
|
|
|
|
/* syslog.c */
|
|
|
|
int syslog_started;
|
|
|
|
char *syslog_device;
|
2000-06-23 16:21:31 +00:00
|
|
|
|
|
|
|
/* var.c */
|
|
|
|
zend_class_entry *incomplete_class;
|
2000-09-04 22:21:10 +00:00
|
|
|
zend_bool use_trans_sid;
|
2000-08-01 07:45:14 +00:00
|
|
|
|
|
|
|
#ifdef TRANS_SID
|
|
|
|
/* url_scanner.c */
|
|
|
|
url_adapt_state_t url_adapt_state;
|
|
|
|
#endif
|
1999-11-28 00:31:02 +00:00
|
|
|
} php_basic_globals;
|
|
|
|
|
|
|
|
#ifdef ZTS
|
|
|
|
#define BLS_D php_basic_globals *basic_globals
|
|
|
|
#define BLS_DC , BLS_D
|
|
|
|
#define BLS_C basic_globals
|
|
|
|
#define BLS_CC , BLS_C
|
|
|
|
#define BG(v) (basic_globals->v)
|
|
|
|
#define BLS_FETCH() php_basic_globals *basic_globals = ts_resource(basic_globals_id)
|
1999-12-01 17:21:52 +00:00
|
|
|
extern int basic_globals_id;
|
1999-11-28 00:31:02 +00:00
|
|
|
#else
|
|
|
|
#define BLS_D
|
|
|
|
#define BLS_DC
|
|
|
|
#define BLS_C
|
|
|
|
#define BLS_CC
|
|
|
|
#define BG(v) (basic_globals.v)
|
|
|
|
#define BLS_FETCH()
|
1999-12-01 17:21:52 +00:00
|
|
|
extern php_basic_globals basic_globals;
|
1999-11-28 00:31:02 +00:00
|
|
|
#endif
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#if HAVE_PUTENV
|
|
|
|
typedef struct {
|
|
|
|
char *putenv_string;
|
|
|
|
char *previous_value;
|
|
|
|
char *key;
|
|
|
|
int key_len;
|
|
|
|
} putenv_entry;
|
|
|
|
#endif
|
|
|
|
|
2000-01-30 22:14:58 +00:00
|
|
|
/* Values are comma-delimited
|
2000-01-30 20:31:41 +00:00
|
|
|
*/
|
2000-01-31 22:31:00 +00:00
|
|
|
#define SAFE_MODE_PROTECTED_ENV_VARS "LD_LIBRARY_PATH"
|
|
|
|
#define SAFE_MODE_ALLOWED_ENV_VARS "PHP_"
|
2000-01-30 20:31:41 +00:00
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* BASIC_FUNCTIONS_H */
|