More Related Content
More from Hideyuki TAKEI (11)
Php Meets Messagepack
- 18. typedef union _zvalue_value {
long lval; /* long value */
double dval; /* double value */
struct {
char *val;
int len;
} str;
HashTable *ht; /* hash table value */
zend_object obj;
} zvalue_value;
struct _zval_struct {
zvalue_value value; /* value */
zend_uchar type; /* active type */
zend_uchar is_ref;
zend_ushort refcount;
};
- 20. PHP_FUNCTION(example2)
{
char *str;
int str_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &str, &str_len) == FAILURE) {
return;
}
printf("%sn", str);
}
- 21. #define RETURN_LONG(l) { RETVAL_LONG(l); return; }
#define RETVAL_LONG(l) ZVAL_LONG(return_value, l)
#define ZVAL_LONG(z, l) {
Z_TYPE_P(z) = IS_LONG;
Z_LVAL_P(z) = l;
}