aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Pall <mike>2011-04-20 01:53:26 +0200
committerMike Pall <mike>2011-04-20 01:53:26 +0200
commit5d096dcfdef5ddb0e6dd67e155adf893df7d7809 (patch)
tree9bdbd2852738e761b1b2f0f1858eb91f22a8e638 /doc
parent9ea679410c8061741a49350b3fc969365ffe5547 (diff)
downloadluajit-5d096dcfdef5ddb0e6dd67e155adf893df7d7809.tar.gz
luajit-5d096dcfdef5ddb0e6dd67e155adf893df7d7809.tar.bz2
luajit-5d096dcfdef5ddb0e6dd67e155adf893df7d7809.zip
FFI: Add ffi.istype() function.
Diffstat (limited to 'doc')
-rw-r--r--doc/ext_ffi_api.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/ext_ffi_api.html b/doc/ext_ffi_api.html
index 2b6d1d86..b1b42878 100644
--- a/doc/ext_ffi_api.html
+++ b/doc/ext_ffi_api.html
@@ -316,6 +316,24 @@ of <tt>ct</tt>, which must be a <tt>struct</tt>. Additionally returns
316the position and the field size (in bits) for bit fields. 316the position and the field size (in bits) for bit fields.
317</p> 317</p>
318 318
319<h3 id="ffi_istype"><tt>status = ffi.istype(ct, obj)</tt></h3>
320<p>
321Returns <tt>true</tt> if <tt>obj</tt> has the C&nbsp;type given by
322<tt>ct</tt>. Returns <tt>false</tt> otherwise.
323</p>
324<p>
325C&nbsp;type qualifiers (<tt>const</tt> etc.) are ignored. Pointers are
326checked with the standard pointer compatibility rules, but without any
327special treatment for <tt>void&nbsp;*</tt>. If <tt>ct</tt> specifies a
328<tt>struct</tt>/<tt>union</tt>, then a pointer to this type is accepted,
329too. Otherwise the types must match exactly.
330</p>
331<p>
332Note: this function accepts all kinds of Lua objects for the
333<tt>obj</tt> argument, but always returns <tt>false</tt> for non-cdata
334objects.
335</p>
336
319<h2 id="util">Utility Functions</h2> 337<h2 id="util">Utility Functions</h2>
320 338
321<h3 id="ffi_string"><tt>str = ffi.string(ptr [,len])</tt></h3> 339<h3 id="ffi_string"><tt>str = ffi.string(ptr [,len])</tt></h3>