Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 57 lines (46 sloc) 1.631 kb
511dc44 initial import
Laurent Sansonetti authored
1 /**********************************************************************
2
3 version.c -
4
eee9d7b sync with ruby trunk r15665
Laurent Sansonetti authored
5 $Author: nobu $
511dc44 initial import
Laurent Sansonetti authored
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)
eee9d7b sync with ruby trunk r15665
Laurent Sansonetti authored
17 #define MKSTR(type) rb_obj_freeze(rb_usascii_str_new(ruby_##type, sizeof(ruby_##type)-1))
511dc44 initial import
Laurent Sansonetti authored
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;
a369be9 wip
Laurent Sansonetti authored
26 const char ruby_engine[] = RUBY_ENGINE;
511dc44 initial import
Laurent Sansonetti authored
27
28 void
29 Init_version(void)
30 {
31 rb_define_global_const("RUBY_VERSION", MKSTR(version));
32 rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
33 rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
34 rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
35 rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
36 rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
37 rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
a369be9 wip
Laurent Sansonetti authored
38 rb_define_global_const("RUBY_ENGINE", MKSTR(engine));
26d8594 framework/universal build work, still in progress
Laurent Sansonetti authored
39 #if WITH_OBJC
40 rb_define_global_const("MACRUBY_VERSION", rb_float_new(MACRUBY_VERSION));
41 #endif
511dc44 initial import
Laurent Sansonetti authored
42 }
43
44 void
45 ruby_show_version(void)
46 {
47 PRINT(description);
48 fflush(stdout);
49 }
50
51 void
52 ruby_show_copyright(void)
53 {
54 PRINT(copyright);
55 exit(0);
56 }
Something went wrong with that request. Please try again.