1999-04-08 02:10:10 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
2000-03-06 13:26:39 +08:00
|
|
|
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2000-03-06 13:26:39 +08:00
|
|
|
| This source file is subject to version 0.92 of the Zend license, |
|
1999-07-16 22:58:16 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
2000-03-06 13:26:39 +08:00
|
|
|
| http://www.zend.com/license/0_92.txt. |
|
1999-07-16 22:58:16 +08:00
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
1999-07-16 22:58:16 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#ifndef _ZEND_H
|
|
|
|
#define _ZEND_H
|
|
|
|
|
1999-07-20 03:58:44 +08:00
|
|
|
#define ZEND_VERSION "0.90"
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-04-23 11:32:33 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#define BEGIN_EXTERN_C() extern "C" {
|
|
|
|
#define END_EXTERN_C() }
|
|
|
|
#else
|
|
|
|
#define BEGIN_EXTERN_C()
|
|
|
|
#define END_EXTERN_C()
|
|
|
|
#endif
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* general definitions
|
|
|
|
*/
|
|
|
|
|
2000-02-11 23:59:30 +08:00
|
|
|
#ifdef ZEND_WIN32
|
1999-09-07 00:14:08 +08:00
|
|
|
# include "zend_config.w32.h"
|
1999-04-08 02:10:10 +08:00
|
|
|
#else
|
1999-09-07 00:14:08 +08:00
|
|
|
# include "zend_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* all HAVE_XXX test have to be after the include of zend_config above */
|
|
|
|
|
|
|
|
#ifdef HAVE_UNIX_H
|
|
|
|
# include <unix.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_STDARG_H
|
|
|
|
# include <stdarg.h>
|
1999-04-08 02:10:10 +08:00
|
|
|
#endif
|
|
|
|
|
2000-01-13 03:52:33 +08:00
|
|
|
#ifdef HAVE_DLFCN_H
|
|
|
|
# include <dlfcn.h>
|
|
|
|
#endif
|
|
|
|
|
2000-03-19 00:11:42 +08:00
|
|
|
#if defined(HAVE_LIBDL)
|
2000-01-14 04:34:45 +08:00
|
|
|
# define DL_LOAD(libname) dlopen(libname, RTLD_NOW)
|
|
|
|
# define DL_UNLOAD dlclose
|
|
|
|
# define DL_FETCH_SYMBOL dlsym
|
|
|
|
# define DL_HANDLE void *
|
|
|
|
# define ZEND_EXTENSIONS_SUPPORT 1
|
2000-02-11 23:59:30 +08:00
|
|
|
#elif defined(ZEND_WIN32)
|
2000-01-14 04:34:45 +08:00
|
|
|
# define DL_LOAD(libname) LoadLibrary(libname)
|
|
|
|
# define DL_FETCH_SYMBOL GetProcAddress
|
|
|
|
# define DL_UNLOAD FreeLibrary
|
|
|
|
# define DL_HANDLE HMODULE
|
|
|
|
# define ZEND_EXTENSIONS_SUPPORT 1
|
2000-01-13 03:52:33 +08:00
|
|
|
#else
|
2000-01-14 04:34:45 +08:00
|
|
|
# define DL_HANDLE void *
|
|
|
|
# define ZEND_EXTENSIONS_SUPPORT 0
|
2000-01-13 03:52:33 +08:00
|
|
|
#endif
|
|
|
|
|
2000-03-16 01:32:29 +08:00
|
|
|
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32))
|
|
|
|
# define do_alloca(p) alloca(p)
|
|
|
|
# define free_alloca(p)
|
|
|
|
#else
|
|
|
|
# define do_alloca(p) emalloc(p)
|
|
|
|
# define free_alloca(p) efree(p)
|
|
|
|
#endif
|
|
|
|
|
1999-08-29 05:43:24 +08:00
|
|
|
#if ZEND_DEBUG
|
1999-08-28 18:18:54 +08:00
|
|
|
#define ZEND_FILE_LINE_D char *__zend_filename, uint __zend_lineno
|
|
|
|
#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
|
|
|
|
#define ZEND_FILE_LINE_ORIG_D char *__zend_orig_filename, uint __zend_orig_lineno
|
|
|
|
#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D
|
|
|
|
#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno
|
|
|
|
#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C
|
|
|
|
#define ZEND_FILE_LINE_C __FILE__, __LINE__
|
|
|
|
#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C
|
|
|
|
#define ZEND_FILE_LINE_EMPTY_C NULL, 0
|
|
|
|
#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C
|
|
|
|
#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno
|
|
|
|
#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C
|
1999-08-28 03:17:19 +08:00
|
|
|
#else
|
|
|
|
#define ZEND_FILE_LINE_D
|
|
|
|
#define ZEND_FILE_LINE_DC
|
1999-08-28 18:18:54 +08:00
|
|
|
#define ZEND_FILE_LINE_ORIG_D
|
|
|
|
#define ZEND_FILE_LINE_ORIG_DC
|
1999-08-28 03:17:19 +08:00
|
|
|
#define ZEND_FILE_LINE_RELAY_C
|
|
|
|
#define ZEND_FILE_LINE_RELAY_CC
|
|
|
|
#define ZEND_FILE_LINE_C
|
|
|
|
#define ZEND_FILE_LINE_CC
|
1999-08-28 18:18:54 +08:00
|
|
|
#define ZEND_FILE_LINE_EMPTY_C
|
|
|
|
#define ZEND_FILE_LINE_EMPTY_CC
|
|
|
|
#define ZEND_FILE_LINE_ORIG_RELAY_C
|
|
|
|
#define ZEND_FILE_LINE_ORIG_RELAY_CC
|
1999-08-28 03:17:19 +08:00
|
|
|
#endif /* ZEND_DEBUG */
|
|
|
|
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include "zend_errors.h"
|
|
|
|
#include "zend_alloc.h"
|
|
|
|
|
1999-08-23 03:43:04 +08:00
|
|
|
typedef unsigned char zend_bool;
|
2000-03-13 23:43:40 +08:00
|
|
|
typedef unsigned char zend_uchar;
|
|
|
|
typedef unsigned int zend_uint;
|
2000-03-19 00:00:30 +08:00
|
|
|
typedef unsigned short zend_ushort;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
#undef SUCCESS
|
|
|
|
#undef FAILURE
|
|
|
|
#define SUCCESS 0
|
1999-09-07 00:14:08 +08:00
|
|
|
#define FAILURE -1 /* this MUST stay a negative number, or it may affect functions! */
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
#include "zend_hash.h"
|
|
|
|
#include "zend_llist.h"
|
|
|
|
|
2000-02-05 23:40:05 +08:00
|
|
|
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval *this_ptr, int return_value_used ELS_DC
|
|
|
|
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, this_ptr, return_value_used ELS_CC
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* zval
|
|
|
|
*/
|
|
|
|
typedef struct _zval_struct zval;
|
|
|
|
typedef struct _zend_class_entry zend_class_entry;
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef union _zvalue_value {
|
1999-04-08 02:10:10 +08:00
|
|
|
long lval; /* long value */
|
|
|
|
double dval; /* double value */
|
|
|
|
struct {
|
|
|
|
char *val;
|
|
|
|
int len;
|
|
|
|
} str;
|
|
|
|
char chval; /* char value */
|
|
|
|
HashTable *ht; /* hash table value */
|
|
|
|
struct {
|
|
|
|
zend_class_entry *ce;
|
|
|
|
HashTable *properties;
|
|
|
|
} obj;
|
|
|
|
} zvalue_value;
|
|
|
|
|
|
|
|
|
|
|
|
struct _zval_struct {
|
|
|
|
/* Variable information */
|
|
|
|
zvalue_value value; /* value */
|
2000-03-19 00:00:30 +08:00
|
|
|
zend_uchar type; /* active type */
|
|
|
|
zend_uchar is_ref;
|
|
|
|
zend_ushort refcount;
|
1999-04-08 02:10:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef struct _zend_function_entry {
|
1999-04-08 02:10:10 +08:00
|
|
|
char *fname;
|
|
|
|
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
|
|
|
|
unsigned char *func_arg_types;
|
1999-04-18 23:11:52 +08:00
|
|
|
} zend_function_entry;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef struct _zend_property_reference {
|
1999-04-08 02:10:10 +08:00
|
|
|
int type; /* read, write or r/w */
|
1999-07-27 00:57:06 +08:00
|
|
|
zval *object;
|
1999-04-08 02:10:10 +08:00
|
|
|
zend_llist elements_list;
|
|
|
|
} zend_property_reference;
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef struct _zend_overloaded_element {
|
1999-04-08 02:10:10 +08:00
|
|
|
int type; /* array offset or object proprety */
|
|
|
|
zval element;
|
|
|
|
} zend_overloaded_element;
|
|
|
|
|
1999-10-05 23:13:22 +08:00
|
|
|
/* excpt.h on Digital Unix 4.0 defines function_table */
|
|
|
|
#undef function_table
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
struct _zend_class_entry {
|
|
|
|
char type;
|
|
|
|
char *name;
|
|
|
|
uint name_length;
|
|
|
|
struct _zend_class_entry *parent;
|
1999-04-18 23:11:52 +08:00
|
|
|
int *refcount;
|
1999-11-22 02:11:10 +08:00
|
|
|
zend_bool constants_updated;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
HashTable function_table;
|
|
|
|
HashTable default_properties;
|
1999-05-28 20:06:59 +08:00
|
|
|
zend_function_entry *builtin_functions;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
/* handlers */
|
|
|
|
void (*handle_function_call)(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
|
|
|
|
zval (*handle_property_get)(zend_property_reference *property_reference);
|
|
|
|
int (*handle_property_set)(zend_property_reference *property_reference, zval *value);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef struct _zend_utility_functions {
|
1999-04-08 02:10:10 +08:00
|
|
|
void (*error_function)(int type, const char *format, ...);
|
|
|
|
int (*printf_function)(const char *format, ...);
|
|
|
|
int (*write_function)(const char *str, uint str_length);
|
1999-12-01 04:15:04 +08:00
|
|
|
FILE *(*fopen_function)(const char *filename, char **opened_path);
|
1999-04-08 02:10:10 +08:00
|
|
|
void (*message_handler)(long message, void *data);
|
1999-12-02 06:55:20 +08:00
|
|
|
void (*block_interruptions)(void);
|
|
|
|
void (*unblock_interruptions)(void);
|
1999-06-20 04:22:56 +08:00
|
|
|
int (*get_ini_entry)(char *name, uint name_length, zval *contents);
|
2000-01-25 03:00:30 +08:00
|
|
|
void (*ticks_function)(int ticks);
|
1999-04-08 02:10:10 +08:00
|
|
|
} zend_utility_functions;
|
|
|
|
|
|
|
|
|
1999-05-23 00:10:51 +08:00
|
|
|
typedef struct _zend_utility_values {
|
1999-12-16 04:15:32 +08:00
|
|
|
zend_bool short_tags;
|
|
|
|
zend_bool asp_tags;
|
|
|
|
zend_bool allow_call_time_pass_reference;
|
1999-12-04 21:26:57 +08:00
|
|
|
char *import_use_extension;
|
|
|
|
uint import_use_extension_length;
|
1999-04-08 02:10:10 +08:00
|
|
|
} zend_utility_values;
|
|
|
|
|
|
|
|
|
|
|
|
#undef MIN
|
|
|
|
#undef MAX
|
|
|
|
#define MAX(a,b) (((a)>(b))?(a):(b))
|
|
|
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
1999-12-31 21:56:59 +08:00
|
|
|
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
|
|
|
#define ZEND_STRS(str) (str), (sizeof(str)
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
/* data types */
|
2000-01-04 21:52:52 +08:00
|
|
|
#define IS_NULL 0
|
1999-04-08 02:10:10 +08:00
|
|
|
#define IS_LONG 1
|
|
|
|
#define IS_DOUBLE 2
|
|
|
|
#define IS_STRING 3
|
|
|
|
#define IS_ARRAY 4
|
|
|
|
#define IS_OBJECT 5
|
2000-01-04 22:25:42 +08:00
|
|
|
#define IS_BOOL 6
|
|
|
|
#define IS_RESOURCE 7
|
|
|
|
#define IS_CONSTANT 8
|
|
|
|
|
|
|
|
/* Special data type to temporarily mark large numbers */
|
|
|
|
#define FLAG_IS_BC 9 /* for parser internal use only */
|
2000-01-04 21:52:52 +08:00
|
|
|
|
|
|
|
/* overloaded elements data types */
|
|
|
|
#define OE_IS_ARRAY (1<<0)
|
|
|
|
#define OE_IS_OBJECT (1<<1)
|
|
|
|
#define OE_IS_METHOD (1<<2)
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-03-22 02:48:28 +08:00
|
|
|
|
|
|
|
/* Argument passing types */
|
|
|
|
#define BYREF_NONE 0
|
|
|
|
#define BYREF_FORCE 1
|
|
|
|
#define BYREF_ALLOW 2
|
|
|
|
#define BYREF_FORCE_REST 3
|
|
|
|
|
1999-04-10 19:21:55 +08:00
|
|
|
int zend_startup(zend_utility_functions *utility_functions, char **extensions);
|
1999-12-02 06:55:20 +08:00
|
|
|
void zend_shutdown(void);
|
1999-06-06 04:00:00 +08:00
|
|
|
|
1999-04-10 19:21:55 +08:00
|
|
|
void zend_set_utility_values(zend_utility_values *utility_values);
|
1999-05-15 23:47:24 +08:00
|
|
|
BEGIN_EXTERN_C()
|
1999-12-02 06:55:20 +08:00
|
|
|
ZEND_API void zend_bailout(void);
|
1999-05-15 23:47:24 +08:00
|
|
|
END_EXTERN_C()
|
1999-12-02 06:55:20 +08:00
|
|
|
ZEND_API char *get_zend_version(void);
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-06-11 18:44:26 +08:00
|
|
|
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
|
1999-04-08 02:10:10 +08:00
|
|
|
ZEND_API int zend_print_zval(zval *expr, int indent);
|
|
|
|
ZEND_API void zend_print_zval_r(zval *expr, int indent);
|
|
|
|
|
|
|
|
ZEND_API extern char *empty_string;
|
|
|
|
|
1999-12-31 21:56:59 +08:00
|
|
|
#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
|
|
|
|
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-12-22 04:30:04 +08:00
|
|
|
#define STR_REALLOC(ptr, size) \
|
1999-12-31 21:56:59 +08:00
|
|
|
if (ptr!=empty_string) { \
|
1999-12-22 04:30:04 +08:00
|
|
|
ptr = (char *) erealloc(ptr, size); \
|
|
|
|
} else { \
|
|
|
|
ptr = (char *) emalloc(size); \
|
|
|
|
memset(ptr, 0, size); \
|
|
|
|
}
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
/* output support */
|
|
|
|
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
|
|
|
|
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
|
|
|
|
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
|
|
|
|
|
1999-04-23 11:32:33 +08:00
|
|
|
BEGIN_EXTERN_C()
|
1999-04-08 02:10:10 +08:00
|
|
|
extern ZEND_API int (*zend_printf)(const char *format, ...);
|
|
|
|
extern ZEND_API int (*zend_write)(const char *str, uint str_length);
|
|
|
|
extern ZEND_API void (*zend_error)(int type, const char *format, ...);
|
1999-12-01 04:15:04 +08:00
|
|
|
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
1999-12-02 06:55:20 +08:00
|
|
|
extern ZEND_API void (*zend_block_interruptions)(void);
|
|
|
|
extern ZEND_API void (*zend_unblock_interruptions)(void);
|
2000-02-17 16:03:13 +08:00
|
|
|
extern ZEND_API void (*zend_ticks_function)(int ticks);
|
1999-12-04 21:26:57 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
void zenderror(char *error);
|
|
|
|
|
1999-06-04 19:44:02 +08:00
|
|
|
extern ZEND_API zend_class_entry zend_standard_class_def;
|
1999-04-08 02:10:10 +08:00
|
|
|
extern zend_utility_values zend_uv;
|
1999-12-23 04:24:52 +08:00
|
|
|
extern ZEND_API zval zval_used_for_init;
|
1999-12-19 14:39:17 +08:00
|
|
|
|
1999-12-04 21:26:57 +08:00
|
|
|
END_EXTERN_C()
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
#define ZEND_UV(name) (zend_uv.name)
|
|
|
|
|
|
|
|
|
|
|
|
#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
|
|
|
|
#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
|
|
|
|
|
2000-03-06 18:46:40 +08:00
|
|
|
BEGIN_EXTERN_C()
|
2000-03-06 03:50:10 +08:00
|
|
|
ZEND_API void zend_message_dispatcher(long message, void *data);
|
2000-03-06 18:46:40 +08:00
|
|
|
END_EXTERN_C()
|
|
|
|
|
2000-03-06 03:50:10 +08:00
|
|
|
ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
/* Messages for applications of Zend */
|
|
|
|
#define ZMSG_ENABLE_TRACK_VARS 1L
|
|
|
|
#define ZMSG_FAILED_INCLUDE_FOPEN 2L
|
|
|
|
#define ZMSG_FAILED_REQUIRE_FOPEN 3L
|
|
|
|
#define ZMSG_FAILED_HIGHLIGHT_FOPEN 4L
|
|
|
|
#define ZMSG_MEMORY_LEAK_DETECTED 5L
|
1999-05-22 19:20:56 +08:00
|
|
|
#define ZMSG_MEMORY_LEAK_REPEATED 6L
|
1999-06-01 02:39:29 +08:00
|
|
|
#define ZMSG_LOG_SCRIPT_NAME 7L
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-07-10 04:43:59 +08:00
|
|
|
#define INIT_PZVAL(z) \
|
|
|
|
(z)->refcount = 1; \
|
1999-10-02 07:31:39 +08:00
|
|
|
(z)->is_ref = 0;
|
1999-07-10 04:43:59 +08:00
|
|
|
|
1999-12-19 14:39:17 +08:00
|
|
|
#define INIT_ZVAL(z) z = zval_used_for_init;
|
|
|
|
|
1999-12-20 02:54:40 +08:00
|
|
|
#define ALLOC_INIT_ZVAL(zp) \
|
1999-12-27 05:21:33 +08:00
|
|
|
ALLOC_ZVAL(zp); \
|
1999-12-20 02:54:40 +08:00
|
|
|
INIT_ZVAL(*zp);
|
|
|
|
|
1999-07-24 00:02:51 +08:00
|
|
|
#define MAKE_STD_ZVAL(zv) \
|
1999-12-27 05:21:33 +08:00
|
|
|
ALLOC_ZVAL(zv); \
|
1999-07-10 04:43:59 +08:00
|
|
|
INIT_PZVAL(zv);
|
|
|
|
|
2000-02-17 00:00:02 +08:00
|
|
|
#define PZVAL_IS_REF(z) ((z)->is_ref)
|
|
|
|
|
1999-07-24 00:02:51 +08:00
|
|
|
#define SEPARATE_ZVAL(ppzv) \
|
|
|
|
{ \
|
|
|
|
zval *orig_ptr = *(ppzv); \
|
|
|
|
\
|
|
|
|
if (orig_ptr->refcount>1) { \
|
|
|
|
orig_ptr->refcount--; \
|
2000-02-17 00:00:02 +08:00
|
|
|
ALLOC_ZVAL(*(ppzv)); \
|
1999-07-24 00:02:51 +08:00
|
|
|
**(ppzv) = *orig_ptr; \
|
|
|
|
zval_copy_ctor(*(ppzv)); \
|
|
|
|
(*(ppzv))->refcount=1; \
|
1999-12-20 02:54:40 +08:00
|
|
|
(*(ppzv))->is_ref = 0; \
|
1999-07-24 00:02:51 +08:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2000-02-17 00:00:02 +08:00
|
|
|
#define SEPARATE_ZVAL_IF_NOT_REF(ppzv) \
|
|
|
|
if (!PZVAL_IS_REF(*ppzv)) { \
|
|
|
|
SEPARATE_ZVAL(ppzv); \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-12-20 02:54:40 +08:00
|
|
|
#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
|
|
|
|
(zv) = *(pzv); \
|
|
|
|
if ((pzv)->refcount>1) { \
|
|
|
|
zval_copy_ctor(&(zv)); \
|
|
|
|
(pzv)->refcount--; \
|
1999-12-21 00:05:36 +08:00
|
|
|
} else { \
|
1999-12-24 23:22:11 +08:00
|
|
|
FREE_ZVAL(pzv); \
|
1999-12-20 02:54:40 +08:00
|
|
|
} \
|
|
|
|
INIT_PZVAL(&(zv));
|
|
|
|
|
1999-08-16 03:29:39 +08:00
|
|
|
#define ZEND_MAX_RESERVED_RESOURCES 1
|
|
|
|
|
2000-02-11 23:59:30 +08:00
|
|
|
#ifdef ZEND_WIN32
|
2000-01-29 05:46:07 +08:00
|
|
|
/* Only use this macro if you know for sure that all of the switches values
|
|
|
|
are covered by its case statements */
|
2000-01-29 05:43:46 +08:00
|
|
|
#define EMPTY_SWITCH_DEFAULT_CASE() \
|
|
|
|
default: \
|
|
|
|
__assume(0); \
|
|
|
|
break;
|
|
|
|
#else
|
|
|
|
#define EMPTY_SWITCH_DEFAULT_CASE()
|
|
|
|
#endif
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#endif /* _ZEND_H */
|
1999-09-07 00:14:08 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* End:
|
|
|
|
*/
|