summaryrefslogtreecommitdiffstats
path: root/ext/tkutil
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-01-16 12:13:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-01-16 12:13:05 +0000
commit99d0354e89aefdb6373dbeb22506216b8790a0bd (patch)
treeb3c086e437cab449f90ba637710daed0ddfec4c4 /ext/tkutil
parent502e7547b5c274c51365d11fdfe0e69ee9aa5a52 (diff)
downloadruby-99d0354e89aefdb6373dbeb22506216b8790a0bd.tar.gz
ruby-99d0354e89aefdb6373dbeb22506216b8790a0bd.tar.xz
ruby-99d0354e89aefdb6373dbeb22506216b8790a0bd.zip
Initial revision
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tkutil')
-rw-r--r--ext/tkutil/MANIFEST3
-rw-r--r--ext/tkutil/depend1
-rw-r--r--ext/tkutil/tkutil.c46
3 files changed, 50 insertions, 0 deletions
diff --git a/ext/tkutil/MANIFEST b/ext/tkutil/MANIFEST
new file mode 100644
index 000000000..870e04b58
--- /dev/null
+++ b/ext/tkutil/MANIFEST
@@ -0,0 +1,3 @@
+MANIFEST
+tkutil.c
+depend
diff --git a/ext/tkutil/depend b/ext/tkutil/depend
new file mode 100644
index 000000000..ead83eda5
--- /dev/null
+++ b/ext/tkutil/depend
@@ -0,0 +1 @@
+tkutil.o: tkutil.c ../../ruby.h ../../config.h ../../defines.h
diff --git a/ext/tkutil/tkutil.c b/ext/tkutil/tkutil.c
new file mode 100644
index 000000000..540995eb8
--- /dev/null
+++ b/ext/tkutil/tkutil.c
@@ -0,0 +1,46 @@
+/************************************************
+
+ tk.c -
+
+ $Author$
+ $Date$
+ created at: Fri Nov 3 00:47:54 JST 1995
+
+************************************************/
+
+#include "ruby.h"
+
+static VALUE
+tk_eval_cmd(argc, argv)
+ int argc;
+ VALUE argv[];
+{
+ VALUE cmd, rest;
+
+ rb_scan_args(argc, argv, "1*", &cmd, &rest);
+ rb_eval_cmd(cmd, rest);
+ return Qnil;
+}
+
+static VALUE
+tk_s_new(argc, argv, class)
+ int argc;
+ VALUE *argv;
+ VALUE class;
+{
+ VALUE obj = obj_alloc(class);
+
+ rb_funcall2(obj, rb_intern("initialize"), argc, argv);
+ if (iterator_p()) rb_yield_0(obj, obj);
+ return obj;
+}
+
+Init_tkutil()
+{
+ VALUE mTK = rb_define_module("TkUtil");
+ VALUE cTK = rb_define_class("TkKernel", cObject);
+
+ rb_define_singleton_method(mTK, "eval_cmd", tk_eval_cmd, -1);
+
+ rb_define_singleton_method(cTK, "new", tk_s_new, -1);
+}