Changeset 213 for libyaml/trunk/include/yaml.h
- Timestamp:
- 07/26/06 16:32:16 (7 years ago)
- File:
-
- 1 edited
-
libyaml/trunk/include/yaml.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libyaml/trunk/include/yaml.h
r212 r213 170 170 171 171 YAML_BLOCK_MAPPING_STYLE, 172 YAML_FLOW_MAPPING_STYLE ,173 YAML_FLOW_SET_MAPPING_STYLE 172 YAML_FLOW_MAPPING_STYLE 173 /* YAML_FLOW_SET_MAPPING_STYLE */ 174 174 } yaml_mapping_style_t; 175 175 … … 413 413 414 414 } yaml_event_t; 415 416 /** 417 * Create the STREAM-START event. 418 * 419 * @param[in] event An empty event object. 420 * 421 * @returns @c 1 if the function succeeded, @c 0 on error. 422 */ 423 424 YAML_DECLARE(int) 425 yaml_stream_start_event_initialize(yaml_event_t *event, 426 yaml_encoding_t encoding); 427 428 /** 429 * Create the STREAM-END event. 430 * 431 * @param[in] event An empty event object. 432 * 433 * @returns @c 1 if the function succeeded, @c 0 on error. 434 */ 435 436 YAML_DECLARE(int) 437 yaml_stream_end_event_initialize(yaml_event_t *event); 438 439 /** 440 * Create the DOCUMENT-START event. 441 * 442 * The @a implicit argument is considered as a stylistic parameter and may be 443 * ignored by the emitter. 444 * 445 * @param[in] event An empty event object. 446 * @param[in] version_directive The %YAML directive value or @c NULL. 447 * @param[in] tag_directives_start The beginning of the %TAG directives list. 448 * @param[in] tag_directives_end The end of the %TAG directives list. 449 * @param[in] implicit If the document start indicator is implicit. 450 * 451 * @returns @c 1 if the function succeeded, @c 0 on error. 452 */ 453 454 YAML_DECLARE(int) 455 yaml_document_start_event_initialize(yaml_event_t *event, 456 yaml_version_directive_t *version_directive, 457 yaml_tag_directive_t *tag_directives_start, 458 yaml_tag_directive_t *tag_directives_end, 459 int implicit); 460 461 /** 462 * Create the DOCUMENT-END event. 463 * 464 * The @a implicit argument is considered as a stylistic parameter and may be 465 * ignored by the emitter. 466 * 467 * @param[in] event An empty event object. 468 * @param[in] implicit If the document end indicator is implicit. 469 * 470 * @returns @c 1 if the function succeeded, @c 0 on error. 471 */ 472 473 YAML_DECLARE(int) 474 yaml_document_end_event_initialize(yaml_event_t *event, int implicit); 475 476 /** 477 * Create an ALIAS event. 478 * 479 * @param[in] event An empty event object. 480 * @param[in] anchor The anchor value. 481 * 482 * @returns @c 1 if the function succeeded, @c 0 on error. 483 */ 484 485 YAML_DECLARE(int) 486 yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor); 487 488 /** 489 * Create a SCALAR event. 490 * 491 * The @a style argument may be ignored by the emitter. 492 * 493 * Either the @a tag attribute or one of the @a plain_implicit and 494 * @a quoted_implicit flags must be set. 495 * 496 * @param[in] event An empty event object. 497 * @param[in] anchor The scalar anchor or @c NULL. 498 * @param[in] tag The scalar tag or @c NULL. 499 * @param[in] value The scalar value. 500 * @param[in] length The length of the scalar value. 501 * @param[in] plain_implicit If the tag may be omitted for the plain style. 502 * @param[in] quoted_implicit If the tag may be omitted for any non-plain style. 503 * @param[in] style The scalar style. 504 * 505 * @returns @c 1 if the function succeeded, @c 0 on error. 506 */ 507 508 YAML_DECLARE(int) 509 yaml_scalar_event_initialize(yaml_event_t *event, 510 yaml_char_t *anchor, yaml_char_t *tag, 511 yaml_char_t *value, size_t length, 512 int plain_implicit, int quoted_implicit, 513 yaml_scalar_style_t style); 514 515 /** 516 * Create a SEQUENCE-START event. 517 * 518 * The @a style argument may be ignored by the emitter. 519 * 520 * Either the @a tag attribute or the @a implicit flag must be set. 521 * 522 * @param[in] event An empty event object. 523 * @param[in] anchor The sequence anchor or @c NULL. 524 * @param[in] tag The sequence tag or @c NULL. 525 * @param[in] implicit If the tag may be omitted. 526 * @param[in] style The sequence style. 527 * 528 * @returns @c 1 if the function succeeded, @c 0 on error. 529 */ 530 531 YAML_DECLARE(int) 532 yaml_sequence_start_event_initialize(yaml_event_t *event, 533 yaml_char_t *anchor, yaml_char_t *tag, int implicit, 534 yaml_sequence_style_t style); 535 536 /** 537 * Create a SEQUENCE-END event. 538 * 539 * @param[in] event An empty event object. 540 * 541 * @returns @c 1 if the function succeeded, @c 0 on error. 542 */ 543 544 YAML_DECLARE(int) 545 yaml_sequence_end_event_initialize(yaml_event_t *event); 546 547 /** 548 * Create a MAPPING-START event. 549 * 550 * The @a style argument may be ignored by the emitter. 551 * 552 * Either the @a tag attribute or the @a implicit flag must be set. 553 * 554 * @param[in] event An empty event object. 555 * @param[in] anchor The mapping anchor or @c NULL. 556 * @param[in] tag The mapping tag or @c NULL. 557 * @param[in] implicit If the tag may be omitted. 558 * @param[in] style The mapping style. 559 * 560 * @returns @c 1 if the function succeeded, @c 0 on error. 561 */ 562 563 YAML_DECLARE(int) 564 yaml_mapping_start_event_initialize(yaml_event_t *event, 565 yaml_char_t *anchor, yaml_char_t *tag, int implicit, 566 yaml_mapping_style_t style); 567 568 /** 569 * Create a MAPPING-END event. 570 * 571 * @param[in] event An empty event object. 572 * 573 * @returns @c 1 if the function succeeded, @c 0 on error. 574 */ 575 576 YAML_DECLARE(int) 577 yaml_mapping_end_event_initialize(yaml_event_t *event); 415 578 416 579 /** … … 871 1034 YAML_EMIT_BLOCK_MAPPING_KEY_STATE, 872 1035 YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE, 873 YAML_EMIT_BLOCK_MAPPING_VALUE_STATE 1036 YAML_EMIT_BLOCK_MAPPING_VALUE_STATE, 1037 YAML_EMIT_END_STATE 874 1038 } yaml_emitter_state_t; 875 1039 … … 996 1160 } events; 997 1161 998 /** The current event. */999 yaml_event_t event;1000 1001 1162 /** The stack of indentation levels. */ 1002 1163 struct { … … 1180 1341 * 1181 1342 * The event object may be generated using the @c yaml_parser_parse function. 1182 * The emitter will destroy the event object if the function succeeds. If the1183 * function fails, the application is responsible for destroing the event1184 * object.1343 * The emitter takes the responsibility for the event object and destroys its 1344 * content after it is emitted. The event object is destroyed even if the 1345 * function fails. 1185 1346 * 1186 1347 * @param[in] emitter An emitter object. … … 1192 1353 YAML_DECLARE(int) 1193 1354 yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event); 1194 1195 /**1196 * Emit the STREAM-START event.1197 *1198 * @param[in] emitter An emitter object.1199 * @param[in] encoding The stream encoding.1200 *1201 * @returns @c 1 if the function succeeded, @c 0 on error.1202 */1203 1204 YAML_DECLARE(int)1205 yaml_emitter_emit_stream_start(yaml_emitter_t *emitter,1206 yaml_encoding_t encoding);1207 1208 /**1209 * Emit the STREAM-END event.1210 *1211 * @param[in] emitter An emitter object.1212 *1213 * @returns @c 1 if the function succeeded, @c 0 on error.1214 */1215 1216 YAML_DECLARE(int)1217 yaml_emitter_emit_stream_end(yaml_emitter_t *emitter);1218 1219 /**1220 * Emit the DOCUMENT-START event.1221 *1222 * The @a implicit argument is considered as a stylistic parameter and may be1223 * ignored by the emitter.1224 *1225 * @param[in] emitter An emitter object.1226 * @param[in] version_directive The %YAML directive value or @c NULL.1227 * @param[in] tag_directives_start The beginning of the %TAG directives list.1228 * @param[in] tag_directives_end The end of the %TAG directives list.1229 * @param[in] implicit If the document start indicator is implicit.1230 *1231 * @returns @c 1 if the function succeeded, @c 0 on error.1232 */1233 1234 YAML_DECLARE(int)1235 yaml_emitter_emit_document_start(yaml_emitter_t *emitter,1236 yaml_version_directive_t *version_directive,1237 yaml_tag_directive_t *tag_directives_start,1238 yaml_tag_directive_t *tag_directives_end,1239 int implicit);1240 1241 /**1242 * Emit the DOCUMENT-END event.1243 *1244 * The @a implicit argument is considered as a stylistic parameter and may be1245 * ignored by the emitter.1246 *1247 * @param[in] emitter An emitter object.1248 * @param[in] implicit If the document end indicator is implicit.1249 *1250 * @returns @c 1 if the function succeeded, @c 0 on error.1251 */1252 1253 YAML_DECLARE(int)1254 yaml_emitter_emit_document_end(yaml_emitter_t *emitter, int implicit);1255 1256 /**1257 * Emit an ALIAS event.1258 *1259 * @param[in] emitter An emitter object.1260 * @param[in] anchor The anchor value.1261 *1262 * @returns @c 1 if the function succeeded, @c 0 on error.1263 */1264 1265 YAML_DECLARE(int)1266 yaml_emitter_emit_alias(yaml_emitter_t *emitter, yaml_char_t *anchor);1267 1268 /**1269 * Emit a SCALAR event.1270 *1271 * The @a style argument may be ignored by the emitter.1272 *1273 * Either the @a tag attribute or one of the @a plain_implicit and1274 * @a quoted_implicit flags must be set.1275 *1276 * @param[in] emitter An emitter object.1277 * @param[in] anchor The scalar anchor or @c NULL.1278 * @param[in] tag The scalar tag or @c NULL.1279 * @param[in] value The scalar value.1280 * @param[in] length The length of the scalar value.1281 * @param[in] plain_implicit If the tag may be omitted for the plain style.1282 * @param[in] quoted_implicit If the tag may be omitted for any non-plain style.1283 * @param[in] style The scalar style.1284 *1285 * @returns @c 1 if the function succeeded, @c 0 on error.1286 */1287 1288 YAML_DECLARE(int)1289 yaml_emitter_emit_scalar(yaml_emitter_t *emitter,1290 yaml_char_t *anchor, yaml_char_t *tag,1291 yaml_char_t *value, size_t length,1292 int plain_implicit, int quoted_implicit,1293 yaml_scalar_style_t style);1294 1295 /**1296 * Emit a SEQUENCE-START event.1297 *1298 * The @a style argument may be ignored by the emitter.1299 *1300 * Either the @a tag attribute or the @a implicit flag must be set.1301 *1302 * @param[in] emitter An emitter object.1303 * @param[in] anchor The sequence anchor or @c NULL.1304 * @param[in] tag The sequence tag or @c NULL.1305 * @param[in] implicit If the tag may be omitted.1306 * @param[in] style The sequence style.1307 *1308 * @returns @c 1 if the function succeeded, @c 0 on error.1309 */1310 1311 YAML_DECLARE(int)1312 yaml_emitter_emit_sequence_start(yaml_emitter_t *emitter,1313 yaml_char_t *anchor, yaml_char_t *tag, int implicit,1314 yaml_sequence_style_t style);1315 1316 /**1317 * Emit a SEQUENCE-END event.1318 *1319 * @param[in] emitter An emitter object.1320 *1321 * @returns @c 1 if the function succeeded, @c 0 on error.1322 */1323 1324 YAML_DECLARE(int)1325 yaml_emitter_emit_sequence_end(yaml_emitter_t *emitter);1326 1327 /**1328 * Emit a MAPPING-START event.1329 *1330 * The @a style argument may be ignored by the emitter.1331 *1332 * Either the @a tag attribute or the @a implicit flag must be set.1333 *1334 * @param[in] emitter An emitter object.1335 * @param[in] anchor The mapping anchor or @c NULL.1336 * @param[in] tag The mapping tag or @c NULL.1337 * @param[in] implicit If the tag may be omitted.1338 * @param[in] style The mapping style.1339 *1340 * @returns @c 1 if the function succeeded, @c 0 on error.1341 */1342 1343 YAML_DECLARE(int)1344 yaml_emitter_emit_mapping_start(yaml_emitter_t *emitter,1345 yaml_char_t *anchor, yaml_char_t *tag, int implicit,1346 yaml_mapping_style_t style);1347 1348 /**1349 * Emit a MAPPING-END event.1350 *1351 * @param[in] emitter An emitter object.1352 *1353 * @returns @c 1 if the function succeeded, @c 0 on error.1354 */1355 1356 YAML_DECLARE(int)1357 yaml_emitter_emit_mapping_end(yaml_emitter_t *emitter);1358 1355 1359 1356 /**
Note: See TracChangeset
for help on using the changeset viewer.
