rbdc 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dyncall/BUGS +1 -1
- data/dyncall/CMakeLists.txt +19 -7
- data/dyncall/ChangeLog +61 -20
- data/dyncall/LICENSE +1 -1
- data/dyncall/Makefile.generic +2 -0
- data/dyncall/ToDo +97 -29
- data/dyncall/autovar/README.txt +1 -0
- data/dyncall/autovar/autovar_ABI.h +4 -2
- data/dyncall/autovar/autovar_ARCH.h +9 -5
- data/dyncall/autovar/autovar_CC.h +3 -1
- data/dyncall/autovar/autovar_OS.h +2 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
- data/dyncall/configure +94 -38
- data/dyncall/dyncall/dyncall.3 +8 -4
- data/dyncall/dyncall/dyncall.h +1 -1
- data/dyncall/dyncall/dyncall_alloc.h +1 -1
- data/dyncall/dyncall/dyncall_api.c +3 -1
- data/dyncall/dyncall/dyncall_call.S +13 -5
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
- data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
- data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
- data/dyncall/dyncall/dyncall_call_mips.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
- data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
- data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
- data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
- data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
- data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
- data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
- data/dyncall/dyncall/dyncall_call_x64.S +83 -86
- data/dyncall/dyncall/dyncall_call_x64.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86.S +9 -9
- data/dyncall/dyncall/dyncall_call_x86.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
- data/dyncall/dyncall/dyncall_callf.c +18 -18
- data/dyncall/dyncall/dyncall_callf.h +1 -1
- data/dyncall/dyncall/dyncall_callvm.c +3 -3
- data/dyncall/dyncall/dyncall_callvm.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
- data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
- data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
- data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
- data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
- data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
- data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
- data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
- data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
- data/dyncall/dyncall/dyncall_config.h +1 -1
- data/dyncall/dyncall/dyncall_macros.h +28 -19
- data/dyncall/dyncall/dyncall_signature.h +1 -1
- data/dyncall/dyncall/dyncall_types.h +17 -18
- data/dyncall/dyncall/dyncall_utils.h +1 -1
- data/dyncall/dyncall/dyncall_value.h +28 -21
- data/dyncall/dyncall/dyncall_vector.c +1 -1
- data/dyncall/dyncall/dyncall_vector.h +1 -1
- data/dyncall/dyncall/gen-masm.sh +2 -2
- data/dyncall/dyncallback/CMakeLists.txt +1 -2
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
- data/dyncall/dyncallback/dyncall_args.c +19 -15
- data/dyncall/dyncallback/dyncall_args.h +1 -1
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
- data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
- data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
- data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
- data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
- data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
- data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
- data/dyncall/dyncallback/dyncall_callback.c +10 -12
- data/dyncall/dyncallback/dyncall_callback.h +2 -4
- data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
- data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
- data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
- data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
- data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
- data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
- data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
- data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
- data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
- data/dyncall/dyncallback/dyncall_thunk.c +6 -6
- data/dyncall/dyncallback/dyncall_thunk.h +9 -7
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
- data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
- data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
- data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
- data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
- data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
- data/dyncall/dyncallback/dyncallback.3 +16 -11
- data/dyncall/dynload/dynload.3 +63 -8
- data/dyncall/dynload/dynload.c +2 -8
- data/dyncall/dynload/dynload.h +9 -5
- data/dyncall/dynload/dynload_alloc.h +1 -1
- data/dyncall/dynload/dynload_syms.c +1 -3
- data/dyncall/dynload/dynload_syms_elf.c +19 -11
- data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
- data/dyncall/dynload/dynload_syms_pe.c +24 -24
- data/dyncall/dynload/dynload_unix.c +156 -13
- data/dyncall/dynload/dynload_windows.c +15 -11
- data/dyncall/portasm/portasm-arm.S +1 -1
- data/dyncall/portasm/portasm-ppc.S +1 -1
- data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
- data/dyncall/portasm/portasm-x86.S +4 -2
- data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
- data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
- metadata +24 -48
- data/dyncall/Makefile.M +0 -15
- data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
- data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
- data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
- data/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/Makefile.M +0 -10
- data/dyncall/dyncall/TODO +0 -9
- data/dyncall/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
- data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
- data/dyncall/dyncallback/Makefile.M +0 -10
- data/dyncall/dyncallback/README.txt +0 -9
- data/dyncall/dyncallback/TODO +0 -4
- data/dyncall/dyncallback/dynMakefile +0 -4
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
- data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
- data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
- data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
- data/dyncall/dynload/Makefile.M +0 -10
- data/dyncall/dynload/TODO +0 -20
- data/dyncall/dynload/dynMakefile +0 -4
- data/dyncall/dynload/dynload_darwin.c +0 -90
@@ -1,30 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
|
3
|
-
Package: dyncall
|
4
|
-
Library: dyncallback
|
5
|
-
File: dyncallback/dyncall_thunk_arm32_thumb.c
|
6
|
-
Description: Thunk - Implementation for ARM32 (THUMB mode)
|
7
|
-
License:
|
8
|
-
|
9
|
-
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
-
|
12
|
-
Permission to use, copy, modify, and distribute this software for any
|
13
|
-
purpose with or without fee is hereby granted, provided that the above
|
14
|
-
copyright notice and this permission notice appear in all copies.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
-
|
24
|
-
*/
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
#include "dyncall_thunk_arm32_arm.c" /* Since we can mix ARM and THUMB */
|
29
|
-
/* assembly, reuse the ARM mode code */
|
30
|
-
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
|
3
|
-
Package: dyncall
|
4
|
-
Library: dyncallback
|
5
|
-
File: dyncallback/dyncall_thunk_arm32_thumb.h
|
6
|
-
Description: Thunk - Header for ARM32 (THUMB mode)
|
7
|
-
License:
|
8
|
-
|
9
|
-
Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
-
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
-
|
12
|
-
Permission to use, copy, modify, and distribute this software for any
|
13
|
-
purpose with or without fee is hereby granted, provided that the above
|
14
|
-
copyright notice and this permission notice appear in all copies.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
-
|
24
|
-
*/
|
25
|
-
|
26
|
-
|
27
|
-
#ifndef DYNCALL_THUNK_ARM32_THUMB_H
|
28
|
-
#define DYNCALL_THUNK_ARM32_THUMB_H
|
29
|
-
|
30
|
-
#include "dyncall_thunk_arm32_arm.h" /* Uses same code as ARM mode. */
|
31
|
-
|
32
|
-
#define DCTHUNK_ARM32_THUMB_SIZE 12
|
33
|
-
|
34
|
-
|
35
|
-
#endif /* DYNCALL_THUNK_ARM32_THUMB_H */
|
36
|
-
|
data/dyncall/dynload/Makefile.M
DELETED
data/dyncall/dynload/TODO
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
- RTLD_LAZY in darwin, why not in unix?
|
2
|
-
- Failed On Open Solaris 11:
|
3
|
-
|
4
|
-
In file included from dynload_syms.c:28:
|
5
|
-
dynload_syms_elf.c:56: error: syntax error before "Elf_Dyn"
|
6
|
-
dynload_syms_elf.c:56: warning: data definition has no type or storage class
|
7
|
-
dynload_syms_elf.c: In function `dlSymsInit':
|
8
|
-
dynload_syms_elf.c:155: error: `pDyn' undeclared (first use in this function)
|
9
|
-
dynload_syms_elf.c:155: error: (Each undeclared identifier is reported only once
|
10
|
-
dynload_syms_elf.c:155: error: for each function it appears in.)
|
11
|
-
dynload_syms_elf.c:155: error: syntax error before ')' token
|
12
|
-
dynload_syms_elf.c:160: error: `DT_NULL' undeclared (first use in this function)
|
13
|
-
dynload_syms_elf.c:163: error: `DT_STRTAB' undeclared (first use in this function)
|
14
|
-
dynload_syms_elf.c:164: error: `DT_SYMTAB' undeclared (first use in this function)
|
15
|
-
dynload_syms_elf.c:165: error: `DT_HASH' undeclared (first use in this function)
|
16
|
-
make: *** [dynload_syms.o] Error 1
|
17
|
-
|
18
|
-
DONE:
|
19
|
-
- remove dependencies dyncall_{alloc,macros}.h
|
20
|
-
|
data/dyncall/dynload/dynMakefile
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
|
3
|
-
Package: dyncall
|
4
|
-
Library: dynload
|
5
|
-
File: dynload/dynload_darwin.c
|
6
|
-
Description: dynload module for .dylib (mach-o darwin/OS X) files
|
7
|
-
License:
|
8
|
-
|
9
|
-
Copyright (c) 2007-2015 Olivier Chafik <olivier.chafik@gmail.com>
|
10
|
-
Minor bug-fix modifications by Daniel Adler.
|
11
|
-
|
12
|
-
Permission to use, copy, modify, and distribute this software for any
|
13
|
-
purpose with or without fee is hereby granted, provided that the above
|
14
|
-
copyright notice and this permission notice appear in all copies.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
-
|
24
|
-
*/
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
/*
|
29
|
-
|
30
|
-
dynload_darwin.c
|
31
|
-
|
32
|
-
dynload module for .dylib (mach-o darwin/OS X) files
|
33
|
-
|
34
|
-
*/
|
35
|
-
|
36
|
-
|
37
|
-
#include "dynload.h"
|
38
|
-
#include "dynload_alloc.h"
|
39
|
-
#include <dlfcn.h>
|
40
|
-
#include <string.h>
|
41
|
-
|
42
|
-
struct DLLib_
|
43
|
-
{
|
44
|
-
char* libPath;
|
45
|
-
void* handle;
|
46
|
-
};
|
47
|
-
|
48
|
-
|
49
|
-
DLLib* dlLoadLibrary(const char* libPath)
|
50
|
-
{
|
51
|
-
void* handle;
|
52
|
-
size_t len;
|
53
|
-
DLLib* lib;
|
54
|
-
|
55
|
-
handle = dlopen(libPath, RTLD_LAZY);
|
56
|
-
if (!handle)
|
57
|
-
return NULL;
|
58
|
-
|
59
|
-
|
60
|
-
lib = (DLLib*)dlAllocMem(sizeof(DLLib));
|
61
|
-
lib->handle = handle;
|
62
|
-
/* libPath might be null (self reference on image) [Daniel] */
|
63
|
-
if (libPath != NULL) {
|
64
|
-
len = strlen(libPath);
|
65
|
-
lib->libPath = (char*)dlAllocMem(len + 1);
|
66
|
-
strcpy(lib->libPath, libPath);
|
67
|
-
lib->libPath[len] = '\0';
|
68
|
-
} else {
|
69
|
-
lib->libPath = NULL;
|
70
|
-
}
|
71
|
-
return lib;
|
72
|
-
}
|
73
|
-
|
74
|
-
void* dlFindSymbol(DLLib* libHandle, const char* symbol)
|
75
|
-
{
|
76
|
-
return dlsym(libHandle && libHandle->handle ? libHandle->handle : RTLD_DEFAULT, symbol);
|
77
|
-
}
|
78
|
-
|
79
|
-
|
80
|
-
void dlFreeLibrary(DLLib* libHandle)
|
81
|
-
{
|
82
|
-
if (!libHandle)
|
83
|
-
return;
|
84
|
-
|
85
|
-
dlclose(libHandle->handle);
|
86
|
-
if (libHandle->libPath)
|
87
|
-
dlFreeMem(libHandle->libPath);
|
88
|
-
dlFreeMem(libHandle);
|
89
|
-
}
|
90
|
-
|