diff options
author | Mike Pall <mike> | 2012-09-03 21:10:10 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-09-03 21:11:08 +0200 |
commit | 0648fd47cb5560cf1a44a211a75997863e8470dd (patch) | |
tree | 794077cf10c0f9dcb05c406904342880025311e3 /doc | |
parent | 90ec1f90d0c31ab9398e971665c1e33d3158f9c0 (diff) | |
download | luajit-0648fd47cb5560cf1a44a211a75997863e8470dd.tar.gz luajit-0648fd47cb5560cf1a44a211a75997863e8470dd.tar.bz2 luajit-0648fd47cb5560cf1a44a211a75997863e8470dd.zip |
FFI: Handle __pairs/__ipairs metamethods for cdata objects.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ext_ffi_api.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/ext_ffi_api.html b/doc/ext_ffi_api.html index 16066612..503c6e4a 100644 --- a/doc/ext_ffi_api.html +++ b/doc/ext_ffi_api.html | |||
@@ -525,7 +525,16 @@ Returns a string representation of the value of 64 bit integers | |||
525 | complex numbers (<tt><b>"</b>re±im<b>i"</b></tt>). Otherwise | 525 | complex numbers (<tt><b>"</b>re±im<b>i"</b></tt>). Otherwise |
526 | returns a string representation of the C type of a ctype object | 526 | returns a string representation of the C type of a ctype object |
527 | (<tt><b>"ctype<</b>type<b>>"</b></tt>) or a cdata object | 527 | (<tt><b>"ctype<</b>type<b>>"</b></tt>) or a cdata object |
528 | (<tt><b>"cdata<</b>type<b>>: </b>address"</tt>). | 528 | (<tt><b>"cdata<</b>type<b>>: </b>address"</tt>), unless you |
529 | override it with a <tt>__tostring</tt> metamethod (see | ||
530 | <a href="#ffi_metatype"><tt>ffi.metatype()</tt></a>). | ||
531 | </p> | ||
532 | |||
533 | <h3 id="pairs"><tt>iter, obj, start = pairs(cdata)<br> | ||
534 | iter, obj, start = ipairs(cdata)<br></tt></h3> | ||
535 | <p> | ||
536 | Calls the <tt>__pairs</tt> or <tt>__ipairs</tt> metamethod of the | ||
537 | corresponding ctype. | ||
529 | </p> | 538 | </p> |
530 | 539 | ||
531 | <h2 id="literals">Extensions to the Lua Parser</h2> | 540 | <h2 id="literals">Extensions to the Lua Parser</h2> |