Lines Matching refs:buf
466 static inline size_t php_utf32_utf8(unsigned char *buf, unsigned k) in php_utf32_utf8() argument
473 buf[0] = k; in php_utf32_utf8()
476 buf[0] = 0xc0 | (k >> 6); in php_utf32_utf8()
477 buf[1] = 0x80 | (k & 0x3f); in php_utf32_utf8()
480 buf[0] = 0xe0 | (k >> 12); in php_utf32_utf8()
481 buf[1] = 0x80 | ((k >> 6) & 0x3f); in php_utf32_utf8()
482 buf[2] = 0x80 | (k & 0x3f); in php_utf32_utf8()
485 buf[0] = 0xf0 | (k >> 18); in php_utf32_utf8()
486 buf[1] = 0x80 | ((k >> 12) & 0x3f); in php_utf32_utf8()
487 buf[2] = 0x80 | ((k >> 6) & 0x3f); in php_utf32_utf8()
488 buf[3] = 0x80 | (k & 0x3f); in php_utf32_utf8()
745 static inline int process_numeric_entity(const char **buf, unsigned *code_point) in process_numeric_entity() argument
748 int hexadecimal = (**buf == 'x' || **buf == 'X'); /* TODO: XML apparently disallows "X" */ in process_numeric_entity()
751 if (hexadecimal && (**buf != '\0')) in process_numeric_entity()
752 (*buf)++; in process_numeric_entity()
756 if ((hexadecimal && !isxdigit(**buf)) || in process_numeric_entity()
757 (!hexadecimal && !isdigit(**buf))) { in process_numeric_entity()
761 code_l = ZEND_STRTOL(*buf, &endptr, hexadecimal ? 16 : 10); in process_numeric_entity()
763 *buf = endptr; in process_numeric_entity()
765 if (**buf != ';') in process_numeric_entity()
781 static inline int process_named_entity_html(const char **buf, const char **start, size_t *length) in process_named_entity_html() argument
783 *start = *buf; in process_named_entity_html()
790 while ((**buf >= 'a' && **buf <= 'z') || in process_named_entity_html()
791 (**buf >= 'A' && **buf <= 'Z') || in process_named_entity_html()
792 (**buf >= '0' && **buf <= '9')) { in process_named_entity_html()
793 (*buf)++; in process_named_entity_html()
796 if (**buf != ';') in process_named_entity_html()
800 *length = *buf - *start; in process_named_entity_html()
830 static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charset charset, unsigned… in write_octet_sequence() argument
834 return php_utf32_utf8(buf, code); in write_octet_sequence()
845 *buf = code; in write_octet_sequence()
856 return php_mb2_int_to_char(buf, code); in write_octet_sequence()
861 *buf = code; in write_octet_sequence()
867 return php_mb2_int_to_char(buf, code); in write_octet_sequence()
872 *buf = code; in write_octet_sequence()