Changeset 346
- Timestamp:
- 02/23/09 14:59:19 (4 years ago)
- Location:
- libyaml/branches/stable/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libyaml/branches/stable/src/api.c
r243 r346 1366 1366 yaml_error_type_t error; 1367 1367 } context; 1368 yaml_node_pair_t pair = { key, value }; 1368 1369 yaml_node_pair_t pair; 1369 1370 1370 1371 assert(document); /* Non-NULL document is required. */ … … 1379 1380 /* Valid value id is required. */ 1380 1381 1382 pair.key = key; 1383 pair.value = value; 1384 1381 1385 if (!PUSH(&context, 1382 1386 document->nodes.start[mapping-1].data.mapping.pairs, pair)) -
libyaml/branches/stable/src/emitter.c
r315 r346 1350 1350 yaml_tag_directive_t tag_directive) 1351 1351 { 1352 yaml_string_t handle = STRING(tag_directive.handle, 1353 strlen((char *)tag_directive.handle)); 1354 yaml_string_t prefix = STRING(tag_directive.prefix, 1355 strlen((char *)tag_directive.prefix)); 1352 yaml_string_t handle; 1353 yaml_string_t prefix; 1354 size_t handle_length; 1355 size_t prefix_length; 1356 1357 handle_length = strlen((char *)tag_directive.handle); 1358 prefix_length = strlen((char *)tag_directive.prefix); 1359 STRING_ASSIGN(handle, tag_directive.handle, handle_length); 1360 STRING_ASSIGN(prefix, tag_directive.prefix, prefix_length); 1356 1361 1357 1362 if (handle.start == handle.end) { … … 1396 1401 yaml_char_t *anchor, int alias) 1397 1402 { 1398 yaml_string_t string = STRING(anchor, strlen((char *)anchor)); 1403 size_t anchor_length; 1404 yaml_string_t string; 1405 1406 anchor_length = strlen((char *)anchor); 1407 STRING_ASSIGN(string, anchor, anchor_length); 1399 1408 1400 1409 if (string.start == string.end) { … … 1428 1437 yaml_char_t *tag) 1429 1438 { 1430 yaml_string_t string = STRING(tag, strlen((char *)tag)); 1439 size_t tag_length; 1440 yaml_string_t string; 1431 1441 yaml_tag_directive_t *tag_directive; 1442 1443 tag_length = strlen((char *)tag); 1444 STRING_ASSIGN(string, tag, tag_length); 1432 1445 1433 1446 if (string.start == string.end) { … … 1467 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 1484 int block_indicators = 0; … … 1485 1498 int previous_space = 0; 1486 1499 int previous_break = 0; 1500 1501 STRING_ASSIGN(string, value, length); 1487 1502 1488 1503 emitter->scalar_data.value = value; … … 1773 1788 int is_whitespace, int is_indention) 1774 1789 { 1775 yaml_string_t string = STRING((yaml_char_t *)indicator, strlen(indicator)); 1790 size_t indicator_length; 1791 yaml_string_t string; 1792 1793 indicator_length = strlen(indicator); 1794 STRING_ASSIGN(string, (yaml_char_t *)indicator, indicator_length); 1776 1795 1777 1796 if (need_whitespace && !emitter->whitespace) { … … 1794 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 1818 while (string.pointer != string.end) { … … 1810 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 1835 if (!emitter->whitespace) { … … 1831 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 1857 if (need_whitespace && !emitter->whitespace) { … … 1877 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 1902 int spaces = 0; 1881 1903 int breaks = 0; 1904 1905 STRING_ASSIGN(string, value, length); 1882 1906 1883 1907 if (!emitter->whitespace) { … … 1935 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 1962 int spaces = 0; 1939 1963 int breaks = 0; 1964 1965 STRING_ASSIGN(string, value, length); 1940 1966 1941 1967 if (!yaml_emitter_write_indicator(emitter, "'", 1, 0, 0)) … … 1996 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 2025 int spaces = 0; 2026 2027 STRING_ASSIGN(string, value, length); 2000 2028 2001 2029 if (!yaml_emitter_write_indicator(emitter, "\"", 1, 0, 0)) … … 2208 2236 yaml_char_t *value, size_t length) 2209 2237 { 2210 yaml_string_t string = STRING(value, length);2238 yaml_string_t string; 2211 2239 int breaks = 1; 2240 2241 STRING_ASSIGN(string, value, length); 2212 2242 2213 2243 if (!yaml_emitter_write_indicator(emitter, "|", 1, 0, 0)) … … 2245 2275 yaml_char_t *value, size_t length) 2246 2276 { 2247 yaml_string_t string = STRING(value, length);2277 yaml_string_t string; 2248 2278 int breaks = 1; 2249 2279 int leading_spaces = 1; 2280 2281 STRING_ASSIGN(string, value, length); 2250 2282 2251 2283 if (!yaml_emitter_write_indicator(emitter, ">", 1, 0, 0)) -
libyaml/branches/stable/src/loader.c
r243 r346 226 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 229 yaml_alias_data_t *alias_data; 230 230 231 231 if (!anchor) return 1; 232 232 233 data.anchor = anchor; 234 data.index = index; 233 235 data.mark = parser->document->nodes.start[index-1].start_mark; 234 236 -
libyaml/branches/stable/src/parser.c
r273 r346 1281 1281 1282 1282 else if (token->type == YAML_TAG_DIRECTIVE_TOKEN) { 1283 yaml_tag_directive_t value = {1284 token->data.tag_directive.handle,1285 token->data.tag_directive.prefix1286 }; 1283 yaml_tag_directive_t value; 1284 value.handle = token->data.tag_directive.handle; 1285 value.prefix = token->data.tag_directive.prefix; 1286 1287 1287 if (!yaml_parser_append_tag_directive(parser, value, 0, 1288 1288 token->start_mark)) -
libyaml/branches/stable/src/scanner.c
r273 r346 1119 1119 if (parser->simple_key_allowed) 1120 1120 { 1121 yaml_simple_key_t simple_key = { 1, required, 1122 parser->tokens_parsed + parser->tokens.tail - parser->tokens.head, 1123 { 0, 0, 0 } }; 1121 yaml_simple_key_t simple_key; 1122 simple_key.possible = 1; 1123 simple_key.required = required; 1124 simple_key.token_number = 1125 parser->tokens_parsed + parser->tokens.tail - parser->tokens.head; 1124 1126 simple_key.mark = parser->mark; 1125 1127 -
libyaml/branches/stable/src/yaml_private.h
r243 r346 113 113 114 114 #define STRING(string,length) { (string), (string)+(length), (string) } 115 116 #define STRING_ASSIGN(value,string,length) \ 117 ((value).start = (string), \ 118 (value).end = (string)+(length), \ 119 (value).pointer = (string)) 115 120 116 121 #define STRING_INIT(context,string,size) \
Note: See TracChangeset
for help on using the changeset viewer.
