summaryrefslogtreecommitdiff
path: root/devtools/swigwin-1.3.34/Lib/ruby/file.i
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/swigwin-1.3.34/Lib/ruby/file.i')
-rw-r--r--devtools/swigwin-1.3.34/Lib/ruby/file.i32
1 files changed, 32 insertions, 0 deletions
diff --git a/devtools/swigwin-1.3.34/Lib/ruby/file.i b/devtools/swigwin-1.3.34/Lib/ruby/file.i
new file mode 100644
index 0000000..54ed0a6
--- /dev/null
+++ b/devtools/swigwin-1.3.34/Lib/ruby/file.i
@@ -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);
+}