Lines Matching refs:buf
58 static inline void php_json_pretty_print_char(smart_str *buf, int options, char c) /* {{{ */ in php_json_pretty_print_char() argument
61 smart_str_appendc(buf, c); in php_json_pretty_print_char()
66 static inline void php_json_pretty_print_indent(smart_str *buf, int options, php_json_encoder *enco… in php_json_pretty_print_indent() argument
72 smart_str_appendl(buf, " ", 4); in php_json_pretty_print_indent()
93 static inline void php_json_encode_double(smart_str *buf, double d, int options) /* {{{ */ in php_json_encode_double() argument
105 smart_str_appendl(buf, num, len); in php_json_encode_double()
123 static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, php_json_encoder *… in php_json_encode_array() argument
132 smart_str_appendl(buf, "null", 4); in php_json_encode_array()
155 smart_str_appendl(buf, "null", 4); in php_json_encode_array()
161 smart_str_appendc(buf, '{'); in php_json_encode_array()
180 smart_str_appendc(buf, ','); in php_json_encode_array()
185 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
186 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
188 if (php_json_escape_string(buf, ZSTR_VAL(prop_info->name), ZSTR_LEN(prop_info->name), in php_json_encode_array()
191 buf->s) { in php_json_encode_array()
192 ZSTR_LEN(buf->s) -= 4; in php_json_encode_array()
193 smart_str_appendl(buf, "\"\"", 2); in php_json_encode_array()
196 smart_str_appendc(buf, ':'); in php_json_encode_array()
197 php_json_pretty_print_char(buf, options, ' '); in php_json_encode_array()
199 if (php_json_encode_zval(buf, prop, options, encoder) == FAILURE && in php_json_encode_array()
216 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
217 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
219 smart_str_appendc(buf, '}'); in php_json_encode_array()
236 smart_str_appendl(buf, "null", 4); in php_json_encode_array()
244 smart_str_appendc(buf, '['); in php_json_encode_array()
246 smart_str_appendc(buf, '{'); in php_json_encode_array()
266 smart_str_appendc(buf, ','); in php_json_encode_array()
271 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
272 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
296 smart_str_appendc(buf, ','); in php_json_encode_array()
301 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
302 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
304 if (php_json_escape_string(buf, ZSTR_VAL(key), ZSTR_LEN(key), in php_json_encode_array()
307 buf->s) { in php_json_encode_array()
308 ZSTR_LEN(buf->s) -= 4; in php_json_encode_array()
309 smart_str_appendl(buf, "\"\"", 2); in php_json_encode_array()
313 smart_str_appendc(buf, ','); in php_json_encode_array()
318 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
319 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
321 smart_str_appendc(buf, '"'); in php_json_encode_array()
322 smart_str_append_long(buf, (zend_long) index); in php_json_encode_array()
323 smart_str_appendc(buf, '"'); in php_json_encode_array()
326 smart_str_appendc(buf, ':'); in php_json_encode_array()
327 php_json_pretty_print_char(buf, options, ' '); in php_json_encode_array()
330 if (php_json_encode_zval(buf, data, options, encoder) == FAILURE && in php_json_encode_array()
354 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
355 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
359 smart_str_appendc(buf, ']'); in php_json_encode_array()
361 smart_str_appendc(buf, '}'); in php_json_encode_array()
370 smart_str *buf, const char *s, size_t len, in php_json_escape_string() argument
378 smart_str_appendl(buf, "\"\"", 2); in php_json_escape_string()
389 smart_str_append_long(buf, p); in php_json_escape_string()
392 php_json_encode_double(buf, d, options); in php_json_escape_string()
398 checkpoint = buf->s ? ZSTR_LEN(buf->s) : 0; in php_json_escape_string()
401 smart_str_alloc(buf, len+2, 0); in php_json_escape_string()
402 smart_str_appendc(buf, '"'); in php_json_escape_string()
416 smart_str_appendl(buf, s, pos); in php_json_escape_string()
421 smart_str_appendl(buf, s, pos); in php_json_escape_string()
437 smart_str_appendl(buf, "\xef\xbf\xbd", 3); in php_json_escape_string()
439 smart_str_appendl(buf, "\\ufffd", 6); in php_json_escape_string()
442 ZSTR_LEN(buf->s) = checkpoint; in php_json_escape_string()
445 smart_str_appendl(buf, "null", 4); in php_json_escape_string()
456 smart_str_appendl(buf, s, pos); in php_json_escape_string()
465 dst = smart_str_extend(buf, 6); in php_json_escape_string()
474 dst = smart_str_extend(buf, 6); in php_json_escape_string()
490 smart_str_appendl(buf, "\\u0022", 6); in php_json_escape_string()
492 smart_str_appendl(buf, "\\\"", 2); in php_json_escape_string()
497 smart_str_appendl(buf, "\\\\", 2); in php_json_escape_string()
502 smart_str_appendc(buf, '/'); in php_json_escape_string()
504 smart_str_appendl(buf, "\\/", 2); in php_json_escape_string()
509 smart_str_appendl(buf, "\\b", 2); in php_json_escape_string()
513 smart_str_appendl(buf, "\\f", 2); in php_json_escape_string()
517 smart_str_appendl(buf, "\\n", 2); in php_json_escape_string()
521 smart_str_appendl(buf, "\\r", 2); in php_json_escape_string()
525 smart_str_appendl(buf, "\\t", 2); in php_json_escape_string()
530 smart_str_appendl(buf, "\\u003C", 6); in php_json_escape_string()
532 smart_str_appendc(buf, '<'); in php_json_escape_string()
538 smart_str_appendl(buf, "\\u003E", 6); in php_json_escape_string()
540 smart_str_appendc(buf, '>'); in php_json_escape_string()
546 smart_str_appendl(buf, "\\u0026", 6); in php_json_escape_string()
548 smart_str_appendc(buf, '&'); in php_json_escape_string()
554 smart_str_appendl(buf, "\\u0027", 6); in php_json_escape_string()
556 smart_str_appendc(buf, '\''); in php_json_escape_string()
562 dst = smart_str_extend(buf, 6); in php_json_escape_string()
576 smart_str_appendc(buf, '"'); in php_json_escape_string()
582 static zend_result php_json_encode_serializable_object(smart_str *buf, zval *val, int options, php_… in php_json_encode_serializable_object() argument
595 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
611 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
623 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
633 return_code = php_json_encode_array(buf, &retval, options, encoder); in php_json_encode_serializable_object()
636 return_code = php_json_encode_zval(buf, &retval, options, encoder); in php_json_encode_serializable_object()
647 static zend_result php_json_encode_serializable_enum(smart_str *buf, zval *val, int options, php_js… in php_json_encode_serializable_enum() argument
652 smart_str_appendc(buf, '0'); in php_json_encode_serializable_enum()
657 return php_json_encode_zval(buf, value_zv, options, encoder); in php_json_encode_serializable_enum()
660 zend_result php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder)… in php_json_encode_zval() argument
666 smart_str_appendl(buf, "null", 4); in php_json_encode_zval()
670 smart_str_appendl(buf, "true", 4); in php_json_encode_zval()
673 smart_str_appendl(buf, "false", 5); in php_json_encode_zval()
677 smart_str_append_long(buf, Z_LVAL_P(val)); in php_json_encode_zval()
682 php_json_encode_double(buf, Z_DVAL_P(val), options); in php_json_encode_zval()
685 smart_str_appendc(buf, '0'); in php_json_encode_zval()
690 return php_json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options, encoder); in php_json_encode_zval()
694 return php_json_encode_serializable_object(buf, val, options, encoder); in php_json_encode_zval()
697 return php_json_encode_serializable_enum(buf, val, options, encoder); in php_json_encode_zval()
707 res = php_json_encode_array(buf, &zv, options, encoder); in php_json_encode_zval()
719 smart_str_appendl(buf, "null", 4); in php_json_encode_zval()