Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
dumper.c File Reference
`#include "yaml_private.h"`
Include dependency graph for dumper.c:

Go to the source code of this file.

## Macros
#define | ANCHOR_TEMPLATE "id%03d"
#define | ANCHOR_TEMPLATE_LENGTH 16

## Functions
| yaml_emitter_open (yaml_emitter_t *emitter)
| Start a YAML stream. More...
| yaml_emitter_close (yaml_emitter_t *emitter)
| Finish a YAML stream. More...
| yaml_emitter_dump (yaml_emitter_t *emitter, yaml_document_t *document)
| Emit a YAML document. More...
static void | yaml_emitter_delete_document_and_anchors (yaml_emitter_t *emitter)
static void | yaml_emitter_anchor_node (yaml_emitter_t *emitter, int index)
static yaml_char_t * | yaml_emitter_generate_anchor (yaml_emitter_t *emitter, int anchor_id)
static int | yaml_emitter_dump_node (yaml_emitter_t *emitter, int index)
static int | yaml_emitter_dump_alias (yaml_emitter_t *emitter, yaml_char_t *anchor)
static int | yaml_emitter_dump_scalar (yaml_emitter_t *emitter, yaml_node_t *node, yaml_char_t *anchor)
static int | yaml_emitter_dump_sequence (yaml_emitter_t *emitter, yaml_node_t *node, yaml_char_t *anchor)
static int | yaml_emitter_dump_mapping (yaml_emitter_t *emitter, yaml_node_t *node, yaml_char_t *anchor)

## Macro Definition Documentation

#define ANCHOR_TEMPLATE "id%03d"

Definition at line 244 of file dumper.c.

Referenced by yaml_emitter_generate_anchor().

#define ANCHOR_TEMPLATE_LENGTH 16

Definition at line 245 of file dumper.c.

Referenced by yaml_emitter_generate_anchor().

## Function Documentation

static void yaml_emitter_anchor_node | ( | yaml_emitter_t * | emitter,
|  | int | index
| ) |  |
| static

Definition at line 207 of file dumper.c.

References yaml_emitter_s::anchor, yaml_emitter_s::anchors, yaml_node_s::data, yaml_emitter_s::document, yaml_node_pair_s::key, yaml_emitter_s::last_anchor_id, yaml_node_s::mapping, yaml_document_s::nodes, yaml_emitter_s::references, yaml_node_s::sequence, yaml_document_s::start, yaml_node_s::type, yaml_node_pair_s::value, YAML_MAPPING_NODE, and YAML_SEQUENCE_NODE.

Referenced by yaml_emitter_dump().

static void yaml_emitter_delete_document_and_anchors | ( | yaml_emitter_t * | emitter) |  |
| static

Definition at line 167 of file dumper.c.

References yaml_emitter_s::anchors, yaml_node_s::data, yaml_emitter_s::document, yaml_emitter_s::last_anchor_id, yaml_node_s::mapping, yaml_document_s::nodes, NULL, yaml_node_s::scalar, yaml_node_s::sequence, yaml_emitter_s::serialized, STACK_DEL, yaml_document_s::start, yaml_node_s::tag, yaml_document_s::top, yaml_node_s::type, yaml_document_delete(), yaml_free(), YAML_MAPPING_NODE, YAML_SCALAR_NODE, and YAML_SEQUENCE_NODE.

Referenced by yaml_emitter_dump().

static int yaml_emitter_dump_alias | ( | yaml_emitter_t * | emitter,
|  | yaml_char_t * | anchor
| ) |  |
| static

Definition at line 301 of file dumper.c.

References ALIAS_EVENT_INIT, mark(), and yaml_emitter_emit().

Referenced by yaml_emitter_dump_node().

static int yaml_emitter_dump_mapping | ( | yaml_emitter_t * | emitter,
|  | yaml_node_t * | node,
|  | yaml_char_t * | anchor
| ) |  |
| static

Definition at line 369 of file dumper.c.

References yaml_node_s::data, yaml_node_pair_s::key, yaml_node_s::mapping, MAPPING_END_EVENT_INIT, MAPPING_START_EVENT_INIT, mark(), yaml_node_s::tag, yaml_node_pair_s::value, YAML_DEFAULT_MAPPING_TAG, yaml_emitter_dump_node(), and yaml_emitter_emit().

Referenced by yaml_emitter_dump_node().

static int yaml_emitter_dump_node | ( | yaml_emitter_t * | emitter,
|  | int | index
| ) |  |
| static

Definition at line 264 of file dumper.c.

References yaml_emitter_s::anchor, yaml_emitter_s::anchors, assert, yaml_emitter_s::document, yaml_document_s::nodes, NULL, yaml_emitter_s::serialized, yaml_document_s::start, yaml_node_s::type, yaml_emitter_dump_alias(), yaml_emitter_dump_mapping(), yaml_emitter_dump_scalar(), yaml_emitter_dump_sequence(), yaml_emitter_generate_anchor(), YAML_MAPPING_NODE, YAML_SCALAR_NODE, and YAML_SEQUENCE_NODE.

Referenced by yaml_emitter_dump(), yaml_emitter_dump_mapping(), and yaml_emitter_dump_sequence().

static int yaml_emitter_dump_scalar | ( | yaml_emitter_t * | emitter,
|  | yaml_node_t * | node,
|  | yaml_char_t * | anchor
| ) |  |
| static

Definition at line 316 of file dumper.c.

References yaml_node_s::data, mark(), yaml_node_s::scalar, SCALAR_EVENT_INIT, yaml_node_s::tag, YAML_DEFAULT_SCALAR_TAG, and yaml_emitter_emit().

Referenced by yaml_emitter_dump_node().

static int yaml_emitter_dump_sequence | ( | yaml_emitter_t * | emitter,
|  | yaml_node_t * | node,
|  | yaml_char_t * | anchor
| ) |  |
| static

Definition at line 339 of file dumper.c.

References yaml_node_s::data, mark(), yaml_node_s::sequence, SEQUENCE_END_EVENT_INIT, SEQUENCE_START_EVENT_INIT, yaml_node_s::tag, YAML_DEFAULT_SEQUENCE_TAG, yaml_emitter_dump_node(), and yaml_emitter_emit().

Referenced by yaml_emitter_dump_node().

static yaml_char_t * yaml_emitter_generate_anchor | ( | yaml_emitter_t * | emitter,
|  | int | anchor_id
| ) |  |
| static

Definition at line 248 of file dumper.c.

References ANCHOR_TEMPLATE, ANCHOR_TEMPLATE_LENGTH, NULL, and yaml_malloc().

Referenced by yaml_emitter_dump_node().