23#define PRINT(type) puts(ruby_##type)
24#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
25#define MKINT(name) INT2FIX(ruby_##name)
33 STRINGIZE(RUBY_VERSION_MAJOR) "." \
34 STRINGIZE(RUBY_VERSION_MINOR) "." \
35 STRINGIZE(RUBY_VERSION_TEENY) ""
36#ifndef RUBY_FULL_REVISION
37# define RUBY_FULL_REVISION RUBY_REVISION
40const char ruby_revision[] = RUBY_FULL_REVISION;
45static const char ruby_description_with_mjit[] = RUBY_DESCRIPTION_WITH(
" +MJIT");
46static const char ruby_description_with_yjit[] = RUBY_DESCRIPTION_WITH(
" +YJIT");
56 VALUE ruby_engine_name;
96#define MJIT_OPTS_ON mjit_opts.on
102Init_ruby_description(
void)
107 description = MKSTR(description_with_mjit);
109 else if (rb_yjit_enabled_p()) {
110 description = MKSTR(description_with_yjit);
113 description = MKSTR(description);
126 PRINT(description_with_mjit);
128 else if (rb_yjit_enabled_p()) {
129 PRINT(description_with_yjit);
135#ifdef RUBY_LAST_COMMIT_TITLE
136 fputs(
"last_commit=" RUBY_LAST_COMMIT_TITLE, stdout);
138#ifdef HAVE_MALLOC_CONF
139 if (malloc_conf) printf(
"malloc_conf=%s\n", malloc_conf);
void ruby_set_script_name(VALUE name)
Identical to ruby_script(), except it takes the name as a Ruby String instance.
const char ruby_description[]
This is what ruby -v prints to the standard error.
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
void ruby_show_version(void)
Prints the version information of the CRuby interpreter to stdout.
void rb_provide(const char *feature)
Declares that the given feature is already provided by someone else.
void rb_define_global_const(const char *name, VALUE val)
Identical to rb_define_const(), except it defines that of "global", i.e.
const int ruby_api_version[3]
API versions, in { major, minor, teeny } order.
const char ruby_engine[]
This is just "ruby" for us.
#define RUBY_API_VERSION_TEENY
Teeny version.
const char ruby_platform[]
Target platform identifier, in a C string.
const char ruby_version[]
Stringised version.
#define RUBY_API_VERSION_MAJOR
Major version.
#define RUBY_API_VERSION_MINOR
Minor version.
const char ruby_copyright[]
Copyright notice.
const char ruby_release_date[]
Date of release, in a C string.
const int ruby_patchlevel
This is a monotonic increasing integer that describes specific "patch" level.