ext/psych/yaml/emitter.c File Reference

#include "yaml_private.h"

Go to the source code of this file.

Defines

#define FLUSH(emitter)
#define PUT(emitter, value)
#define PUT_BREAK(emitter)
#define WRITE(emitter, string)
#define WRITE_BREAK(emitter, string)

Functions

 yaml_emitter_emit (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_set_emitter_error (yaml_emitter_t *emitter, const char *problem)
static int yaml_emitter_need_more_events (yaml_emitter_t *emitter)
static int yaml_emitter_append_tag_directive (yaml_emitter_t *emitter, yaml_tag_directive_t value, int allow_duplicates)
static int yaml_emitter_increase_indent (yaml_emitter_t *emitter, int flow, int indentless)
static int yaml_emitter_state_machine (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_stream_start (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_document_start (yaml_emitter_t *emitter, yaml_event_t *event, int first)
static int yaml_emitter_emit_document_content (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_document_end (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_flow_sequence_item (yaml_emitter_t *emitter, yaml_event_t *event, int first)
static int yaml_emitter_emit_flow_mapping_key (yaml_emitter_t *emitter, yaml_event_t *event, int first)
static int yaml_emitter_emit_flow_mapping_value (yaml_emitter_t *emitter, yaml_event_t *event, int simple)
static int yaml_emitter_emit_block_sequence_item (yaml_emitter_t *emitter, yaml_event_t *event, int first)
static int yaml_emitter_emit_block_mapping_key (yaml_emitter_t *emitter, yaml_event_t *event, int first)
static int yaml_emitter_emit_block_mapping_value (yaml_emitter_t *emitter, yaml_event_t *event, int simple)
static int yaml_emitter_emit_node (yaml_emitter_t *emitter, yaml_event_t *event, int root, int sequence, int mapping, int simple_key)
static int yaml_emitter_emit_alias (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_scalar (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_sequence_start (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_emit_mapping_start (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_check_empty_document (yaml_emitter_t *emitter)
static int yaml_emitter_check_empty_sequence (yaml_emitter_t *emitter)
static int yaml_emitter_check_empty_mapping (yaml_emitter_t *emitter)
static int yaml_emitter_check_simple_key (yaml_emitter_t *emitter)
static int yaml_emitter_select_scalar_style (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_process_anchor (yaml_emitter_t *emitter)
static int yaml_emitter_process_tag (yaml_emitter_t *emitter)
static int yaml_emitter_process_scalar (yaml_emitter_t *emitter)
static int yaml_emitter_analyze_version_directive (yaml_emitter_t *emitter, yaml_version_directive_t version_directive)
static int yaml_emitter_analyze_tag_directive (yaml_emitter_t *emitter, yaml_tag_directive_t tag_directive)
static int yaml_emitter_analyze_anchor (yaml_emitter_t *emitter, yaml_char_t *anchor, int alias)
static int yaml_emitter_analyze_tag (yaml_emitter_t *emitter, yaml_char_t *tag)
static int yaml_emitter_analyze_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length)
static int yaml_emitter_analyze_event (yaml_emitter_t *emitter, yaml_event_t *event)
static int yaml_emitter_write_bom (yaml_emitter_t *emitter)
static int yaml_emitter_write_indent (yaml_emitter_t *emitter)
static int yaml_emitter_write_indicator (yaml_emitter_t *emitter, const char *indicator, int need_whitespace, int is_whitespace, int is_indention)
static int yaml_emitter_write_anchor (yaml_emitter_t *emitter, yaml_char_t *value, size_t length)
static int yaml_emitter_write_tag_handle (yaml_emitter_t *emitter, yaml_char_t *value, size_t length)
static int yaml_emitter_write_tag_content (yaml_emitter_t *emitter, yaml_char_t *value, size_t length, int need_whitespace)
static int yaml_emitter_write_plain_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length, int allow_breaks)
static int yaml_emitter_write_single_quoted_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length, int allow_breaks)
static int yaml_emitter_write_double_quoted_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length, int allow_breaks)
static int yaml_emitter_write_block_scalar_hints (yaml_emitter_t *emitter, yaml_string_t string)
static int yaml_emitter_write_literal_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length)
static int yaml_emitter_write_folded_scalar (yaml_emitter_t *emitter, yaml_char_t *value, size_t length)


Define Documentation

#define FLUSH ( emitter   ) 

Value:

((emitter->buffer.pointer+5 < emitter->buffer.end)                          \
     || yaml_emitter_flush(emitter))

Definition at line 8 of file emitter.c.

Referenced by BSD_vfprintf(), and yaml_emitter_write_bom().

#define PUT ( emitter,
value   ) 

Value:

(FLUSH(emitter)                                                             \
     && (*(emitter->buffer.pointer++) = (yaml_char_t)(value),                   \
         emitter->column ++,                                                    \
         1))

Definition at line 16 of file emitter.c.

Referenced by yaml_emitter_write_double_quoted_scalar(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), yaml_emitter_write_plain_scalar(), yaml_emitter_write_single_quoted_scalar(), yaml_emitter_write_tag_content(), and yaml_emitter_write_tag_handle().

#define PUT_BREAK ( emitter   ) 

Value:

(FLUSH(emitter)                                                             \
     && ((emitter->line_break == YAML_CR_BREAK ?                                \
             (*(emitter->buffer.pointer++) = (yaml_char_t) '\r') :              \
          emitter->line_break == YAML_LN_BREAK ?                                \
             (*(emitter->buffer.pointer++) = (yaml_char_t) '\n') :              \
          emitter->line_break == YAML_CRLN_BREAK ?                              \
             (*(emitter->buffer.pointer++) = (yaml_char_t) '\r',                \
              *(emitter->buffer.pointer++) = (yaml_char_t) '\n') : 0),          \
         emitter->column = 0,                                                   \
         emitter->line ++,                                                      \
         1))

Definition at line 26 of file emitter.c.

Referenced by yaml_emitter_write_folded_scalar(), yaml_emitter_write_indent(), yaml_emitter_write_literal_scalar(), yaml_emitter_write_plain_scalar(), and yaml_emitter_write_single_quoted_scalar().

#define WRITE ( emitter,
string   ) 

Value:

(FLUSH(emitter)                                                             \
     && (COPY(emitter->buffer,string),                                          \
         emitter->column ++,                                                    \
         1))

Definition at line 43 of file emitter.c.

Referenced by yaml_emitter_write_anchor(), yaml_emitter_write_double_quoted_scalar(), yaml_emitter_write_folded_scalar(), yaml_emitter_write_indicator(), yaml_emitter_write_literal_scalar(), yaml_emitter_write_plain_scalar(), yaml_emitter_write_single_quoted_scalar(), yaml_emitter_write_tag_content(), and yaml_emitter_write_tag_handle().

#define WRITE_BREAK ( emitter,
string   ) 

Value:

(FLUSH(emitter)                                                             \
     && (CHECK(string,'\n') ?                                                   \
         ((void)PUT_BREAK(emitter),                                             \
          string.pointer ++,                                                    \
          1) :                                                                  \
         (COPY(emitter->buffer,string),                                         \
          emitter->column = 0,                                                  \
          emitter->line ++,                                                     \
          1)))

Definition at line 53 of file emitter.c.

Referenced by yaml_emitter_write_folded_scalar(), yaml_emitter_write_literal_scalar(), yaml_emitter_write_plain_scalar(), and yaml_emitter_write_single_quoted_scalar().


Function Documentation

static int yaml_emitter_analyze_anchor ( yaml_emitter_t emitter,
yaml_char_t anchor,
int  alias 
) [static]

Definition at line 1400 of file emitter.c.

References yaml_emitter_s::alias, yaml_emitter_s::anchor, yaml_emitter_s::anchor_data, yaml_emitter_s::anchor_length, yaml_string_t::end, IS_ALPHA, MOVE, yaml_string_t::pointer, yaml_string_t::start, STRING_ASSIGN, strlen(), and yaml_emitter_set_emitter_error().

Referenced by yaml_emitter_analyze_event().

static int yaml_emitter_analyze_event ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1679 of file emitter.c.

References yaml_event_s::alias, yaml_emitter_s::anchor, yaml_emitter_s::anchor_data, yaml_emitter_s::anchor_length, yaml_emitter_s::canonical, yaml_event_s::data, yaml_emitter_s::handle, yaml_emitter_s::handle_length, yaml_emitter_s::length, yaml_event_s::mapping_start, NULL, yaml_event_s::scalar, yaml_emitter_s::scalar_data, yaml_event_s::sequence_start, yaml_emitter_s::suffix, yaml_emitter_s::suffix_length, yaml_emitter_s::tag_data, yaml_event_s::type, yaml_emitter_s::value, YAML_ALIAS_EVENT, yaml_emitter_analyze_anchor(), yaml_emitter_analyze_scalar(), yaml_emitter_analyze_tag(), YAML_MAPPING_START_EVENT, YAML_SCALAR_EVENT, and YAML_SEQUENCE_START_EVENT.

Referenced by yaml_emitter_emit().

static int yaml_emitter_analyze_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length 
) [static]

Definition at line 1479 of file emitter.c.

References yaml_emitter_s::block_allowed, yaml_emitter_s::block_plain_allowed, CHECK, CHECK_AT, yaml_string_t::end, yaml_emitter_s::flow_plain_allowed, IS_ASCII, IS_BLANKZ, IS_BLANKZ_AT, IS_BREAK, IS_PRINTABLE, IS_SPACE, yaml_emitter_s::length, MOVE, yaml_emitter_s::multiline, yaml_string_t::pointer, yaml_emitter_s::scalar_data, yaml_emitter_s::single_quoted_allowed, yaml_string_t::start, STRING_ASSIGN, yaml_emitter_s::unicode, yaml_emitter_s::value, and WIDTH.

Referenced by yaml_emitter_analyze_event().

static int yaml_emitter_analyze_tag ( yaml_emitter_t emitter,
yaml_char_t tag 
) [static]

Definition at line 1436 of file emitter.c.

References yaml_string_t::end, yaml_tag_directive_s::handle, yaml_emitter_s::handle, yaml_emitter_s::handle_length, yaml_tag_directive_s::prefix, yaml_emitter_s::start, yaml_string_t::start, STRING_ASSIGN, strlen(), yaml_emitter_s::suffix, yaml_emitter_s::suffix_length, yaml_emitter_s::tag_data, yaml_emitter_s::tag_directives, yaml_emitter_s::top, and yaml_emitter_set_emitter_error().

Referenced by yaml_emitter_analyze_event().

static int yaml_emitter_analyze_tag_directive ( yaml_emitter_t emitter,
yaml_tag_directive_t  tag_directive 
) [static]

Definition at line 1349 of file emitter.c.

References yaml_string_t::end, yaml_tag_directive_s::handle, IS_ALPHA, MOVE, yaml_string_t::pointer, yaml_tag_directive_s::prefix, yaml_string_t::start, STRING_ASSIGN, strlen(), and yaml_emitter_set_emitter_error().

Referenced by yaml_emitter_emit_document_start().

static int yaml_emitter_analyze_version_directive ( yaml_emitter_t emitter,
yaml_version_directive_t  version_directive 
) [static]

Definition at line 1333 of file emitter.c.

References yaml_version_directive_s::major, yaml_version_directive_s::minor, and yaml_emitter_set_emitter_error().

Referenced by yaml_emitter_emit_document_start().

static int yaml_emitter_append_tag_directive ( yaml_emitter_t emitter,
yaml_tag_directive_t  value,
int  allow_duplicates 
) [static]

Definition at line 364 of file emitter.c.

References yaml_emitter_s::error, yaml_tag_directive_s::handle, NULL, yaml_tag_directive_s::prefix, PUSH, yaml_emitter_s::start, yaml_emitter_s::tag_directives, yaml_emitter_s::top, yaml_emitter_set_emitter_error(), yaml_free(), YAML_MEMORY_ERROR, and yaml_strdup().

Referenced by yaml_emitter_emit_document_start().

static int yaml_emitter_check_empty_document ( yaml_emitter_t emitter  )  [static]

Definition at line 1090 of file emitter.c.

static int yaml_emitter_check_empty_mapping ( yaml_emitter_t emitter  )  [static]

Definition at line 1114 of file emitter.c.

References yaml_emitter_s::events, yaml_emitter_s::head, yaml_emitter_s::tail, yaml_event_s::type, YAML_MAPPING_END_EVENT, and YAML_MAPPING_START_EVENT.

Referenced by yaml_emitter_check_simple_key(), and yaml_emitter_emit_mapping_start().

static int yaml_emitter_check_empty_sequence ( yaml_emitter_t emitter  )  [static]

Definition at line 1100 of file emitter.c.

References yaml_emitter_s::events, yaml_emitter_s::head, yaml_emitter_s::tail, yaml_event_s::type, YAML_SEQUENCE_END_EVENT, and YAML_SEQUENCE_START_EVENT.

Referenced by yaml_emitter_check_simple_key(), and yaml_emitter_emit_sequence_start().

static int yaml_emitter_check_simple_key ( yaml_emitter_t emitter  )  [static]

Definition at line 1128 of file emitter.c.

References yaml_emitter_s::anchor_data, yaml_emitter_s::anchor_length, yaml_emitter_s::events, yaml_emitter_s::handle_length, yaml_emitter_s::head, yaml_emitter_s::length, yaml_emitter_s::multiline, yaml_emitter_s::scalar_data, yaml_emitter_s::suffix_length, yaml_emitter_s::tag_data, yaml_event_s::type, YAML_ALIAS_EVENT, yaml_emitter_check_empty_mapping(), yaml_emitter_check_empty_sequence(), YAML_MAPPING_START_EVENT, YAML_SCALAR_EVENT, and YAML_SEQUENCE_START_EVENT.

Referenced by yaml_emitter_emit_block_mapping_key(), and yaml_emitter_emit_flow_mapping_key().

yaml_emitter_emit ( yaml_emitter_t emitter,
yaml_event_t event 
)

Definition at line 281 of file emitter.c.

References DEQUEUE, ENQUEUE, yaml_emitter_analyze_event(), yaml_emitter_need_more_events(), yaml_emitter_state_machine(), and yaml_event_delete().

Referenced by emit(), yaml_emitter_close(), yaml_emitter_dump(), yaml_emitter_dump_alias(), yaml_emitter_dump_mapping(), yaml_emitter_dump_scalar(), yaml_emitter_dump_sequence(), and yaml_emitter_open().

static int yaml_emitter_emit_alias ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1005 of file emitter.c.

References POP, yaml_emitter_s::state, yaml_emitter_s::states, and yaml_emitter_process_anchor().

Referenced by yaml_emitter_emit_node().

static int yaml_emitter_emit_block_mapping_key ( yaml_emitter_t emitter,
yaml_event_t event,
int  first 
) [static]

Definition at line 900 of file emitter.c.

References yaml_emitter_s::indent, yaml_emitter_s::indents, POP, PUSH, yaml_emitter_s::state, yaml_emitter_s::states, yaml_event_s::type, YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_BLOCK_MAPPING_VALUE_STATE, yaml_emitter_check_simple_key(), yaml_emitter_emit_node(), yaml_emitter_increase_indent(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), and YAML_MAPPING_END_EVENT.

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_block_mapping_value ( yaml_emitter_t emitter,
yaml_event_t event,
int  simple 
) [static]

Definition at line 945 of file emitter.c.

References PUSH, yaml_emitter_s::states, YAML_EMIT_BLOCK_MAPPING_KEY_STATE, yaml_emitter_emit_node(), yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_block_sequence_item ( yaml_emitter_t emitter,
yaml_event_t event,
int  first 
) [static]

Definition at line 866 of file emitter.c.

References yaml_emitter_s::indent, yaml_emitter_s::indention, yaml_emitter_s::indents, yaml_emitter_s::mapping_context, POP, PUSH, yaml_emitter_s::state, yaml_emitter_s::states, yaml_event_s::type, YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE, yaml_emitter_emit_node(), yaml_emitter_increase_indent(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), and YAML_SEQUENCE_END_EVENT.

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_document_content ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 677 of file emitter.c.

References PUSH, yaml_emitter_s::states, YAML_EMIT_DOCUMENT_END_STATE, and yaml_emitter_emit_node().

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_document_end ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 691 of file emitter.c.

References yaml_event_s::data, yaml_event_s::document_end, yaml_tag_directive_s::handle, POP, yaml_tag_directive_s::prefix, STACK_EMPTY, yaml_emitter_s::state, yaml_emitter_s::tag_directives, yaml_event_s::type, YAML_DOCUMENT_END_EVENT, YAML_EMIT_DOCUMENT_START_STATE, yaml_emitter_flush(), yaml_emitter_set_emitter_error(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), and yaml_free().

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_document_start ( yaml_emitter_t emitter,
yaml_event_t event,
int  first 
) [static]

Definition at line 551 of file emitter.c.

References yaml_emitter_s::canonical, yaml_event_s::data, yaml_event_s::document_start, yaml_tag_directive_s::handle, if(), NULL, yaml_emitter_s::open_ended, yaml_event_s::type, YAML_DOCUMENT_START_EVENT, yaml_emitter_analyze_tag_directive(), yaml_emitter_analyze_version_directive(), yaml_emitter_append_tag_directive(), yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_flow_mapping_key ( yaml_emitter_t emitter,
yaml_event_t event,
int  first 
) [static]

Definition at line 778 of file emitter.c.

References yaml_emitter_s::best_width, yaml_emitter_s::canonical, yaml_emitter_s::column, yaml_emitter_s::flow_level, yaml_emitter_s::indent, yaml_emitter_s::indents, POP, PUSH, yaml_emitter_s::state, yaml_emitter_s::states, yaml_event_s::type, YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_FLOW_MAPPING_VALUE_STATE, yaml_emitter_check_simple_key(), yaml_emitter_emit_node(), yaml_emitter_increase_indent(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), and YAML_MAPPING_END_EVENT.

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_flow_mapping_value ( yaml_emitter_t emitter,
yaml_event_t event,
int  simple 
) [static]

Definition at line 841 of file emitter.c.

References yaml_emitter_s::best_width, yaml_emitter_s::canonical, yaml_emitter_s::column, PUSH, yaml_emitter_s::states, YAML_EMIT_FLOW_MAPPING_KEY_STATE, yaml_emitter_emit_node(), yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_flow_sequence_item ( yaml_emitter_t emitter,
yaml_event_t event,
int  first 
) [static]

Definition at line 729 of file emitter.c.

References yaml_emitter_s::best_width, yaml_emitter_s::canonical, yaml_emitter_s::column, yaml_emitter_s::flow_level, yaml_emitter_s::indent, yaml_emitter_s::indents, POP, PUSH, yaml_emitter_s::state, yaml_emitter_s::states, yaml_event_s::type, YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE, yaml_emitter_emit_node(), yaml_emitter_increase_indent(), yaml_emitter_write_indent(), yaml_emitter_write_indicator(), and YAML_SEQUENCE_END_EVENT.

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_emit_mapping_start ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1066 of file emitter.c.

References yaml_emitter_s::canonical, yaml_event_s::data, yaml_emitter_s::flow_level, yaml_event_s::mapping_start, yaml_emitter_s::state, YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE, YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE, yaml_emitter_check_empty_mapping(), yaml_emitter_process_anchor(), yaml_emitter_process_tag(), and YAML_FLOW_MAPPING_STYLE.

Referenced by yaml_emitter_emit_node().

static int yaml_emitter_emit_node ( yaml_emitter_t emitter,
yaml_event_t event,
int  root,
int  sequence,
int  mapping,
int  simple_key 
) [static]

Definition at line 970 of file emitter.c.

References yaml_emitter_s::mapping_context, yaml_emitter_s::root_context, yaml_emitter_s::sequence_context, yaml_emitter_s::simple_key_context, yaml_event_s::type, YAML_ALIAS_EVENT, yaml_emitter_emit_alias(), yaml_emitter_emit_mapping_start(), yaml_emitter_emit_scalar(), yaml_emitter_emit_sequence_start(), yaml_emitter_set_emitter_error(), YAML_MAPPING_START_EVENT, YAML_SCALAR_EVENT, and YAML_SEQUENCE_START_EVENT.

Referenced by yaml_emitter_emit_block_mapping_key(), yaml_emitter_emit_block_mapping_value(), yaml_emitter_emit_block_sequence_item(), yaml_emitter_emit_document_content(), yaml_emitter_emit_flow_mapping_key(), yaml_emitter_emit_flow_mapping_value(), and yaml_emitter_emit_flow_sequence_item().

static int yaml_emitter_emit_scalar ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1019 of file emitter.c.

References yaml_emitter_s::indent, yaml_emitter_s::indents, POP, yaml_emitter_s::state, yaml_emitter_s::states, yaml_emitter_increase_indent(), yaml_emitter_process_anchor(), yaml_emitter_process_scalar(), yaml_emitter_process_tag(), and yaml_emitter_select_scalar_style().

Referenced by yaml_emitter_emit_node().

static int yaml_emitter_emit_sequence_start ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1042 of file emitter.c.

References yaml_emitter_s::canonical, yaml_event_s::data, yaml_emitter_s::flow_level, yaml_event_s::sequence_start, yaml_emitter_s::state, YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE, YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE, yaml_emitter_check_empty_sequence(), yaml_emitter_process_anchor(), yaml_emitter_process_tag(), and YAML_FLOW_SEQUENCE_STYLE.

Referenced by yaml_emitter_emit_node().

static int yaml_emitter_emit_stream_start ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 495 of file emitter.c.

References yaml_emitter_s::best_indent, yaml_emitter_s::best_width, yaml_emitter_s::column, yaml_event_s::data, yaml_emitter_s::encoding, yaml_emitter_s::indent, yaml_emitter_s::indention, yaml_emitter_s::line, yaml_emitter_s::line_break, yaml_emitter_s::state, yaml_event_s::stream_start, yaml_event_s::type, yaml_emitter_s::whitespace, YAML_EMIT_FIRST_DOCUMENT_START_STATE, yaml_emitter_set_emitter_error(), yaml_emitter_write_bom(), YAML_LN_BREAK, YAML_STREAM_START_EVENT, and YAML_UTF8_ENCODING.

Referenced by yaml_emitter_state_machine().

static int yaml_emitter_increase_indent ( yaml_emitter_t emitter,
int  flow,
int  indentless 
) [static]

Definition at line 403 of file emitter.c.

References yaml_emitter_s::best_indent, yaml_emitter_s::indent, yaml_emitter_s::indents, and PUSH.

Referenced by yaml_emitter_emit_block_mapping_key(), yaml_emitter_emit_block_sequence_item(), yaml_emitter_emit_flow_mapping_key(), yaml_emitter_emit_flow_sequence_item(), and yaml_emitter_emit_scalar().

static int yaml_emitter_need_more_events ( yaml_emitter_t emitter  )  [static]

Definition at line 309 of file emitter.c.

References yaml_emitter_s::events, yaml_emitter_s::head, level, QUEUE_EMPTY, yaml_emitter_s::tail, yaml_event_s::type, YAML_DOCUMENT_END_EVENT, YAML_DOCUMENT_START_EVENT, YAML_MAPPING_END_EVENT, YAML_MAPPING_START_EVENT, YAML_SEQUENCE_END_EVENT, YAML_SEQUENCE_START_EVENT, YAML_STREAM_END_EVENT, and YAML_STREAM_START_EVENT.

Referenced by yaml_emitter_emit().

static int yaml_emitter_process_anchor ( yaml_emitter_t emitter  )  [static]

Definition at line 1241 of file emitter.c.

References yaml_emitter_s::alias, yaml_emitter_s::anchor, yaml_emitter_s::anchor_data, yaml_emitter_s::anchor_length, yaml_emitter_write_anchor(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_emit_alias(), yaml_emitter_emit_mapping_start(), yaml_emitter_emit_scalar(), and yaml_emitter_emit_sequence_start().

static int yaml_emitter_process_scalar ( yaml_emitter_t emitter  )  [static]

Definition at line 1294 of file emitter.c.

References assert, yaml_emitter_s::length, yaml_emitter_s::scalar_data, yaml_emitter_s::simple_key_context, yaml_emitter_s::style, yaml_emitter_s::value, YAML_DOUBLE_QUOTED_SCALAR_STYLE, yaml_emitter_write_double_quoted_scalar(), yaml_emitter_write_folded_scalar(), yaml_emitter_write_literal_scalar(), yaml_emitter_write_plain_scalar(), yaml_emitter_write_single_quoted_scalar(), YAML_FOLDED_SCALAR_STYLE, YAML_LITERAL_SCALAR_STYLE, YAML_PLAIN_SCALAR_STYLE, and YAML_SINGLE_QUOTED_SCALAR_STYLE.

Referenced by yaml_emitter_emit_scalar().

static int yaml_emitter_process_tag ( yaml_emitter_t emitter  )  [static]

Definition at line 1259 of file emitter.c.

References yaml_emitter_s::handle, yaml_emitter_s::handle_length, yaml_emitter_s::suffix, yaml_emitter_s::suffix_length, yaml_emitter_s::tag_data, yaml_emitter_write_indicator(), yaml_emitter_write_tag_content(), and yaml_emitter_write_tag_handle().

Referenced by yaml_emitter_emit_mapping_start(), yaml_emitter_emit_scalar(), and yaml_emitter_emit_sequence_start().

static int yaml_emitter_select_scalar_style ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 1179 of file emitter.c.

References yaml_emitter_s::block_allowed, yaml_emitter_s::block_plain_allowed, yaml_emitter_s::canonical, yaml_event_s::data, yaml_emitter_s::flow_level, yaml_emitter_s::flow_plain_allowed, yaml_emitter_s::handle, yaml_emitter_s::handle_length, yaml_emitter_s::length, yaml_emitter_s::multiline, yaml_event_s::scalar, yaml_emitter_s::scalar_data, yaml_emitter_s::simple_key_context, yaml_emitter_s::single_quoted_allowed, yaml_emitter_s::style, yaml_emitter_s::suffix, yaml_emitter_s::tag_data, YAML_ANY_SCALAR_STYLE, YAML_DOUBLE_QUOTED_SCALAR_STYLE, yaml_emitter_set_emitter_error(), YAML_FOLDED_SCALAR_STYLE, YAML_LITERAL_SCALAR_STYLE, YAML_PLAIN_SCALAR_STYLE, and YAML_SINGLE_QUOTED_SCALAR_STYLE.

Referenced by yaml_emitter_emit_scalar().

static int yaml_emitter_set_emitter_error ( yaml_emitter_t emitter,
const char *  problem 
) [static]

Definition at line 268 of file emitter.c.

References YAML_EMITTER_ERROR.

Referenced by yaml_emitter_analyze_anchor(), yaml_emitter_analyze_tag(), yaml_emitter_analyze_tag_directive(), yaml_emitter_analyze_version_directive(), yaml_emitter_append_tag_directive(), yaml_emitter_emit_document_end(), yaml_emitter_emit_node(), yaml_emitter_emit_stream_start(), yaml_emitter_select_scalar_style(), and yaml_emitter_state_machine().

static int yaml_emitter_state_machine ( yaml_emitter_t emitter,
yaml_event_t event 
) [static]

Definition at line 424 of file emitter.c.

References assert, yaml_emitter_s::state, YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE, YAML_EMIT_BLOCK_MAPPING_KEY_STATE, YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_BLOCK_MAPPING_VALUE_STATE, YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE, YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE, YAML_EMIT_DOCUMENT_CONTENT_STATE, YAML_EMIT_DOCUMENT_END_STATE, YAML_EMIT_DOCUMENT_START_STATE, YAML_EMIT_END_STATE, YAML_EMIT_FIRST_DOCUMENT_START_STATE, YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE, YAML_EMIT_FLOW_MAPPING_KEY_STATE, YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE, YAML_EMIT_FLOW_MAPPING_VALUE_STATE, YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE, YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE, YAML_EMIT_STREAM_START_STATE, yaml_emitter_emit_block_mapping_key(), yaml_emitter_emit_block_mapping_value(), yaml_emitter_emit_block_sequence_item(), yaml_emitter_emit_document_content(), yaml_emitter_emit_document_end(), yaml_emitter_emit_document_start(), yaml_emitter_emit_flow_mapping_key(), yaml_emitter_emit_flow_mapping_value(), yaml_emitter_emit_flow_sequence_item(), yaml_emitter_emit_stream_start(), and yaml_emitter_set_emitter_error().

Referenced by yaml_emitter_emit().

static int yaml_emitter_write_anchor ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length 
) [static]

Definition at line 1812 of file emitter.c.

References yaml_string_t::end, yaml_emitter_s::indention, yaml_string_t::pointer, STRING_ASSIGN, yaml_emitter_s::whitespace, and WRITE.

Referenced by yaml_emitter_process_anchor().

static int yaml_emitter_write_block_scalar_hints ( yaml_emitter_t emitter,
yaml_string_t  string 
) [static]

Definition at line 2177 of file emitter.c.

References yaml_emitter_s::best_indent, yaml_string_t::end, if(), IS_BREAK, IS_SPACE, NULL, yaml_emitter_s::open_ended, yaml_string_t::pointer, yaml_string_t::start, and yaml_emitter_write_indicator().

Referenced by yaml_emitter_write_folded_scalar(), and yaml_emitter_write_literal_scalar().

static int yaml_emitter_write_bom ( yaml_emitter_t emitter  )  [static]

Definition at line 1754 of file emitter.c.

References yaml_emitter_s::buffer, and FLUSH.

Referenced by yaml_emitter_emit_stream_start().

static int yaml_emitter_write_double_quoted_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length,
int  allow_breaks 
) [static]

