Diff for /embedaddon/php/Zend/zend.h between versions 1.1.1.1 and 1.1.1.3

version 1.1.1.1, 2012/02/21 23:47:52 version 1.1.1.3, 2013/07/22 01:32:15
Line 2 Line 2
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | Zend Engine                                                          |     | Zend Engine                                                          |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
   | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |   | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) |
    +----------------------------------------------------------------------+     +----------------------------------------------------------------------+
    | This source file is subject to version 2.00 of the Zend license,     |     | This source file is subject to version 2.00 of the Zend license,     |
    | that is bundled with this package in the file LICENSE, and is        |      | that is bundled with this package in the file LICENSE, and is        | 
Line 22 Line 22
 #ifndef ZEND_H  #ifndef ZEND_H
 #define ZEND_H  #define ZEND_H
   
#define ZEND_VERSION "2.3.0"#define ZEND_VERSION "2.4.0"
   
 #define ZEND_ENGINE_2  #define ZEND_ENGINE_2
   
Line 180  char *alloca (); Line 180  char *alloca ();
 #endif  #endif
 #define restrict __restrict__  #define restrict __restrict__
   
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) && !(defined(ZTS) && defined(__FreeBSD__))#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
 # define ZEND_ALLOCA_MAX_SIZE (32 * 1024)  # define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
 # define ALLOCA_FLAG(name) \  # define ALLOCA_FLAG(name) \
         zend_bool name;          zend_bool name;
Line 200  char *alloca (); Line 200  char *alloca ();
 #endif  #endif
   
 #if ZEND_DEBUG  #if ZEND_DEBUG
#define ZEND_FILE_LINE_D                                char *__zend_filename, uint __zend_lineno#define ZEND_FILE_LINE_D                                const char *__zend_filename, const uint __zend_lineno
 #define ZEND_FILE_LINE_DC                               , ZEND_FILE_LINE_D  #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_D                   const char *__zend_orig_filename, const uint __zend_orig_lineno
 #define ZEND_FILE_LINE_ORIG_DC                  , ZEND_FILE_LINE_ORIG_D  #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_C                  __zend_filename, __zend_lineno
 #define ZEND_FILE_LINE_RELAY_CC                 , ZEND_FILE_LINE_RELAY_C  #define ZEND_FILE_LINE_RELAY_CC                 , ZEND_FILE_LINE_RELAY_C
Line 237  char *alloca (); Line 237  char *alloca ();
 #include "zend_alloc.h"  #include "zend_alloc.h"
   
 #include "zend_types.h"  #include "zend_types.h"
   #include "zend_string.h"
   
 #ifdef HAVE_LIMITS_H  #ifdef HAVE_LIMITS_H
 # include <limits.h>  # include <limits.h>
