15 static int writer(
void *ctx,
unsigned char *buffer,
size_t size)
59 if (
rb_scan_args(argc, argv,
"11", &io, &options) == 2) {
89 emit(emitter, &event);
108 emit(emitter, &event);
142 #ifdef HAVE_RUBY_ENCODING_H
164 #ifdef HAVE_RUBY_ENCODING_H
184 emit(emitter, &event);
186 if(head)
xfree(head);
205 emit(emitter, &event);
228 #ifdef HAVE_RUBY_ENCODING_H
235 #ifdef HAVE_RUBY_ENCODING_H
262 emit(emitter, &event);
284 #ifdef HAVE_RUBY_ENCODING_H
308 emit(emitter, &event);
327 emit(emitter, &event);
348 #ifdef HAVE_RUBY_ENCODING_H
353 #ifdef HAVE_RUBY_ENCODING_H
375 emit(emitter, &event);
394 emit(emitter, &event);
411 #ifdef HAVE_RUBY_ENCODING_H
423 emit(emitter, &event);
static VALUE alias(VALUE self, VALUE anchor)
yaml_stream_end_event_initialize(yaml_event_t *event)
Create the STREAM-END event.
VALUE rb_ary_entry(VALUE ary, long offset)
static VALUE start_sequence(VALUE self, VALUE anchor, VALUE tag, VALUE implicit, VALUE style)
int canonical
If the output is in the canonical style?
enum yaml_encoding_e yaml_encoding_t
The stream encoding.
static VALUE set_indentation(VALUE self, VALUE level)
enum yaml_sequence_style_e yaml_sequence_style_t
Sequence styles.
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.
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
yaml_emitter_set_output(yaml_emitter_t *emitter, yaml_write_handler_t *handler, void *data)
Set a generic output handler.
static VALUE allocate(VALUE klass)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
void rb_raise(VALUE exc, const char *fmt,...)
unsigned char yaml_char_t
The character type (UTF-8 octet).
static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
The version directive data.
static void emit(yaml_emitter_t *emitter, yaml_event_t *event)
yaml_char_t * prefix
The tag prefix.
yaml_stream_start_event_initialize(yaml_event_t *event, yaml_encoding_t encoding)
Create the STREAM-START event.
yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor)
Create an ALIAS event.
rb_encoding * rb_utf8_encoding(void)
yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event)
Emit an event.
static void dealloc(void *ptr)
static VALUE set_line_width(VALUE self, VALUE width)
#define StringValuePtr(v)
static VALUE canonical(VALUE self)
int major
The major version number.
static VALUE start_stream(VALUE self, VALUE encoding)
enum yaml_scalar_style_e yaml_scalar_style_t
Scalar styles.
static VALUE end_stream(VALUE self)
yaml_sequence_end_event_initialize(yaml_event_t *event)
Create a SEQUENCE-END event.
static VALUE end_sequence(VALUE self)
static VALUE end_mapping(VALUE self)
static VALUE set_canonical(VALUE self, VALUE style)
static VALUE scalar(VALUE self, VALUE value, VALUE anchor, VALUE tag, VALUE plain, VALUE quoted, VALUE style)
static VALUE indentation(VALUE self)
VALUE rb_str_export_to_enc(VALUE, rb_encoding *)
yaml_char_t * handle
The tag handle.
yaml_document_end_event_initialize(yaml_event_t *event, int implicit)
Create the DOCUMENT-END event.
yaml_emitter_set_width(yaml_emitter_t *emitter, int width)
Set the preferred line width.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical)
Set if the output should be in the "canonical" format as in the YAML specification.
static int options(unsigned char *cp)
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.
yaml_emitter_set_unicode(yaml_emitter_t *emitter, int unicode)
Set if unescaped non-ASCII characters are allowed.
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.
static VALUE initialize(int argc, VALUE *argv, VALUE self)
int best_indent
The number of indentation spaces.
RUBY_EXTERN VALUE rb_cObject
int minor
The minor version number.
static VALUE start_mapping(VALUE self, VALUE anchor, VALUE tag, VALUE implicit, VALUE style)
#define Data_Get_Struct(obj, type, sval)
VALUE rb_str_new(const char *, long)
yaml_mapping_end_event_initialize(yaml_event_t *event)
Create a MAPPING-END event.
static VALUE end_document(VALUE self, VALUE imp)
static int writer(void *ctx, unsigned char *buffer, size_t size)
int best_width
The preferred width of the output lines.
yaml_emitter_set_indent(yaml_emitter_t *emitter, int indent)
Set the intendation increment.
enum yaml_mapping_style_e yaml_mapping_style_t
Mapping styles.
static VALUE line_width(VALUE self)
static void version(void)
const char * problem
Error description.
#define Data_Wrap_Struct(klass, mark, free, sval)
void Init_psych_emitter()
VALUE rb_define_module(const char *name)
yaml_emitter_initialize(yaml_emitter_t *emitter)
Initialize an emitter.
yaml_emitter_delete(yaml_emitter_t *emitter)
Destroy an emitter.
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
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.