* transcode_data.h (rb_transcoder): add resetstate_func field for
[ruby-svn.git] / version.c
blob3a1d1fc3ffd3bb17482f1914a45eda96cf0cf7c8
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;
26 void
27 Init_version(void)
29 rb_define_global_const("RUBY_VERSION", MKSTR(version));
30 rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
31 rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
32 rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
33 rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
34 rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
35 rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
38 void
39 ruby_show_version(void)
41 PRINT(description);
42 fflush(stdout);
45 void
46 ruby_show_copyright(void)
48 PRINT(copyright);
49 exit(0);