-/*
- * Check the octet at the specified position.
- */
-
-#define CHECK_AT(parser,octet,offset) \
- (parser->buffer.pointer[offset] == (yaml_char_t)(octet))
-
-/*
- * Check the current octet in the buffer.
- */
-
-#define CHECK(parser,octet) CHECK_AT(parser,(octet),0)
-
-/*
- * Check if the character at the specified position is an alphabetical
- * character, a digit, '_', or '-'.
- */
-
-#define IS_ALPHA_AT(parser,offset) \
- ((parser->buffer.pointer[offset] >= (yaml_char_t) '0' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) '9') || \
- (parser->buffer.pointer[offset] >= (yaml_char_t) 'A' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'Z') || \
- (parser->buffer.pointer[offset] >= (yaml_char_t) 'a' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'z') || \
- parser->buffer.pointer[offset] == '_' || \
- parser->buffer.pointer[offset] == '-')
-
-#define IS_ALPHA(parser) IS_ALPHA_AT(parser,0)
-
-/*
- * Check if the character at the specified position is a digit.
- */
-
-#define IS_DIGIT_AT(parser,offset) \
- ((parser->buffer.pointer[offset] >= (yaml_char_t) '0' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) '9'))
-
-#define IS_DIGIT(parser) IS_DIGIT_AT(parser,0)
-
-/*
- * Get the value of a digit.
- */
-
-#define AS_DIGIT_AT(parser,offset) \
- (parser->buffer.pointer[offset] - (yaml_char_t) '0')
-
-#define AS_DIGIT(parser) AS_DIGIT_AT(parser,0)
-
-/*
- * Check if the character at the specified position is a hex-digit.
- */
-
-#define IS_HEX_AT(parser,offset) \
- ((parser->buffer.pointer[offset] >= (yaml_char_t) '0' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) '9') || \
- (parser->buffer.pointer[offset] >= (yaml_char_t) 'A' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'F') || \
- (parser->buffer.pointer[offset] >= (yaml_char_t) 'a' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'f'))
-
-#define IS_HEX(parser) IS_HEX_AT(parser,0)
-
-/*
- * Get the value of a hex-digit.
- */
-
-#define AS_HEX_AT(parser,offset) \
- ((parser->buffer.pointer[offset] >= (yaml_char_t) 'A' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'F') ? \
- (parser->buffer.pointer[offset] - (yaml_char_t) 'A' + 10) : \
- (parser->buffer.pointer[offset] >= (yaml_char_t) 'a' && \
- parser->buffer.pointer[offset] <= (yaml_char_t) 'f') ? \
- (parser->buffer.pointer[offset] - (yaml_char_t) 'a' + 10) : \
- (parser->buffer.pointer[offset] - (yaml_char_t) '0'))
-
-#define AS_HEX(parser) AS_HEX_AT(parser,0)
-
-/*
- * Check if the character at the specified position is NUL.
- */
-
-#define IS_Z_AT(parser,offset) CHECK_AT(parser,'\0',(offset))
-
-#define IS_Z(parser) IS_Z_AT(parser,0)
-
-/*
- * Check if the character at the specified position is BOM.
- */
-
-#define IS_BOM_AT(parser,offset) \
- (CHECK_AT(parser,'\xEF',(offset)) \
- && CHECK_AT(parser,'\xBB',(offset)+1) \
- && CHECK_AT(parser,'\xBF',(offset)+1)) /* BOM (#xFEFF) */
-
-#define IS_BOM(parser) IS_BOM_AT(parser,0)
-
-/*
- * Check if the character at the specified position is space.
- */
-
-#define IS_SPACE_AT(parser,offset) CHECK_AT(parser,' ',(offset))
-
-#define IS_SPACE(parser) IS_SPACE_AT(parser,0)
-
-/*
- * Check if the character at the specified position is tab.
- */
-
-#define IS_TAB_AT(parser,offset) CHECK_AT(parser,'\t',(offset))
-
-#define IS_TAB(parser) IS_TAB_AT(parser,0)
-
-/*
- * Check if the character at the specified position is blank (space or tab).
- */
-
-#define IS_BLANK_AT(parser,offset) \
- (IS_SPACE_AT(parser,(offset)) || IS_TAB_AT(parser,(offset)))
-
-#define IS_BLANK(parser) IS_BLANK_AT(parser,0)
-
-/*
- * Check if the character at the specified position is a line break.
- */
-
-#define IS_BREAK_AT(parser,offset) \
- (CHECK_AT(parser,'\r',(offset)) /* CR (#xD)*/ \
- || CHECK_AT(parser,'\n',(offset)) /* LF (#xA) */ \
- || (CHECK_AT(parser,'\xC2',(offset)) \
- && CHECK_AT(parser,'\x85',(offset)+1)) /* NEL (#x85) */ \
- || (CHECK_AT(parser,'\xE2',(offset)) \
- && CHECK_AT(parser,'\x80',(offset)+1) \
- && CHECK_AT(parser,'\xA8',(offset)+2)) /* LS (#x2028) */ \
- || (CHECK_AT(parser,'\xE2',(offset)) \
- && CHECK_AT(parser,'\x80',(offset)+1) \
- && CHECK_AT(parser,'\xA9',(offset)+2))) /* PS (#x2029) */
-
-#define IS_BREAK(parser) IS_BREAK_AT(parser,0)
-
-#define IS_CRLF_AT(parser,offset) \
- (CHECK_AT(parser,'\r',(offset)) && CHECK_AT(parser,'\n',(offset)+1))
-
-#define IS_CRLF(parser) IS_CRLF_AT(parser,0)
-
-/*
- * Check if the character is a line break or NUL.
- */
-
-#define IS_BREAKZ_AT(parser,offset) \
- (IS_BREAK_AT(parser,(offset)) || IS_Z_AT(parser,(offset)))
-
-#define IS_BREAKZ(parser) IS_BREAKZ_AT(parser,0)
-
-/*
- * Check if the character is a line break, space, or NUL.
- */
-
-#define IS_SPACEZ_AT(parser,offset) \
- (IS_SPACE_AT(parser,(offset)) || IS_BREAKZ_AT(parser,(offset)))
-
-#define IS_SPACEZ(parser) IS_SPACEZ_AT(parser,0)
-
-/*
- * Check if the character is a line break, space, tab, or NUL.
- */
-
-#define IS_BLANKZ_AT(parser,offset) \
- (IS_BLANK_AT(parser,(offset)) || IS_BREAKZ_AT(parser,(offset)))
-
-#define IS_BLANKZ(parser) IS_BLANKZ_AT(parser,0)
-
-/*
- * Determine the width of the character.
- */
-
-#define WIDTH_AT(parser,offset) \
- ((parser->buffer.pointer[offset] & 0x80) == 0x00 ? 1 : \
- (parser->buffer.pointer[offset] & 0xE0) == 0xC0 ? 2 : \
- (parser->buffer.pointer[offset] & 0xF0) == 0xE0 ? 3 : \
- (parser->buffer.pointer[offset] & 0xF8) == 0xF0 ? 4 : 0)
-
-#define WIDTH(parser) WIDTH_AT(parser,0)
-