diff options
author | Mike Pall <mike> | 2011-04-20 01:53:26 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-04-20 01:53:26 +0200 |
commit | 5d096dcfdef5ddb0e6dd67e155adf893df7d7809 (patch) | |
tree | 9bdbd2852738e761b1b2f0f1858eb91f22a8e638 /doc | |
parent | 9ea679410c8061741a49350b3fc969365ffe5547 (diff) | |
download | luajit-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.html | 18 |
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 | |||
316 | the position and the field size (in bits) for bit fields. | 316 | the 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> | ||
321 | Returns <tt>true</tt> if <tt>obj</tt> has the C type given by | ||
322 | <tt>ct</tt>. Returns <tt>false</tt> otherwise. | ||
323 | </p> | ||
324 | <p> | ||
325 | C type qualifiers (<tt>const</tt> etc.) are ignored. Pointers are | ||
326 | checked with the standard pointer compatibility rules, but without any | ||
327 | special treatment for <tt>void *</tt>. If <tt>ct</tt> specifies a | ||
328 | <tt>struct</tt>/<tt>union</tt>, then a pointer to this type is accepted, | ||
329 | too. Otherwise the types must match exactly. | ||
330 | </p> | ||
331 | <p> | ||
332 | Note: this function accepts all kinds of Lua objects for the | ||
333 | <tt>obj</tt> argument, but always returns <tt>false</tt> for non-cdata | ||
334 | objects. | ||
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> |