keep old typemap code in place, but disable, for readers to look around, and rescue other lost typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7980 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a849510dfa
commit
32cbb57ab6
10 changed files with 1718 additions and 0 deletions
32
Lib/ruby/file.i
Normal file
32
Lib/ruby/file.i
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// FILE *
|
||||
%{
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "rubyio.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
%}
|
||||
|
||||
%typemap(in) FILE *READ {
|
||||
OpenFile *of;
|
||||
GetOpenFile($input, of);
|
||||
rb_io_check_readable(of);
|
||||
$1 = GetReadFile(of);
|
||||
rb_read_check($1);
|
||||
}
|
||||
|
||||
%typemap(in) FILE *READ_NOCHECK {
|
||||
OpenFile *of;
|
||||
GetOpenFile($input, of);
|
||||
rb_io_check_readable(of);
|
||||
$1 = GetReadFile(of);
|
||||
}
|
||||
|
||||
%typemap(in) FILE *WRITE {
|
||||
OpenFile *of;
|
||||
GetOpenFile($input, of);
|
||||
rb_io_check_writable(of);
|
||||
$1 = GetWriteFile(of);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue