Lines Matching refs:buf

294 static void json_create_zval(zval **z, smart_str *buf, int type, int options)  in json_create_zval()  argument
302 if (buf->c[0] == '-') { in json_create_zval()
303 buf->len--; in json_create_zval()
306 if (buf->len >= MAX_LENGTH_OF_LONG - 1) { in json_create_zval()
307 if (buf->len == MAX_LENGTH_OF_LONG - 1) { in json_create_zval()
308 int cmp = strcmp(buf->c + (buf->c[0] == '-'), long_min_digits); in json_create_zval()
310 if (!(cmp < 0 || (cmp == 0 && buf->c[0] == '-'))) { in json_create_zval()
321 if (buf->c[0] == '-') { in json_create_zval()
323 buf->len++; in json_create_zval()
331 ZVAL_LONG(*z, strtol(buf->c, NULL, 10)); in json_create_zval()
336 ZVAL_DOUBLE(*z, zend_strtod(buf->c, NULL)); in json_create_zval()
341 ZVAL_STRINGL(*z, buf->c, buf->len, 1); in json_create_zval()
345 ZVAL_BOOL(*z, (*(buf->c) == 't')); in json_create_zval()
354 static void utf16_to_utf8(smart_str *buf, unsigned short utf16) in utf16_to_utf8() argument
358 smart_str_appendc(buf, (unsigned char) utf16); in utf16_to_utf8()
362 smart_str_appendc(buf, 0xc0 | (utf16 >> 6)); in utf16_to_utf8()
363 smart_str_appendc(buf, 0x80 | (utf16 & 0x3f)); in utf16_to_utf8()
366 && buf->len >= 3 in utf16_to_utf8()
367 && ((unsigned char) buf->c[buf->len - 3]) == 0xed in utf16_to_utf8()
368 && ((unsigned char) buf->c[buf->len - 2] & 0xf0) == 0xa0 in utf16_to_utf8()
369 && ((unsigned char) buf->c[buf->len - 1] & 0xc0) == 0x80) in utf16_to_utf8()
374 utf32 = (((buf->c[buf->len - 2] & 0xf) << 16) in utf16_to_utf8()
375 | ((buf->c[buf->len - 1] & 0x3f) << 10) in utf16_to_utf8()
377 buf->len -= 3; in utf16_to_utf8()
379 smart_str_appendc(buf, (unsigned char) (0xf0 | (utf32 >> 18))); in utf16_to_utf8()
380 smart_str_appendc(buf, 0x80 | ((utf32 >> 12) & 0x3f)); in utf16_to_utf8()
381 smart_str_appendc(buf, 0x80 | ((utf32 >> 6) & 0x3f)); in utf16_to_utf8()
382 smart_str_appendc(buf, 0x80 | (utf32 & 0x3f)); in utf16_to_utf8()
386 smart_str_appendc(buf, 0xe0 | (utf16 >> 12)); in utf16_to_utf8()
387 smart_str_appendc(buf, 0x80 | ((utf16 >> 6) & 0x3f)); in utf16_to_utf8()
388 smart_str_appendc(buf, 0x80 | (utf16 & 0x3f)); in utf16_to_utf8()
418 #define FREE_BUFFERS() smart_str_free(&buf); smart_str_free(&key);
447 smart_str buf = {0}; in parse_JSON_ex() local
478 utf16_to_utf8(&buf, next_char); in parse_JSON_ex()
482 smart_str_appendc(&buf, '\b'); in parse_JSON_ex()
485 smart_str_appendc(&buf, '\t'); in parse_JSON_ex()
488 smart_str_appendc(&buf, '\n'); in parse_JSON_ex()
491 smart_str_appendc(&buf, '\f'); in parse_JSON_ex()
494 smart_str_appendc(&buf, '\r'); in parse_JSON_ex()
497 utf16_to_utf8(&buf, next_char); in parse_JSON_ex()
509 utf16_to_utf8(&buf, utf16); in parse_JSON_ex()
513 smart_str_appendc(&buf, next_char); in parse_JSON_ex()
516 smart_str_appendc(&buf, next_char); in parse_JSON_ex()
519 smart_str_appendc(&buf, next_char); in parse_JSON_ex()
527 utf16_to_utf8(&buf, next_char); in parse_JSON_ex()
548 smart_str_0(&buf); in parse_JSON_ex()
550 json_create_zval(&mval, &buf, type, options); in parse_JSON_ex()
559 buf.len = 0; in parse_JSON_ex()
576 smart_str_0(&buf); in parse_JSON_ex()
578 json_create_zval(&mval, &buf, type, options); in parse_JSON_ex()
580 buf.len = 0; in parse_JSON_ex()
658 smart_str_0(&buf); in parse_JSON_ex()
659 SWAP_BUFFERS(buf, key); in parse_JSON_ex()
668 smart_str_0(&buf); in parse_JSON_ex()
669 ZVAL_STRINGL(z, buf.c, buf.len, 1); in parse_JSON_ex()
689 smart_str_0(&buf); in parse_JSON_ex()
690 json_create_zval(&mval, &buf, type, options); in parse_JSON_ex()
719 buf.len = 0; in parse_JSON_ex()