Lines Matching refs:buf

470 static inline size_t php_utf32_utf8(unsigned char *buf, unsigned k)  in php_utf32_utf8()  argument
477 buf[0] = k; in php_utf32_utf8()
480 buf[0] = 0xc0 | (k >> 6); in php_utf32_utf8()
481 buf[1] = 0x80 | (k & 0x3f); in php_utf32_utf8()
484 buf[0] = 0xe0 | (k >> 12); in php_utf32_utf8()
485 buf[1] = 0x80 | ((k >> 6) & 0x3f); in php_utf32_utf8()
486 buf[2] = 0x80 | (k & 0x3f); in php_utf32_utf8()
489 buf[0] = 0xf0 | (k >> 18); in php_utf32_utf8()
490 buf[1] = 0x80 | ((k >> 12) & 0x3f); in php_utf32_utf8()
491 buf[2] = 0x80 | ((k >> 6) & 0x3f); in php_utf32_utf8()
492 buf[3] = 0x80 | (k & 0x3f); in php_utf32_utf8()
503 static inline size_t php_mb2_int_to_char(unsigned char *buf, unsigned k) in php_mb2_int_to_char() argument
508 buf[0] = k; in php_mb2_int_to_char()
511 buf[0] = k >> 8; in php_mb2_int_to_char()
512 buf[1] = k & 0xFFU; in php_mb2_int_to_char()
521 static inline size_t php_mb3_int_to_char(unsigned char *buf, unsigned k) in php_mb3_int_to_char() argument
526 buf[0] = k; in php_mb3_int_to_char()
529 buf[0] = k >> 8; in php_mb3_int_to_char()
530 buf[1] = k & 0xFFU; in php_mb3_int_to_char()
533 buf[0] = k >> 16; in php_mb3_int_to_char()
534 buf[1] = (k >> 8) & 0xFFU; in php_mb3_int_to_char()
535 buf[2] = k & 0xFFU; in php_mb3_int_to_char()
790 static inline int process_numeric_entity(const char **buf, unsigned *code_point) in process_numeric_entity() argument
793 int hexadecimal = (**buf == 'x' || **buf == 'X'); /* TODO: XML apparently disallows "X" */ in process_numeric_entity()
796 if (hexadecimal && (**buf != '\0')) in process_numeric_entity()
797 (*buf)++; in process_numeric_entity()
801 if ((hexadecimal && !isxdigit(**buf)) || in process_numeric_entity()
802 (!hexadecimal && !isdigit(**buf))) { in process_numeric_entity()
806 code_l = ZEND_STRTOL(*buf, &endptr, hexadecimal ? 16 : 10); in process_numeric_entity()
808 *buf = endptr; in process_numeric_entity()
810 if (**buf != ';') in process_numeric_entity()
826 static inline int process_named_entity_html(const char **buf, const char **start, size_t *length) in process_named_entity_html() argument
828 *start = *buf; in process_named_entity_html()
835 while ((**buf >= 'a' && **buf <= 'z') || in process_named_entity_html()
836 (**buf >= 'A' && **buf <= 'Z') || in process_named_entity_html()
837 (**buf >= '0' && **buf <= '9')) { in process_named_entity_html()
838 (*buf)++; in process_named_entity_html()
841 if (**buf != ';') in process_named_entity_html()
845 *length = *buf - *start; in process_named_entity_html()
875 static inline size_t write_octet_sequence(unsigned char *buf, enum entity_charset charset, unsigned… in write_octet_sequence() argument
879 return php_utf32_utf8(buf, code); in write_octet_sequence()
890 *buf = code; in write_octet_sequence()
901 return php_mb2_int_to_char(buf, code); in write_octet_sequence()
906 *buf = code; in write_octet_sequence()
912 return php_mb2_int_to_char(buf, code); in write_octet_sequence()
917 *buf = code; in write_octet_sequence()