Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (43 sloc) 2.111 kb
c3197d1 A few more docs
Evan Phoenix authored
1 /* A simple C++ wrapper around libffi. */
2
fceff3d NativeFunction, Selector, SendSite
Evan Phoenix authored
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <stdint.h>
6 #include <unistd.h>
7 #include <sys/stat.h>
8 #include <dlfcn.h>
9
10 #include "vm.hpp"
11 #include "objectmemory.hpp"
12
6ac48bd Fixed a LOT of dependencies by stripping objects.hpp and prelude.hpp …
Ryan Davis authored
13 #include "builtin/array.hpp"
14 #include "builtin/class.hpp"
15 #include "builtin/fixnum.hpp"
a390c02 More dependency fixes
Ryan Davis authored
16 #include "builtin/float.hpp"
6ac48bd Fixed a LOT of dependencies by stripping objects.hpp and prelude.hpp …
Ryan Davis authored
17 #include "builtin/memorypointer.hpp"
18 #include "builtin/nativefunction.hpp"
19 #include "builtin/string.hpp"
20 #include "builtin/symbol.hpp"
21
3a0e9a4 @rue Renamed vm/object.hpp to vm/object_utils.hpp. File/#include shuffling.
rue authored
22 #include "ffi_util.hpp"
9eb4748 Flesh out Task considerable more
Evan Phoenix authored
23 #include "message.hpp"
fceff3d NativeFunction, Selector, SendSite
Evan Phoenix authored
24
25 namespace rubinius {
26
27 void VM::init_ffi() {
28 Module* mod = new_module("FFI");
4a7b116 @dbussink Refactor Bignum::create to Bignum::from and clean up to_ functions
dbussink authored
29 mod->set_const(this, "TYPE_OBJECT", Fixnum::from(RBX_FFI_TYPE_OBJECT));
30 mod->set_const(this, "TYPE_CHAR", Fixnum::from(RBX_FFI_TYPE_CHAR));
31 mod->set_const(this, "TYPE_UCHAR", Fixnum::from(RBX_FFI_TYPE_UCHAR));
32 mod->set_const(this, "TYPE_SHORT", Fixnum::from(RBX_FFI_TYPE_SHORT));
33 mod->set_const(this, "TYPE_USHORT", Fixnum::from(RBX_FFI_TYPE_USHORT));
34 mod->set_const(this, "TYPE_INT", Fixnum::from(RBX_FFI_TYPE_INT));
35 mod->set_const(this, "TYPE_UINT", Fixnum::from(RBX_FFI_TYPE_UINT));
36 mod->set_const(this, "TYPE_LONG", Fixnum::from(RBX_FFI_TYPE_LONG));
37 mod->set_const(this, "TYPE_ULONG", Fixnum::from(RBX_FFI_TYPE_ULONG));
b881222 Steamroller session getting the kernel running.
Evan Phoenix authored
38 mod->set_const(this, "TYPE_LL", Fixnum::from(RBX_FFI_TYPE_LONG_LONG));
39 mod->set_const(this, "TYPE_ULL", Fixnum::from(RBX_FFI_TYPE_ULONG_LONG));
4a7b116 @dbussink Refactor Bignum::create to Bignum::from and clean up to_ functions
dbussink authored
40 mod->set_const(this, "TYPE_FLOAT", Fixnum::from(RBX_FFI_TYPE_FLOAT));
41 mod->set_const(this, "TYPE_DOUBLE", Fixnum::from(RBX_FFI_TYPE_DOUBLE));
42 mod->set_const(this, "TYPE_PTR", Fixnum::from(RBX_FFI_TYPE_PTR));
43 mod->set_const(this, "TYPE_VOID", Fixnum::from(RBX_FFI_TYPE_VOID));
44 mod->set_const(this, "TYPE_STRING", Fixnum::from(RBX_FFI_TYPE_STRING));
45 mod->set_const(this, "TYPE_STATE", Fixnum::from(RBX_FFI_TYPE_STATE));
46 mod->set_const(this, "TYPE_STRPTR", Fixnum::from(RBX_FFI_TYPE_STRPTR));
47 mod->set_const(this, "TYPE_CHARARR", Fixnum::from(RBX_FFI_TYPE_CHARARR));
fceff3d NativeFunction, Selector, SendSite
Evan Phoenix authored
48 }
49 };
Something went wrong with that request. Please try again.