Definition at line 2021 of file emitter.c.

References yaml_emitter_s::best_width, CHECK, yaml_emitter_s::column, digit, yaml_string_t::end, if(), IS_ASCII, IS_BOM, IS_BREAK, IS_PRINTABLE, IS_SPACE, IS_SPACE_AT, MOVE, yaml_string_t::pointer, PUT, yaml_string_t::start, STRING_ASSIGN, yaml_emitter_s::unicode, WRITE, yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_process_scalar().

static int yaml_emitter_write_folded_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length 
) [static]

Definition at line 2274 of file emitter.c.

References yaml_emitter_s::best_width, CHECK, yaml_emitter_s::column, yaml_string_t::end, yaml_emitter_s::indention, IS_BLANK, IS_BLANKZ_AT, IS_BREAK, IS_BREAK_AT, IS_SPACE, IS_SPACE_AT, MOVE, yaml_string_t::pointer, PUT_BREAK, STRING_ASSIGN, yaml_emitter_s::whitespace, WIDTH_AT, WRITE, WRITE_BREAK, yaml_emitter_write_block_scalar_hints(), yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_process_scalar().

static int yaml_emitter_write_indent ( yaml_emitter_t emitter  )  [static]

Definition at line 1766 of file emitter.c.

References yaml_emitter_s::column, if(), yaml_emitter_s::indent, yaml_emitter_s::indention, PUT, PUT_BREAK, and yaml_emitter_s::whitespace.

