aboutsummaryrefslogtreecommitdiffstats
path: root/ext/fiddle/function.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-27 23:26:07 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-27 23:26:07 +0000
commit9c831edbf4f30fdcf90d8c991ded624c27898874 (patch)
tree65e7dc87ad5016d456ef5aa81ef80639e614eb6d /ext/fiddle/function.c
parent7e4b6fa7d601a5a15b760e8bccd3f583ea89fef7 (diff)
downloadruby-9c831edbf4f30fdcf90d8c991ded624c27898874.tar.gz
* ext/fiddle/closure.c: Documentation for Fiddle
* ext/fiddle/pointer.c: ditto * ext/fiddle/function.c: ditto * ext/fiddle/lib/fiddle.rb: ditto * ext/fiddle/fiddle.c: ditto * ext/fiddle/handle.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle/function.c')
-rw-r--r--ext/fiddle/function.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index 7fc5127f9f..4c4bc13abc 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -161,25 +161,28 @@ Init_fiddle_function(void)
*
* === '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>
+ * @libc = Fiddle.dlopen "/lib/libc.so.6"
+ * #=> #<Fiddle::Handle:0x00000001d7a8d8>
+ * f = Fiddle::Function.new(
+ * @libc['strcpy'],
+ * [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP],
+ * Fiddle::TYPE_VOIDP)
+ * #=> #<Fiddle::Function:0x00000001d8ee00>
* buff = "000"
- * => "000"
+ * #=> "000"
* str = f.call(buff, "123")
- * => #<DL::CPtr:0x00000001d0c380 ptr=0x000000018a21b8 size=0 free=0x00000000000000>
+ * #=> #<Fiddle::Pointer:0x00000001d0c380 ptr=0x000000018a21b8 size=0 free=0x00000000000000>
* str.to_s
* => "123"
*
* === ABI check
*
* @libc = DL.dlopen "/lib/libc.so.6"
- * => #<DL::Handle:0x00000001d7a8d8>
+ * #=> #<Fiddle::Handle:0x00000001d7a8d8>
* f = Fiddle::Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP)
- * => #<Fiddle::Function:0x00000001d8ee00>
+ * #=> #<Fiddle::Function:0x00000001d8ee00>
* f.abi == Fiddle::Function::DEFAULT
- * => true
+ * #=> true
*/
cFiddleFunction = rb_define_class_under(mFiddle, "Function", rb_cObject);
@@ -218,7 +221,7 @@ Init_fiddle_function(void)
* call-seq: new(ptr, *args, ret_type, abi = DEFAULT)
*
* Constructs a Function object.
- * * +ptr+ is a referenced function, of a DL::Handle
+ * * +ptr+ is a referenced function, of a Fiddle::Handle
* * +args+ is an Array of arguments, passed to the +ptr+ function
* * +ret_type+ is the return type of the function
* * +abi+ is the ABI of the function