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: 2005/05/12 00:54:36 $
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     fflush(stdout);
00043 }
00044 
00045 void
00046 ruby_show_copyright()
00047 {
00048     printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR);
00049     exit(0);
00050 }
00051 

Generated on Wed Jan 18 23:32:08 2006 for Ruby by doxygen 1.3.5