Line 297  typedef struct _zend_guard { Line 298  typedef struct _zend_guard {
 typedef struct _zend_object {  typedef struct _zend_object {
         zend_class_entry *ce;          zend_class_entry *ce;
         HashTable *properties;          HashTable *properties;
           zval **properties_table;
         HashTable *guards; /* protects from __get/__set ... recursion */          HashTable *guards; /* protects from __get/__set ... recursion */
 } zend_object;  } zend_object;
   
Line 348  struct _zval_struct { Line 350  struct _zval_struct {
 #define Z_UNSET_ISREF(z)                Z_UNSET_ISREF_P(&(z))  #define Z_UNSET_ISREF(z)                Z_UNSET_ISREF_P(&(z))
 #define Z_SET_ISREF_TO(z, isref)        Z_SET_ISREF_TO_P(&(z), isref)  #define Z_SET_ISREF_TO(z, isref)        Z_SET_ISREF_TO_P(&(z), isref)
   
   #if ZEND_DEBUG
   #define zend_always_inline inline
   #define zend_never_inline
   #else
 #if defined(__GNUC__)  #if defined(__GNUC__)
 #if __GNUC__ >= 3  #if __GNUC__ >= 3
 #define zend_always_inline inline __attribute__((always_inline))  #define zend_always_inline inline __attribute__((always_inline))
   #define zend_never_inline __attribute__((noinline))
 #else  #else
 #define zend_always_inline inline  #define zend_always_inline inline
   #define zend_never_inline
 #endif  #endif
   
 #elif defined(_MSC_VER)  #elif defined(_MSC_VER)
 #define zend_always_inline __forceinline  #define zend_always_inline __forceinline
   #define zend_never_inline
 #else  #else
 #define zend_always_inline inline  #define zend_always_inline inline
   #define zend_never_inline
 #endif  #endif
   #endif /* ZEND_DEBUG */
   
#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)#if (defined (__GNUC__) && __GNUC__ > 2 ) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX)
 # define EXPECTED(condition)   __builtin_expect(condition, 1)  # define EXPECTED(condition)   __builtin_expect(condition, 1)
 # define UNEXPECTED(condition) __builtin_expect(condition, 0)  # define UNEXPECTED(condition) __builtin_expect(condition, 0)
 #else  #else
Line 415  struct _zend_unserialize_data; Line 425  struct _zend_unserialize_data;
 typedef struct _zend_serialize_data zend_serialize_data;  typedef struct _zend_serialize_data zend_serialize_data;
 typedef struct _zend_unserialize_data zend_unserialize_data;  typedef struct _zend_unserialize_data zend_unserialize_data;
   
   struct _zend_trait_method_reference {
           const char* method_name;
           unsigned int mname_len;
           
           zend_class_entry *ce;
           
           const char* class_name;
           unsigned int cname_len;
   };
   typedef struct _zend_trait_method_reference     zend_trait_method_reference;
   
   struct _zend_trait_precedence {
           zend_trait_method_reference *trait_method;
           
           zend_class_entry** exclude_from_classes;
           
           union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
   };
   typedef struct _zend_trait_precedence zend_trait_precedence;
   
   struct _zend_trait_alias {
           zend_trait_method_reference *trait_method;
           
           /**
           * name for method to be added
           */
           const char* alias;
           unsigned int alias_len;
           
           /**
           * modifiers to be set on trait method
           */
           zend_uint modifiers;
           
           union _zend_function* function; /* FIXME: kept in 5.4 for BC, not used */
   };
   typedef struct _zend_trait_alias zend_trait_alias;
   
 struct _zend_class_entry {  struct _zend_class_entry {
         char type;          char type;
        char *name;        const char *name;
         zend_uint name_length;          zend_uint name_length;
         struct _zend_class_entry *parent;          struct _zend_class_entry *parent;
         int refcount;          int refcount;
         zend_bool constants_updated;  
         zend_uint ce_flags;          zend_uint ce_flags;
   
         HashTable function_table;          HashTable function_table;
         HashTable default_properties;  
         HashTable properties_info;          HashTable properties_info;
        HashTable default_static_members;        zval **default_properties_table;
        HashTable *static_members;        zval **default_static_members_table;
         zval **static_members_table;
         HashTable constants_table;          HashTable constants_table;
        const struct _zend_function_entry *builtin_functions;        int default_properties_count;
         int default_static_members_count;
   
         union _zend_function *constructor;          union _zend_function *constructor;
         union _zend_function *destructor;          union _zend_function *destructor;
Line 459  struct _zend_class_entry { Line 507  struct _zend_class_entry {
   
         zend_class_entry **interfaces;          zend_class_entry **interfaces;
         zend_uint num_interfaces;          zend_uint num_interfaces;
           
           zend_class_entry **traits;
           zend_uint num_traits;
           zend_trait_alias **trait_aliases;
           zend_trait_precedence **trait_precedences;
   
        char *filename;        union {
        zend_uint line_start;                struct {
        zend_uint line_end;                        const char *filename;
        char *doc_comment;                        zend_uint line_start;
        zend_uint doc_comment_len;                        zend_uint line_end;
                        const char *doc_comment;
        struct _zend_module_entry *module;                        zend_uint doc_comment_len;
                 } user;
                 struct {
                         const struct _zend_function_entry *builtin_functions;
                         struct _zend_module_entry *module;
                 } internal;
         } info;
 };  };
   
 #include "zend_stream.h"  #include "zend_stream.h"
Line 475  typedef struct _zend_utility_functions { Line 534  typedef struct _zend_utility_functions {
         int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);          int (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
         int (*write_function)(const char *str, uint str_length);          int (*write_function)(const char *str, uint str_length);
         FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);          FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC);
        void (*message_handler)(long message, void *data TSRMLS_DC);        void (*message_handler)(long message, const void *data TSRMLS_DC);
         void (*block_interruptions)(void);          void (*block_interruptions)(void);
         void (*unblock_interruptions)(void);          void (*unblock_interruptions)(void);
         int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);          int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
Line 518  typedef int (*zend_write_func_t)(const char *str, uint Line 577  typedef int (*zend_write_func_t)(const char *str, uint
 #define IS_RESOURCE     7  #define IS_RESOURCE     7
 #define IS_CONSTANT     8  #define IS_CONSTANT     8
 #define IS_CONSTANT_ARRAY       9  #define IS_CONSTANT_ARRAY       9
   #define IS_CALLABLE     10
   
 /* Ugly hack to support constants as static array indices */  /* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_TYPE_MASK   0x0f#define IS_CONSTANT_TYPE_MASK           0x00f
#define IS_CONSTANT_UNQUALIFIED 0x10#define IS_CONSTANT_UNQUALIFIED         0x010
#define IS_CONSTANT_INDEX               0x80#define IS_CONSTANT_INDEX                       0x080
#define IS_LEXICAL_VAR                  0x20#define IS_LEXICAL_VAR                          0x020
#define IS_LEXICAL_REF                  0x40#define IS_LEXICAL_REF                          0x040
 #define IS_CONSTANT_IN_NAMESPACE        0x100
   
 /* overloaded elements data types */  /* overloaded elements data types */
 #define OE_IS_ARRAY             (1<<0)  #define OE_IS_ARRAY             (1<<0)
Line 599  END_EXTERN_C() Line 660  END_EXTERN_C()
   
 /* FIXME: Check if we can save if (ptr) too */  /* FIXME: Check if we can save if (ptr) too */
   
#define STR_FREE(ptr) if (ptr) { efree(ptr); }#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); }
#define STR_FREE_REL(ptr) if (ptr) { efree_rel(ptr); }#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); }
   
 #define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)  #define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1)
   
Line 622  extern ZEND_API void (*zend_block_interruptions)(void) Line 683  extern ZEND_API void (*zend_block_interruptions)(void)
 extern ZEND_API void (*zend_unblock_interruptions)(void);  extern ZEND_API void (*zend_unblock_interruptions)(void);
 extern ZEND_API void (*zend_ticks_function)(int ticks);  extern ZEND_API void (*zend_ticks_function)(int ticks);
 extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);  extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern void (*zend_on_timeout)(int seconds TSRMLS_DC);extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
 extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);  extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
 extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);  extern int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
 extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);  extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
 extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);  extern ZEND_API char *(*zend_resolve_path)(const char *filename, int filename_len TSRMLS_DC);
 #if SUHOSIN_PATCH  
 extern ZEND_API void (*zend_suhosin_log)(int loglevel, char *fmt, ...);  
 #endif  
   
 ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);  ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
   
Line 645  END_EXTERN_C() Line 703  END_EXTERN_C()
   
 #define ZEND_UV(name) (zend_uv.name)  #define ZEND_UV(name) (zend_uv.name)
   
   #ifndef ZEND_SIGNALS
 #define HANDLE_BLOCK_INTERRUPTIONS()            if (zend_block_interruptions) { zend_block_interruptions(); }  #define HANDLE_BLOCK_INTERRUPTIONS()            if (zend_block_interruptions) { zend_block_interruptions(); }
 #define HANDLE_UNBLOCK_INTERRUPTIONS()          if (zend_unblock_interruptions) { zend_unblock_interruptions(); }  #define HANDLE_UNBLOCK_INTERRUPTIONS()          if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
   #else
   #include "zend_signal.h"
   
   #define HANDLE_BLOCK_INTERRUPTIONS()            ZEND_SIGNAL_BLOCK_INTERRUPUTIONS()
   #define HANDLE_UNBLOCK_INTERRUPTIONS()          ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
   #endif
   
 BEGIN_EXTERN_C()  BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC);ZEND_API void zend_message_dispatcher(long message, const void *data TSRMLS_DC);
   
 ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);  ZEND_API int zend_get_configuration_directive(const char *name, uint name_length, zval *contents);
 END_EXTERN_C()  END_EXTERN_C()
