PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LTP GCOV extension - code coverage report
Current view: directory - var/php_gcov/PHP_HEAD/Zend - zend_operators.h
Test: PHP Code Coverage
Date: 2009-11-23 Instrumented lines: 107
Code covered: 90.7 % Executed lines: 97
Legend: not executed executed

       1                 : /*
       2                 :    +----------------------------------------------------------------------+
       3                 :    | Zend Engine                                                          |
       4                 :    +----------------------------------------------------------------------+
       5                 :    | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |
       6                 :    +----------------------------------------------------------------------+
       7                 :    | This source file is subject to version 2.00 of the Zend license,     |
       8                 :    | that is bundled with this package in the file LICENSE, and is        |
       9                 :    | available through the world-wide-web at the following url:           |
      10                 :    | http://www.zend.com/license/2_00.txt.                                |
      11                 :    | If you did not receive a copy of the Zend license and are unable to  |
      12                 :    | obtain it through the world-wide-web, please send a note to          |
      13                 :    | license@zend.com so we can mail you a copy immediately.              |
      14                 :    +----------------------------------------------------------------------+
      15                 :    | Authors: Andi Gutmans <andi@zend.com>                                |
      16                 :    |          Zeev Suraski <zeev@zend.com>                                |
      17                 :    +----------------------------------------------------------------------+
      18                 : */
      19                 : 
      20                 : /* $Id: zend_operators.h 281669 2009-06-04 18:18:47Z mattwil $ */
      21                 : 
      22                 : #ifndef ZEND_OPERATORS_H
      23                 : #define ZEND_OPERATORS_H
      24                 : 
      25                 : #include <errno.h>
      26                 : #include <math.h>
      27                 : 
      28                 : #ifdef HAVE_IEEEFP_H
      29                 : #include <ieeefp.h>
      30                 : #endif
      31                 : 
      32                 : #include "zend_strtod.h"
      33                 : #include "zend_unicode.h"
      34                 : 
      35                 : #if 0&&HAVE_BCMATH
      36                 : #include "ext/bcmath/libbcmath/src/bcmath.h"
      37                 : #endif
      38                 : 
      39                 : BEGIN_EXTERN_C()
      40                 : ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      41                 : ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      42                 : ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      43                 : ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      44                 : ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      45                 : ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      46                 : ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC);
      47                 : ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC);
      48                 : ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      49                 : ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      50                 : ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      51                 : ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      52                 : ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      53                 : ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      54                 : 
      55                 : ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      56                 : ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      57                 : ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      58                 : ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      59                 : ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      60                 : ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
      61                 : 
      62                 : ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC);
      63                 : ZEND_API zend_bool instanceof_function(const zend_class_entry *instance_ce, const zend_class_entry *ce TSRMLS_DC);
      64                 : ZEND_API long zend_u_strtol(const UChar *nptr, UChar **endptr, int base);
      65                 : ZEND_API unsigned long zend_u_strtoul(const UChar *nptr, UChar **endptr, int base);
      66                 : ZEND_API double zend_u_strtod(const UChar *nptr, UChar **endptr);
      67                 : END_EXTERN_C()
      68                 : 
      69                 : /* {{{ zend_dval_to_lval */
      70                 : #if ZEND_DVAL_TO_LVAL_CAST_OK
      71                 : # define zend_dval_to_lval(d) ((long) (d))
      72                 : #elif SIZEOF_LONG == 4 && defined(HAVE_ZEND_LONG64)
      73                 : static zend_always_inline long zend_dval_to_lval(double d)
      74            9960 : {
      75            9960 :         if (d > LONG_MAX || d < LONG_MIN) {
      76             316 :                 return (long)(unsigned long)(zend_long64) d;
      77                 :         }
      78            9644 :         return (long) d;
      79                 : }
      80                 : #else
      81                 : static zend_always_inline long zend_dval_to_lval(double d)
      82                 : {
      83                 :         if (d > LONG_MAX) {
      84                 :                 return (long)(unsigned long) d;
      85                 :         }
      86                 :         return (long) d;
      87                 : }
      88                 : #endif
      89                 : /* }}} */
      90                 : 
      91                 : static inline zend_uchar is_numeric_string(char *str, int length, long *lval, double *dval, int allow_errors)
      92           15400 : {
      93                 :         long local_lval;
      94                 :         double local_dval;
      95                 :         char *end_ptr_long, *end_ptr_double;
      96           15400 :         int conv_base=10;
      97                 : 
      98           15400 :         if (!length) {
      99               0 :                 return 0;
     100                 :         }
     101                 : 
     102                 :         /* handle hex numbers */
     103           15400 :         if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
     104               0 :                 conv_base=16;
     105                 :         }
     106           15400 :         errno=0;
     107           15400 :         local_lval = strtol(str, &end_ptr_long, conv_base);
     108           15400 :         if (errno!=ERANGE) {
     109           15374 :                 if (end_ptr_long == str+length) { /* integer string */
     110           11097 :                         if (lval) {
     111           11078 :                                 *lval = local_lval;
     112                 :                         }
     113           11097 :                         return IS_LONG;
     114            4277 :                 } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */
     115            3479 :                         return 0;
     116                 :                 }
     117                 :         } else {
     118              26 :                 end_ptr_long=NULL;
     119                 :         }
     120                 : 
     121             824 :         if (conv_base==16) { /* hex string, under UNIX strtod() messes it up */
     122               0 :                 return 0;
     123                 :         }
     124                 : 
     125             824 :         errno=0;
     126             824 :         local_dval = zend_strtod(str, &end_ptr_double);
     127             824 :         if (errno != ERANGE) {
     128             822 :                 if (end_ptr_double == str+length) { /* floating point string */
     129             702 :                         if (!zend_finite(local_dval)) {
     130                 :                                 /* "inf","nan" and maybe other weird ones */
     131               0 :                                 return 0;
     132                 :                         }
     133                 : 
     134             702 :                         if (dval) {
     135             702 :                                 *dval = local_dval;
     136                 :                         }
     137             702 :                         return IS_DOUBLE;
     138                 :                 }
     139                 :         } else {
     140               2 :                 end_ptr_double=NULL;
     141                 :         }
     142                 : 
     143             122 :         if (!allow_errors) {
     144             117 :                 return 0;
     145                 :         }
     146               5 :         if (allow_errors == -1) {
     147               0 :                 zend_error(E_NOTICE, "A non well formed numeric value encountered");
     148                 :         }
     149                 : 
     150               5 :         if (end_ptr_double>end_ptr_long && dval) {
     151               0 :                 *dval = local_dval;
     152               0 :                 return IS_DOUBLE;
     153               5 :         } else if (end_ptr_long && lval) {
     154               5 :                 *lval = local_lval;
     155               5 :                 return IS_LONG;
     156                 :         }
     157               0 :         return 0;
     158                 : }
     159                 : 
     160                 : static inline zend_uchar is_numeric_unicode(UChar *str, int length, long *lval, double *dval, int allow_errors)
     161         1370006 : {
     162                 :         long local_lval;
     163                 :         double local_dval;
     164                 :         UChar *end_ptr_long, *end_ptr_double;
     165         1370006 :         int conv_base=10;
     166                 : 
     167         1370006 :         if (!length) {
     168            1408 :                 return 0;
     169                 :         }
     170                 : 
     171                 :         /* handle hex numbers */
     172         1368598 :         if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
     173             235 :                 conv_base=16;
     174                 :         }
     175                 : 
     176         1368598 :         errno=0;
     177         1368598 :         local_lval = zend_u_strtol(str, &end_ptr_long, conv_base);
     178         1368598 :         if (errno != ERANGE) {
     179         1365901 :                 if (end_ptr_long == str+length) { /* integer string */
     180          522855 :                         if (lval) {
     181          522829 :                                 *lval = local_lval;
     182                 :                         }
     183          522855 :                         return IS_LONG;
     184          843046 :                 } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */
     185          574476 :                         return 0;
     186                 :                 }
     187                 :         } else {
     188            2697 :                 end_ptr_long = NULL;
     189                 :         }
     190                 : 
     191          271267 :         if (conv_base == 16) { /* hex string, under UNIX strtod() messes it up */
     192                 :                 /* UTODO: keep compatibility with is_numeric_string() here? */
     193               1 :                 return 0;
     194                 :         }
     195                 : 
     196          271266 :         local_dval = zend_u_strtod(str, &end_ptr_double);
     197          336939 :         if (local_dval == 0 && end_ptr_double == str) {
     198           65673 :                 end_ptr_double = NULL;
     199                 :         } else {
     200          205593 :                 if (end_ptr_double == str+length) { /* floating point string */
     201          204080 :                         if (!zend_finite(local_dval)) {
     202                 :                                 /* "inf","nan" and maybe other weird ones */
     203               0 :                                 return 0;
     204                 :                         }
     205                 : 
     206          204080 :                         if (dval) {
     207          204069 :                                 *dval = local_dval;
     208                 :                         }
     209          204080 :                         return IS_DOUBLE;
     210                 :                 }
     211                 :         }
     212                 : 
     213           67186 :         if (!allow_errors) {
     214           66355 :                 return 0;
     215                 :         }
     216             831 :         if (allow_errors == -1) {
     217              61 :                 zend_error(E_NOTICE, "A non well formed numeric value encountered");
     218                 :         }
     219                 : 
     220             831 :         if (allow_errors) {
     221             831 :                 if (end_ptr_double > end_ptr_long && dval) {
     222             256 :                         *dval = local_dval;
     223             256 :                         return IS_DOUBLE;
     224             575 :                 } else if (end_ptr_long && lval) {
     225             575 :                         *lval = local_lval;
     226             575 :                         return IS_LONG;
     227                 :                 }
     228                 :         }
     229               0 :         return 0;
     230                 : }
     231                 : 
     232                 : static inline UChar*
     233                 : zend_u_memnstr(UChar *haystack, UChar *needle, int needle_len, UChar *end)
     234         2131404 : {
     235         2131404 :         return u_strFindFirst(haystack, end - haystack, needle, needle_len);
     236                 : }
     237                 : 
     238                 : static inline char *
     239                 : zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
     240          349250 : {
     241          349250 :         char *p = haystack;
     242          349250 :         char ne = needle[needle_len-1];
     243                 : 
     244          349250 :         if (needle_len == 1) {
     245          343448 :                 return (char *)memchr(p, *needle, (end-p));
     246                 :         }
     247                 : 
     248            5802 :         if (needle_len > end-haystack) {
     249            1149 :                 return NULL;
     250                 :         }
     251                 : 
     252            4653 :         end -= needle_len;
     253                 : 
     254           56466 :         while (p <= end) {
     255           50814 :                 if ((p = (char *)memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) {
     256            3890 :                         if (!memcmp(needle, p, needle_len-1)) {
     257             184 :                                 return p;
     258                 :                         }
     259                 :                 }
     260                 : 
     261           50630 :                 if (p == NULL) {
     262            3470 :                         return NULL;
     263                 :                 }
     264                 : 
     265           47160 :                 p++;
     266                 :         }
     267                 : 
     268             999 :         return NULL;
     269                 : }
     270                 : 
     271                 : static inline void *zend_memrchr(const void *s, int c, size_t n)
     272           44644 : {
     273                 :         register unsigned char *e;
     274                 : 
     275           44644 :         if (n <= 0) {
     276             289 :                 return NULL;
     277                 :         }
     278                 : 
     279         1394866 :         for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) {
     280         1373153 :                 if (*e == (unsigned char)c) {
     281           22642 :                         return (void *)e;
     282                 :                 }
     283                 :         }
     284                 : 
     285           21713 :         return NULL;
     286                 : }
     287                 : 
     288                 : BEGIN_EXTERN_C()
     289                 : ZEND_API int increment_function(zval *op1);
     290                 : ZEND_API int decrement_function(zval *op2);
     291                 : 
     292                 : ZEND_API int convert_scalar_to_number(zval *op TSRMLS_DC);
     293                 : ZEND_API int _convert_to_string(zval *op ZEND_FILE_LINE_DC);
     294                 : ZEND_API int _convert_to_string_with_converter(zval *op, UConverter *conv TSRMLS_DC ZEND_FILE_LINE_DC);
     295                 : ZEND_API int _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC);
     296                 : ZEND_API int _convert_to_unicode_with_converter(zval *op, UConverter *conv TSRMLS_DC ZEND_FILE_LINE_DC);
     297                 : ZEND_API int convert_to_long(zval *op);
     298                 : ZEND_API int convert_to_double(zval *op);
     299                 : ZEND_API int convert_to_long_base(zval *op, int base);
     300                 : ZEND_API int convert_to_null(zval *op);
     301                 : ZEND_API int convert_to_boolean(zval *op);
     302                 : ZEND_API int convert_to_array(zval *op);
     303                 : ZEND_API int convert_to_object(zval *op);
     304                 : ZEND_API void multi_convert_to_long_ex(int argc, ...);
     305                 : ZEND_API void multi_convert_to_double_ex(int argc, ...);
     306                 : ZEND_API void multi_convert_to_string_ex(int argc, ...);
     307                 : ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
     308                 : ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2);
     309                 : 
     310                 : #define convert_to_string(op)                                           _convert_to_string((op) ZEND_FILE_LINE_CC)
     311                 : #define convert_to_string_with_converter(op, conv)      _convert_to_string_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC)
     312                 : #define convert_to_unicode(op)                                          _convert_to_unicode((op) TSRMLS_CC ZEND_FILE_LINE_CC)
     313                 : #define convert_to_unicode_with_converter(op, conv)     _convert_to_unicode_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC)
     314                 : 
     315                 : ZEND_API double zend_string_to_double(const char *number, zend_uint length);
     316                 : 
     317                 : ZEND_API int zval_is_true(zval *op);
     318                 : ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
     319                 : ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
     320                 : ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
     321                 : #if HAVE_STRCOLL
     322                 : ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
     323                 : #endif
     324                 : 
     325                 : ZEND_API void zend_str_tolower(char *str, unsigned int length);
     326                 : ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length);
     327                 : ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length);
     328                 : 
     329                 : ZEND_API void zend_u_str_tolower(zend_uchar type, zstr str, unsigned int length);
     330                 : ZEND_API zstr zend_u_str_tolower_copy(zend_uchar type, zstr dest, zstr source, unsigned int length);
     331                 : ZEND_API zstr zend_u_str_tolower_dup(zend_uchar type, zstr source, unsigned int length);
     332                 : 
     333                 : ZEND_API zstr zend_u_str_case_fold(zend_uchar type, zstr source, unsigned int length, zend_bool normalize, unsigned int *new_len);
     334                 : 
     335                 : ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
     336                 : ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
     337                 : ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
     338                 : ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3);
     339                 : ZEND_API int zend_binary_strcmp(const char *s1, uint len1, const char *s2, uint len2);
     340                 : ZEND_API int zend_binary_strncmp(const char *s1, uint len1, const char *s2, uint len2, uint length);
     341                 : ZEND_API int zend_binary_strcasecmp(const char *s1, uint len1, const char *s2, uint len2);
     342                 : ZEND_API int zend_binary_strncasecmp(const char *s1, uint len1, const char *s2, uint len2, uint length);
     343                 : 
     344                 : ZEND_API int zend_u_binary_zval_strcmp(zval *s1, zval *s2);
     345                 : ZEND_API int zend_u_binary_strcmp(UChar *s1, int len1, UChar *s2, int len2);
     346                 : ZEND_API int zend_u_binary_strncmp(UChar *s1, int len1, UChar *s2, int len2, uint length);
     347                 : ZEND_API int zend_u_binary_strcasecmp(UChar *s1, int len1, UChar *s2, int len2);
     348                 : ZEND_API int zend_u_binary_strncasecmp(UChar *s1, int len1, UChar *s2, int len2, uint length);
     349                 : 
     350                 : ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
     351                 : ZEND_API void zendi_u_smart_strcmp(zval *result, zval *s1, zval *s2);
     352                 : ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC);
     353                 : ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC);
     354                 : ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC);
     355                 : 
     356                 : ZEND_API int zend_atoi(const char *str, int str_len);
     357                 : ZEND_API long zend_atol(const char *str, int str_len);
     358                 : 
     359                 : ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
     360                 : END_EXTERN_C()
     361                 : 
     362                 : #define convert_to_ex_master(ppzv, lower_type, upper_type)      \
     363                 :         if (Z_TYPE_PP(ppzv)!=IS_##upper_type) {                                 \
     364                 :                 SEPARATE_ZVAL_IF_NOT_REF(ppzv);                                         \
     365                 :                 convert_to_##lower_type(*ppzv);                                         \
     366                 :         }
     367                 : 
     368                 : #define convert_to_explicit_type(pzv, type)             \
     369                 :         do {                                                                            \
     370                 :                 switch (type) {                                                 \
     371                 :                         case IS_NULL:                                           \
     372                 :                                 convert_to_null(pzv);                   \
     373                 :                                 break;                                                  \
     374                 :                         case IS_LONG:                                           \
     375                 :                                 convert_to_long(pzv);                   \
     376                 :                                 break;                                                  \
     377                 :                         case IS_DOUBLE:                                         \
     378                 :                                 convert_to_double(pzv);                 \
     379                 :                                 break;                                                  \
     380                 :                         case IS_BOOL:                                           \
     381                 :                                 convert_to_boolean(pzv);                \
     382                 :                                 break;                                                  \
     383                 :                         case IS_ARRAY:                                          \
     384                 :                                 convert_to_array(pzv);                  \
     385                 :                                 break;                                                  \
     386                 :                         case IS_OBJECT:                                         \
     387                 :                                 convert_to_object(pzv);                 \
     388                 :                                 break;                                                  \
     389                 :                         case IS_STRING:                                         \
     390                 :                                 convert_to_string(pzv);                 \
     391                 :                                 break;                                                  \
     392                 :                         case IS_UNICODE:                                        \
     393                 :                                 convert_to_unicode(pzv);                \
     394                 :                                 break;                                                  \
     395                 :                         default:                                                        \
     396                 :                                 assert(0);                                              \
     397                 :                                 break;                                                  \
     398                 :                 }                                                                               \
     399                 :         } while (0);
     400                 : 
     401                 : #define convert_to_explicit_type_ex(ppzv, str_type)     \
     402                 :         if (Z_TYPE_PP(ppzv) != str_type) {                              \
     403                 :                 SEPARATE_ZVAL_IF_NOT_REF(ppzv);                         \
     404                 :                 convert_to_explicit_type(*ppzv, str_type);      \
     405                 :         }
     406                 : 
     407                 : #define convert_to_boolean_ex(ppzv)     convert_to_ex_master(ppzv, boolean, BOOL)
     408                 : #define convert_to_long_ex(ppzv)        convert_to_ex_master(ppzv, long, LONG)
     409                 : #define convert_to_double_ex(ppzv)      convert_to_ex_master(ppzv, double, DOUBLE)
     410                 : #define convert_to_string_ex(ppzv)      convert_to_ex_master(ppzv, string, STRING)
     411                 : #define convert_to_unicode_ex(ppzv)     convert_to_ex_master(ppzv, unicode, UNICODE)
     412                 : #define convert_to_array_ex(ppzv)       convert_to_ex_master(ppzv, array, ARRAY)
     413                 : #define convert_to_object_ex(ppzv)      convert_to_ex_master(ppzv, object, OBJECT)
     414                 : #define convert_to_null_ex(ppzv)        convert_to_ex_master(ppzv, null, NULL)
     415                 : 
     416                 : #define convert_to_string_with_converter_ex(ppzv, conv) \
     417                 :         if (Z_TYPE_PP(ppzv) != IS_STRING) {                                     \
     418                 :                 SEPARATE_ZVAL_IF_NOT_REF(ppzv);                                 \
     419                 :                 convert_to_string_with_converter(*ppzv, conv);  \
     420                 :         }
     421                 : 
     422                 : #define convert_scalar_to_number_ex(ppzv)                                                       \
     423                 :         if (Z_TYPE_PP(ppzv)!=IS_LONG && Z_TYPE_PP(ppzv)!=IS_DOUBLE) {   \
     424                 :                 if (!Z_ISREF_PP(ppzv)) {                                                                        \
     425                 :                         SEPARATE_ZVAL(ppzv);                                                                    \
     426                 :                 }                                                                                                                       \
     427                 :                 convert_scalar_to_number(*ppzv TSRMLS_CC);                                      \
     428                 :         }
     429                 : 
     430                 : 
     431                 : #define Z_LVAL(zval)                    (zval).value.lval
     432                 : #define Z_BVAL(zval)                    ((zend_bool)(zval).value.lval)
     433                 : #define Z_DVAL(zval)                    (zval).value.dval
     434                 : #define Z_STRVAL(zval)                  (zval).value.str.val
     435                 : #define Z_STRLEN(zval)                  (zval).value.str.len
     436                 : #define Z_USTRVAL(zval)                 (zval).value.ustr.val
     437                 : #define Z_USTRLEN(zval)                 (zval).value.ustr.len
     438                 : #define Z_USTRCPLEN(zval)               (u_countChar32((zval).value.ustr.val, (zval).value.ustr.len))
     439                 : #define Z_ARRVAL(zval)                  (zval).value.ht
     440                 : #define Z_OBJVAL(zval)                  (zval).value.obj
     441                 : #define Z_OBJ_HANDLE(zval)              Z_OBJVAL(zval).handle
     442                 : #define Z_OBJ_HT(zval)                  Z_OBJVAL(zval).handlers
     443                 : #define Z_OBJCE(zval)                   zend_get_class_entry(&(zval) TSRMLS_CC)
     444                 : #define Z_OBJPROP(zval)                 Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC)
     445                 : #define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf
     446                 : #define Z_RESVAL(zval)                  (zval).value.lval
     447                 : #define Z_UNIVAL(zval)                  (zval).value.uni.val
     448                 : #define Z_UNILEN(zval)                  (zval).value.uni.len
     449                 : #define Z_UNISIZE(zval)                 ((Z_TYPE(zval)==IS_UNICODE) ? Z_UNILEN(zval)*sizeof(UChar) : Z_UNILEN(zval))
     450                 : #define Z_OBJDEBUG(zval,is_tmp) (Z_OBJ_HANDLER((zval),get_debug_info)?Z_OBJ_HANDLER((zval),get_debug_info)(&(zval),&is_tmp TSRMLS_CC):(is_tmp=0,Z_OBJ_HANDLER((zval),get_properties)?Z_OBJPROP(zval):NULL))
     451                 : 
     452                 : #define Z_LVAL_P(zval_p)                Z_LVAL(*zval_p)
     453                 : #define Z_BVAL_P(zval_p)                Z_BVAL(*zval_p)
     454                 : #define Z_DVAL_P(zval_p)                Z_DVAL(*zval_p)
     455                 : #define Z_STRVAL_P(zval_p)              Z_STRVAL(*zval_p)
     456                 : #define Z_STRLEN_P(zval_p)              Z_STRLEN(*zval_p)
     457                 : #define Z_USTRVAL_P(zval_p)             Z_USTRVAL(*zval_p)
     458                 : #define Z_USTRLEN_P(zval_p)             Z_USTRLEN(*zval_p)
     459                 : #define Z_USTRCPLEN_P(zval_p)   Z_USTRCPLEN(*zval_p)
     460                 : #define Z_ARRVAL_P(zval_p)              Z_ARRVAL(*zval_p)
     461                 : #define Z_OBJPROP_P(zval_p)             Z_OBJPROP(*zval_p)
     462                 : #define Z_OBJCE_P(zval_p)               Z_OBJCE(*zval_p)
     463                 : #define Z_RESVAL_P(zval_p)              Z_RESVAL(*zval_p)
     464                 : #define Z_OBJVAL_P(zval_p)              Z_OBJVAL(*zval_p)
     465                 : #define Z_OBJ_HANDLE_P(zval_p)  Z_OBJ_HANDLE(*zval_p)
     466                 : #define Z_OBJ_HT_P(zval_p)              Z_OBJ_HT(*zval_p)
     467                 : #define Z_OBJ_HANDLER_P(zval_p, h)      Z_OBJ_HANDLER(*zval_p, h)
     468                 : #define Z_UNIVAL_P(zval_p)              Z_UNIVAL(*zval_p)
     469                 : #define Z_UNILEN_P(zval_p)              Z_UNILEN(*zval_p)
     470                 : #define Z_UNISIZE_P(zval_p)             Z_UNISIZE(*zval_p)
     471                 : #define Z_OBJDEBUG_P(zval_p,is_tmp)     Z_OBJDEBUG(*zval_p,is_tmp)
     472                 : 
     473                 : #define Z_LVAL_PP(zval_pp)              Z_LVAL(**zval_pp)
     474                 : #define Z_BVAL_PP(zval_pp)              Z_BVAL(**zval_pp)
     475                 : #define Z_DVAL_PP(zval_pp)              Z_DVAL(**zval_pp)
     476                 : #define Z_STRVAL_PP(zval_pp)    Z_STRVAL(**zval_pp)
     477                 : #define Z_STRLEN_PP(zval_pp)    Z_STRLEN(**zval_pp)
     478                 : #define Z_USTRVAL_PP(zval_pp)   Z_USTRVAL(**zval_pp)
     479                 : #define Z_USTRLEN_PP(zval_pp)   Z_USTRLEN(**zval_pp)
     480                 : #define Z_USTRCPLEN_PP(zval_pp) Z_USTRCPLEN(**zval_pp)
     481                 : #define Z_ARRVAL_PP(zval_pp)    Z_ARRVAL(**zval_pp)
     482                 : #define Z_OBJPROP_PP(zval_pp)   Z_OBJPROP(**zval_pp)
     483                 : #define Z_OBJCE_PP(zval_pp)             Z_OBJCE(**zval_pp)
     484                 : #define Z_RESVAL_PP(zval_pp)    Z_RESVAL(**zval_pp)
     485                 : #define Z_OBJVAL_PP(zval_pp)    Z_OBJVAL(**zval_pp)
     486                 : #define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p)
     487                 : #define Z_OBJ_HT_PP(zval_p)             Z_OBJ_HT(**zval_p)
     488                 : #define Z_OBJ_HANDLER_PP(zval_p, h)             Z_OBJ_HANDLER(**zval_p, h)
     489                 : #define Z_UNIVAL_PP(zval_pp)    Z_UNIVAL(**zval_pp)
     490                 : #define Z_UNILEN_PP(zval_pp)    Z_UNILEN(**zval_pp)
     491                 : #define Z_UNISIZE_PP(zval_pp)   Z_UNISIZE(**zval_pp)
     492                 : #define Z_OBJDEBUG_PP(zval_pp,is_tmp)   Z_OBJDEBUG(**zval_pp,is_tmp)
     493                 : 
     494                 : #define Z_TYPE(zval)            (zval).type
     495                 : #define Z_TYPE_P(zval_p)        Z_TYPE(*zval_p)
     496                 : #define Z_TYPE_PP(zval_pp)      Z_TYPE(**zval_pp)
     497                 : 
     498                 : #if HAVE_SETLOCALE && defined(ZEND_WIN32) && !defined(ZTS) && defined(_MSC_VER) && (_MSC_VER >= 1400)
     499                 : /* This is performance improvement of tolower() on Windows and VC2005
     500                 :  * Gives 10-18% on bench.php
     501                 :  */
     502                 : #define ZEND_USE_TOLOWER_L 1
     503                 : #endif
     504                 : 
     505                 : #ifdef ZEND_USE_TOLOWER_L
     506                 : ZEND_API void zend_update_current_locale(void);
     507                 : #else
     508                 : #define zend_update_current_locale()
     509                 : #endif
     510                 : 
     511                 : #endif
     512                 : 
     513                 : /*
     514                 :  * Local variables:
     515                 :  * tab-width: 4
     516                 :  * c-basic-offset: 4
     517                 :  * indent-tabs-mode: t
     518                 :  * End:
     519                 :  */

Generated by: LTP GCOV extension version 1.5

Generated at Mon, 23 Nov 2009 17:39:26 +0000 (33 hours ago)

Copyright © 2005-2009 The PHP Group
All rights reserved.