Referenced by yaml_emitter_emit_block_mapping_key(), yaml_emitter_emit_block_mapping_value(), yaml_emitter_emit_block_sequence_item(), yaml_emitter_emit_document_end(), yaml_emitter_emit_document_start(), yaml_emitter_emit_flow_mapping_key(), yaml_emitter_emit_flow_mapping_value(), yaml_emitter_emit_flow_sequence_item(), yaml_emitter_write_double_quoted_scalar(), yaml_emitter_write_folded_scalar(), yaml_emitter_write_literal_scalar(), yaml_emitter_write_plain_scalar(), and yaml_emitter_write_single_quoted_scalar().

static int yaml_emitter_write_indicator ( yaml_emitter_t emitter,
const char *  indicator,
int  need_whitespace,
int  is_whitespace,
int  is_indention 
) [static]

Definition at line 1786 of file emitter.c.

References yaml_string_t::end, yaml_emitter_s::indention, yaml_emitter_s::open_ended, yaml_string_t::pointer, PUT, STRING_ASSIGN, strlen(), yaml_emitter_s::whitespace, and WRITE.

Referenced by yaml_emitter_emit_block_mapping_key(), yaml_emitter_emit_block_mapping_value(), yaml_emitter_emit_block_sequence_item(), yaml_emitter_emit_document_end(), yaml_emitter_emit_document_start(), yaml_emitter_emit_flow_mapping_key(), yaml_emitter_emit_flow_mapping_value(), yaml_emitter_emit_flow_sequence_item(), yaml_emitter_process_anchor(), yaml_emitter_process_tag(), yaml_emitter_write_block_scalar_hints(), yaml_emitter_write_double_quoted_scalar(), yaml_emitter_write_folded_scalar(), yaml_emitter_write_literal_scalar(), and yaml_emitter_write_single_quoted_scalar().

