summaryrefslogtreecommitdiff
path: root/ext/tcltklib/tcltklib.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-23 04:17:03 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-23 04:17:03 +0000
commit13fde676feb8c1280f674cb7537fb680bb86eef7 (patch)
tree5ef382441ec9e73d90dfc93f84062bfe598dd98c /ext/tcltklib/tcltklib.c
parent7d6f48ccd22e93b6213514962a6ded168cad2966 (diff)
* ext/tcltklib/tcltklib.c: define TclTkLib::COMPILE_INFO and RELEASE_DATE
* ext/tcltklib/extconf.rb: ditto * ext/tk/lib/tkutil.c: define Tk::RELEASE_DATE * ext/tk/lib/tk.rb: define Tk::RELEASE_DATE git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib/tcltklib.c')
-rw-r--r--ext/tcltklib/tcltklib.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index a80b4530f1..6184d73880 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -4,8 +4,11 @@
* Oct. 24, 1997 Y. Matsumoto
*/
+#define TCLTKLIB_RELEASE_DATE "2004-12-23"
+
#include "ruby.h"
#include "rubysig.h"
+#include "version.h"
#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
#include <stdio.h>
#ifdef HAVE_STDARG_PROTOTYPES
@@ -64,6 +67,9 @@ fprintf(stderr, ARG1, ARG2); fprintf(stderr, "\n"); fflush(stderr); }
#define DUMP2(ARG1, ARG2)
*/
+/* release date */
+const char tcltklib_release_date[] = TCLTKLIB_RELEASE_DATE;
+
/*finalize_proc_name */
static char *finalize_hook_name = "INTERP_FINALIZE_HOOK";
@@ -6178,6 +6184,66 @@ _macinit()
}
#endif
+static VALUE
+tcltklib_compile_info()
+{
+ volatile VALUE ret;
+ int size;
+ char form[]
+ = "tcltklib %s :: Ruby%s (%s) %s pthread :: Tcl%s(%s)/Tk%s(%s) %s";
+ char *info;
+
+ size = strlen(form)
+ + strlen(TCLTKLIB_RELEASE_DATE)
+ + strlen(RUBY_VERSION)
+ + strlen(RUBY_RELEASE_DATE)
+ + strlen("without")
+ + strlen(TCL_PATCH_LEVEL)
+ + strlen("without stub")
+ + strlen(TK_PATCH_LEVEL)
+ + strlen("without stub")
+ + strlen("unknown tcl_threads");
+
+ info = ALLOC_N(char, size);
+
+ sprintf(info, form,
+ TCLTKLIB_RELEASE_DATE,
+ RUBY_VERSION, RUBY_RELEASE_DATE,
+#ifdef HAVE_NATIVETHREAD
+ "with",
+#else
+ "without",
+#endif
+ TCL_PATCH_LEVEL,
+#ifdef USE_TCL_STUBS
+ "with stub",
+#else
+ "without stub",
+#endif
+ TK_PATCH_LEVEL,
+#ifdef USE_TK_STUBS
+ "with stub",
+#else
+ "without stub",
+#endif
+#ifdef WITH_TCL_ENABLE_THREAD
+# if WITH_TCL_ENABLE_THREAD
+ "with tcl_threads"
+# else
+ "without tcl_threads"
+# endif
+#else
+ "unknown tcl_threads"
+#endif
+ );
+
+ ret = rb_obj_freeze(rb_str_new2(info));
+
+ free(info);
+
+ return ret;
+}
+
/*---- initialization ----*/
void
Init_tcltklib()
@@ -6211,6 +6277,11 @@ Init_tcltklib()
/* --------------------------------------------------------------- */
+ rb_define_const(lib, "COMPILE_INFO", tcltklib_compile_info());
+
+ rb_define_const(lib, "RELEASE_DATE",
+ rb_obj_freeze(rb_str_new2(tcltklib_release_date)));
+
rb_define_const(lib, "FINALIZE_PROC_NAME",
rb_str_new2(finalize_hook_name));