Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 55 lines (44 sloc) 1.524 kb
511dc44 initial import
Laurent Sansonetti authored
1 /**********************************************************************
2
3 version.c -
4
5 $Author: akr $
6 created at: Thu Sep 30 20:08:01 JST 1993
7
8 Copyright (C) 1993-2007 Yukihiro Matsumoto
9
10 **********************************************************************/
11
12 #include "ruby/ruby.h"
13 #include "version.h"
14 #include <stdio.h>
15
16 #define PRINT(type) puts(ruby_##type)
17 #define MKSTR(type) rb_obj_freeze(rb_str_new(ruby_##type, sizeof(ruby_##type)-1))
18
19 const int ruby_version_code = RUBY_VERSION_CODE;
20 const char ruby_version[] = RUBY_VERSION;
21 const char ruby_release_date[] = RUBY_RELEASE_DATE;
22 const char ruby_platform[] = RUBY_PLATFORM;
23 const int ruby_patchlevel = RUBY_PATCHLEVEL;
24 const char ruby_description[] = RUBY_DESCRIPTION;
25 const char ruby_copyright[] = RUBY_COPYRIGHT;
26
27 void
28 Init_version(void)
29 {
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));
26d8594 framework/universal build work, still in progress
Laurent Sansonetti authored
37 #if WITH_OBJC
38 rb_define_global_const("MACRUBY_VERSION", rb_float_new(MACRUBY_VERSION));
39 #endif
511dc44 initial import
Laurent Sansonetti authored
40 }
41
42 void
43 ruby_show_version(void)
44 {
45 PRINT(description);
46 fflush(stdout);
47 }
48
49 void
50 ruby_show_copyright(void)
51 {
52 PRINT(copyright);
53 exit(0);
54 }
Something went wrong with that request. Please try again.