2 cdef extern from "_yaml.h":
4 int PyString_CheckExact(object o)
5 int PyUnicode_CheckExact(object o)
6 char *PyString_AS_STRING(object o)
7 int PyString_GET_SIZE(object o)
8 object PyString_FromStringAndSize(char *v, int l)
10 cdef enum yaml_encoding_t:
15 cdef enum yaml_error_type_t:
23 cdef enum yaml_scalar_style_t:
25 YAML_PLAIN_SCALAR_STYLE
26 YAML_SINGLE_QUOTED_SCALAR_STYLE
27 YAML_DOUBLE_QUOTED_SCALAR_STYLE
28 YAML_LITERAL_SCALAR_STYLE
29 YAML_FOLDED_SCALAR_STYLE
30 cdef enum yaml_sequence_style_t:
31 YAML_ANY_SEQUENCE_STYLE
32 YAML_BLOCK_SEQUENCE_STYLE
33 YAML_FLOW_SEQUENCE_STYLE
34 cdef enum yaml_mapping_style_t:
35 YAML_ANY_MAPPING_STYLE
36 YAML_BLOCK_MAPPING_STYLE
37 YAML_FLOW_MAPPING_STYLE
38 cdef enum yaml_token_type_t:
39 YAML_STREAM_START_TOKEN
41 YAML_VERSION_DIRECTIVE_TOKEN
42 YAML_TAG_DIRECTIVE_TOKEN
43 YAML_DOCUMENT_START_TOKEN
44 YAML_DOCUMENT_END_TOKEN
45 YAML_BLOCK_SEQUENCE_START_TOKEN
46 YAML_BLOCK_MAPPING_START_TOKEN
48 YAML_FLOW_SEQUENCE_START_TOKEN
49 YAML_FLOW_SEQUENCE_END_TOKEN
50 YAML_FLOW_MAPPING_START_TOKEN
51 YAML_FLOW_MAPPING_END_TOKEN
52 YAML_BLOCK_ENTRY_TOKEN
60 cdef enum yaml_event_type_t:
61 YAML_STREAM_START_EVENT
63 YAML_DOCUMENT_START_EVENT
64 YAML_DOCUMENT_END_EVENT
67 YAML_SEQUENCE_START_EVENT
68 YAML_SEQUENCE_END_EVENT
69 YAML_MAPPING_START_EVENT
70 YAML_MAPPING_END_EVENT
72 ctypedef int yaml_read_handler_t(void *data, char *buffer,
73 int size, int *size_read)
75 ctypedef struct yaml_mark_t:
79 ctypedef struct yaml_version_directive_t:
82 ctypedef struct yaml_tag_directive_t:
86 ctypedef struct _yaml_token_stream_start_data_t:
87 yaml_encoding_t encoding
88 ctypedef struct _yaml_token_alias_data_t:
90 ctypedef struct _yaml_token_anchor_data_t:
92 ctypedef struct _yaml_token_tag_data_t:
95 ctypedef struct _yaml_token_scalar_data_t:
98 yaml_scalar_style_t style
99 ctypedef struct _yaml_token_version_directive_data_t:
102 ctypedef struct _yaml_token_tag_directive_data_t:
105 ctypedef union _yaml_token_data_t:
106 _yaml_token_stream_start_data_t stream_start
107 _yaml_token_alias_data_t alias
108 _yaml_token_anchor_data_t anchor
109 _yaml_token_tag_data_t tag
110 _yaml_token_scalar_data_t scalar
111 _yaml_token_version_directive_data_t version_directive
112 _yaml_token_tag_directive_data_t tag_directive
113 ctypedef struct yaml_token_t:
114 yaml_token_type_t type
115 _yaml_token_data_t data
116 yaml_mark_t start_mark
119 ctypedef struct _yaml_event_stream_start_data_t:
120 yaml_encoding_t encoding
121 ctypedef struct _yaml_event_document_start_data_t:
122 yaml_version_directive_t *version_directive
123 yaml_tag_directive_t **tag_directives
125 ctypedef struct _yaml_event_document_end_data_t:
127 ctypedef struct _yaml_event_alias_data_t:
129 ctypedef struct _yaml_event_scalar_data_t:
136 yaml_scalar_style_t style
137 ctypedef struct _yaml_event_sequence_start_data_t:
141 yaml_sequence_style_t style
142 ctypedef struct _yaml_event_mapping_start_data_t:
146 yaml_mapping_style_t style
147 ctypedef union _yaml_event_data_t:
148 _yaml_event_stream_start_data_t stream_start
149 _yaml_event_document_start_data_t document_start
150 _yaml_event_document_end_data_t document_end
151 _yaml_event_alias_data_t alias
152 _yaml_event_scalar_data_t scalar
153 _yaml_event_sequence_start_data_t sequence_start
154 _yaml_event_mapping_start_data_t mapping_start
155 ctypedef struct yaml_event_t:
156 yaml_event_type_t type
157 _yaml_event_data_t data
158 yaml_mark_t start_mark
161 ctypedef struct yaml_parser_t:
162 yaml_error_type_t error
166 yaml_mark_t problem_mark
168 yaml_mark_t context_mark
170 char *yaml_get_version_string()
171 void yaml_get_version(int *major, int *minor, int *patch)
172 void yaml_token_delete(yaml_token_t *token)
173 void yaml_event_delete(yaml_event_t *event)
174 yaml_parser_t *yaml_parser_new()
175 void yaml_parser_delete(yaml_parser_t *parser)
176 void yaml_parser_set_input_string(yaml_parser_t *parser,
177 char *input, int size)
178 void yaml_parser_set_input(yaml_parser_t *parser,
179 yaml_read_handler_t *handler, void *data)
180 void yaml_parser_set_encoding(yaml_parser_t *parser,
181 yaml_encoding_t encoding)
182 yaml_token_t *yaml_parser_get_token(yaml_parser_t *parser)
183 yaml_token_t *yaml_parser_peek_token(yaml_parser_t *parser)
184 yaml_event_t *yaml_parser_get_event(yaml_parser_t *parser)
185 yaml_event_t *yaml_parser_peek_event(yaml_parser_t *parser)