func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) {
	*event = yaml_event_t{
		typ:      yaml_STREAM_START_EVENT,
		encoding: encoding,
	}
}
func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) {
	*event = yaml_event_t{
		typ:      yaml_STREAM_START_EVENT,
		encoding: encoding,
	}
}
func yaml_stream_start_event_initialize ( event * yaml_event_t , encoding yaml_encoding_t ) { * event = yaml_event_t { typ : yaml_STREAM_START_EVENT , encoding : encoding , } }
///*
// * Destroy a token object.
// */
//
//YAML_DECLARE(void)
//yaml_token_delete(yaml_token_t *token)
//{
//    assert(token);  // Non-NULL token object expected.
//
//    switch (token.type)
//    {
//        case YAML_TAG_DIRECTIVE_TOKEN:
//            yaml_free(token.data.tag_directive.handle);
//            yaml_free(token.data.tag_directive.prefix);
//            break;
//
//        case YAML_ALIAS_TOKEN:
//            yaml_free(token.data.alias.value);
//            break;
//
//        case YAML_ANCHOR_TOKEN:
//            yaml_free(token.data.anchor.value);
//            break;
//
//        case YAML_TAG_TOKEN:
//            yaml_free(token.data.tag.handle);
//            yaml_free(token.data.tag.suffix);
//            break;
//
//        case YAML_SCALAR_TOKEN:
//            yaml_free(token.data.scalar.value);
//            break;
//
//        default:
//            break;
//    }
//
//    memset(token, 0, sizeof(yaml_token_t));
//}
//
///*
// * Check if a string is a valid UTF-8 sequence.
// *
// * Check 'reader.c' for more details on UTF-8 encoding.
// */
//
//static int
//yaml_check_utf8(yaml_char_t *start, size_t length)
//{
//    yaml_char_t *end = start+length;
//    yaml_char_t *pointer = start;
//
//    while (pointer < end) {
//        unsigned char octet;
//        unsigned int width;
//        unsigned int value;
//        size_t k;
//
//        octet = pointer[0];
//        width = (octet & 0x80) == 0x00 ? 1 :
//                (octet & 0xE0) == 0xC0 ? 2 :
//                (octet & 0xF0) == 0xE0 ? 3 :
//                (octet & 0xF8) == 0xF0 ? 4 : 0;
//        value = (octet & 0x80) == 0x00 ? octet & 0x7F :
//                (octet & 0xE0) == 0xC0 ? octet & 0x1F :
//                (octet & 0xF0) == 0xE0 ? octet & 0x0F :
//                (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0;
//        if (!width) return 0;
//        if (pointer+width > end) return 0;
//        for (k = 1; k < width; k ++) {
//            octet = pointer[k];
//            if ((octet & 0xC0) != 0x80) return 0;
//            value = (value << 6) + (octet & 0x3F);
//        }
//        if (!((width == 1) ||
//            (width == 2 && value >= 0x80) ||
//            (width == 3 && value >= 0x800) ||
//            (width == 4 && value >= 0x10000))) return 0;
//
//        pointer += width;
//    }
//
//    return 1;
//}
//
// Create STREAM-START.
/ * * Destroy a token object . YAML_DECLARE ( void ) yaml_token_delete ( yaml_token_t * token ) { assert ( token ) ; // Non - NULL token object expected . switch ( token . type ) { case YAML_TAG_DIRECTIVE_TOKEN : yaml_free ( token . data . tag_directive . handle ) ; yaml_free ( token . data . tag_directive . prefix ) ; break ; case YAML_ALIAS_TOKEN : yaml_free ( token . data . alias . value ) ; break ; case YAML_ANCHOR_TOKEN : yaml_free ( token . data . anchor . value ) ; break ; case YAML_TAG_TOKEN : yaml_free ( token . data . tag . handle ) ; yaml_free ( token . data . tag . suffix ) ; break ; case YAML_SCALAR_TOKEN : yaml_free ( token . data . scalar . value ) ; break ; default : break ; } memset ( token 0 sizeof ( yaml_token_t )) ; } / * * Check if a string is a valid UTF - 8 sequence . * * Check reader . c for more details on UTF - 8 encoding . static int yaml_check_utf8 ( yaml_char_t * start size_t length ) { yaml_char_t * end = start + length ; yaml_char_t * pointer = start ; while ( pointer < end ) { unsigned char octet ; unsigned int width ; unsigned int value ; size_t k ; octet = pointer [ 0 ] ; width = ( octet & 0x80 ) == 0x00 ? 1 : ( octet & 0xE0 ) == 0xC0 ? 2 : ( octet & 0xF0 ) == 0xE0 ? 3 : ( octet & 0xF8 ) == 0xF0 ? 4 : 0 ; value = ( octet & 0x80 ) == 0x00 ? octet & 0x7F : ( octet & 0xE0 ) == 0xC0 ? octet & 0x1F : ( octet & 0xF0 ) == 0xE0 ? octet & 0x0F : ( octet & 0xF8 ) == 0xF0 ? octet & 0x07 : 0 ; if ( !width ) return 0 ; if ( pointer + width > end ) return 0 ; for ( k = 1 ; k < width ; k ++ ) { octet = pointer [ k ] ; if (( octet & 0xC0 ) ! = 0x80 ) return 0 ; value = ( value << 6 ) + ( octet & 0x3F ) ; } if ( ! (( width == 1 ) || ( width == 2 && value > = 0x80 ) || ( width == 3 && value > = 0x800 ) || ( width == 4 && value > = 0x10000 ))) return 0 ; pointer + = width ; } return 1 ; } Create STREAM - START .