From 0648fd47cb5560cf1a44a211a75997863e8470dd Mon Sep 17 00:00:00 2001
From: Mike Pall
Date: Mon, 3 Sep 2012 21:10:10 +0200
Subject: FFI: Handle __pairs/__ipairs metamethods for cdata objects.
---
doc/ext_ffi_api.html | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'doc')
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
complex numbers ("re±imi"). Otherwise
returns a string representation of the C type of a ctype object
("ctype<type>") or a cdata object
-("cdata<type>: address").
+("cdata<type>: address"), unless you
+override it with a __tostring metamethod (see
+ffi.metatype()).
+
+
+iter, obj, start = pairs(cdata)
+iter, obj, start = ipairs(cdata)
+
+Calls the __pairs or __ipairs metamethod of the
+corresponding ctype.
Extensions to the Lua Parser
--
cgit v1.2.3-55-g6feb