8 #ifndef parserutils_input_inputstream_h_ 9 #define parserutils_input_inputstream_h_ 33 const uint8_t *data,
size_t len,
34 uint16_t *mibenum, uint32_t *source);
59 const uint8_t *data,
size_t len);
63 const uint8_t *data,
size_t len);
68 size_t offset,
const uint8_t **ptr,
size_t *length);
93 const uint8_t **ptr,
size_t *length)
97 const uint8_t *utf8_data;
98 size_t len, off, utf8_len;
100 if (stream == NULL || ptr == NULL || length == NULL)
104 #ifdef VERBOSE_INPUTSTREAM 105 fprintf(stdout,
"Peek: len: %zu cur: %u off: %zu\n",
108 #ifdef RANDOMISE_INPUTSTREAM 114 utf8_data = utf8->
data;
116 off = stream->
cursor + offset;
118 #define IS_ASCII(x) (((x) & 0x80) == 0) 120 if (off < utf8_len) {
124 (*ptr) = (utf8_data + off);
128 utf8_data + off, &len);
132 (*ptr) = (utf8_data + off);
157 #if !defined(NDEBUG) && defined(VERBOSE_INPUTSTREAM) 158 fprintf(stdout,
"Advance: len: %zu cur: %u bytes: %zu\n",
177 const char *enc, uint32_t source);
parserutils_error parserutils_buffer_randomise(parserutils_buffer *buffer)
UTF-8 manipulation functions (interface).
parserutils_error parserutils_charset_utf8_char_byte_length(const uint8_t *s, size_t *len)
Calculate the length (in bytes) of a UTF-8 character.