Changeset 1477 in svn for trunk


Ignore:
Timestamp:
2013-11-23T01:46:42Z (22 months ago)
Author:
Xuefer
Message:

adds reflection info for APIs

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r1476 r1477  
    1010   * (WIP) defragment
    1111   * (WIP) cache to disk
     12 * misc:
     13   * Reflection info added for APIs
    1214
    13153.1.1 2013-??-??
  • trunk/mod_cacher/xc_cacher.c

    r1470 r1477  
    31333133/* {{{ proto int xcache_count(int type)
    31343134   Return count of cache on specified cache type */
     3135#ifdef ZEND_BEGIN_ARG_INFO_EX
     3136ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_count, 0, 0, 1)
     3137    ZEND_ARG_INFO(0, type)
     3138ZEND_END_ARG_INFO()
     3139#else
     3140static unsigned char arginfo_xcache_count[] = { 1, BYREF_NONE };
     3141#endif
     3142
    31353143PHP_FUNCTION(xcache_count)
    31363144{
     
    31403148/* {{{ proto array xcache_info(int type, int id)
    31413149   Get cache info by id on specified cache type */
     3150#ifdef ZEND_BEGIN_ARG_INFO_EX
     3151ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_info, 0, 0, 2)
     3152    ZEND_ARG_INFO(0, type)
     3153    ZEND_ARG_INFO(0, id)
     3154ZEND_END_ARG_INFO()
     3155#else
     3156static unsigned char arginfo_xcache_info[] = { 2, BYREF_NONE, BYREF_NONE };
     3157#endif
     3158
    31423159PHP_FUNCTION(xcache_info)
    31433160{
     
    31473164/* {{{ proto array xcache_list(int type, int id)
    31483165   Get cache entries list by id on specified cache type */
     3166#ifdef ZEND_BEGIN_ARG_INFO_EX
     3167ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_list, 0, 0, 2)
     3168    ZEND_ARG_INFO(0, type)
     3169    ZEND_ARG_INFO(0, id)
     3170ZEND_END_ARG_INFO()
     3171#else
     3172static unsigned char arginfo_xcache_list[] = { 2, BYREF_NONE, BYREF_NONE };
     3173#endif
     3174
    31493175PHP_FUNCTION(xcache_list)
    31503176{
     
    31543180/* {{{ proto array xcache_clear_cache(int type, [ int id = -1 ])
    31553181   Clear cache by id on specified cache type */
     3182#ifdef ZEND_BEGIN_ARG_INFO_EX
     3183ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_clear_cache, 0, 0, 1)
     3184    ZEND_ARG_INFO(0, type)
     3185    ZEND_ARG_INFO(0, id)
     3186ZEND_END_ARG_INFO()
     3187#else
     3188static unsigned char arginfo_xcache_clear_cache[] = { 2, BYREF_NONE, BYREF_NONE };
     3189#endif
     3190
    31563191PHP_FUNCTION(xcache_clear_cache)
    31573192{
     
    31613196/* {{{ proto array xcache_enable_cache(int type, [ int id = -1, [ bool enable = true ] ])
    31623197   Enable or disable cache by id on specified cache type */
     3198#ifdef ZEND_BEGIN_ARG_INFO_EX
     3199ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_enable_cache, 0, 0, 1)
     3200    ZEND_ARG_INFO(0, type)
     3201    ZEND_ARG_INFO(0, id)
     3202    ZEND_ARG_INFO(0, enable)
     3203ZEND_END_ARG_INFO()
     3204#else
     3205static unsigned char arginfo_xcache_enable_cache[] = { 1, BYREF_NONE };
     3206#endif
     3207
    31633208PHP_FUNCTION(xcache_enable_cache)
    31643209{
     
    31683213/* {{{ proto mixed xcache_admin_namespace()
    31693214   Break out of namespace limitation */
     3215#ifdef ZEND_BEGIN_ARG_INFO_EX
     3216ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_admin_namespace, 0, 0, 0)
     3217ZEND_END_ARG_INFO()
     3218#else
     3219static unsigned char arginfo_xcache_admin_namespace[] = { 0 };
     3220#endif
     3221
    31703222PHP_FUNCTION(xcache_admin_namespace)
    31713223{
     
    31993251/* {{{ proto mixed xcache_set_namespace(string namespace)
    32003252   Switch to user defined namespace */
     3253#ifdef ZEND_BEGIN_ARG_INFO_EX
     3254ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_set_namespace, 0, 0, 1)
     3255    ZEND_ARG_INFO(0, namespace)
     3256ZEND_END_ARG_INFO()
     3257#else
     3258static unsigned char arginfo_xcache_set_namespace[] = { 1, BYREF_NONE };
     3259#endif
     3260
    32013261PHP_FUNCTION(xcache_set_namespace)
    32023262{
     
    32243284/* {{{ proto mixed xcache_get(string name)
    32253285   Get cached data by specified name */
     3286#ifdef ZEND_BEGIN_ARG_INFO_EX
     3287ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get, 0, 0, 1)
     3288    ZEND_ARG_INFO(0, name)
     3289ZEND_END_ARG_INFO()
     3290#else
     3291static unsigned char arginfo_xcache_get[] = { 1, BYREF_NONE };
     3292#endif
     3293
    32263294PHP_FUNCTION(xcache_get)
    32273295{
     
    32653333/* {{{ proto bool  xcache_set(string name, mixed value [, int ttl])
    32663334   Store data to cache by specified name */
     3335#ifdef ZEND_BEGIN_ARG_INFO_EX
     3336ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_set, 0, 0, 2)
     3337    ZEND_ARG_INFO(0, name)
     3338    ZEND_ARG_INFO(0, value)
     3339    ZEND_ARG_INFO(0, ttl)
     3340ZEND_END_ARG_INFO()
     3341#else
     3342static unsigned char arginfo_xcache_set[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_NONE };
     3343#endif
     3344
    32673345PHP_FUNCTION(xcache_set)
    32683346{
     
    33163394/* {{{ proto bool  xcache_isset(string name)
    33173395   Check if an entry exists in cache by specified name */
     3396#ifdef ZEND_BEGIN_ARG_INFO_EX
     3397ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_isset, 0, 0, 1)
     3398    ZEND_ARG_INFO(0, name)
     3399ZEND_END_ARG_INFO()
     3400#else
     3401static unsigned char arginfo_xcache_isset[] = { 1, BYREF_NONE };
     3402#endif
     3403
    33183404PHP_FUNCTION(xcache_isset)
    33193405{
     
    33583444/* {{{ proto bool  xcache_unset(string name)
    33593445   Unset existing data in cache by specified name */
     3446#ifdef ZEND_BEGIN_ARG_INFO_EX
     3447ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_unset, 0, 0, 1)
     3448    ZEND_ARG_INFO(0, name)
     3449ZEND_END_ARG_INFO()
     3450#else
     3451static unsigned char arginfo_xcache_unset[] = { 1, BYREF_NONE };
     3452#endif
     3453
    33603454PHP_FUNCTION(xcache_unset)
    33613455{
     
    33983492/* {{{ proto bool  xcache_unset_by_prefix(string prefix)
    33993493   Unset existing data in cache by specified prefix */
     3494#ifdef ZEND_BEGIN_ARG_INFO_EX
     3495ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_unset_by_prefix, 0, 0, 1)
     3496    ZEND_ARG_INFO(0, prefix)
     3497ZEND_END_ARG_INFO()
     3498#else
     3499static unsigned char arginfo_xcache_unset_by_prefix[] = { 1, BYREF_NONE };
     3500#endif
     3501
    34003502PHP_FUNCTION(xcache_unset_by_prefix)
    34013503{
     
    35183620/* {{{ proto int xcache_inc(string name [, int value [, int ttl]])
    35193621   Increase an int counter in cache by specified name, create it if not exists */
     3622#ifdef ZEND_BEGIN_ARG_INFO_EX
     3623ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_inc, 0, 0, 1)
     3624    ZEND_ARG_INFO(0, prefix)
     3625    ZEND_ARG_INFO(0, value)
     3626    ZEND_ARG_INFO(0, ttl)
     3627ZEND_END_ARG_INFO()
     3628#else
     3629static unsigned char arginfo_xcache_inc[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_NONE };
     3630#endif
     3631
    35203632PHP_FUNCTION(xcache_inc)
    35213633{
     
    35253637/* {{{ proto int xcache_dec(string name [, int value [, int ttl]])
    35263638   Decrease an int counter in cache by specified name, create it if not exists */
     3639#ifdef ZEND_BEGIN_ARG_INFO_EX
     3640ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_dec, 0, 0, 1)
     3641    ZEND_ARG_INFO(0, prefix)
     3642    ZEND_ARG_INFO(0, value)
     3643    ZEND_ARG_INFO(0, ttl)
     3644ZEND_END_ARG_INFO()
     3645#else
     3646static unsigned char arginfo_xcache_dec[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_NONE };
     3647#endif
     3648
    35273649PHP_FUNCTION(xcache_dec)
    35283650{
     
    35323654static zend_function_entry xcache_cacher_functions[] = /* {{{ */
    35333655{
    3534     PHP_FE(xcache_count,             NULL)
    3535     PHP_FE(xcache_info,              NULL)
    3536     PHP_FE(xcache_list,              NULL)
    3537     PHP_FE(xcache_clear_cache,       NULL)
    3538     PHP_FE(xcache_enable_cache,      NULL)
    3539     PHP_FE(xcache_admin_namespace,   NULL)
    3540     PHP_FE(xcache_set_namespace,     NULL)
    3541     PHP_FE(xcache_get,               NULL)
    3542     PHP_FE(xcache_set,               NULL)
    3543     PHP_FE(xcache_isset,             NULL)
    3544     PHP_FE(xcache_unset,             NULL)
    3545     PHP_FE(xcache_unset_by_prefix,   NULL)
    3546     PHP_FE(xcache_inc,               NULL)
    3547     PHP_FE(xcache_dec,               NULL)
     3656    PHP_FE(xcache_count,             arginfo_xcache_count)
     3657    PHP_FE(xcache_info,              arginfo_xcache_info)
     3658    PHP_FE(xcache_list,              arginfo_xcache_list)
     3659    PHP_FE(xcache_clear_cache,       arginfo_xcache_clear_cache)
     3660    PHP_FE(xcache_enable_cache,      arginfo_xcache_enable_cache)
     3661    PHP_FE(xcache_admin_namespace,   arginfo_xcache_admin_namespace)
     3662    PHP_FE(xcache_set_namespace,     arginfo_xcache_set_namespace)
     3663    PHP_FE(xcache_get,               arginfo_xcache_get)
     3664    PHP_FE(xcache_set,               arginfo_xcache_set)
     3665    PHP_FE(xcache_isset,             arginfo_xcache_isset)
     3666    PHP_FE(xcache_unset,             arginfo_xcache_unset)
     3667    PHP_FE(xcache_unset_by_prefix,   arginfo_xcache_unset_by_prefix)
     3668    PHP_FE(xcache_inc,               arginfo_xcache_inc)
     3669    PHP_FE(xcache_dec,               arginfo_xcache_dec)
    35483670    PHP_FE_END
    35493671};
  • trunk/mod_coverager/xc_coverager.c

    r1321 r1477  
    485485 * decode specified data which is saved by auto dumper to array
    486486 */
     487#ifdef ZEND_BEGIN_ARG_INFO_EX
     488ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_coverager_decode, 0, 0, 1)
     489    ZEND_ARG_INFO(0, data)
     490ZEND_END_ARG_INFO()
     491#else
     492static unsigned char arginfo_xcache_coverager_decode[] = { 1, BYREF_NONE };
     493#endif
     494
    487495PHP_FUNCTION(xcache_coverager_decode)
    488496{
     
    515523 * starts coverager data collecting
    516524 */
     525#ifdef ZEND_BEGIN_ARG_INFO_EX
     526ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_coverager_start, 0, 0, 0)
     527    ZEND_ARG_INFO(0, clean)
     528ZEND_END_ARG_INFO()
     529#else
     530static unsigned char arginfo_xcache_coverager_start[] = { 1, BYREF_NONE };
     531#endif
     532
    517533PHP_FUNCTION(xcache_coverager_start)
    518534{
     
    538554 * stop coverager data collecting
    539555 */
     556#ifdef ZEND_BEGIN_ARG_INFO_EX
     557ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_coverager_stop, 0, 0, 0)
     558    ZEND_ARG_INFO(0, clean)
     559ZEND_END_ARG_INFO()
     560#else
     561static unsigned char arginfo_xcache_coverager_stop[] = { 1, BYREF_NONE };
     562#endif
     563
    540564PHP_FUNCTION(xcache_coverager_stop)
    541565{
     
    555579 * get coverager data collected
    556580 */
     581#ifdef ZEND_BEGIN_ARG_INFO_EX
     582ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_coverager_get, 0, 0, 0)
     583    ZEND_ARG_INFO(0, clean)
     584ZEND_END_ARG_INFO()
     585#else
     586static unsigned char arginfo_xcache_coverager_get[] = { 1, BYREF_NONE };
     587#endif
    557588PHP_FUNCTION(xcache_coverager_get)
    558589{
     
    570601static zend_function_entry xcache_coverager_functions[] = /* {{{ */
    571602{
    572     PHP_FE(xcache_coverager_decode,  NULL)
    573     PHP_FE(xcache_coverager_start,   NULL)
    574     PHP_FE(xcache_coverager_stop,    NULL)
    575     PHP_FE(xcache_coverager_get,     NULL)
     603    PHP_FE(xcache_coverager_decode,  arginfo_xcache_coverager_decode)
     604    PHP_FE(xcache_coverager_start,   arginfo_xcache_coverager_start)
     605    PHP_FE(xcache_coverager_stop,    arginfo_xcache_coverager_stop)
     606    PHP_FE(xcache_coverager_get,     arginfo_xcache_coverager_get)
    576607    PHP_FE_END
    577608};
  • trunk/mod_disassembler/xc_disassembler.c

    r1321 r1477  
    195195/* {{{ proto array xcache_dasm_file(string filename)
    196196   Disassemble file into opcode array by filename */
     197#ifdef ZEND_BEGIN_ARG_INFO_EX
     198ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_dasm_file, 0, 0, 1)
     199    ZEND_ARG_INFO(0, filename)
     200ZEND_END_ARG_INFO()
     201#else
     202static unsigned char arginfo_xcache_dasm_file[] = { 1, BYREF_NONE };
     203#endif
     204
    197205PHP_FUNCTION(xcache_dasm_file)
    198206{
     
    210218/* {{{ proto array xcache_dasm_string(string code)
    211219   Disassemble php code into opcode array */
     220#ifdef ZEND_BEGIN_ARG_INFO_EX
     221ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_dasm_string, 0, 0, 1)
     222    ZEND_ARG_INFO(0, code)
     223ZEND_END_ARG_INFO()
     224#else
     225static unsigned char arginfo_xcache_dasm_string[] = { 1, BYREF_NONE };
     226#endif
     227
    212228PHP_FUNCTION(xcache_dasm_string)
    213229{
     
    233249static zend_function_entry xcache_disassembler_functions[] = /* {{{ */
    234250{
    235     PHP_FE(xcache_dasm_file,         NULL)
    236     PHP_FE(xcache_dasm_string,       NULL)
     251    PHP_FE(xcache_dasm_file,         arginfo_xcache_dasm_file)
     252    PHP_FE(xcache_dasm_string,       arginfo_xcache_dasm_string)
    237253    PHP_FE_END
    238254};
  • trunk/xcache.c

    r1476 r1477  
    177177/* }}} */
    178178
    179 /* {{{ proto int xcache_get_refcount(mixed &variable)
    180    XCache internal uses only: Get reference count of referenced variable */
    181 #ifdef ZEND_BEGIN_ARG_INFO_EX
    182 ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_refcount, 0, 0, 1)
    183     ZEND_ARG_INFO(1, variable)
    184 ZEND_END_ARG_INFO()
    185 #else
    186 static unsigned char arginfo_xcache_get_refcount[] = { 1, BYREF_FORCE };
    187 #endif
    188 
    189 PHP_FUNCTION(xcache_get_refcount)
    190 {
    191     zval *variable;
    192     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
    193         RETURN_NULL();
    194     }
    195 
    196     RETURN_LONG(Z_REFCOUNT(*variable) - 1);
    197 }
    198 /* }}} */
    199 /* {{{ proto int xcache_get_cowcount(mixed value)
    200    XCache internal uses only: Get reference count of copy-on-write variable or data */
    201 #ifdef ZEND_BEGIN_ARG_INFO_EX
    202 ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_cowcount, 0, 0, 1)
    203     ZEND_ARG_INFO(0, variable)
    204 ZEND_END_ARG_INFO()
    205 #else
    206 static unsigned char arginfo_xcache_get_cowcount[] = { 1, BYREF_NONE };
    207 #endif
    208 
    209 PHP_FUNCTION(xcache_get_cowcount)
    210 {
    211     zval *variable;
    212     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
    213         RETURN_NULL();
    214     }
    215 
    216     RETURN_LONG(Z_REFCOUNT(*variable) - 1);
    217 }
    218 /* }}} */
    219 /* {{{ proto bool xcache_get_isref(mixed variable)
    220    XCache internal uses only: Check if variable data is marked referenced */
    221 #ifdef ZEND_BEGIN_ARG_INFO_EX
    222 ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_isref, 0, 0, 1)
    223     ZEND_ARG_INFO(1, variable)
    224 ZEND_END_ARG_INFO()
    225 #else
    226 static unsigned char arginfo_xcache_get_isref[] = { 1, BYREF_FORCE };
    227 #endif
    228 
    229 PHP_FUNCTION(xcache_get_isref)
    230 {
    231     zval *variable;
    232     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
    233         RETURN_NULL();
    234     }
    235 
    236     RETURN_BOOL(Z_ISREF(*variable) && Z_REFCOUNT(*variable) >= 3);
    237 }
    238 /* }}} */
    239179#ifdef HAVE_XCACHE_DPRINT
    240180/* {{{ proto bool  xcache_dprint(mixed value)
    241    Prints variable (or value) internal struct (debug only) */
     181   Prints internal struct of an zval (debug only) */
    242182#include "xc_processor.h"
     183
     184#ifdef ZEND_BEGIN_ARG_INFO_EX
     185ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_dprint, 0, 0, 1)
     186    ZEND_ARG_INFO(0, value)
     187ZEND_END_ARG_INFO()
     188#else
     189static unsigned char arginfo_xcache_dprint[] = { 1, BYREF_NONE };
     190#endif
     191
    243192PHP_FUNCTION(xcache_dprint)
    244193{
     
    252201/* }}} */
    253202#endif
     203#ifdef HAVE_XCACHE_ASSEMBLER
    254204/* {{{ proto string xcache_asm(string filename)
    255205 */
    256 #ifdef HAVE_XCACHE_ASSEMBLER
    257206PHP_FUNCTION(xcache_asm)
    258207{
    259208}
    260 #endif
    261 /* }}} */
     209/* }}} */
     210#endif
     211#ifdef HAVE_XCACHE_ENCODER
    262212/* {{{ proto string xcache_encode(string filename)
    263213   Encode php file into XCache opcode encoded format */
    264 #ifdef HAVE_XCACHE_ENCODER
    265214PHP_FUNCTION(xcache_encode)
    266215{
    267216}
    268 #endif
    269 /* }}} */
     217/* }}} */
     218#endif
     219#ifdef HAVE_XCACHE_DECODER
    270220/* {{{ proto bool xcache_decode_file(string filename)
    271221   Decode(load) opcode from XCache encoded format file */
    272 #ifdef HAVE_XCACHE_DECODER
    273222PHP_FUNCTION(xcache_decode_file)
    274223{
    275224}
    276 #endif
    277225/* }}} */
    278226/* {{{ proto bool xcache_decode_string(string data)
    279227   Decode(load) opcode from XCache encoded format data */
    280 #ifdef HAVE_XCACHE_DECODER
    281228PHP_FUNCTION(xcache_decode_string)
    282229{
    283230}
    284 #endif
    285 /* }}} */
     231/* }}} */
     232#endif
    286233/* {{{ xc_call_getter */
    287234typedef const char *(xc_name_getter_t)(zend_uchar type);
     
    309256/* }}} */
    310257/* {{{ proto string xcache_get_op_type(int op_type) */
     258#ifdef ZEND_BEGIN_ARG_INFO_EX
     259ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_op_type, 0, 0, 1)
     260    ZEND_ARG_INFO(0, op_type)
     261ZEND_END_ARG_INFO()
     262#else
     263static unsigned char arginfo_xcache_get_op_type[] = { 1, BYREF_NONE };
     264#endif
     265
    311266PHP_FUNCTION(xcache_get_op_type)
    312267{
     
    315270/* }}} */
    316271/* {{{ proto string xcache_get_data_type(int type) */
     272#ifdef ZEND_BEGIN_ARG_INFO_EX
     273ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_data_type, 0, 0, 1)
     274    ZEND_ARG_INFO(0, type)
     275ZEND_END_ARG_INFO()
     276#else
     277static unsigned char arginfo_xcache_get_data_type[] = { 1, BYREF_NONE };
     278#endif
     279
    317280PHP_FUNCTION(xcache_get_data_type)
    318281{
     
    321284/* }}} */
    322285/* {{{ proto string xcache_get_opcode(int opcode) */
     286#ifdef ZEND_BEGIN_ARG_INFO_EX
     287ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_opcode, 0, 0, 1)
     288    ZEND_ARG_INFO(0, opcode)
     289ZEND_END_ARG_INFO()
     290#else
     291static unsigned char arginfo_xcache_get_opcode[] = { 1, BYREF_NONE };
     292#endif
     293
    323294PHP_FUNCTION(xcache_get_opcode)
    324295{
     
    327298/* }}} */
    328299/* {{{ proto string xcache_get_op_spec(int op_type) */
     300#ifdef ZEND_BEGIN_ARG_INFO_EX
     301ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_op_spec, 0, 0, 1)
     302    ZEND_ARG_INFO(0, op_type)
     303ZEND_END_ARG_INFO()
     304#else
     305static unsigned char arginfo_xcache_get_op_spec[] = { 1, BYREF_NONE };
     306#endif
     307
    329308PHP_FUNCTION(xcache_get_op_spec)
    330309{
     
    333312/* }}} */
    334313/* {{{ proto string xcache_get_opcode_spec(int opcode) */
     314#ifdef ZEND_BEGIN_ARG_INFO_EX
     315ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_opcode_spec, 0, 0, 1)
     316    ZEND_ARG_INFO(0, opcode)
     317ZEND_END_ARG_INFO()
     318#else
     319static unsigned char arginfo_xcache_get_opcode_spec[] = { 1, BYREF_NONE };
     320#endif
     321
    335322PHP_FUNCTION(xcache_get_opcode_spec)
    336323{
     
    357344/* {{{ proto mixed xcache_get_special_value(zval value)
    358345   XCache internal use only: For decompiler to get static value with type fixed */
     346#ifdef ZEND_BEGIN_ARG_INFO_EX
     347ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_special_value, 0, 0, 1)
     348    ZEND_ARG_INFO(0, value)
     349ZEND_END_ARG_INFO()
     350#else
     351static unsigned char arginfo_xcache_get_special_value[] = { 1, BYREF_NONE };
     352#endif
     353
    359354PHP_FUNCTION(xcache_get_special_value)
    360355{
     
    392387/* {{{ proto int xcache_get_type(zval value)
    393388   XCache internal use only for disassembler to get variable type in engine level */
     389#ifdef ZEND_BEGIN_ARG_INFO_EX
     390ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_type, 0, 0, 1)
     391    ZEND_ARG_INFO(0, value)
     392ZEND_END_ARG_INFO()
     393#else
     394static unsigned char arginfo_xcache_get_type[] = { 1, BYREF_NONE };
     395#endif
     396
    394397PHP_FUNCTION(xcache_get_type)
    395398{
     
    403406}
    404407/* }}} */
    405 /* {{{ proto string xcache_coredump(int op_type) */
     408/* {{{ proto string xcache_coredump() */
     409#ifdef ZEND_BEGIN_ARG_INFO_EX
     410ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_coredump, 0, 0, 0)
     411ZEND_END_ARG_INFO()
     412#else
     413static unsigned char arginfo_xcache_coredump[] = { 1, BYREF_NONE };
     414#endif
     415
    406416PHP_FUNCTION(xcache_coredump)
    407417{
     
    417427/* }}} */
    418428/* {{{ proto string xcache_is_autoglobal(string name) */
     429#ifdef ZEND_BEGIN_ARG_INFO_EX
     430ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_is_autoglobal, 0, 0, 1)
     431    ZEND_ARG_INFO(0, name)
     432ZEND_END_ARG_INFO()
     433#else
     434static unsigned char arginfo_xcache_is_autoglobal[] = { 1, BYREF_NONE };
     435#endif
     436
    419437PHP_FUNCTION(xcache_is_autoglobal)
    420438{
     
    434452}
    435453/* }}} */
     454/* {{{ proto int xcache_get_refcount(mixed &variable)
     455   XCache internal uses only: Get reference count of referenced variable */
     456#ifdef ZEND_BEGIN_ARG_INFO_EX
     457ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_refcount, 0, 0, 1)
     458    ZEND_ARG_INFO(1, variable)
     459ZEND_END_ARG_INFO()
     460#else
     461static unsigned char arginfo_xcache_get_refcount[] = { 1, BYREF_FORCE };
     462#endif
     463
     464PHP_FUNCTION(xcache_get_refcount)
     465{
     466    zval *variable;
     467    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
     468        RETURN_NULL();
     469    }
     470
     471    RETURN_LONG(Z_REFCOUNT(*variable) - 1);
     472}
     473/* }}} */
     474/* {{{ proto int xcache_get_cowcount(mixed value)
     475   XCache internal uses only: Get reference count of copy-on-write variable or data */
     476#ifdef ZEND_BEGIN_ARG_INFO_EX
     477ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_cowcount, 0, 0, 1)
     478    ZEND_ARG_INFO(0, variable)
     479ZEND_END_ARG_INFO()
     480#else
     481static unsigned char arginfo_xcache_get_cowcount[] = { 1, BYREF_NONE };
     482#endif
     483
     484PHP_FUNCTION(xcache_get_cowcount)
     485{
     486    zval *variable;
     487    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
     488        RETURN_NULL();
     489    }
     490
     491    RETURN_LONG(Z_REFCOUNT(*variable) - 1);
     492}
     493/* }}} */
     494/* {{{ proto bool xcache_get_isref(mixed variable)
     495   XCache internal uses only: Check if variable data is marked referenced */
     496#ifdef ZEND_BEGIN_ARG_INFO_EX
     497ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_get_isref, 0, 0, 1)
     498    ZEND_ARG_INFO(1, variable)
     499ZEND_END_ARG_INFO()
     500#else
     501static unsigned char arginfo_xcache_get_isref[] = { 1, BYREF_FORCE };
     502#endif
     503
     504PHP_FUNCTION(xcache_get_isref)
     505{
     506    zval *variable;
     507    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &variable) == FAILURE) {
     508        RETURN_NULL();
     509    }
     510
     511    RETURN_BOOL(Z_ISREF(*variable) && Z_REFCOUNT(*variable) >= 3);
     512}
     513/* }}} */
    436514static zend_function_entry xcache_functions[] = /* {{{ */
    437515{
    438     PHP_FE(xcache_coredump,          NULL)
     516#ifdef HAVE_XCACHE_DPRINT
     517    PHP_FE(xcache_dprint,            arginfo_xcache_dprint)
     518#endif
    439519#ifdef HAVE_XCACHE_ASSEMBLER
    440520    PHP_FE(xcache_asm,               NULL)
     
    447527    PHP_FE(xcache_decode_string,     NULL)
    448528#endif
    449     PHP_FE(xcache_get_special_value, NULL)
    450     PHP_FE(xcache_get_type,          NULL)
    451     PHP_FE(xcache_get_op_type,       NULL)
    452     PHP_FE(xcache_get_data_type,     NULL)
    453     PHP_FE(xcache_get_opcode,        NULL)
    454     PHP_FE(xcache_get_opcode_spec,   NULL)
    455     PHP_FE(xcache_is_autoglobal,     NULL)
     529    PHP_FE(xcache_get_special_value, arginfo_xcache_get_special_value)
     530    PHP_FE(xcache_get_type,          arginfo_xcache_get_type)
     531    PHP_FE(xcache_get_op_type,       arginfo_xcache_get_op_type)
     532    PHP_FE(xcache_get_data_type,     arginfo_xcache_get_data_type)
     533    PHP_FE(xcache_get_opcode,        arginfo_xcache_get_opcode)
     534    PHP_FE(xcache_get_opcode_spec,   arginfo_xcache_get_opcode_spec)
     535    PHP_FE(xcache_coredump,          arginfo_xcache_coredump)
     536    PHP_FE(xcache_is_autoglobal,     arginfo_xcache_is_autoglobal)
    456537    PHP_FE(xcache_get_refcount,      arginfo_xcache_get_refcount)
    457538    PHP_FE(xcache_get_cowcount,      arginfo_xcache_get_cowcount)
    458539    PHP_FE(xcache_get_isref,         arginfo_xcache_get_isref)
    459 #ifdef HAVE_XCACHE_DPRINT
    460     PHP_FE(xcache_dprint,            NULL)
    461 #endif
    462540    PHP_FE_END
    463541};
Note: See TracChangeset for help on using the changeset viewer.