Line 679  END_EXTERN_C() Line 744  END_EXTERN_C()
   
 #define PZVAL_IS_REF(z)         Z_ISREF_P(z)  #define PZVAL_IS_REF(z)         Z_ISREF_P(z)
   
#define SEPARATE_ZVAL(ppzv)                                                                      \#define ZVAL_COPY_VALUE(z, v)                                     \
        {                                                                                                               \        do {                                                                              \
                zval *orig_ptr = *(ppzv);                                                     \                (z)->value = (v)->value;                                \
                                                                                                                        \                Z_TYPE_P(z) = Z_TYPE_P(v);                             \
                if (Z_REFCOUNT_P(orig_ptr) > 1) {                                       \        } while (0)
                        Z_DELREF_P(orig_ptr);                                                   \ 
                        ALLOC_ZVAL(*(ppzv));                                                    \ 
                        **(ppzv) = *orig_ptr;                                                   \ 
                        zval_copy_ctor(*(ppzv));                                                \ 
                        Z_SET_REFCOUNT_PP(ppzv, 1);                                             \ 
                        Z_UNSET_ISREF_PP((ppzv));                                               \ 
                }                                                                                                       \ 
        } 
   
   #define INIT_PZVAL_COPY(z, v)                                   \
           do {                                                                            \
                   ZVAL_COPY_VALUE(z, v);                                  \
                   Z_SET_REFCOUNT_P(z, 1);                                 \
                   Z_UNSET_ISREF_P(z);                                             \
           } while (0)
   
   #define SEPARATE_ZVAL(ppzv)                                             \
           do {                                                                            \
                   if (Z_REFCOUNT_PP((ppzv)) > 1) {                \
                           zval *new_zv;                                           \
                           Z_DELREF_PP(ppzv);                                      \
                           ALLOC_ZVAL(new_zv);                                     \
                           INIT_PZVAL_COPY(new_zv, *(ppzv));       \
                           *(ppzv) = new_zv;                                       \
                           zval_copy_ctor(new_zv);                         \
                   }                                                                               \
           } while (0)
   
 #define SEPARATE_ZVAL_IF_NOT_REF(ppzv)          \  #define SEPARATE_ZVAL_IF_NOT_REF(ppzv)          \
         if (!PZVAL_IS_REF(*ppzv)) {                             \          if (!PZVAL_IS_REF(*ppzv)) {                             \
                 SEPARATE_ZVAL(ppzv);                            \                  SEPARATE_ZVAL(ppzv);                            \
Line 714  END_EXTERN_C() Line 790  END_EXTERN_C()
         }                                                                               \          }                                                                               \
         INIT_PZVAL(&(zv));          INIT_PZVAL(&(zv));
                   
