1a5f9918aSopenharmony_ci 2a5f9918aSopenharmony_cicdef extern from "_yaml.h": 3a5f9918aSopenharmony_ci 4a5f9918aSopenharmony_ci void malloc(int l) 5a5f9918aSopenharmony_ci void memcpy(void *d, void *s, int l) 6a5f9918aSopenharmony_ci int strlen(char *s) 7a5f9918aSopenharmony_ci int PyString_CheckExact(object o) 8a5f9918aSopenharmony_ci int PyUnicode_CheckExact(object o) 9a5f9918aSopenharmony_ci char *PyString_AS_STRING(object o) 10a5f9918aSopenharmony_ci object PyUnicode_FromString(char *u) 11a5f9918aSopenharmony_ci object PyUnicode_DecodeUTF8(char *u, int s, char *e) 12a5f9918aSopenharmony_ci object PyUnicode_AsUTF8String(object o) 13a5f9918aSopenharmony_ci int PY_MAJOR_VERSION 14a5f9918aSopenharmony_ci 15a5f9918aSopenharmony_ci ctypedef unsigned char yaml_char_t 16a5f9918aSopenharmony_ci 17a5f9918aSopenharmony_ci object PyUnicode_FromYamlString(void *u) 18a5f9918aSopenharmony_ci yaml_char_t *PyBytes_AS_Yaml_STRING(object o) 19a5f9918aSopenharmony_ci const char *PyBytes_AS_STRING(object o) 20a5f9918aSopenharmony_ci int PyBytes_CheckExact(object o) 21a5f9918aSopenharmony_ci int PyBytes_GET_SIZE(object o) 22a5f9918aSopenharmony_ci object PyBytes_FromStringAndSize(char *v, int l) 23a5f9918aSopenharmony_ci 24a5f9918aSopenharmony_ci ctypedef enum: 25a5f9918aSopenharmony_ci SIZEOF_VOID_P 26a5f9918aSopenharmony_ci ctypedef enum yaml_encoding_t: 27a5f9918aSopenharmony_ci YAML_ANY_ENCODING 28a5f9918aSopenharmony_ci YAML_UTF8_ENCODING 29a5f9918aSopenharmony_ci YAML_UTF16LE_ENCODING 30a5f9918aSopenharmony_ci YAML_UTF16BE_ENCODING 31a5f9918aSopenharmony_ci ctypedef enum yaml_break_t: 32a5f9918aSopenharmony_ci YAML_ANY_BREAK 33a5f9918aSopenharmony_ci YAML_CR_BREAK 34a5f9918aSopenharmony_ci YAML_LN_BREAK 35a5f9918aSopenharmony_ci YAML_CRLN_BREAK 36a5f9918aSopenharmony_ci ctypedef enum yaml_error_type_t: 37a5f9918aSopenharmony_ci YAML_NO_ERROR 38a5f9918aSopenharmony_ci YAML_MEMORY_ERROR 39a5f9918aSopenharmony_ci YAML_READER_ERROR 40a5f9918aSopenharmony_ci YAML_SCANNER_ERROR 41a5f9918aSopenharmony_ci YAML_PARSER_ERROR 42a5f9918aSopenharmony_ci YAML_WRITER_ERROR 43a5f9918aSopenharmony_ci YAML_EMITTER_ERROR 44a5f9918aSopenharmony_ci ctypedef enum yaml_scalar_style_t: 45a5f9918aSopenharmony_ci YAML_ANY_SCALAR_STYLE 46a5f9918aSopenharmony_ci YAML_PLAIN_SCALAR_STYLE 47a5f9918aSopenharmony_ci YAML_SINGLE_QUOTED_SCALAR_STYLE 48a5f9918aSopenharmony_ci YAML_DOUBLE_QUOTED_SCALAR_STYLE 49a5f9918aSopenharmony_ci YAML_LITERAL_SCALAR_STYLE 50a5f9918aSopenharmony_ci YAML_FOLDED_SCALAR_STYLE 51a5f9918aSopenharmony_ci ctypedef enum yaml_sequence_style_t: 52a5f9918aSopenharmony_ci YAML_ANY_SEQUENCE_STYLE 53a5f9918aSopenharmony_ci YAML_BLOCK_SEQUENCE_STYLE 54a5f9918aSopenharmony_ci YAML_FLOW_SEQUENCE_STYLE 55a5f9918aSopenharmony_ci ctypedef enum yaml_mapping_style_t: 56a5f9918aSopenharmony_ci YAML_ANY_MAPPING_STYLE 57a5f9918aSopenharmony_ci YAML_BLOCK_MAPPING_STYLE 58a5f9918aSopenharmony_ci YAML_FLOW_MAPPING_STYLE 59a5f9918aSopenharmony_ci ctypedef enum yaml_token_type_t: 60a5f9918aSopenharmony_ci YAML_NO_TOKEN 61a5f9918aSopenharmony_ci YAML_STREAM_START_TOKEN 62a5f9918aSopenharmony_ci YAML_STREAM_END_TOKEN 63a5f9918aSopenharmony_ci YAML_VERSION_DIRECTIVE_TOKEN 64a5f9918aSopenharmony_ci YAML_TAG_DIRECTIVE_TOKEN 65a5f9918aSopenharmony_ci YAML_DOCUMENT_START_TOKEN 66a5f9918aSopenharmony_ci YAML_DOCUMENT_END_TOKEN 67a5f9918aSopenharmony_ci YAML_BLOCK_SEQUENCE_START_TOKEN 68a5f9918aSopenharmony_ci YAML_BLOCK_MAPPING_START_TOKEN 69a5f9918aSopenharmony_ci YAML_BLOCK_END_TOKEN 70a5f9918aSopenharmony_ci YAML_FLOW_SEQUENCE_START_TOKEN 71a5f9918aSopenharmony_ci YAML_FLOW_SEQUENCE_END_TOKEN 72a5f9918aSopenharmony_ci YAML_FLOW_MAPPING_START_TOKEN 73a5f9918aSopenharmony_ci YAML_FLOW_MAPPING_END_TOKEN 74a5f9918aSopenharmony_ci YAML_BLOCK_ENTRY_TOKEN 75a5f9918aSopenharmony_ci YAML_FLOW_ENTRY_TOKEN 76a5f9918aSopenharmony_ci YAML_KEY_TOKEN 77a5f9918aSopenharmony_ci YAML_VALUE_TOKEN 78a5f9918aSopenharmony_ci YAML_ALIAS_TOKEN 79a5f9918aSopenharmony_ci YAML_ANCHOR_TOKEN 80a5f9918aSopenharmony_ci YAML_TAG_TOKEN 81a5f9918aSopenharmony_ci YAML_SCALAR_TOKEN 82a5f9918aSopenharmony_ci ctypedef enum yaml_event_type_t: 83a5f9918aSopenharmony_ci YAML_NO_EVENT 84a5f9918aSopenharmony_ci YAML_STREAM_START_EVENT 85a5f9918aSopenharmony_ci YAML_STREAM_END_EVENT 86a5f9918aSopenharmony_ci YAML_DOCUMENT_START_EVENT 87a5f9918aSopenharmony_ci YAML_DOCUMENT_END_EVENT 88a5f9918aSopenharmony_ci YAML_ALIAS_EVENT 89a5f9918aSopenharmony_ci YAML_SCALAR_EVENT 90a5f9918aSopenharmony_ci YAML_SEQUENCE_START_EVENT 91a5f9918aSopenharmony_ci YAML_SEQUENCE_END_EVENT 92a5f9918aSopenharmony_ci YAML_MAPPING_START_EVENT 93a5f9918aSopenharmony_ci YAML_MAPPING_END_EVENT 94a5f9918aSopenharmony_ci 95a5f9918aSopenharmony_ci ctypedef int yaml_read_handler_t(void *data, unsigned char *buffer, 96a5f9918aSopenharmony_ci size_t size, size_t *size_read) except 0 97a5f9918aSopenharmony_ci 98a5f9918aSopenharmony_ci ctypedef int yaml_write_handler_t(void *data, unsigned char *buffer, 99a5f9918aSopenharmony_ci size_t size) except 0 100a5f9918aSopenharmony_ci 101a5f9918aSopenharmony_ci ctypedef struct yaml_mark_t: 102a5f9918aSopenharmony_ci size_t index 103a5f9918aSopenharmony_ci size_t line 104a5f9918aSopenharmony_ci size_t column 105a5f9918aSopenharmony_ci ctypedef struct yaml_version_directive_t: 106a5f9918aSopenharmony_ci int major 107a5f9918aSopenharmony_ci int minor 108a5f9918aSopenharmony_ci ctypedef struct yaml_tag_directive_t: 109a5f9918aSopenharmony_ci yaml_char_t *handle 110a5f9918aSopenharmony_ci yaml_char_t *prefix 111a5f9918aSopenharmony_ci 112a5f9918aSopenharmony_ci ctypedef struct _yaml_token_stream_start_data_t: 113a5f9918aSopenharmony_ci yaml_encoding_t encoding 114a5f9918aSopenharmony_ci ctypedef struct _yaml_token_alias_data_t: 115a5f9918aSopenharmony_ci char *value 116a5f9918aSopenharmony_ci ctypedef struct _yaml_token_anchor_data_t: 117a5f9918aSopenharmony_ci char *value 118a5f9918aSopenharmony_ci ctypedef struct _yaml_token_tag_data_t: 119a5f9918aSopenharmony_ci char *handle 120a5f9918aSopenharmony_ci char *suffix 121a5f9918aSopenharmony_ci ctypedef struct _yaml_token_scalar_data_t: 122a5f9918aSopenharmony_ci char *value 123a5f9918aSopenharmony_ci size_t length 124a5f9918aSopenharmony_ci yaml_scalar_style_t style 125a5f9918aSopenharmony_ci ctypedef struct _yaml_token_version_directive_data_t: 126a5f9918aSopenharmony_ci int major 127a5f9918aSopenharmony_ci int minor 128a5f9918aSopenharmony_ci ctypedef struct _yaml_token_tag_directive_data_t: 129a5f9918aSopenharmony_ci char *handle 130a5f9918aSopenharmony_ci char *prefix 131a5f9918aSopenharmony_ci ctypedef union _yaml_token_data_t: 132a5f9918aSopenharmony_ci _yaml_token_stream_start_data_t stream_start 133a5f9918aSopenharmony_ci _yaml_token_alias_data_t alias 134a5f9918aSopenharmony_ci _yaml_token_anchor_data_t anchor 135a5f9918aSopenharmony_ci _yaml_token_tag_data_t tag 136a5f9918aSopenharmony_ci _yaml_token_scalar_data_t scalar 137a5f9918aSopenharmony_ci _yaml_token_version_directive_data_t version_directive 138a5f9918aSopenharmony_ci _yaml_token_tag_directive_data_t tag_directive 139a5f9918aSopenharmony_ci ctypedef struct yaml_token_t: 140a5f9918aSopenharmony_ci yaml_token_type_t type 141a5f9918aSopenharmony_ci _yaml_token_data_t data 142a5f9918aSopenharmony_ci yaml_mark_t start_mark 143a5f9918aSopenharmony_ci yaml_mark_t end_mark 144a5f9918aSopenharmony_ci 145a5f9918aSopenharmony_ci ctypedef struct _yaml_event_stream_start_data_t: 146a5f9918aSopenharmony_ci yaml_encoding_t encoding 147a5f9918aSopenharmony_ci ctypedef struct _yaml_event_document_start_data_tag_directives_t: 148a5f9918aSopenharmony_ci yaml_tag_directive_t *start 149a5f9918aSopenharmony_ci yaml_tag_directive_t *end 150a5f9918aSopenharmony_ci ctypedef struct _yaml_event_document_start_data_t: 151a5f9918aSopenharmony_ci yaml_version_directive_t *version_directive 152a5f9918aSopenharmony_ci _yaml_event_document_start_data_tag_directives_t tag_directives 153a5f9918aSopenharmony_ci int implicit 154a5f9918aSopenharmony_ci ctypedef struct _yaml_event_document_end_data_t: 155a5f9918aSopenharmony_ci int implicit 156a5f9918aSopenharmony_ci ctypedef struct _yaml_event_alias_data_t: 157a5f9918aSopenharmony_ci char *anchor 158a5f9918aSopenharmony_ci ctypedef struct _yaml_event_scalar_data_t: 159a5f9918aSopenharmony_ci char *anchor 160a5f9918aSopenharmony_ci char *tag 161a5f9918aSopenharmony_ci char *value 162a5f9918aSopenharmony_ci size_t length 163a5f9918aSopenharmony_ci int plain_implicit 164a5f9918aSopenharmony_ci int quoted_implicit 165a5f9918aSopenharmony_ci yaml_scalar_style_t style 166a5f9918aSopenharmony_ci ctypedef struct _yaml_event_sequence_start_data_t: 167a5f9918aSopenharmony_ci char *anchor 168a5f9918aSopenharmony_ci char *tag 169a5f9918aSopenharmony_ci int implicit 170a5f9918aSopenharmony_ci yaml_sequence_style_t style 171a5f9918aSopenharmony_ci ctypedef struct _yaml_event_mapping_start_data_t: 172a5f9918aSopenharmony_ci char *anchor 173a5f9918aSopenharmony_ci char *tag 174a5f9918aSopenharmony_ci int implicit 175a5f9918aSopenharmony_ci yaml_mapping_style_t style 176a5f9918aSopenharmony_ci ctypedef union _yaml_event_data_t: 177a5f9918aSopenharmony_ci _yaml_event_stream_start_data_t stream_start 178a5f9918aSopenharmony_ci _yaml_event_document_start_data_t document_start 179a5f9918aSopenharmony_ci _yaml_event_document_end_data_t document_end 180a5f9918aSopenharmony_ci _yaml_event_alias_data_t alias 181a5f9918aSopenharmony_ci _yaml_event_scalar_data_t scalar 182a5f9918aSopenharmony_ci _yaml_event_sequence_start_data_t sequence_start 183a5f9918aSopenharmony_ci _yaml_event_mapping_start_data_t mapping_start 184a5f9918aSopenharmony_ci ctypedef struct yaml_event_t: 185a5f9918aSopenharmony_ci yaml_event_type_t type 186a5f9918aSopenharmony_ci _yaml_event_data_t data 187a5f9918aSopenharmony_ci yaml_mark_t start_mark 188a5f9918aSopenharmony_ci yaml_mark_t end_mark 189a5f9918aSopenharmony_ci 190a5f9918aSopenharmony_ci ctypedef struct yaml_parser_t: 191a5f9918aSopenharmony_ci yaml_error_type_t error 192a5f9918aSopenharmony_ci char *problem 193a5f9918aSopenharmony_ci size_t problem_offset 194a5f9918aSopenharmony_ci int problem_value 195a5f9918aSopenharmony_ci yaml_mark_t problem_mark 196a5f9918aSopenharmony_ci char *context 197a5f9918aSopenharmony_ci yaml_mark_t context_mark 198a5f9918aSopenharmony_ci 199a5f9918aSopenharmony_ci ctypedef struct yaml_emitter_t: 200a5f9918aSopenharmony_ci yaml_error_type_t error 201a5f9918aSopenharmony_ci char *problem 202a5f9918aSopenharmony_ci 203a5f9918aSopenharmony_ci char *yaml_get_version_string() 204a5f9918aSopenharmony_ci void yaml_get_version(int *major, int *minor, int *patch) 205a5f9918aSopenharmony_ci 206a5f9918aSopenharmony_ci void yaml_token_delete(yaml_token_t *token) 207a5f9918aSopenharmony_ci 208a5f9918aSopenharmony_ci int yaml_stream_start_event_initialize(yaml_event_t *event, 209a5f9918aSopenharmony_ci yaml_encoding_t encoding) 210a5f9918aSopenharmony_ci int yaml_stream_end_event_initialize(yaml_event_t *event) 211a5f9918aSopenharmony_ci int yaml_document_start_event_initialize(yaml_event_t *event, 212a5f9918aSopenharmony_ci yaml_version_directive_t *version_directive, 213a5f9918aSopenharmony_ci yaml_tag_directive_t *tag_directives_start, 214a5f9918aSopenharmony_ci yaml_tag_directive_t *tag_directives_end, 215a5f9918aSopenharmony_ci int implicit) 216a5f9918aSopenharmony_ci int yaml_document_end_event_initialize(yaml_event_t *event, 217a5f9918aSopenharmony_ci int implicit) 218a5f9918aSopenharmony_ci int yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor) 219a5f9918aSopenharmony_ci int yaml_scalar_event_initialize(yaml_event_t *event, 220a5f9918aSopenharmony_ci yaml_char_t *anchor, yaml_char_t *tag, yaml_char_t *value, int length, 221a5f9918aSopenharmony_ci int plain_implicit, int quoted_implicit, 222a5f9918aSopenharmony_ci yaml_scalar_style_t style) 223a5f9918aSopenharmony_ci int yaml_sequence_start_event_initialize(yaml_event_t *event, 224a5f9918aSopenharmony_ci yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_sequence_style_t style) 225a5f9918aSopenharmony_ci int yaml_sequence_end_event_initialize(yaml_event_t *event) 226a5f9918aSopenharmony_ci int yaml_mapping_start_event_initialize(yaml_event_t *event, 227a5f9918aSopenharmony_ci yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_mapping_style_t style) 228a5f9918aSopenharmony_ci int yaml_mapping_end_event_initialize(yaml_event_t *event) 229a5f9918aSopenharmony_ci void yaml_event_delete(yaml_event_t *event) 230a5f9918aSopenharmony_ci 231a5f9918aSopenharmony_ci int yaml_parser_initialize(yaml_parser_t *parser) 232a5f9918aSopenharmony_ci void yaml_parser_delete(yaml_parser_t *parser) 233a5f9918aSopenharmony_ci void yaml_parser_set_input_string(yaml_parser_t *parser, 234a5f9918aSopenharmony_ci const unsigned char *input, size_t size) 235a5f9918aSopenharmony_ci void yaml_parser_set_input(yaml_parser_t *parser, 236a5f9918aSopenharmony_ci yaml_read_handler_t *handler, void *data) 237a5f9918aSopenharmony_ci void yaml_parser_set_encoding(yaml_parser_t *parser, 238a5f9918aSopenharmony_ci yaml_encoding_t encoding) 239a5f9918aSopenharmony_ci int yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token) except * 240a5f9918aSopenharmony_ci int yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event) except * 241a5f9918aSopenharmony_ci 242a5f9918aSopenharmony_ci int yaml_emitter_initialize(yaml_emitter_t *emitter) 243a5f9918aSopenharmony_ci void yaml_emitter_delete(yaml_emitter_t *emitter) 244a5f9918aSopenharmony_ci void yaml_emitter_set_output_string(yaml_emitter_t *emitter, 245a5f9918aSopenharmony_ci char *output, size_t size, size_t *size_written) 246a5f9918aSopenharmony_ci void yaml_emitter_set_output(yaml_emitter_t *emitter, 247a5f9918aSopenharmony_ci yaml_write_handler_t *handler, void *data) 248a5f9918aSopenharmony_ci void yaml_emitter_set_encoding(yaml_emitter_t *emitter, 249a5f9918aSopenharmony_ci yaml_encoding_t encoding) 250a5f9918aSopenharmony_ci void yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical) 251a5f9918aSopenharmony_ci void yaml_emitter_set_indent(yaml_emitter_t *emitter, int indent) 252a5f9918aSopenharmony_ci void yaml_emitter_set_width(yaml_emitter_t *emitter, int width) 253a5f9918aSopenharmony_ci void yaml_emitter_set_unicode(yaml_emitter_t *emitter, int unicode) 254a5f9918aSopenharmony_ci void yaml_emitter_set_break(yaml_emitter_t *emitter, 255a5f9918aSopenharmony_ci yaml_break_t line_break) 256a5f9918aSopenharmony_ci int yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event) except * 257a5f9918aSopenharmony_ci int yaml_emitter_flush(yaml_emitter_t *emitter) 258a5f9918aSopenharmony_ci 259