Lines Matching refs:buf

444 #define buffer_append_spaces(buf, num_spaces) \  argument
449 smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \
453 …y_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ in php_array_element_export() argument
456 buffer_append_spaces(buf, level+1); in php_array_element_export()
457 smart_str_append_long(buf, (zend_long) index); in php_array_element_export()
458 smart_str_appendl(buf, " => ", 4); in php_array_element_export()
465 buffer_append_spaces(buf, level + 1); in php_array_element_export()
467 smart_str_appendc(buf, '\''); in php_array_element_export()
468 smart_str_append(buf, tmp_str); in php_array_element_export()
469 smart_str_appendl(buf, "' => ", 5); in php_array_element_export()
474 zend_result result = php_var_export_ex(zv, level + 2, buf); in php_array_element_export()
476 smart_str_appendc(buf, ','); in php_array_element_export()
477 smart_str_appendc(buf, '\n'); in php_array_element_export()
483 …t_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ in php_object_element_export() argument
485 buffer_append_spaces(buf, level + 2); in php_object_element_export()
494 smart_str_appendc(buf, '\''); in php_object_element_export()
495 smart_str_append(buf, pname_esc); in php_object_element_export()
496 smart_str_appendc(buf, '\''); in php_object_element_export()
499 smart_str_append_long(buf, (zend_long) index); in php_object_element_export()
501 smart_str_appendl(buf, " => ", 4); in php_object_element_export()
502 zend_result result = php_var_export_ex(zv, level + 2, buf); in php_object_element_export()
503 smart_str_appendc(buf, ','); in php_object_element_export()
504 smart_str_appendc(buf, '\n'); in php_object_element_export()
510 PHPAPI zend_result php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */ in php_var_export_ex() argument
521 smart_str_appendl(buf, "false", 5); in php_var_export_ex()
524 smart_str_appendl(buf, "true", 4); in php_var_export_ex()
527 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
533 smart_str_append_long(buf, ZEND_LONG_MIN+1); in php_var_export_ex()
534 smart_str_appends(buf, "-1"); in php_var_export_ex()
537 smart_str_append_long(buf, Z_LVAL_P(struc)); in php_var_export_ex()
541 buf, Z_DVAL_P(struc), (int) PG(serialize_precision), /* zero_fraction */ true); in php_var_export_ex()
547 smart_str_appendc(buf, '\''); in php_var_export_ex()
548 smart_str_append(buf, ztmp2); in php_var_export_ex()
549 smart_str_appendc(buf, '\''); in php_var_export_ex()
558 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
566 smart_str_appendc(buf, '\n'); in php_var_export_ex()
567 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
569 smart_str_appendl(buf, "array (\n", 8); in php_var_export_ex()
571 if (php_array_element_export(val, index, key, level, buf) == FAILURE) { in php_var_export_ex()
584 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
586 smart_str_appendc(buf, ')'); in php_var_export_ex()
598 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
605 smart_str_appendc(buf, '\n'); in php_var_export_ex()
606 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
614 smart_str_appendl(buf, "(object) array(\n", 16); in php_var_export_ex()
616 smart_str_appendc(buf, '\\'); in php_var_export_ex()
617 smart_str_append(buf, ce->name); in php_var_export_ex()
621 smart_str_appendl(buf, "::", 2); in php_var_export_ex()
622 smart_str_append(buf, Z_STR_P(case_name_zval)); in php_var_export_ex()
624 smart_str_appendl(buf, "::__set_state(array(\n", 21); in php_var_export_ex()
648 php_object_element_export(val, index, key, level, buf); in php_var_export_ex()
658 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
661 smart_str_appendc(buf, ')'); in php_var_export_ex()
663 smart_str_appendl(buf, "))", 2); in php_var_export_ex()
673 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
684 smart_str buf = {0}; in php_var_export() local
685 zend_result result = php_var_export_ex(struc, level, &buf); in php_var_export()
686 smart_str_0(&buf); in php_var_export()
688 PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s)); in php_var_export()
690 smart_str_free(&buf); in php_var_export()
699 smart_str buf = {0}; in PHP_FUNCTION() local
707 zend_result result = php_var_export_ex(var, 1, &buf); in PHP_FUNCTION()
708 smart_str_0 (&buf); in PHP_FUNCTION()
711 smart_str_free(&buf); in PHP_FUNCTION()
713 RETURN_STR(smart_str_extract(&buf)); in PHP_FUNCTION()
715 PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s)); in PHP_FUNCTION()
716 smart_str_free(&buf); in PHP_FUNCTION()
721 static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash, bo…
778 static inline void php_var_serialize_long(smart_str *buf, zend_long val) /* {{{ */ in php_var_serialize_long() argument
783 char *res = smart_str_extend(buf, 2 + l + 1); in php_var_serialize_long()
790 static inline void php_var_serialize_string(smart_str *buf, char *str, size_t len) /* {{{ */ in php_var_serialize_string() argument
795 char *res = smart_str_extend(buf, 2 + l + 2 + len + 2); in php_var_serialize_string()
804 static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */ in php_var_serialize_class_name() argument
813 char *res = smart_str_extend(buf, 2 + l + 2 + class_name_len + 2); in php_var_serialize_class_name()
973 static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable *ht, uint32_t coun… in php_var_serialize_nested_data() argument
975 smart_str_append_unsigned(buf, count); in php_var_serialize_nested_data()
976 smart_str_appendl(buf, ":{", 2); in php_var_serialize_nested_data()
989 php_var_serialize_long(buf, index); in php_var_serialize_nested_data()
991 php_var_serialize_string(buf, ZSTR_VAL(key), ZSTR_LEN(key)); in php_var_serialize_nested_data()
1004 smart_str_appendl(buf, "N;", 2); in php_var_serialize_nested_data()
1009 php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); in php_var_serialize_nested_data()
1015 php_var_serialize_intern(buf, data, var_hash, in_rcn_array, false); in php_var_serialize_nested_data()
1019 smart_str_appendc(buf, '}'); in php_var_serialize_nested_data()
1023 static void php_var_serialize_class(smart_str *buf, zval *struc, HashTable *ht, php_serialize_data_… in php_var_serialize_class() argument
1028 php_var_serialize_class_name(buf, struc); in php_var_serialize_class()
1030buf, struc, &props, zend_hash_num_elements(&props), /* incomplete_class */ 0, var_hash, GC_REFCOUN… in php_var_serialize_class()
1047 static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash, bo… in php_var_serialize_intern() argument
1063 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1066 smart_str_appendl(buf, "R:", 2); in php_var_serialize_intern()
1067 smart_str_append_long(buf, var_already); in php_var_serialize_intern()
1068 smart_str_appendc(buf, ';'); in php_var_serialize_intern()
1071 smart_str_appendl(buf, "r:", 2); in php_var_serialize_intern()
1072 smart_str_append_long(buf, var_already); in php_var_serialize_intern()
1073 smart_str_appendc(buf, ';'); in php_var_serialize_intern()
1081 smart_str_appendl(buf, "b:0;", 4); in php_var_serialize_intern()
1085 smart_str_appendl(buf, "b:1;", 4); in php_var_serialize_intern()
1089 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1093 php_var_serialize_long(buf, Z_LVAL_P(struc)); in php_var_serialize_intern()
1101 char *res = smart_str_extend(buf, 2 + len + 1); in php_var_serialize_intern()
1109 php_var_serialize_string(buf, Z_STRVAL_P(struc), Z_STRLEN_P(struc)); in php_var_serialize_intern()
1129 smart_str_appendl(buf, "E:", 2); in php_var_serialize_intern()
1130 … smart_str_append_unsigned(buf, ZSTR_LEN(class_name) + strlen(":") + Z_STRLEN_P(case_name_zval)); in php_var_serialize_intern()
1131 smart_str_appendl(buf, ":\"", 2); in php_var_serialize_intern()
1132 smart_str_append(buf, class_name); in php_var_serialize_intern()
1133 smart_str_appendc(buf, ':'); in php_var_serialize_intern()
1134 smart_str_append(buf, Z_STR_P(case_name_zval)); in php_var_serialize_intern()
1135 smart_str_appendl(buf, "\";", 2); in php_var_serialize_intern()
1149 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1155 php_var_serialize_class_name(buf, &obj); in php_var_serialize_intern()
1156 smart_str_append_unsigned(buf, zend_hash_num_elements(Z_ARRVAL(retval))); in php_var_serialize_intern()
1157 smart_str_appendl(buf, ":{", 2); in php_var_serialize_intern()
1160 php_var_serialize_long(buf, index); in php_var_serialize_intern()
1162 php_var_serialize_string(buf, ZSTR_VAL(key), ZSTR_LEN(key)); in php_var_serialize_intern()
1168 php_var_serialize_intern(buf, data, var_hash, Z_REFCOUNT(retval) > 1, false); in php_var_serialize_intern()
1170 smart_str_appendc(buf, '}'); in php_var_serialize_intern()
1188 …char *res = smart_str_extend(buf, 2 + l1 + 2 + ZSTR_LEN(Z_OBJCE_P(struc)->name) + 2 + l2 + 2 + ser… in php_var_serialize_intern()
1205 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1225 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1231 php_var_serialize_class(buf, &tmp, ht, var_hash); in php_var_serialize_intern()
1238 incomplete_class = php_var_serialize_class_name(buf, struc); in php_var_serialize_intern()
1265 smart_str_append_unsigned(buf, count); in php_var_serialize_intern()
1266 smart_str_appendl(buf, ":{", 2); in php_var_serialize_intern()
1277 php_var_serialize_string(buf, ZSTR_VAL(prop_info->name), ZSTR_LEN(prop_info->name)); in php_var_serialize_intern()
1283 php_var_serialize_intern(buf, prop, var_hash, false, false); in php_var_serialize_intern()
1285 smart_str_appendc(buf, '}'); in php_var_serialize_intern()
1287 smart_str_appendl(buf, "0:{}", 4); in php_var_serialize_intern()
1298 …php_var_serialize_nested_data(buf, struc, myht, count, incomplete_class, var_hash, GC_REFCOUNT(myh… in php_var_serialize_intern()
1303 smart_str_appendl(buf, "a:", 2); in php_var_serialize_intern()
1306 buf, struc, myht, zend_array_count(myht), /* incomplete_class */ 0, var_hash, in php_var_serialize_intern()
1313 smart_str_appendl(buf, "i:0;", 4); in php_var_serialize_intern()
1319 PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data) /* {{{ */ in php_var_serialize() argument
1321 php_var_serialize_intern(buf, struc, *data, false, true); in php_var_serialize()
1322 smart_str_0(buf); in php_var_serialize()
1360 smart_str buf = {0}; in PHP_FUNCTION() local
1367 php_var_serialize(&buf, struc, &var_hash); in PHP_FUNCTION()
1371 smart_str_free(&buf); in PHP_FUNCTION()
1375 RETURN_STR(smart_str_extract(&buf)); in PHP_FUNCTION()
1380 PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, const size_t buf_len,… in php_unserialize_with_options() argument
1392 p = (const unsigned char*) buf; in php_unserialize_with_options()
1464 (zend_long)((char*)p - buf), buf_len); in php_unserialize_with_options()
1471 if ((char*)p < buf + buf_len) { in php_unserialize_with_options()
1474 (zend_long)((char*)p - buf), buf_len); in php_unserialize_with_options()
1509 char *buf = NULL; in PHP_FUNCTION() local
1514 Z_PARAM_STRING(buf, buf_len) in PHP_FUNCTION()
1519 php_unserialize_with_options(return_value, buf, buf_len, options, "unserialize"); in PHP_FUNCTION()