mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
68bc47726b
commit
3c89a278e3
2 changed files with 38 additions and 25 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Aug 30 11:31:47 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
|
||||
|
||||
* ext/Win32API/Win32API.c (Win32API_initialize): add the
|
||||
arguments checking.
|
||||
|
||||
Tue Aug 29 16:29:15 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* parse.y (assignable): remove NODE_CVASGN3.
|
||||
|
|
|
@ -70,36 +70,44 @@ Win32API_initialize(self, dllname, proc, import, export)
|
|||
rb_iv_set(self, "__proc__", UINT2NUM((unsigned long)hproc));
|
||||
|
||||
a_import = rb_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':
|
||||
rb_ary_push(a_import, INT2FIX(_T_NUMBER));
|
||||
break;
|
||||
case 'P': case 'p':
|
||||
rb_ary_push(a_import, INT2FIX(_T_POINTER));
|
||||
break;
|
||||
case 'I': case 'i':
|
||||
rb_ary_push(a_import, INT2FIX(_T_INTEGER));
|
||||
break;
|
||||
if (!NIL_P(import)) {
|
||||
Check_Type(import, T_ARRAY);
|
||||
ptr = RARRAY(import)->ptr;
|
||||
for (i = 0, len = RARRAY(import)->len; i < len; i++) {
|
||||
Check_Type(ptr[i], T_STRING);
|
||||
switch (*(char *)RSTRING(ptr[i])->ptr) {
|
||||
case 'N': case 'n': case 'L': case 'l':
|
||||
rb_ary_push(a_import, INT2FIX(_T_NUMBER));
|
||||
break;
|
||||
case 'P': case 'p':
|
||||
rb_ary_push(a_import, INT2FIX(_T_POINTER));
|
||||
break;
|
||||
case 'I': case 'i':
|
||||
rb_ary_push(a_import, INT2FIX(_T_INTEGER));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
rb_iv_set(self, "__import__", a_import);
|
||||
|
||||
switch (*RSTRING(export)->ptr) {
|
||||
case 'V': case 'v':
|
||||
if (NIL_P(export)) {
|
||||
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;
|
||||
} else {
|
||||
Check_Type(export, T_STRING);
|
||||
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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue