* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / version.c
blob53edf0257461e46dbbcfa06ec156f9c470f7755a
1 /**********************************************************************
3 version.c -
5 $Author$
6 created at: Thu Sep 30 20:08:01 JST 1993
8 Copyright (C) 1993-2007 Yukihiro Matsumoto
10 **********************************************************************/
12 #include "ruby/ruby.h"
13 #include "version.h"
14 #include <stdio.h>
16 #define PRINT(type) puts(ruby_##type)
17 #define MKSTR(type) rb_obj_freeze(rb_usascii_str_new(ruby_##type, sizeof(ruby_##type)-1))
19 const char ruby_version[] = RUBY_VERSION;
20 const char ruby_release_date[] = RUBY_RELEASE_DATE;
21 const char ruby_platform[] = RUBY_PLATFORM;
22 const int ruby_patchlevel = RUBY_PATCHLEVEL;
23 const char ruby_description[] = RUBY_DESCRIPTION;
24 const char ruby_copyright[] = RUBY_COPYRIGHT;
25 const char ruby_engine[] = "ruby";
27 void
28 Init_version(void)
30 rb_define_global_const("RUBY_VERSION", MKSTR(version));
31 rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
32 rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
33 rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
34 rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
35 rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
36 rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
37 rb_define_global_const("RUBY_ENGINE", MKSTR(engine));
40 void
41 ruby_show_version(void)
43 PRINT(description);
44 fflush(stdout);
47 void
48 ruby_show_copyright(void)
50 PRINT(copyright);
51 exit(0);