Lines Matching refs:buf

400 #define buffer_append_spaces(buf, num_spaces) \  argument
405 smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \
409 …y_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ in php_array_element_export() argument
412 buffer_append_spaces(buf, level+1); in php_array_element_export()
413 smart_str_append_long(buf, (zend_long) index); in php_array_element_export()
414 smart_str_appendl(buf, " => ", 4); in php_array_element_export()
421 buffer_append_spaces(buf, level + 1); in php_array_element_export()
423 smart_str_appendc(buf, '\''); in php_array_element_export()
424 smart_str_append(buf, tmp_str); in php_array_element_export()
425 smart_str_appendl(buf, "' => ", 5); in php_array_element_export()
430 php_var_export_ex(zv, level + 2, buf); in php_array_element_export()
432 smart_str_appendc(buf, ','); in php_array_element_export()
433 smart_str_appendc(buf, '\n'); in php_array_element_export()
437 …t_element_export(zval *zv, zend_ulong index, zend_string *key, int level, smart_str *buf) /* {{{ */ in php_object_element_export() argument
439 buffer_append_spaces(buf, level + 2); in php_object_element_export()
448 smart_str_appendc(buf, '\''); in php_object_element_export()
449 smart_str_append(buf, pname_esc); in php_object_element_export()
450 smart_str_appendc(buf, '\''); in php_object_element_export()
453 smart_str_append_long(buf, (zend_long) index); in php_object_element_export()
455 smart_str_appendl(buf, " => ", 4); in php_object_element_export()
456 php_var_export_ex(zv, level + 2, buf); in php_object_element_export()
457 smart_str_appendc(buf, ','); in php_object_element_export()
458 smart_str_appendc(buf, '\n'); in php_object_element_export()
462 PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf) /* {{{ */ in php_var_export_ex() argument
474 smart_str_appendl(buf, "false", 5); in php_var_export_ex()
477 smart_str_appendl(buf, "true", 4); in php_var_export_ex()
480 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
486 smart_str_append_long(buf, ZEND_LONG_MIN+1); in php_var_export_ex()
487 smart_str_appends(buf, "-1"); in php_var_export_ex()
490 smart_str_append_long(buf, Z_LVAL_P(struc)); in php_var_export_ex()
494 smart_str_appends(buf, tmp_str); in php_var_export_ex()
502 smart_str_appendl(buf, ".0", 2); in php_var_export_ex()
509 smart_str_appendc(buf, '\''); in php_var_export_ex()
510 smart_str_append(buf, ztmp2); in php_var_export_ex()
511 smart_str_appendc(buf, '\''); in php_var_export_ex()
520 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
528 smart_str_appendc(buf, '\n'); in php_var_export_ex()
529 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
531 smart_str_appendl(buf, "array (\n", 8); in php_var_export_ex()
533 php_array_element_export(val, index, key, level, buf); in php_var_export_ex()
540 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
542 smart_str_appendc(buf, ')'); in php_var_export_ex()
550 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
559 smart_str_appendc(buf, '\n'); in php_var_export_ex()
560 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
565 smart_str_appendl(buf, "(object) array(\n", 16); in php_var_export_ex()
567 smart_str_append(buf, Z_OBJCE_P(struc)->name); in php_var_export_ex()
568 smart_str_appendl(buf, "::__set_state(array(\n", 21); in php_var_export_ex()
573 php_object_element_export(val, index, key, level, buf); in php_var_export_ex()
579 buffer_append_spaces(buf, level - 1); in php_var_export_ex()
582 smart_str_appendc(buf, ')'); in php_var_export_ex()
584 smart_str_appendl(buf, "))", 2); in php_var_export_ex()
593 smart_str_appendl(buf, "NULL", 4); in php_var_export_ex()
602 smart_str buf = {0}; in php_var_export() local
603 php_var_export_ex(struc, level, &buf); in php_var_export()
604 smart_str_0(&buf); in php_var_export()
605 PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s)); in php_var_export()
606 smart_str_free(&buf); in php_var_export()
615 smart_str buf = {0}; in PHP_FUNCTION() local
623 php_var_export_ex(var, 1, &buf); in PHP_FUNCTION()
624 smart_str_0 (&buf); in PHP_FUNCTION()
627 RETURN_NEW_STR(buf.s); in PHP_FUNCTION()
629 PHPWRITE(ZSTR_VAL(buf.s), ZSTR_LEN(buf.s)); in PHP_FUNCTION()
630 smart_str_free(&buf); in PHP_FUNCTION()
635 static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash);
683 static inline void php_var_serialize_long(smart_str *buf, zend_long val) /* {{{ */ in php_var_serialize_long() argument
685 smart_str_appendl(buf, "i:", 2); in php_var_serialize_long()
686 smart_str_append_long(buf, val); in php_var_serialize_long()
687 smart_str_appendc(buf, ';'); in php_var_serialize_long()
691 static inline void php_var_serialize_string(smart_str *buf, char *str, size_t len) /* {{{ */ in php_var_serialize_string() argument
693 smart_str_appendl(buf, "s:", 2); in php_var_serialize_string()
694 smart_str_append_unsigned(buf, len); in php_var_serialize_string()
695 smart_str_appendl(buf, ":\"", 2); in php_var_serialize_string()
696 smart_str_appendl(buf, str, len); in php_var_serialize_string()
697 smart_str_appendl(buf, "\";", 2); in php_var_serialize_string()
701 static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc) /* {{{ */ in php_var_serialize_class_name() argument
706 smart_str_appendl(buf, "O:", 2); in php_var_serialize_class_name()
707 smart_str_append_unsigned(buf, ZSTR_LEN(class_name)); in php_var_serialize_class_name()
708 smart_str_appendl(buf, ":\"", 2); in php_var_serialize_class_name()
709 smart_str_append(buf, class_name); in php_var_serialize_class_name()
710 smart_str_appendl(buf, "\":", 2); in php_var_serialize_class_name()
871 static void php_var_serialize_nested_data(smart_str *buf, zval *struc, HashTable *ht, uint32_t coun… in php_var_serialize_nested_data() argument
873 smart_str_append_unsigned(buf, count); in php_var_serialize_nested_data()
874 smart_str_appendl(buf, ":{", 2); in php_var_serialize_nested_data()
886 php_var_serialize_long(buf, index); in php_var_serialize_nested_data()
888 php_var_serialize_string(buf, ZSTR_VAL(key), ZSTR_LEN(key)); in php_var_serialize_nested_data()
901 smart_str_appendl(buf, "N;", 2); in php_var_serialize_nested_data()
906 php_var_serialize_intern(buf, data, var_hash); in php_var_serialize_nested_data()
912 php_var_serialize_intern(buf, data, var_hash); in php_var_serialize_nested_data()
916 smart_str_appendc(buf, '}'); in php_var_serialize_nested_data()
920 static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_da… in php_var_serialize_class() argument
924 php_var_serialize_class_name(buf, struc); in php_var_serialize_class()
926 buf, struc, &props, zend_hash_num_elements(&props), /* incomplete_class */ 0, var_hash); in php_var_serialize_class()
932 static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash) /*… in php_var_serialize_intern() argument
944 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
947 smart_str_appendl(buf, "R:", 2); in php_var_serialize_intern()
948 smart_str_append_long(buf, var_already); in php_var_serialize_intern()
949 smart_str_appendc(buf, ';'); in php_var_serialize_intern()
952 smart_str_appendl(buf, "r:", 2); in php_var_serialize_intern()
953 smart_str_append_long(buf, var_already); in php_var_serialize_intern()
954 smart_str_appendc(buf, ';'); in php_var_serialize_intern()
962 smart_str_appendl(buf, "b:0;", 4); in php_var_serialize_intern()
966 smart_str_appendl(buf, "b:1;", 4); in php_var_serialize_intern()
970 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
974 php_var_serialize_long(buf, Z_LVAL_P(struc)); in php_var_serialize_intern()
979 smart_str_appendl(buf, "d:", 2); in php_var_serialize_intern()
981 smart_str_appends(buf, tmp_str); in php_var_serialize_intern()
982 smart_str_appendc(buf, ';'); in php_var_serialize_intern()
987 php_var_serialize_string(buf, Z_STRVAL_P(struc), Z_STRLEN_P(struc)); in php_var_serialize_intern()
1004 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1010 php_var_serialize_class_name(buf, &obj); in php_var_serialize_intern()
1011 smart_str_append_unsigned(buf, zend_array_count(Z_ARRVAL(retval))); in php_var_serialize_intern()
1012 smart_str_appendl(buf, ":{", 2); in php_var_serialize_intern()
1015 php_var_serialize_long(buf, index); in php_var_serialize_intern()
1017 php_var_serialize_string(buf, ZSTR_VAL(key), ZSTR_LEN(key)); in php_var_serialize_intern()
1023 php_var_serialize_intern(buf, data, var_hash); in php_var_serialize_intern()
1025 smart_str_appendc(buf, '}'); in php_var_serialize_intern()
1038 smart_str_appendl(buf, "C:", 2); in php_var_serialize_intern()
1039 smart_str_append_unsigned(buf, ZSTR_LEN(Z_OBJCE_P(struc)->name)); in php_var_serialize_intern()
1040 smart_str_appendl(buf, ":\"", 2); in php_var_serialize_intern()
1041 smart_str_append(buf, Z_OBJCE_P(struc)->name); in php_var_serialize_intern()
1042 smart_str_appendl(buf, "\":", 2); in php_var_serialize_intern()
1044 smart_str_append_unsigned(buf, serialized_length); in php_var_serialize_intern()
1045 smart_str_appendl(buf, ":{", 2); in php_var_serialize_intern()
1046 smart_str_appendl(buf, (char *) serialized_data, serialized_length); in php_var_serialize_intern()
1047 smart_str_appendc(buf, '}'); in php_var_serialize_intern()
1053 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1070 smart_str_appendl(buf, "N;", 2); in php_var_serialize_intern()
1076 php_var_serialize_class(buf, &tmp, &retval, var_hash); in php_var_serialize_intern()
1082 incomplete_class = php_var_serialize_class_name(buf, struc); in php_var_serialize_intern()
1090 php_var_serialize_nested_data(buf, struc, myht, count, incomplete_class, var_hash); in php_var_serialize_intern()
1095 smart_str_appendl(buf, "a:", 2); in php_var_serialize_intern()
1098 buf, struc, myht, zend_array_count(myht), /* incomplete_class */ 0, var_hash); in php_var_serialize_intern()
1104 smart_str_appendl(buf, "i:0;", 4); in php_var_serialize_intern()
1110 PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data) /* {{{ */ in php_var_serialize() argument
1112 php_var_serialize_intern(buf, struc, *data); in php_var_serialize()
1113 smart_str_0(buf); in php_var_serialize()
1151 smart_str buf = {0}; in PHP_FUNCTION() local
1158 php_var_serialize(&buf, struc, &var_hash); in PHP_FUNCTION()
1162 smart_str_free(&buf); in PHP_FUNCTION()
1166 if (buf.s) { in PHP_FUNCTION()
1167 RETURN_NEW_STR(buf.s); in PHP_FUNCTION()
1175 PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, const size_t buf_len,… in php_unserialize_with_options() argument
1187 p = (const unsigned char*) buf; in php_unserialize_with_options()
1250 (zend_long)((char*)p - buf), buf_len); in php_unserialize_with_options()
1287 char *buf = NULL; in PHP_FUNCTION() local
1292 Z_PARAM_STRING(buf, buf_len) in PHP_FUNCTION()
1297 php_unserialize_with_options(return_value, buf, buf_len, options, "unserialize"); in PHP_FUNCTION()