summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2012-09-03 21:10:10 +0200
committerMike Pall <mike>2012-09-03 21:11:08 +0200
commit0648fd47cb5560cf1a44a211a75997863e8470dd (patch)
tree794077cf10c0f9dcb05c406904342880025311e3 /doc
parent90ec1f90d0c31ab9398e971665c1e33d3158f9c0 (diff)
downloadluajit2-0648fd47cb5560cf1a44a211a75997863e8470dd.tar.gz
FFI: Handle __pairs/__ipairs metamethods for cdata objects.
Diffstat (limited to 'doc')
-rw-r--r--doc/ext_ffi_api.html11
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&nbsp;bit integers
complex numbers (<tt><b>"</b>re&plusmn;im<b>i"</b></tt>). Otherwise
returns a string representation of the C&nbsp;type of a ctype object
(<tt><b>"ctype&lt;</b>type<b>&gt;"</b></tt>) or a cdata object
-(<tt><b>"cdata&lt;</b>type<b>&gt;:&nbsp;</b>address"</tt>).
+(<tt><b>"cdata&lt;</b>type<b>&gt;:&nbsp;</b>address"</tt>), unless you
+override it with a <tt>__tostring</tt> metamethod (see
+<a href="#ffi_metatype"><tt>ffi.metatype()</tt></a>).
+</p>
+
+<h3 id="pairs"><tt>iter, obj, start = pairs(cdata)<br>
+iter, obj, start = ipairs(cdata)<br></tt></h3>
+<p>
+Calls the <tt>__pairs</tt> or <tt>__ipairs</tt> metamethod of the
+corresponding ctype.
</p>
<h2 id="literals">Extensions to the Lua Parser</h2>