summaryrefslogtreecommitdiff
path: root/ext/fiddle/fiddle.h
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 06:59:24 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-06 06:59:24 +0000
commit4bada8b864e445b6eebe1a341e30cad94dbcaf84 (patch)
treebb7e4ed991aa16eda953d536265c6f9e5dc03a5d /ext/fiddle/fiddle.h
parentca3c007f058f17b2f0bf3c5ccc6701f3f6d49ca5 (diff)
* ext/fiddle/*: Adding fiddle library to wrap libffi
* test/fiddle/*: testing fiddle extension * ext/dl/lib/dl.rb: Requiring fiddle if it is available * ext/dl/lib/dl/callback.rb: using Fiddle if it is available * ext/dl/lib/dl/func.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle/fiddle.h')
-rw-r--r--ext/fiddle/fiddle.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h
new file mode 100644
index 00000000000..0c573871dc7
--- /dev/null
+++ b/ext/fiddle/fiddle.h
@@ -0,0 +1,45 @@
+#ifndef FIDDLE_H
+#define FIDDLE_H
+
+#include <ruby.h>
+#include <errno.h>
+
+#if defined(HAVE_WINDOWS_H)
+#include <windows.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
+#ifdef USE_HEADER_HACKS
+#include <ffi/ffi.h>
+#else
+#include <ffi.h>
+#endif
+
+#include <closure.h>
+#include <conversions.h>
+#include <function.h>
+
+/* FIXME
+ * These constants need to match up with DL. We need to refactor this to use
+ * the DL header files or vice versa.
+ */
+
+#define TYPE_VOID 0
+#define TYPE_VOIDP 1
+#define TYPE_CHAR 2
+#define TYPE_SHORT 3
+#define TYPE_INT 4
+#define TYPE_LONG 5
+#if HAVE_LONG_LONG
+#define TYPE_LONG_LONG 6
+#endif
+#define TYPE_FLOAT 7
+#define TYPE_DOUBLE 8
+
+extern VALUE mFiddle;
+
+#endif
+/* vim: set noet sws=4 sw=4: */