Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Typedefs | Enumerations | Functions
Events

## Data Structures
struct | yaml_event_s
| The event structure. More...

## Typedefs
typedef enum yaml_event_type_e | yaml_event_type_t
| Event types. More...
typedef struct yaml_event_s | yaml_event_t
| The event structure. More...

## Enumerations
enum | yaml_event_type_e { YAML_NO_EVENT, YAML_STREAM_START_EVENT, YAML_STREAM_END_EVENT, YAML_DOCUMENT_START_EVENT, YAML_DOCUMENT_END_EVENT, YAML_ALIAS_EVENT, YAML_SCALAR_EVENT, YAML_SEQUENCE_START_EVENT, YAML_SEQUENCE_END_EVENT, YAML_MAPPING_START_EVENT, YAML_MAPPING_END_EVENT }
| Event types. More...

## Functions
| yaml_stream_start_event_initialize (yaml_event_t *event, yaml_encoding_t encoding)
| Create the STREAM-START event. More...
| yaml_stream_end_event_initialize (yaml_event_t *event)
| Create the STREAM-END event. More...
| yaml_document_start_event_initialize (yaml_event_t *event, yaml_version_directive_t *version_directive, yaml_tag_directive_t *tag_directives_start, yaml_tag_directive_t *tag_directives_end, int implicit)
| Create the DOCUMENT-START event. More...
| yaml_document_end_event_initialize (yaml_event_t *event, int implicit)
| Create the DOCUMENT-END event. More...
| yaml_alias_event_initialize (yaml_event_t *event, yaml_char_t *anchor)
| Create an ALIAS event. More...
| yaml_scalar_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, yaml_char_t *value, int length, int plain_implicit, int quoted_implicit, yaml_scalar_style_t style)
| Create a SCALAR event. More...
| yaml_sequence_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_sequence_style_t style)
| Create a SEQUENCE-START event. More...
| yaml_sequence_end_event_initialize (yaml_event_t *event)
| Create a SEQUENCE-END event. More...
| yaml_mapping_start_event_initialize (yaml_event_t *event, yaml_char_t *anchor, yaml_char_t *tag, int implicit, yaml_mapping_style_t style)
| Create a MAPPING-START event. More...
| yaml_mapping_end_event_initialize (yaml_event_t *event)
| Create a MAPPING-END event. More...
| yaml_event_delete (yaml_event_t *event)
| Free any memory allocated for an event object. More...

## Detailed Description

## Typedef Documentation

typedef struct yaml_event_s yaml_event_t

The event structure.

typedef enum yaml_event_type_e yaml_event_type_t

Event types.

## Enumeration Type Documentation

enum yaml_event_type_e

Event types.

Enumerator
YAML_NO_EVENT | An empty event.
YAML_STREAM_START_EVENT | A STREAM-START event.
YAML_STREAM_END_EVENT | A STREAM-END event.
YAML_DOCUMENT_START_EVENT | A DOCUMENT-START event.
YAML_DOCUMENT_END_EVENT | A DOCUMENT-END event.
YAML_ALIAS_EVENT | An ALIAS event.
YAML_SCALAR_EVENT | A SCALAR event.
YAML_SEQUENCE_START_EVENT | A SEQUENCE-START event.
YAML_SEQUENCE_END_EVENT | A SEQUENCE-END event.
YAML_MAPPING_START_EVENT | A MAPPING-START event.
YAML_MAPPING_END_EVENT | A MAPPING-END event.

Definition at line 353 of file yaml.h.

## Function Documentation

yaml_alias_event_initialize | ( | yaml_event_t * | event,
|  | yaml_char_t * | anchor
| ) |  |

Create an ALIAS event.

Parameters

  [out] | event | An empty event object.
  [in] | anchor | The anchor value.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 791 of file api.c.

References ALIAS_EVENT_INIT, assert, mark(), NULL, strlen(), yaml_check_utf8(), and yaml_strdup().

Referenced by alias().

yaml_document_end_event_initialize | ( | yaml_event_t * | event,
|  | int | implicit
| ) |  |

Create the DOCUMENT-END event.

The implicit argument is considered as a stylistic parameter and may be ignored by the emitter.

Parameters

  [out] | event | An empty event object.
  [in] | implicit | If the document end indicator is implicit.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 775 of file api.c.

References assert, DOCUMENT_END_EVENT_INIT, and mark().

Referenced by end_document().

yaml_document_start_event_initialize | ( | yaml_event_t * | event,
|  | yaml_version_directive_t * | version_directive,
|  | yaml_tag_directive_t * | tag_directives_start,
|  | yaml_tag_directive_t * | tag_directives_end,
|  | int | implicit
| ) |  |

Create the DOCUMENT-START event.

The implicit argument is considered as a stylistic parameter and may be ignored by the emitter.

Parameters

  [out] | event | An empty event object.
  [in] | version_directive | The YAML directive value or `NULL`.
  [in] | tag_directives_start | The beginning of the TAG directives list.
  [in] | tag_directives_end | The end of the TAG directives list.
  [in] | implicit | If the document start indicator is implicit.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 696 of file api.c.

