2 cdef extern from "_yaml.h":
4 void memcpy(char *d, char *s, int l)
6 int PyString_CheckExact(object o)
7 int PyUnicode_CheckExact(object o)
8 char *PyString_AS_STRING(object o)
9 int PyString_GET_SIZE(object o)
10 object PyString_FromStringAndSize(char *v, int l)
11 object PyUnicode_DecodeUTF8(char *s, int s, char *e)
12 object PyUnicode_AsUTF8String(object o)
14 cdef enum yaml_encoding_t:
19 cdef enum yaml_error_type_t:
27 cdef enum yaml_scalar_style_t:
29 YAML_PLAIN_SCALAR_STYLE
30 YAML_SINGLE_QUOTED_SCALAR_STYLE
31 YAML_DOUBLE_QUOTED_SCALAR_STYLE
32 YAML_LITERAL_SCALAR_STYLE
33 YAML_FOLDED_SCALAR_STYLE
34 cdef enum yaml_sequence_style_t:
35 YAML_ANY_SEQUENCE_STYLE
36 YAML_BLOCK_SEQUENCE_STYLE
37 YAML_FLOW_SEQUENCE_STYLE
38 cdef enum yaml_mapping_style_t:
39 YAML_ANY_MAPPING_STYLE
40 YAML_BLOCK_MAPPING_STYLE
41 YAML_FLOW_MAPPING_STYLE
42 cdef enum yaml_token_type_t:
44 YAML_STREAM_START_TOKEN
46 YAML_VERSION_DIRECTIVE_TOKEN
47 YAML_TAG_DIRECTIVE_TOKEN
48 YAML_DOCUMENT_START_TOKEN
49 YAML_DOCUMENT_END_TOKEN
50 YAML_BLOCK_SEQUENCE_START_TOKEN
51 YAML_BLOCK_MAPPING_START_TOKEN
53 YAML_FLOW_SEQUENCE_START_TOKEN
54 YAML_FLOW_SEQUENCE_END_TOKEN
55 YAML_FLOW_MAPPING_START_TOKEN
56 YAML_FLOW_MAPPING_END_TOKEN
57 YAML_BLOCK_ENTRY_TOKEN
65 cdef enum yaml_event_type_t:
67 YAML_STREAM_START_EVENT
69 YAML_DOCUMENT_START_EVENT
70 YAML_DOCUMENT_END_EVENT
73 YAML_SEQUENCE_START_EVENT
74 YAML_SEQUENCE_END_EVENT
75 YAML_MAPPING_START_EVENT
76 YAML_MAPPING_END_EVENT
78 ctypedef int yaml_read_handler_t(void *data, char *buffer,
79 int size, int *size_read) except 0
81 ctypedef struct yaml_mark_t:
85 ctypedef struct yaml_version_directive_t:
88 ctypedef struct yaml_tag_directive_t:
92 ctypedef struct _yaml_token_stream_start_data_t:
93 yaml_encoding_t encoding
94 ctypedef struct _yaml_token_alias_data_t:
96 ctypedef struct _yaml_token_anchor_data_t:
98 ctypedef struct _yaml_token_tag_data_t:
101 ctypedef struct _yaml_token_scalar_data_t:
104 yaml_scalar_style_t style
105 ctypedef struct _yaml_token_version_directive_data_t:
108 ctypedef struct _yaml_token_tag_directive_data_t:
111 ctypedef union _yaml_token_data_t:
112 _yaml_token_stream_start_data_t stream_start
113 _yaml_token_alias_data_t alias
114 _yaml_token_anchor_data_t anchor
115 _yaml_token_tag_data_t tag
116 _yaml_token_scalar_data_t scalar
117 _yaml_token_version_directive_data_t version_directive
118 _yaml_token_tag_directive_data_t tag_directive
119 ctypedef struct yaml_token_t:
120 yaml_token_type_t type
121 _yaml_token_data_t data
122 yaml_mark_t start_mark
125 ctypedef struct _yaml_event_stream_start_data_t:
126 yaml_encoding_t encoding
127 ctypedef struct _yaml_event_document_start_data_t:
128 yaml_version_directive_t *version_directive
129 yaml_tag_directive_t **tag_directives
131 ctypedef struct _yaml_event_document_end_data_t:
133 ctypedef struct _yaml_event_alias_data_t:
135 ctypedef struct _yaml_event_scalar_data_t:
142 yaml_scalar_style_t style
143 ctypedef struct _yaml_event_sequence_start_data_t:
147 yaml_sequence_style_t style
148 ctypedef struct _yaml_event_mapping_start_data_t:
152 yaml_mapping_style_t style
153 ctypedef union _yaml_event_data_t:
154 _yaml_event_stream_start_data_t stream_start
155 _yaml_event_document_start_data_t document_start
156 _yaml_event_document_end_data_t document_end
157 _yaml_event_alias_data_t alias
158 _yaml_event_scalar_data_t scalar
159 _yaml_event_sequence_start_data_t sequence_start
160 _yaml_event_mapping_start_data_t mapping_start
161 ctypedef struct yaml_event_t:
162 yaml_event_type_t type
163 _yaml_event_data_t data
164 yaml_mark_t start_mark
167 ctypedef struct yaml_parser_t:
168 yaml_error_type_t error
172 yaml_mark_t problem_mark
174 yaml_mark_t context_mark
176 char *yaml_get_version_string()
177 void yaml_get_version(int *major, int *minor, int *patch)
178 void yaml_token_delete(yaml_token_t *token)
179 void yaml_event_delete(yaml_event_t *event)
180 int yaml_parser_initialize(yaml_parser_t *parser)
181 void yaml_parser_delete(yaml_parser_t *parser)
182 void yaml_parser_set_input_string(yaml_parser_t *parser,
183 char *input, int size)
184 void yaml_parser_set_input(yaml_parser_t *parser,
185 yaml_read_handler_t *handler, void *data)
186 void yaml_parser_set_encoding(yaml_parser_t *parser,
187 yaml_encoding_t encoding)
188 int yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token) except *
189 int yaml_parser_parse(yaml_parser_t *parser, yaml_event_t *event) except *