v1_9_3_125 -
Show latest stable
-
0 notes
- Superclass:
Object
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (2)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
Description
A representation of a C function
Examples
‘strcpy’
@libc = DL.dlopen "/lib/libc.so.6" => #<DL::Handle:0x00000001d7a8d8> f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP) => #<Fiddle::Function:0x00000001d8ee00> buff = "000" => "000" str = f.call(buff, "123") => #<DL::CPtr:0x00000001d0c380 ptr=0x000000018a21b8 size=0 free=0x00000000000000> str.to_s => "123"
ABI check
@libc = DL.dlopen "/lib/libc.so.6" => #<DL::Handle:0x00000001d7a8d8> f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP) => #<Fiddle::Function:0x00000001d8ee00> f.abi == Fiddle::Function::DEFAULT => true
Constants
DEFAULT = Document-const
STDCALL = Document-const
Attributes
[R] | abi |
The ABI of the Function. |