References assert, DOCUMENT_START_EVENT_INIT, end, yaml_tag_directive_s::handle, INITIAL_STACK_SIZE, yaml_version_directive_s::major, mark(), yaml_version_directive_s::minor, NULL, POP, yaml_tag_directive_s::prefix, PUSH, STACK_DEL, STACK_EMPTY, STACK_INIT, strlen(), top, value, yaml_check_utf8(), yaml_free(), yaml_malloc(), and yaml_strdup().

Referenced by start_document().

yaml_event_delete | ( | yaml_event_t * | event | ) |

Free any memory allocated for an event object.

Parameters

  [in,out] | event | An event object.

Definition at line 979 of file api.c.

References assert, yaml_tag_directive_s::handle, memset(), yaml_tag_directive_s::prefix, YAML_ALIAS_EVENT, YAML_DOCUMENT_START_EVENT, yaml_free(), YAML_MAPPING_START_EVENT, YAML_SCALAR_EVENT, and YAML_SEQUENCE_START_EVENT.

Referenced by parse(), yaml_emitter_delete(), and yaml_emitter_emit().

yaml_mapping_end_event_initialize | ( | yaml_event_t * | event | ) |

Create a MAPPING-END event.

Parameters

  [out] | event | An empty event object.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 963 of file api.c.

References assert, MAPPING_END_EVENT_INIT, and mark().

Referenced by end_mapping().

yaml_mapping_start_event_initialize | ( | yaml_event_t * | event,
|  | yaml_char_t * | anchor,
|  | yaml_char_t * | tag,
|  | int | implicit,
|  | yaml_mapping_style_t | style
| ) |  |

Create a MAPPING-START event.

The style argument may be ignored by the emitter.

Either the tag attribute or the implicit flag must be set.

Parameters

  [out] | event | An empty event object.
  [in] | anchor | The mapping anchor or `NULL`.
  [in] | tag | The mapping tag or `NULL`.
  [in] | implicit | If the tag may be omitted.
  [in] | style | The mapping style.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 924 of file api.c.

References assert, MAPPING_START_EVENT_INIT, mark(), NULL, strlen(), yaml_check_utf8(), yaml_free(), and yaml_strdup().

Referenced by start_mapping().

yaml_scalar_event_initialize | ( | yaml_event_t * | event,
|  | yaml_char_t * | anchor,
|  | yaml_char_t * | tag,
|  | yaml_char_t * | value,
|  | int | length,
|  | int | plain_implicit,
|  | int | quoted_implicit,
|  | yaml_scalar_style_t | style
| ) |  |

Create a SCALAR event.

The style argument may be ignored by the emitter.

Either the tag attribute or one of the plain_implicit and quoted_implicit flags must be set.

Parameters

  [out] | event | An empty event object.
  [in] | anchor | The scalar anchor or `NULL`.
  [in] | tag | The scalar tag or `NULL`.
  [in] | value | The scalar value.
  [in] | length | The length of the scalar value.
  [in] | plain_implicit | If the tag may be omitted for the plain style.
  [in] | quoted_implicit | If the tag may be omitted for any non-plain style.
  [in] | style | The scalar style.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 815 of file api.c.

References assert, length, mark(), memcpy(), NULL, SCALAR_EVENT_INIT, strlen(), yaml_check_utf8(), yaml_free(), yaml_malloc(), and yaml_strdup().

Referenced by scalar().

yaml_sequence_end_event_initialize | ( | yaml_event_t * | event | ) |

Create a SEQUENCE-END event.

Parameters

  [out] | event | An empty event object.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 908 of file api.c.

References assert, mark(), and SEQUENCE_END_EVENT_INIT.

Referenced by end_sequence().

yaml_sequence_start_event_initialize | ( | yaml_event_t * | event,
|  | yaml_char_t * | anchor,
|  | yaml_char_t * | tag,
|  | int | implicit,
|  | yaml_sequence_style_t | style
| ) |  |

Create a SEQUENCE-START event.

The style argument may be ignored by the emitter.

Either the tag attribute or the implicit flag must be set.

Parameters

  [out] | event | An empty event object.
  [in] | anchor | The sequence anchor or `NULL`.
  [in] | tag | The sequence tag or `NULL`.
  [in] | implicit | If the tag may be omitted.
  [in] | style | The sequence style.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 869 of file api.c.

References assert, mark(), NULL, SEQUENCE_START_EVENT_INIT, strlen(), yaml_check_utf8(), yaml_free(), and yaml_strdup().

Referenced by start_sequence().

yaml_stream_end_event_initialize | ( | yaml_event_t * | event | ) |

Create the STREAM-END event.

Parameters

  [out] | event | An empty event object.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 680 of file api.c.

References assert, mark(), and STREAM_END_EVENT_INIT.

Referenced by end_stream().

yaml_stream_start_event_initialize | ( | yaml_event_t * | event,
|  | yaml_encoding_t | encoding
| ) |  |

Create the STREAM-START event.

Parameters

  [out] | event | An empty event object.
  [in] | encoding | The stream encoding.

Returns
  `1` if the function succeeded, `0` on error.

Definition at line 663 of file api.c.

References assert, mark(), and STREAM_START_EVENT_INIT.

Referenced by start_stream().