Check_Type() added to FILE* typemap
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@1026 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9c773451f3
commit
7353fc53a9
1 changed files with 3 additions and 0 deletions
|
|
@ -482,6 +482,7 @@ extern "C" {
|
||||||
%}
|
%}
|
||||||
%typemap(ruby,in) FILE *READ {
|
%typemap(ruby,in) FILE *READ {
|
||||||
OpenFile *of;
|
OpenFile *of;
|
||||||
|
Check_Type($source, T_FILE);
|
||||||
GetOpenFile($source, of);
|
GetOpenFile($source, of);
|
||||||
rb_io_check_readable(of);
|
rb_io_check_readable(of);
|
||||||
$target = GetReadFile(of);
|
$target = GetReadFile(of);
|
||||||
|
|
@ -489,12 +490,14 @@ extern "C" {
|
||||||
}
|
}
|
||||||
%typemap(ruby,in) FILE *READ_NOCHECK {
|
%typemap(ruby,in) FILE *READ_NOCHECK {
|
||||||
OpenFile *of;
|
OpenFile *of;
|
||||||
|
Check_Type($source, T_FILE);
|
||||||
GetOpenFile($source, of);
|
GetOpenFile($source, of);
|
||||||
rb_io_check_readable(of);
|
rb_io_check_readable(of);
|
||||||
$target = GetReadFile(of);
|
$target = GetReadFile(of);
|
||||||
}
|
}
|
||||||
%typemap(ruby,in) FILE *WRITE {
|
%typemap(ruby,in) FILE *WRITE {
|
||||||
OpenFile *of;
|
OpenFile *of;
|
||||||
|
Check_Type($source, T_FILE);
|
||||||
GetOpenFile($source, of);
|
GetOpenFile($source, of);
|
||||||
rb_io_check_writable(of);
|
rb_io_check_writable(of);
|
||||||
$target = GetWriteFile(of);
|
$target = GetWriteFile(of);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue