Changeset 346 for libyaml/branches/stable/src/emitter.c
- Timestamp:
- 02/23/09 14:59:19 (4 years ago)
- File:
-
- 1 edited
-
libyaml/branches/stable/src/emitter.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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))
Note: See TracChangeset
for help on using the changeset viewer.