#define MAKE_COPY_ZVAL(ppzv, pzv) \#define MAKE_COPY_ZVAL(ppzv, pzv)       \
        *(pzv) = **(ppzv);            \        INIT_PZVAL_COPY(pzv, *(ppzv));        \
        zval_copy_ctor((pzv));        \        zval_copy_ctor((pzv));
        INIT_PZVAL((pzv)); 
   
 #define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) {  \  #define REPLACE_ZVAL_VALUE(ppzv_dest, pzv_src, copy) {  \
         int is_ref, refcount;                                           \          int is_ref, refcount;                                           \
Line 726  END_EXTERN_C() Line 801  END_EXTERN_C()
         is_ref = Z_ISREF_PP(ppzv_dest);                         \          is_ref = Z_ISREF_PP(ppzv_dest);                         \
         refcount = Z_REFCOUNT_PP(ppzv_dest);            \          refcount = Z_REFCOUNT_PP(ppzv_dest);            \
         zval_dtor(*ppzv_dest);                                          \          zval_dtor(*ppzv_dest);                                          \
        **ppzv_dest = *pzv_src;                                               \        ZVAL_COPY_VALUE(*ppzv_dest, pzv_src);              \
         if (copy) {                                 \          if (copy) {                                 \
                 zval_copy_ctor(*ppzv_dest);                             \                  zval_copy_ctor(*ppzv_dest);                             \
     }                                               \      }                                               \
Line 738  END_EXTERN_C() Line 813  END_EXTERN_C()
         if (PZVAL_IS_REF(varptr)) { \          if (PZVAL_IS_REF(varptr)) { \
                 zval *original_var = varptr; \                  zval *original_var = varptr; \
                 ALLOC_ZVAL(varptr); \                  ALLOC_ZVAL(varptr); \
                varptr->value = original_var->value; \                INIT_PZVAL_COPY(varptr, original_var); \
                Z_TYPE_P(varptr) = Z_TYPE_P(original_var); \ 
                Z_UNSET_ISREF_P(varptr); \ 
                Z_SET_REFCOUNT_P(varptr, 1); \ 
                 zval_copy_ctor(varptr); \                  zval_copy_ctor(varptr); \
         } else { \          } else { \
                 Z_ADDREF_P(varptr); \                  Z_ADDREF_P(varptr); \
Line 776  ZEND_API void zend_restore_error_handling(zend_error_h Line 848  ZEND_API void zend_restore_error_handling(zend_error_h
   
 #define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0)  #define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0)
 #define DEBUG_BACKTRACE_IGNORE_ARGS    (1<<1)  #define DEBUG_BACKTRACE_IGNORE_ARGS    (1<<1)
   
 #if SUHOSIN_PATCH  
 #include "suhosin_globals.h"  
 #include "suhosin_patch.h"  
 #include "php_syslog.h"  
   
 ZEND_API void zend_canary(void *buf, int len);  
 ZEND_API char suhosin_get_config(int element);  
   
 #endif  
   
 #endif /* ZEND_H */  #endif /* ZEND_H */
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>