summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beos/ruby.def.in353
-rw-r--r--ext/Win32API/MANIFEST7
-rw-r--r--ext/Win32API/Win32API.c223
-rw-r--r--ext/Win32API/extconf.rb7
-rw-r--r--ext/Win32API/getch.rb5
-rw-r--r--ext/Win32API/point.rb18
6 files changed, 0 insertions, 613 deletions
diff --git a/beos/ruby.def.in b/beos/ruby.def.in
deleted file mode 100644
index 04de159208..0000000000
--- a/beos/ruby.def.in
+++ /dev/null
@@ -1,353 +0,0 @@
-ArgError
-Bug
-Error
-Error_Append
-Fail
-Fatal
-IndexError
-LoadError
-NameError
-Raise
-TypeError
-Warning
-any_to_s
-ary_assoc
-ary_concat
-ary_delete
-ary_delete_at
-ary_each
-ary_entry
-ary_freeze
-ary_includes
-ary_join
-ary_new
-ary_new2
-ary_new3
-ary_new4
-ary_plus
-ary_pop
-ary_push
-ary_rassoc
-ary_reverse
-ary_shift
-ary_sort
-ary_sort_bang
-ary_store
-ary_to_s
-ary_unshift
-assoc_new
-backref_get
-backref_set
-big2dbl
-big2str
-big_2comp
-big_and
-big_clone
-big_lshift
-big_minus
-big_mul
-big_norm
-big_or
-big_plus
-big_pow
-big_rand
-big_to_f
-big_to_i
-big_xor
-cArray
-cBignum
-cClass
-cData
-cFile
-cFixnum
-cFixnum
-cFloat
-cHash
-cIO
-cInteger
-cModule
-cNumeric
-cObject
-cProc
-cRegexp
-cString
-cStruct
-class_new
-class_new_instance
-data_object_alloc
-dbl2big
-dln_find_exe
-dln_find_file
-dln_load
-dyna_var_asgn
-dyna_var_defined
-dyna_var_ref
-eaccess
-enum_length
-eof_error
-exc_new
-exc_new2
-exc_new3
-f_autoload
-f_gets
-f_lambda
-f_load
-f_require
-file_open
-file_s_expand_path
-fix2str
-fix_to_s
-fix_upto
-flo_pow
-float_new
-gc_force_recycle
-gc_gc
-gc_mark
-gc_mark_frame
-gc_mark_global_tbl
-gc_mark_locations
-gc_mark_maybe
-gc_mark_threads
-gc_mark_trap_list
-gc_s_disable
-gc_s_enable
-hash_aref
-hash_aset
-hash_new
-id_attrset
-int2big
-int2inum
-io_binmode
-io_check_closed
-io_close
-io_fptr_finalize
-io_getc
-io_gets
-io_gets_method
-io_mode_flags
-io_readable
-io_reopen
-io_unbuffered
-io_ungetc
-io_writable
-io_write
-iterator_p
-lastline_get
-lastline_set
-local_var_append
-memclear
-mod_constants
-module_new
-new_idhash
-nodeline
-nodetype
-num2fix
-num2int
-num2long
-num_coerce_bin
-num_upto
-num_zerodiv
-obj_alloc
-obj_as_string
-obj_call_init
-obj_equal
-obj_is_instance_of
-obj_is_kind_of
-range_beg_end
-range_new
-rb_Array
-rb_Float
-rb_Integer
-rb_String
-rb_add_method
-rb_alias
-rb_alias_variable
-rb_apply
-rb_autoload
-rb_autoload_defined
-rb_backtrace
-rb_call_inits
-rb_check_safe_str
-rb_check_type
-rb_class2name
-rb_class_of
-rb_class_path
-rb_clear_cache
-rb_const_defined
-rb_const_defined_at
-rb_const_get
-rb_const_get_at
-rb_const_set
-rb_define_alias
-rb_define_attr
-rb_define_class
-rb_define_class_id
-rb_define_class_under
-rb_define_const
-rb_define_global_const
-rb_define_global_function
-rb_define_hooked_variable
-rb_define_method
-rb_define_method_id
-rb_define_module
-rb_define_module_function
-rb_define_module_id
-rb_define_module_under
-rb_define_private_method
-rb_define_readonly_variable
-rb_define_singleton_method
-rb_define_variable
-rb_define_virtual_variable
-rb_each
-rb_ensure
-rb_eql
-rb_equal
-rb_eval_cmd
-rb_eval_string
-rb_exit
-rb_extend_object
-rb_fatal
-rb_fdopen
-rb_fopen
-rb_frame_last_func
-rb_funcall
-rb_funcall2
-rb_get_kcode
-rb_global_entry
-rb_global_variable
-rb_gvar_defined
-rb_gvar_get
-rb_gvar_set
-rb_gvar_set2
-rb_hash
-rb_id2name
-rb_include_module
-rb_inspect
-rb_intern
-rb_interrupt
-rb_is_const_id
-rb_is_instance_id
-rb_iterate
-rb_iv_get
-rb_iv_set
-rb_ivar_defined
-rb_ivar_get
-rb_ivar_set
-rb_load_file
-rb_method_boundp
-rb_name_class
-rb_newobj
-rb_notimplement
-rb_path2class
-rb_proc_exec
-rb_provide
-rb_raise
-rb_rescue
-rb_respond_to
-rb_safe_level
-rb_scan_args
-rb_secure
-rb_set_class_path
-rb_set_kcode
-rb_set_safe_level
-rb_singleton_class
-rb_special_const_p
-rb_str_setter
-rb_sys_fail
-rb_syswait
-rb_test_false_or_nil
-rb_to_id
-rb_trap_eval
-rb_trap_exec
-rb_trap_exit
-rb_type
-rb_undef_method
-rb_yield
-rb_yield_0
-reg_free
-reg_last_match
-reg_match
-reg_match2
-reg_match_last
-reg_match_post
-reg_match_pre
-reg_new
-reg_nth_defined
-reg_nth_match
-reg_regcomp
-reg_regsub
-reg_search
-ruby_init
-ruby_options
-ruby_process_options
-ruby_prog_init
-ruby_run
-ruby_script
-ruby_set_argv
-scan_hex
-scan_oct
-show_copyright
-show_version
-singleton_class_clone
-singleton_class_new
-st_add_direct
-st_copy
-st_delete
-st_delete_safe
-st_find_or_add
-st_foreach
-st_free_table
-st_init_numtable
-st_init_strtable
-st_init_table
-st_init_table_with_size
-st_insert
-st_lookup
-str2inum
-str2cstr
-str_cat
-str_cicmp
-str_cmp
-str_dup
-str_freeze
-str_hash
-str_inspect
-str_modify
-str_new
-str_new2
-str_new3
-str_new4
-str_plus
-str_resize
-str_split
-str_substr
-str_taint
-str_tainted
-str_times
-str_upto
-struct_alloc
-struct_aref
-struct_aset
-struct_define
-struct_getmember
-struct_new
-thread_alone
-thread_create
-thread_fd_writable
-thread_interrupt
-thread_schedule
-thread_select
-thread_sleep
-thread_sleep_forever
-thread_wait_fd
-thread_wait_for
-time_new
-time_timeval
-uint2big
-uint2inum
-xcalloc
-xmalloc
-xrealloc
-eException
-eStandardError
-trap_immediate
diff --git a/ext/Win32API/MANIFEST b/ext/Win32API/MANIFEST
deleted file mode 100644
index 7cc9ac445e..0000000000
--- a/ext/Win32API/MANIFEST
+++ /dev/null
@@ -1,7 +0,0 @@
-MANIFEST
-depend
-MANIFEST
-Win32API.c
-extconf.rb
-getch.rb
-point.rb
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
deleted file mode 100644
index f4cb5c726f..0000000000
--- a/ext/Win32API/Win32API.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- Win32API - Ruby Win32 API Import Facility
-*/
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <stdio.h>
-
-#define _T_VOID 0
-#define _T_NUMBER 1
-#define _T_POINTER 2
-#define _T_INTEGER 3
-
-typedef char *ApiPointer(void);
-typedef long ApiNumber(void);
-typedef void ApiVoid(void);
-typedef int ApiInteger(void);
-
-#include "ruby.h"
-
-typedef struct {
- HANDLE dll;
- HANDLE proc;
- VALUE dllname;
- VALUE import;
- VALUE export;
-} Win32API;
-
-static void
-Win32API_FreeLibrary(hdll)
- HINSTANCE hdll;
-{
- FreeLibrary(hdll);
-}
-
-static VALUE
-Win32API_initialize(self, dllname, proc, import, export)
- VALUE self;
- VALUE dllname;
- VALUE proc;
- VALUE import;
- VALUE export;
-{
- HANDLE hproc;
- HINSTANCE hdll;
- VALUE str;
- VALUE a_import;
- VALUE *ptr;
- int i;
- int len;
- int ex;
-
- hdll = GetModuleHandle(RSTRING(dllname)->ptr);
- if (!hdll) {
- hdll = LoadLibrary(RSTRING(dllname)->ptr);
- if (!hdll)
- Fail("LoadLibrary: %s\n", RSTRING(dllname)->ptr);
- Data_Wrap_Struct(self, 0, Win32API_FreeLibrary, hdll);
- }
- hproc = GetProcAddress(hdll, RSTRING(proc)->ptr);
- if (!hproc) {
- str = str_new3(proc);
- str = str_cat(str, "A", 1);
- hproc = GetProcAddress(hdll, RSTRING(str)->ptr);
- if (!hproc)
- Fail("GetProcAddress: %s or %s\n",
- RSTRING(proc)->ptr, RSTRING(str)->ptr);
- }
- rb_iv_set(self, "__dll__", INT2NUM((int)hdll));
- rb_iv_set(self, "__dllname__", dllname);
- rb_iv_set(self, "__proc__", INT2NUM((int)hproc));
-
- a_import = ary_new();
- ptr = RARRAY(import)->ptr;
- for (i = 0, len = RARRAY(import)->len; i < len; i++) {
- int c = *(char *)RSTRING(ptr[i])->ptr;
- switch (c) {
- case 'N': case 'n': case 'L': case 'l':
- ary_push(a_import, INT2FIX(_T_NUMBER));
- break;
- case 'P': case 'p':
- ary_push(a_import, INT2FIX(_T_POINTER));
- break;
- case 'I': case 'i':
- ary_push(a_import, INT2FIX(_T_INTEGER));
- break;
- }
- }
- rb_iv_set(self, "__import__", a_import);
-
- switch (*RSTRING(export)->ptr) {
- case 'V': case 'v':
- ex = _T_VOID;
- break;
- case 'N': case 'n': case 'L': case 'l':
- ex = _T_NUMBER;
- break;
- case 'P': case 'p':
- ex = _T_POINTER;
- break;
- case 'I': case 'i':
- ex = _T_INTEGER;
- break;
- }
- rb_iv_set(self, "__export__", INT2FIX(ex));
-
- return Qnil;
-}
-
-static VALUE
-Win32API_Call(argc, argv, obj)
- VALUE argc;
- VALUE argv;
- VALUE obj;
-{
- VALUE args;
-
- FARPROC ApiFunction;
-
- ApiPointer *ApiFunctionPointer;
- ApiNumber *ApiFunctionNumber;
- ApiVoid *ApiFunctionVoid;
- ApiInteger *ApiFunctionInteger;
-
- long lParam;
- char *pParam;
-
- VALUE Return;
-
- VALUE obj_proc;
- VALUE obj_import;
- VALUE obj_export;
- VALUE import_type;
- int nimport, timport, texport, i;
- int items;
-
- items = rb_scan_args(argc, argv, "0*", &args);
-
- obj_proc = rb_iv_get(obj, "__proc__");
-
- ApiFunction = (FARPROC)NUM2INT(obj_proc);
-
- obj_import = rb_iv_get(obj, "__import__");
- obj_export = rb_iv_get(obj, "__export__");
- nimport = RARRAY(obj_import)->len;
- texport = FIX2INT(obj_export);
-
- if (items != nimport)
- Fail("Wrong number of parameters: expected %d, got %d.\n",
- nimport, items);
-
- if (0 < nimport) {
- for (i = nimport - 1; 0 <= i; i--) {
- VALUE str;
- import_type = ary_entry(obj_import, i);
- timport = FIX2INT(import_type);
- switch (timport) {
- case _T_NUMBER:
- case _T_INTEGER:
- lParam = NUM2INT(ary_entry(args, i));
-#if defined(_MSC_VER) || defined(__LCC__)
- _asm {
- mov eax, lParam
- push eax
- }
-#elif defined(__CYGWIN32__) || defined(__MINGW32__)
- asm volatile ("pushl %0" :: "g" (lParam));
-#else
-#error
-#endif
- break;
- case _T_POINTER:
- str = ary_entry(args, i);
- Check_Type(str, T_STRING);
- str_modify(str);
- pParam = RSTRING(str)->ptr;
-#if defined(_MSC_VER) || defined(__LCC__)
- _asm {
- mov eax, dword ptr pParam
- push eax
- }
-#elif defined(__CYGWIN32__) || defined(__MINGW32__)
- asm volatile ("pushl %0" :: "g" (pParam));
-#else
-#error
-#endif
- break;
- }
- }
-
- }
-
- switch (texport) {
- case _T_NUMBER:
- ApiFunctionNumber = (ApiNumber *) ApiFunction;
- Return = INT2NUM(ApiFunctionNumber());
- break;
- case _T_POINTER:
- ApiFunctionPointer = (ApiPointer *) ApiFunction;
- Return = str_new2((char *)ApiFunctionPointer());
- break;
- case _T_INTEGER:
- ApiFunctionInteger = (ApiInteger *) ApiFunction;
- Return = INT2NUM(ApiFunctionInteger());
- break;
- case _T_VOID:
- default:
- ApiFunctionVoid = (ApiVoid *) ApiFunction;
- ApiFunctionVoid();
- Return = INT2NUM(0);
- break;
- }
- return Return;
-}
-
-void
-Init_Win32API()
-{
- VALUE cWin32API = rb_define_class("Win32API", cObject);
- rb_define_method(cWin32API, "initialize", Win32API_initialize, 4);
- rb_define_method(cWin32API, "call", Win32API_Call, -1);
- rb_define_alias(cWin32API, "Call", "call");
-}
diff --git a/ext/Win32API/extconf.rb b/ext/Win32API/extconf.rb
deleted file mode 100644
index a03f358593..0000000000
--- a/ext/Win32API/extconf.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-case PLATFORM
-when /cygwin32/,/mingw32/
- $CFLAGS = "-fno-defer-pop"
- create_makefile("Win32API")
-when /win32/
- create_makefile("Win32API")
-end
diff --git a/ext/Win32API/getch.rb b/ext/Win32API/getch.rb
deleted file mode 100644
index c015bbe9bc..0000000000
--- a/ext/Win32API/getch.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'Win32API'
-
-getch = Win32API.new("crtdll", "_getch", [], 'L')
-
-puts getch.Call.chr
diff --git a/ext/Win32API/point.rb b/ext/Win32API/point.rb
deleted file mode 100644
index 60e265f3ee..0000000000
--- a/ext/Win32API/point.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'Win32API'
-
-getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
-
-lpPoint = " " * 8 # store two LONGs
-getCursorPos.Call(lpPoint)
-x, y = lpPoint.unpack("LL") # get the actual values
-
-print "x: ", x, "\n"
-print "y: ", y, "\n"
-
-ods = Win32API.new("kernel32", "OutputDebugString", ['P'], 'V')
-ods.Call("Hello, World\n");
-
-GetDesktopWindow = Win32API.new("user32", "GetDesktopWindow", [], 'L')
-GetActiveWindow = Win32API.new("user32", "GetActiveWindow", [], 'L')
-SendMessage = Win32API.new("user32", "SendMessage", ['L'] * 4, 'L')
-SendMessage.Call GetDesktopWindow.Call, 274, 0xf140, 0