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
|
|
|
|
|
2003-01-16 10:34:03 +03:00
|
|
|
Copyright (C) 1993-2003 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>
|
|
|
|
|
2004-03-25 15:01:41 +03:00
|
|
|
const char ruby_version[] = RUBY_VERSION;
|
|
|
|
const char ruby_release_date[] = RUBY_RELEASE_DATE;
|
|
|
|
const char ruby_platform[] = RUBY_PLATFORM;
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
void
|
|
|
|
Init_version()
|
|
|
|
{
|
2004-03-25 15:01:41 +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);
|
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
|
|
|
{
|
2004-03-25 15:01:41 +03:00
|
|
|
printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR);
|
1998-01-16 15:13:05 +03:00
|
|
|
exit(0);
|
|
|
|
}
|