2000-05-01 13:42:38 +04:00
|
|
|
/**********************************************************************
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
version.c -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
$Date$
|
|
|
|
created at: Thu Sep 30 20:08:01 JST 1993
|
|
|
|
|
2002-01-11 12:18:54 +03:00
|
|
|
Copyright (C) 1993-2002 Yukihiro Matsumoto
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2000-05-01 13:42:38 +04:00
|
|
|
**********************************************************************/
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
#include "ruby.h"
|
|
|
|
#include "version.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
Init_version()
|
|
|
|
{
|
2001-10-29 08:07:26 +03: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 09:45:20 +04: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 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-20 07:59:39 +03:00
|
|
|
ruby_show_version()
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
1999-08-13 09:45:20 +04:00
|
|
|
printf("ruby %s (%s) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PLATFORM);
|
1998-01-16 15:13:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-01-20 07:59:39 +03:00
|
|
|
ruby_show_copyright()
|
1998-01-16 15:13:05 +03:00
|
|
|
{
|
2002-01-11 12:18:54 +03:00
|
|
|
printf("ruby - Copyright (C) 1993-2002 Yukihiro Matsumoto\n");
|
1998-01-16 15:13:05 +03:00
|
|
|
exit(0);
|
|
|
|
}
|