Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

version.c

Go to the documentation of this file.
00001 /**********************************************************************
00002 
00003   version.c -
00004 
00005   $Author: nobu $
00006   $Date: 2004/04/23 14:26:20 $
00007   created at: Thu Sep 30 20:08:01 JST 1993
00008 
00009   Copyright (C) 1993-2003 Yukihiro Matsumoto
00010 
00011 **********************************************************************/
00012 
00013 #include "ruby.h"
00014 #include "version.h"
00015 #include <stdio.h>
00016 
00017 const char ruby_version[] = RUBY_VERSION;
00018 const char ruby_release_date[] = RUBY_RELEASE_DATE;
00019 const char ruby_platform[] = RUBY_PLATFORM;
00020 
00021 void
00022 Init_version()
00023 {
00024     VALUE v = rb_obj_freeze(rb_str_new2(ruby_version));
00025     VALUE d = rb_obj_freeze(rb_str_new2(ruby_release_date));
00026     VALUE p = rb_obj_freeze(rb_str_new2(ruby_platform));
00027 
00028     rb_define_global_const("RUBY_VERSION", v);
00029     rb_define_global_const("RUBY_RELEASE_DATE", d);
00030     rb_define_global_const("RUBY_PLATFORM", p);
00031 
00032     /* obsolete constants */
00033     rb_define_global_const("VERSION", v);
00034     rb_define_global_const("RELEASE_DATE", d);
00035     rb_define_global_const("PLATFORM", p);
00036 }
00037 
00038 void
00039 ruby_show_version()
00040 {
00041     printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
00042 }
00043 
00044 void
00045 ruby_show_copyright()
00046 {
00047     printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR);
00048     exit(0);
00049 }
00050 

Generated on Sat Jan 22 14:29:56 2005 for Ruby by doxygen1.2.18