on master help sign in
libyaml C library update (thanks @jgm)
583abc2Michael Snoyman
libyaml/api.c+5−1
@@ -1367,7 +1367,8 @@ yaml_document_append_mapping_pair(yaml_document_t *document,
1367 struct {
1367 struct {
1368 yaml_error_type_t error;
1368 yaml_error_type_t error;
1369 } context;
1369 } context;
1370+
1370− yaml_node_pair_t pair = { key, value };
1371+ yaml_node_pair_t pair;
1371
1372
1372 assert(document); /* Non-NULL document is required. */
1373 assert(document); /* Non-NULL document is required. */
1373 assert(mapping > 0
1374 assert(mapping > 0
@@ -1380,6 +1381,9 @@ yaml_document_append_mapping_pair(yaml_document_t *document,
1380 assert(value > 0 && document->nodes.start + value <= document->nodes.top);
1381 assert(value > 0 && document->nodes.start + value <= document->nodes.top);
1381 /* Valid value id is required. */
1382 /* Valid value id is required. */
1382
1383
1384+ pair.key = key;
1385+ pair.value = value;
1386+
1383 if (!PUSH(&context,
1387 if (!PUSH(&context,
1384 document->nodes.start[mapping-1].data.mapping.pairs, pair))
1388 document->nodes.start[mapping-1].data.mapping.pairs, pair))
1385 return 0;
1389 return 0;
libyaml/emitter.c+49−17
@@ -1154,7 +1154,7 @@ yaml_emitter_check_simple_key(yaml_emitter_t *emitter)
1154 break;
1154 break;
1155
1155
1156 case YAML_MAPPING_START_EVENT:
1156 case YAML_MAPPING_START_EVENT:
1157− if (!yaml_emitter_check_empty_sequence(emitter))
1157+ if (!yaml_emitter_check_empty_mapping(emitter))
1158 return 0;
1158 return 0;
1159 length += emitter->anchor_data.anchor_length
1159 length += emitter->anchor_data.anchor_length
1160 + emitter->tag_data.handle_length
1160 + emitter->tag_data.handle_length
@@ -1349,10 +1349,15 @@ static int
1349yaml_emitter_analyze_tag_directive(yaml_emitter_t *emitter,
1349yaml_emitter_analyze_tag_directive(yaml_emitter_t *emitter,
1350 yaml_tag_directive_t tag_directive)
1350 yaml_tag_directive_t tag_directive)
1351{
1351{
1352− yaml_string_t handle = STRING(tag_directive.handle,
1352+ yaml_string_t handle;
1353+ yaml_string_t prefix;
1354+ size_t handle_length;
1355+ size_t prefix_length;
1356+
1353− strlen((char *)tag_directive.handle));
1357+ handle_length = strlen((char *)tag_directive.handle);
1354− yaml_string_t prefix = STRING(tag_directive.prefix,
1358+ prefix_length = strlen((char *)tag_directive.prefix);
1359+ STRING_ASSIGN(handle, tag_directive.handle, handle_length);
1355− strlen((char *)tag_directive.prefix));
1360+ STRING_ASSIGN(prefix, tag_directive.prefix, prefix_length);
1356
1361
1357 if (handle.start == handle.end) {
1362 if (handle.start == handle.end) {
1358 return yaml_emitter_set_emitter_error(emitter,
1363 return yaml_emitter_set_emitter_error(emitter,
@@ -1395,7 +1400,11 @@ static int
1395yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
1400yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
1396 yaml_char_t *anchor, int alias)
1401 yaml_char_t *anchor, int alias)
1397{
1402{
1403+ size_t anchor_length;
1398− yaml_string_t string = STRING(anchor, strlen((char *)anchor));
1404+ yaml_string_t string;
1405+
1406+ anchor_length = strlen((char *)anchor);
1407+ STRING_ASSIGN(string, anchor, anchor_length);
1399
1408
1400 if (string.start == string.end) {
1409 if (string.start == string.end) {
1401 return yaml_emitter_set_emitter_error(emitter, alias ?
1410 return yaml_emitter_set_emitter_error(emitter, alias ?
@@ -1427,9 +1436,13 @@ static int
1427yaml_emitter_analyze_tag(yaml_emitter_t *emitter,
1436yaml_emitter_analyze_tag(yaml_emitter_t *emitter,
1428 yaml_char_t *tag)
1437 yaml_char_t *tag)
1429{
1438{
1439+ size_t tag_length;
1430− yaml_string_t string = STRING(tag, strlen((char *)tag));
1440+ yaml_string_t string;
1431 yaml_tag_directive_t *tag_directive;
1441 yaml_tag_directive_t *tag_directive;
1432
1442
1443+ tag_length = strlen((char *)tag);
1444+ STRING_ASSIGN(string, tag, tag_length);
1445+
1433 if (string.start == string.end) {
1446 if (string.start == string.end) {
1434 return yaml_emitter_set_emitter_error(emitter,
1447 return yaml_emitter_set_emitter_error(emitter,
1435 "tag value must not be empty");
1448 "tag value must not be empty");
@@ -1466,7 +1479,7 @@ static int
1466yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
1479yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
1467 yaml_char_t *value, size_t length)
1480 yaml_char_t *value, size_t length)
1468{
1481{
1469− yaml_string_t string = STRING(value, length);
1482+ yaml_string_t string;
1470
1483
1471 int block_indicators = 0;
1484 int block_indicators = 0;
1472 int flow_indicators = 0;
1485 int flow_indicators = 0;
@@ -1485,6 +1498,8 @@ yaml_emitter_analyze_scalar(yaml_emitter_t *emitter,
1485 int previous_space = 0;
1498 int previous_space = 0;
1486 int previous_break = 0;
1499 int previous_break = 0;
1487
1500
1501+ STRING_ASSIGN(string, value, length);
1502+
1488 emitter->scalar_data.value = value;
1503 emitter->scalar_data.value = value;
1489 emitter->scalar_data.length = length;
1504 emitter->scalar_data.length = length;
1490
1505
@@ -1772,7 +1787,11 @@ yaml_emitter_write_indicator(yaml_emitter_t *emitter,
1772 char *indicator, int need_whitespace,
1787 char *indicator, int need_whitespace,
1773 int is_whitespace, int is_indention)
1788 int is_whitespace, int is_indention)
1774{
1789{
1790+ size_t indicator_length;
1775− yaml_string_t string = STRING((yaml_char_t *)indicator, strlen(indicator));
1791+ yaml_string_t string;
1792+
1793+ indicator_length = strlen(indicator);
1794+ STRING_ASSIGN(string, (yaml_char_t *)indicator, indicator_length);
1776
1795
1777 if (need_whitespace && !emitter->whitespace) {
1796 if (need_whitespace && !emitter->whitespace) {
1778 if (!PUT(emitter, ' ')) return 0;
1797 if (!PUT(emitter, ' ')) return 0;
@@ -1793,7 +1812,8 @@ static int
1793yaml_emitter_write_anchor(yaml_emitter_t *emitter,
1812yaml_emitter_write_anchor(yaml_emitter_t *emitter,
1794 yaml_char_t *value, size_t length)
1813 yaml_char_t *value, size_t length)
1795{
1814{
1796− yaml_string_t string = STRING(value, length);
1815+ yaml_string_t string;
1816+ STRING_ASSIGN(string, value, length);
1797
1817
1798 while (string.pointer != string.end) {
1818 while (string.pointer != string.end) {
1799 if (!WRITE(emitter, string)) return 0;
1819 if (!WRITE(emitter, string)) return 0;
@@ -1809,7 +1829,8 @@ static int
1809yaml_emitter_write_tag_handle(yaml_emitter_t *emitter,
1829yaml_emitter_write_tag_handle(yaml_emitter_t *emitter,
1810 yaml_char_t *value, size_t length)
1830 yaml_char_t *value, size_t length)
1811{
1831{
1812− yaml_string_t string = STRING(value, length);
1832+ yaml_string_t string;
1833+ STRING_ASSIGN(string, value, length);
1813
1834
1814 if (!emitter->whitespace) {
1835 if (!emitter->whitespace) {
1815 if (!PUT(emitter, ' ')) return 0;
1836 if (!PUT(emitter, ' ')) return 0;
@@ -1830,7 +1851,8 @@ yaml_emitter_write_tag_content(yaml_emitter_t *emitter,
1830 yaml_char_t *value, size_t length,
1851 yaml_char_t *value, size_t length,
1831 int need_whitespace)
1852 int need_whitespace)
1832{
1853{
1833− yaml_string_t string = STRING(value, length);
1854+ yaml_string_t string;
1855+ STRING_ASSIGN(string, value, length);
1834
1856
1835 if (need_whitespace && !emitter->whitespace) {
1857 if (need_whitespace && !emitter->whitespace) {
1836 if (!PUT(emitter, ' ')) return 0;
1858 if (!PUT(emitter, ' ')) return 0;
@@ -1876,10 +1898,12 @@ static int
1876yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
1898yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
1877 yaml_char_t *value, size_t length, int allow_breaks)
1899 yaml_char_t *value, size_t length, int allow_breaks)
1878{
1900{
1879− yaml_string_t string = STRING(value, length);
1901+ yaml_string_t string;
1880 int spaces = 0;
1902 int spaces = 0;
1881 int breaks = 0;
1903 int breaks = 0;
1882
1904
1905+ STRING_ASSIGN(string, value, length);
1906+
1883 if (!emitter->whitespace) {
1907 if (!emitter->whitespace) {
1884 if (!PUT(emitter, ' ')) return 0;
1908 if (!PUT(emitter, ' ')) return 0;
1885 }
1909 }
@@ -1934,10 +1958,12 @@ static int
1934yaml_emitter_write_single_quoted_scalar(yaml_emitter_t *emitter,
1958yaml_emitter_write_single_quoted_scalar(yaml_emitter_t *emitter,
1935 yaml_char_t *value, size_t length, int allow_breaks)
1959 yaml_char_t *value, size_t length, int allow_breaks)
1936{
1960{
1937− yaml_string_t string = STRING(value, length);
1961+ yaml_string_t string;
1938 int spaces = 0;
1962 int spaces = 0;
1939 int breaks = 0;
1963 int breaks = 0;
1940
1964
1965+ STRING_ASSIGN(string, value, length);
1966+
1941 if (!yaml_emitter_write_indicator(emitter, "'", 1, 0, 0))
1967 if (!yaml_emitter_write_indicator(emitter, "'", 1, 0, 0))
1942 return 0;
1968 return 0;
1943
1969
@@ -1995,9 +2021,11 @@ static int
1995yaml_emitter_write_double_quoted_scalar(yaml_emitter_t *emitter,
2021yaml_emitter_write_double_quoted_scalar(yaml_emitter_t *emitter,
1996 yaml_char_t *value, size_t length, int allow_breaks)
2022 yaml_char_t *value, size_t length, int allow_breaks)
1997{
2023{
1998− yaml_string_t string = STRING(value, length);
2024+ yaml_string_t string;
1999 int spaces = 0;
2025 int spaces = 0;
2000
2026
2027+ STRING_ASSIGN(string, value, length);
2028+
2001 if (!yaml_emitter_write_indicator(emitter, "\"", 1, 0, 0))
2029 if (!yaml_emitter_write_indicator(emitter, "\"", 1, 0, 0))
2002 return 0;
2030 return 0;
2003
2031
@@ -2207,9 +2235,11 @@ static int
2207yaml_emitter_write_literal_scalar(yaml_emitter_t *emitter,
2235yaml_emitter_write_literal_scalar(yaml_emitter_t *emitter,
2208 yaml_char_t *value, size_t length)
2236 yaml_char_t *value, size_t length)
2209{
2237{
2210− yaml_string_t string = STRING(value, length);
2238+ yaml_string_t string;
2211 int breaks = 1;
2239 int breaks = 1;
2212
2240
2241+ STRING_ASSIGN(string, value, length);
2242+
2213 if (!yaml_emitter_write_indicator(emitter, "|", 1, 0, 0))
2243 if (!yaml_emitter_write_indicator(emitter, "|", 1, 0, 0))
2214 return 0;
2244 return 0;
2215 if (!yaml_emitter_write_block_scalar_hints(emitter, string))
2245 if (!yaml_emitter_write_block_scalar_hints(emitter, string))
@@ -2244,10 +2274,12 @@ static int
2244yaml_emitter_write_folded_scalar(yaml_emitter_t *emitter,
2274yaml_emitter_write_folded_scalar(yaml_emitter_t *emitter,
2245 yaml_char_t *value, size_t length)
2275 yaml_char_t *value, size_t length)
2246{
2276{
2247− yaml_string_t string = STRING(value, length);
2277+ yaml_string_t string;
2248 int breaks = 1;
2278 int breaks = 1;
2249 int leading_spaces = 1;
2279 int leading_spaces = 1;
2250
2280
2281+ STRING_ASSIGN(string, value, length);
2282+
2251 if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0))
2283 if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0))
2252 return 0;
2284 return 0;
2253 if (!yaml_emitter_write_block_scalar_hints(emitter, string))
2285 if (!yaml_emitter_write_block_scalar_hints(emitter, string))
libyaml/loader.c+3−1
@@ -225,11 +225,13 @@ static int
225yaml_parser_register_anchor(yaml_parser_t *parser,
225yaml_parser_register_anchor(yaml_parser_t *parser,
226 int index, yaml_char_t *anchor)
226 int index, yaml_char_t *anchor)
227{
227{
228− yaml_alias_data_t data = { anchor, index, { 0, 0, 0 } };
228+ yaml_alias_data_t data;
229 yaml_alias_data_t *alias_data;
229 yaml_alias_data_t *alias_data;
230
230
231 if (!anchor) return 1;
231 if (!anchor) return 1;
232
232
233+ data.anchor = anchor;
234+ data.index = index;
233 data.mark = parser->document->nodes.start[index-1].start_mark;
235 data.mark = parser->document->nodes.start[index-1].start_mark;
234
236
235 for (alias_data = parser->aliases.start;
237 for (alias_data = parser->aliases.start;
libyaml/parser.c+4−4
@@ -1280,10 +1280,10 @@ yaml_parser_process_directives(yaml_parser_t *parser,
1280 }
1280 }
1281
1281
1282 else if (token->type == YAML_TAG_DIRECTIVE_TOKEN) {
1282 else if (token->type == YAML_TAG_DIRECTIVE_TOKEN) {
1283− yaml_tag_directive_t value = {
1283+ yaml_tag_directive_t value;
1284− token->data.tag_directive.handle,
1284+ value.handle = token->data.tag_directive.handle;
1285− token->data.tag_directive.prefix
1285+ value.prefix = token->data.tag_directive.prefix;
1286− };
1286+
1287 if (!yaml_parser_append_tag_directive(parser, value, 0,
1287 if (!yaml_parser_append_tag_directive(parser, value, 0,
1288 token->start_mark))
1288 token->start_mark))
1289 goto error;
1289 goto error;
libyaml/reader.c+18−13
@@ -120,7 +120,7 @@ yaml_parser_update_raw_buffer(yaml_parser_t *parser)
120
120
121 if (!parser->read_handler(parser->read_handler_data, parser->raw_buffer.last,
121 if (!parser->read_handler(parser->read_handler_data, parser->raw_buffer.last,
122 parser->raw_buffer.end - parser->raw_buffer.last, &size_read)) {
122 parser->raw_buffer.end - parser->raw_buffer.last, &size_read)) {
123− return yaml_parser_set_reader_error(parser, "Input error",
123+ return yaml_parser_set_reader_error(parser, "input error",
124 parser->offset, -1);
124 parser->offset, -1);
125 }
125 }
126 parser->raw_buffer.last += size_read;
126 parser->raw_buffer.last += size_read;
@@ -141,6 +141,8 @@ yaml_parser_update_raw_buffer(yaml_parser_t *parser)
141YAML_DECLARE(int)
141YAML_DECLARE(int)
142yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
142yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
143{
143{
144+ int first = 1;
145+
144 assert(parser->read_handler); /* Read handler must be set. */
146 assert(parser->read_handler); /* Read handler must be set. */
145
147
146 /* If the EOF flag is set and the raw buffer is empty, do nothing. */
148 /* If the EOF flag is set and the raw buffer is empty, do nothing. */
@@ -178,9 +180,12 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
178
180
179 while (parser->unread < length)
181 while (parser->unread < length)
180 {
182 {
181− /* Fill the raw buffer. */
183+ /* Fill the raw buffer if necessary. */
182
184
185+ if (!first || parser->raw_buffer.pointer == parser->raw_buffer.last) {
183− if (!yaml_parser_update_raw_buffer(parser)) return 0;
186+ if (!yaml_parser_update_raw_buffer(parser)) return 0;
187+ }
188+ first = 0;
184
189
185 /* Decode the raw buffer. */
190 /* Decode the raw buffer. */
186
191
@@ -232,7 +237,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
232
237
233 if (!width)
238 if (!width)
234 return yaml_parser_set_reader_error(parser,
239 return yaml_parser_set_reader_error(parser,
235− "Invalid leading UTF-8 octet",
240+ "invalid leading UTF-8 octet",
236 parser->offset, octet);
241 parser->offset, octet);
237
242
238 /* Check if the raw buffer contains an incomplete character. */
243 /* Check if the raw buffer contains an incomplete character. */
@@ -240,7 +245,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
240 if (width > raw_unread) {
245 if (width > raw_unread) {
241 if (parser->eof) {
246 if (parser->eof) {
242 return yaml_parser_set_reader_error(parser,
247 return yaml_parser_set_reader_error(parser,
243− "Incomplete UTF-8 octet sequence",
248+ "incomplete UTF-8 octet sequence",
244 parser->offset, -1);
249 parser->offset, -1);
245 }
250 }
246 incomplete = 1;
251 incomplete = 1;
@@ -264,7 +269,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
264
269
265 if ((octet & 0xC0) != 0x80)
270 if ((octet & 0xC0) != 0x80)
266 return yaml_parser_set_reader_error(parser,
271 return yaml_parser_set_reader_error(parser,
267− "Invalid trailing UTF-8 octet",
272+ "invalid trailing UTF-8 octet",
268 parser->offset+k, octet);
273 parser->offset+k, octet);
269
274
270 /* Decode the octet. */
275 /* Decode the octet. */
@@ -279,14 +284,14 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
279 (width == 3 && value >= 0x800) ||
284 (width == 3 && value >= 0x800) ||
280 (width == 4 && value >= 0x10000)))
285 (width == 4 && value >= 0x10000)))
281 return yaml_parser_set_reader_error(parser,
286 return yaml_parser_set_reader_error(parser,
282− "Invalid length of a UTF-8 sequence",
287+ "invalid length of a UTF-8 sequence",
283 parser->offset, -1);
288 parser->offset, -1);
284
289
285 /* Check the range of the value. */
290 /* Check the range of the value. */
286
291
287 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
292 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF)
288 return yaml_parser_set_reader_error(parser,
293 return yaml_parser_set_reader_error(parser,
289− "Invalid Unicode character",
294+ "invalid Unicode character",
290 parser->offset, value);
295 parser->offset, value);
291
296
292 break;
297 break;
@@ -328,7 +333,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
328 if (raw_unread < 2) {
333 if (raw_unread < 2) {
329 if (parser->eof) {
334 if (parser->eof) {
330 return yaml_parser_set_reader_error(parser,
335 return yaml_parser_set_reader_error(parser,
331− "Incomplete UTF-16 character",
336+ "incomplete UTF-16 character",
332 parser->offset, -1);
337 parser->offset, -1);
333 }
338 }
334 incomplete = 1;
339 incomplete = 1;
@@ -344,7 +349,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
344
349
345 if ((value & 0xFC00) == 0xDC00)
350 if ((value & 0xFC00) == 0xDC00)
346 return yaml_parser_set_reader_error(parser,
351 return yaml_parser_set_reader_error(parser,
347− "Unexpected low surrogate area",
352+ "unexpected low surrogate area",
348 parser->offset, value);
353 parser->offset, value);
349
354
350 /* Check for a high surrogate area. */
355 /* Check for a high surrogate area. */
@@ -358,7 +363,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
358 if (raw_unread < 4) {
363 if (raw_unread < 4) {
359 if (parser->eof) {
364 if (parser->eof) {
360 return yaml_parser_set_reader_error(parser,
365 return yaml_parser_set_reader_error(parser,
361− "Incomplete UTF-16 surrogate pair",
366+ "incomplete UTF-16 surrogate pair",
362 parser->offset, -1);
367 parser->offset, -1);
363 }
368 }
364 incomplete = 1;
369 incomplete = 1;
@@ -374,7 +379,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
374
379
375 if ((value2 & 0xFC00) != 0xDC00)
380 if ((value2 & 0xFC00) != 0xDC00)
376 return yaml_parser_set_reader_error(parser,
381 return yaml_parser_set_reader_error(parser,
377− "Expected low surrogate area",
382+ "expected low surrogate area",
378 parser->offset+2, value2);
383 parser->offset+2, value2);
379
384
380 /* Generate the value of the surrogate pair. */
385 /* Generate the value of the surrogate pair. */
@@ -409,7 +414,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
409 || (value >= 0xE000 && value <= 0xFFFD)
414 || (value >= 0xE000 && value <= 0xFFFD)
410 || (value >= 0x10000 && value <= 0x10FFFF)))
415 || (value >= 0x10000 && value <= 0x10FFFF)))
411 return yaml_parser_set_reader_error(parser,
416 return yaml_parser_set_reader_error(parser,
412− "Control characters are not allowed",
417+ "control characters are not allowed",
413 parser->offset, value);
418 parser->offset, value);
414
419
415 /* Move the raw pointers. */
420 /* Move the raw pointers. */
libyaml/scanner.c+5−3
@@ -1118,9 +1118,11 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
1118
1118
1119 if (parser->simple_key_allowed)
1119 if (parser->simple_key_allowed)
1120 {
1120 {
1121− yaml_simple_key_t simple_key = { 1, required,
1121+ yaml_simple_key_t simple_key;
1122+ simple_key.possible = 1;
1123+ simple_key.required = required;
1124+ simple_key.token_number =
1122− parser->tokens_parsed + parser->tokens.tail - parser->tokens.head,
1125+ parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
1123− { 0, 0, 0 } };
1124 simple_key.mark = parser->mark;
1126 simple_key.mark = parser->mark;
1125
1127
1126 if (!yaml_parser_remove_simple_key(parser)) return 0;
1128 if (!yaml_parser_remove_simple_key(parser)) return 0;
libyaml/writer.c+2−2
@@ -58,7 +58,7 @@ yaml_emitter_flush(yaml_emitter_t *emitter)
58 return 1;
58 return 1;
59 }
59 }
60 else {
60 else {
61− return yaml_emitter_set_writer_error(emitter, "Write error");
61+ return yaml_emitter_set_writer_error(emitter, "write error");
62 }
62 }
63 }
63 }
64
64
@@ -135,7 +135,7 @@ yaml_emitter_flush(yaml_emitter_t *emitter)
135 return 1;
135 return 1;
136 }
136 }
137 else {
137 else {
138− return yaml_emitter_set_writer_error(emitter, "Write error");
138+ return yaml_emitter_set_writer_error(emitter, "write error");
139 }
139 }
140}
140}
141
141
libyaml/yaml.h+1−3
@@ -26,9 +26,7 @@ extern "C" {
26
26
27/** The public API declaration. */
27/** The public API declaration. */
28
28
29−#define YAML_DECLARE_STATIC
30−
31−#ifdef WIN32
29+#ifdef _WIN32
32# if defined(YAML_DECLARE_STATIC)
30# if defined(YAML_DECLARE_STATIC)
33# define YAML_DECLARE(type) type
31# define YAML_DECLARE(type) type
34# elif defined(YAML_DECLARE_EXPORT)
32# elif defined(YAML_DECLARE_EXPORT)
libyaml/yaml_private.h+7−2
@@ -113,6 +113,11 @@ yaml_string_join(
113
113
114#define STRING(string,length) { (string), (string)+(length), (string) }
114#define STRING(string,length) { (string), (string)+(length), (string) }
115
115
116+#define STRING_ASSIGN(value,string,length) \
117+ ((value).start = (string), \
118+ (value).end = (string)+(length), \
119+ (value).pointer = (string))
120+
116#define STRING_INIT(context,string,size) \
121#define STRING_INIT(context,string,size) \
117 (((string).start = yaml_malloc(size)) ? \
122 (((string).start = yaml_malloc(size)) ? \
118 ((string).pointer = (string).start, \
123 ((string).pointer = (string).start, \
@@ -633,7 +638,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
633 (node).data.mapping.pairs.top = (node_pairs_start), \
638 (node).data.mapping.pairs.top = (node_pairs_start), \
634 (node).data.mapping.style = (node_style))
639 (node).data.mapping.style = (node_style))
635
640
636−#define YAML_VERSION_STRING "0.1.2"
641+#define YAML_VERSION_STRING "0.1.4"
637#define YAML_VERSION_MAJOR 0
642#define YAML_VERSION_MAJOR 0
638#define YAML_VERSION_MINOR 1
643#define YAML_VERSION_MINOR 1
639−#define YAML_VERSION_PATCH 2
644+#define YAML_VERSION_PATCH 4
yaml.cabal+1−1
@@ -1,5 +1,5 @@
1name: yaml
1name: yaml
2−version: 0.8.5.4
2+version: 0.8.6
3license: BSD3
3license: BSD3
4license-file: LICENSE
4license-file: LICENSE
5author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov
5author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov