Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# ext/psych/psych.c

Go to the documentation of this file.

    00001 #include <psych.h>
    00002
    00003 /* call-seq: Psych.libyaml_version
    00004  *
    00005  * Returns the version of libyaml being used
    00006  */
    00007 static VALUE libyaml_version(VALUE module)
    00008 {
    00009     int major, minor, patch;
    00010     VALUE list[3];
    00011
    00012     yaml_get_version(&major, &minor, &patch);
    00013
    00014     list[0] = INT2NUM((long)major);
    00015     list[1] = INT2NUM((long)minor);
    00016     list[2] = INT2NUM((long)patch);
    00017
    00018     return rb_ary_new4((long)3, list);
    00019 }
    00020
    00021 VALUE mPsych;
    00022
    00023 void Init_psych()
    00024 {
    00025     mPsych = rb_define_module("Psych");
    00026
    00027     rb_define_singleton_method(mPsych, "libyaml_version", libyaml_version, 0);
    00028
    00029     Init_psych_parser();
    00030     Init_psych_emitter();
    00031     Init_psych_to_ruby();
    00032     Init_psych_yaml_tree();
    00033 }
    00034 /* vim: set noet sws=4 sw=4: */
    00035