Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

psych.c
Go to the documentation of this file.
1 #include <psych.h>
2
3 /* call-seq: Psych.libyaml_version
4 *
5 * Returns the version of libyaml being used
6 */
7 static VALUE libyaml_version(VALUE module)
8 {
9 int major, minor, patch;
10 VALUE list[3];
11
12 yaml_get_version(&major, &minor, &patch);
13
14 list[0] = INT2NUM((long)major);
15 list[1] = INT2NUM((long)minor);
16 list[2] = INT2NUM((long)patch);
17
18 return rb_ary_new4((long)3, list);
19 }
20
21 VALUE mPsych;
22
23 void Init_psych(void)
24 {
25 mPsych = rb_define_module("Psych");
26
27 rb_define_singleton_method(mPsych, "libyaml_version", libyaml_version, 0);
28
29 Init_psych_parser();
30 Init_psych_emitter();
31 Init_psych_to_ruby();
32 Init_psych_yaml_tree();
33 }
34 /* vim: set noet sws=4 sw=4: */
Init_psych_yaml_tree
void Init_psych_yaml_tree(void)
Definition: psych_yaml_tree.c:15
VALUE
unsigned long VALUE
Definition: ruby.h:102
rb_define_module
VALUE rb_define_module(const char *name)
Definition: class.c:772
Init_psych_to_ruby
void Init_psych_to_ruby(void)
Definition: psych_to_ruby.c:27
rb_define_singleton_method
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
Definition: class.c:1755
INT2NUM
#define INT2NUM(x)
Definition: ruby.h:1609
major
#define major(dev)
Definition: rb_mjit_min_header-2.7.0.h:1436
psych.h
Init_psych_emitter
void Init_psych_emitter(void)
Definition: psych_emitter.c:522
Init_psych_parser
void Init_psych_parser(void)
Definition: psych_parser.c:537
list
struct rb_encoding_entry * list
Definition: encoding.c:56
rb_ary_new4
#define rb_ary_new4
Definition: intern.h:105
Init_psych
void Init_psych(void)
Definition: psych.c:23
minor
#define minor(dev)
Definition: rb_mjit_min_header-2.7.0.h:1437
mPsych
VALUE mPsych
Definition: psych.c:21