2000-05-01 09:42:38 +00:00
|
|
|
/**********************************************************************
|
1998-01-16 12:13:05 +00:00
|
|
|
|
|
|
|
version.c -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
$Date$
|
|
|
|
created at: Thu Sep 30 20:08:01 JST 1993
|
|
|
|
|
2003-01-16 07:34:03 +00:00
|
|
|
Copyright (C) 1993-2003 Yukihiro Matsumoto
|
1998-01-16 12:13:05 +00:00
|
|
|
|
2000-05-01 09:42:38 +00:00
|
|
|
**********************************************************************/
|
1998-01-16 12:13:05 +00:00
|
|
|
|
|
|
|
#include "ruby.h"
|
|
|
|
#include "version.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
Init_version()
|
|
|
|
{
|
2001-10-29 05:07:26 +00:00
|
|
|
VALUE v = rb_obj_freeze(rb_str_new2(RUBY_VERSION));
|
|
|
|
VALUE d = rb_obj_freeze(rb_str_new2(RUBY_RELEASE_DATE));
|
|
|
|
VALUE p = rb_obj_freeze(rb_str_new2(RUBY_PLATFORM));
|
1999-08-13 05:45:20 +00:00
|
|
|
|
|
|
|
rb_define_global_const("RUBY_VERSION", v);
|
|
|
|
rb_define_global_const("RUBY_RELEASE_DATE", d);
|
|
|
|
rb_define_global_const("RUBY_PLATFORM", p);
|
|
|
|
|
|
|
|
/* obsolete constants */
|
|
|
|
rb_define_global_const("VERSION", v);
|
|
|
|
rb_define_global_const("RELEASE_DATE", d);
|
|
|
|
rb_define_global_const("PLATFORM", p);
|
1998-01-16 12:13:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-20 04:59:39 +00:00
|
|
|
ruby_show_version()
|
1998-01-16 12:13:05 +00:00
|
|
|
{
|
1999-08-13 05:45:20 +00:00
|
|
|
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
|
1998-01-16 12:13:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-20 04:59:39 +00:00
|
|
|
ruby_show_copyright()
|
1998-01-16 12:13:05 +00:00
|
|
|
{
|
2003-01-16 07:34:03 +00:00
|
|
|
printf("ruby - Copyright (C) 1993-2003 Yukihiro Matsumoto\n");
|
1998-01-16 12:13:05 +00:00
|
|
|
exit(0);
|
|
|
|
}
|