static int yaml_emitter_write_literal_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length 
) [static]

Definition at line 2235 of file emitter.c.

References yaml_string_t::end, yaml_emitter_s::indention, IS_BREAK, yaml_string_t::pointer, PUT_BREAK, STRING_ASSIGN, yaml_emitter_s::whitespace, WRITE, WRITE_BREAK, yaml_emitter_write_block_scalar_hints(), yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_process_scalar().

static int yaml_emitter_write_plain_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length,
int  allow_breaks 
) [static]

Definition at line 1898 of file emitter.c.

References yaml_emitter_s::best_width, CHECK, yaml_emitter_s::column, yaml_string_t::end, yaml_emitter_s::indention, IS_BREAK, IS_SPACE, IS_SPACE_AT, MOVE, yaml_emitter_s::open_ended, yaml_string_t::pointer, PUT, PUT_BREAK, yaml_emitter_s::root_context, STRING_ASSIGN, yaml_emitter_s::whitespace, WRITE, WRITE_BREAK, and yaml_emitter_write_indent().

Referenced by yaml_emitter_process_scalar().

static int yaml_emitter_write_single_quoted_scalar ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length,
int  allow_breaks 
) [static]

Definition at line 1958 of file emitter.c.

References yaml_emitter_s::best_width, CHECK, yaml_emitter_s::column, yaml_string_t::end, yaml_emitter_s::indention, IS_BREAK, IS_SPACE, IS_SPACE_AT, MOVE, yaml_string_t::pointer, PUT, PUT_BREAK, yaml_string_t::start, STRING_ASSIGN, yaml_emitter_s::whitespace, WRITE, WRITE_BREAK, yaml_emitter_write_indent(), and yaml_emitter_write_indicator().

Referenced by yaml_emitter_process_scalar().

static int yaml_emitter_write_tag_content ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length,
int  need_whitespace 
) [static]

Definition at line 1850 of file emitter.c.

References CHECK, yaml_string_t::end, yaml_emitter_s::indention, IS_ALPHA, yaml_string_t::pointer, PUT, STRING_ASSIGN, yaml_emitter_s::whitespace, WIDTH, and WRITE.

Referenced by yaml_emitter_process_tag().

static int yaml_emitter_write_tag_handle ( yaml_emitter_t emitter,
yaml_char_t value,
size_t  length 
) [static]

Definition at line 1829 of file emitter.c.

References yaml_string_t::end, yaml_emitter_s::indention, yaml_string_t::pointer, PUT, STRING_ASSIGN, yaml_emitter_s::whitespace, and WRITE.

Referenced by yaml_emitter_process_tag().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7