Lines Matching refs:buf
34 smart_str *buf, const char *s, size_t len,
70 static inline void php_json_pretty_print_char(smart_str *buf, int options, char c) /* {{{ */ in php_json_pretty_print_char() argument
73 smart_str_appendc(buf, c); in php_json_pretty_print_char()
78 static inline void php_json_pretty_print_indent(smart_str *buf, int options, php_json_encoder *enco… in php_json_pretty_print_indent() argument
84 smart_str_appendl(buf, " ", 4); in php_json_pretty_print_indent()
98 static inline void php_json_encode_double(smart_str *buf, double d, int options) /* {{{ */ in php_json_encode_double() argument
110 smart_str_appendl(buf, num, len); in php_json_encode_double()
128 static int php_json_encode_array(smart_str *buf, zval *val, int options, php_json_encoder *encoder)… in php_json_encode_array() argument
144 smart_str_appendl(buf, "null", 4); in php_json_encode_array()
152 smart_str_appendc(buf, '['); in php_json_encode_array()
154 smart_str_appendc(buf, '{'); in php_json_encode_array()
169 smart_str_appendc(buf, ','); in php_json_encode_array()
174 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
175 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
184 smart_str_appendc(buf, ','); in php_json_encode_array()
189 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
190 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
192 if (php_json_escape_string(buf, ZSTR_VAL(key), ZSTR_LEN(key), in php_json_encode_array()
195 buf->s) { in php_json_encode_array()
196 ZSTR_LEN(buf->s) -= 4; in php_json_encode_array()
197 smart_str_appendl(buf, "\"\"", 2); in php_json_encode_array()
201 smart_str_appendc(buf, ','); in php_json_encode_array()
206 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
207 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
209 smart_str_appendc(buf, '"'); in php_json_encode_array()
210 smart_str_append_long(buf, (zend_long) index); in php_json_encode_array()
211 smart_str_appendc(buf, '"'); in php_json_encode_array()
214 smart_str_appendc(buf, ':'); in php_json_encode_array()
215 php_json_pretty_print_char(buf, options, ' '); in php_json_encode_array()
218 if (php_json_encode_zval(buf, data, options, encoder) == FAILURE && in php_json_encode_array()
240 php_json_pretty_print_char(buf, options, '\n'); in php_json_encode_array()
241 php_json_pretty_print_indent(buf, options, encoder); in php_json_encode_array()
245 smart_str_appendc(buf, ']'); in php_json_encode_array()
247 smart_str_appendc(buf, '}'); in php_json_encode_array()
256 smart_str *buf, const char *s, size_t len, in php_json_escape_string() argument
265 smart_str_appendl(buf, "\"\"", 2); in php_json_escape_string()
276 smart_str_append_long(buf, p); in php_json_escape_string()
279 php_json_encode_double(buf, d, options); in php_json_escape_string()
285 checkpoint = buf->s ? ZSTR_LEN(buf->s) : 0; in php_json_escape_string()
288 smart_str_alloc(buf, len+2, 0); in php_json_escape_string()
289 smart_str_appendc(buf, '"'); in php_json_escape_string()
303 smart_str_appendl(buf, s, pos); in php_json_escape_string()
308 smart_str_appendl(buf, s, pos); in php_json_escape_string()
324 smart_str_appendl(buf, "\xef\xbf\xbd", 3); in php_json_escape_string()
326 smart_str_appendl(buf, "\\ufffd", 6); in php_json_escape_string()
329 ZSTR_LEN(buf->s) = checkpoint; in php_json_escape_string()
332 smart_str_appendl(buf, "null", 4); in php_json_escape_string()
343 smart_str_appendl(buf, s, pos); in php_json_escape_string()
352 dst = smart_str_extend(buf, 6); in php_json_escape_string()
361 dst = smart_str_extend(buf, 6); in php_json_escape_string()
377 smart_str_appendl(buf, "\\u0022", 6); in php_json_escape_string()
379 smart_str_appendl(buf, "\\\"", 2); in php_json_escape_string()
384 smart_str_appendl(buf, "\\\\", 2); in php_json_escape_string()
389 smart_str_appendc(buf, '/'); in php_json_escape_string()
391 smart_str_appendl(buf, "\\/", 2); in php_json_escape_string()
396 smart_str_appendl(buf, "\\b", 2); in php_json_escape_string()
400 smart_str_appendl(buf, "\\f", 2); in php_json_escape_string()
404 smart_str_appendl(buf, "\\n", 2); in php_json_escape_string()
408 smart_str_appendl(buf, "\\r", 2); in php_json_escape_string()
412 smart_str_appendl(buf, "\\t", 2); in php_json_escape_string()
417 smart_str_appendl(buf, "\\u003C", 6); in php_json_escape_string()
419 smart_str_appendc(buf, '<'); in php_json_escape_string()
425 smart_str_appendl(buf, "\\u003E", 6); in php_json_escape_string()
427 smart_str_appendc(buf, '>'); in php_json_escape_string()
433 smart_str_appendl(buf, "\\u0026", 6); in php_json_escape_string()
435 smart_str_appendc(buf, '&'); in php_json_escape_string()
441 smart_str_appendl(buf, "\\u0027", 6); in php_json_escape_string()
443 smart_str_appendc(buf, '\''); in php_json_escape_string()
449 dst = smart_str_extend(buf, 6); in php_json_escape_string()
463 smart_str_appendc(buf, '"'); in php_json_escape_string()
469 static int php_json_encode_serializable_object(smart_str *buf, zval *val, int options, php_json_enc… in php_json_encode_serializable_object() argument
479 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
495 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
507 smart_str_appendl(buf, "null", 4); in php_json_encode_serializable_object()
517 return_code = php_json_encode_array(buf, &retval, options, encoder); in php_json_encode_serializable_object()
520 return_code = php_json_encode_zval(buf, &retval, options, encoder); in php_json_encode_serializable_object()
531 int php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder) /* {{{ … in php_json_encode_zval() argument
537 smart_str_appendl(buf, "null", 4); in php_json_encode_zval()
541 smart_str_appendl(buf, "true", 4); in php_json_encode_zval()
544 smart_str_appendl(buf, "false", 5); in php_json_encode_zval()
548 smart_str_append_long(buf, Z_LVAL_P(val)); in php_json_encode_zval()
553 php_json_encode_double(buf, Z_DVAL_P(val), options); in php_json_encode_zval()
556 smart_str_appendc(buf, '0'); in php_json_encode_zval()
561 return php_json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options, encoder); in php_json_encode_zval()
565 return php_json_encode_serializable_object(buf, val, options, encoder); in php_json_encode_zval()
574 res = php_json_encode_array(buf, &zv, options, encoder); in php_json_encode_zval()
586 smart_str_appendl(buf, "null", 4); in php_json_encode_zval()