diff options
| author | Mike Pall <mike> | 2011-02-11 13:50:01 +0100 |
|---|---|---|
| committer | Mike Pall <mike> | 2011-02-11 14:51:20 +0100 |
| commit | 1f0006ac71fd4eb308ab900b0b9917e1dd046680 (patch) | |
| tree | 93a6e6435ef45c776c28da2d3f4c8330e0e72968 /doc/ext_ffi_semantics.html | |
| parent | a5aade2fa9ff89f9f3c4a91261071299de0d0fa4 (diff) | |
| download | luajit-1f0006ac71fd4eb308ab900b0b9917e1dd046680.tar.gz luajit-1f0006ac71fd4eb308ab900b0b9917e1dd046680.tar.bz2 luajit-1f0006ac71fd4eb308ab900b0b9917e1dd046680.zip | |
Cleanup of docs.
Diffstat (limited to 'doc/ext_ffi_semantics.html')
| -rw-r--r-- | doc/ext_ffi_semantics.html | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index 69dfc2ca..8c7bd478 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html | |||
| @@ -66,9 +66,9 @@ and its interaction with both Lua and C code. | |||
| 66 | </p> | 66 | </p> |
| 67 | <p> | 67 | <p> |
| 68 | Given that the FFI library is designed to interface with C code | 68 | Given that the FFI library is designed to interface with C code |
| 69 | and that declarations can be written in plain C syntax, it | 69 | and that declarations can be written in plain C syntax, <b>it |
| 70 | closely follows the C language semantics, wherever possible. Some | 70 | closely follows the C language semantics</b>, wherever possible. |
| 71 | minor concessions are needed for smoother interoperation with Lua | 71 | Some minor concessions are needed for smoother interoperation with Lua |
| 72 | language semantics. | 72 | language semantics. |
| 73 | </p> | 73 | </p> |
| 74 | <p> | 74 | <p> |
| @@ -83,9 +83,8 @@ background. | |||
| 83 | Please note: this is the first public release of the FFI library. This | 83 | Please note: this is the first public release of the FFI library. This |
| 84 | does not comprise the final specification for the FFI semantics, yet. | 84 | does not comprise the final specification for the FFI semantics, yet. |
| 85 | Some of the semantics may need to be changed, based on feedback from | 85 | Some of the semantics may need to be changed, based on feedback from |
| 86 | developers. Please <a href="contact.html">report</a> any problems | 86 | developers. Please <a href="contact.html">report</a> any problems you |
| 87 | you've encountered or any improvements you'd like to see — thank | 87 | may encounter or any improvements you'd like to see — thank you! |
| 88 | you! | ||
| 89 | </p> | 88 | </p> |
| 90 | 89 | ||
| 91 | <h2 id="clang">C Language Support</h2> | 90 | <h2 id="clang">C Language Support</h2> |
| @@ -204,7 +203,7 @@ The following C features are <b>not</b> supported: | |||
| 204 | default to an <tt>int</tt> type.</li> | 203 | default to an <tt>int</tt> type.</li> |
| 205 | 204 | ||
| 206 | <li>Old-style empty function declarations (K&R) are not allowed. | 205 | <li>Old-style empty function declarations (K&R) are not allowed. |
| 207 | All C functions must have a proper protype declaration. A | 206 | All C functions must have a proper prototype declaration. A |
| 208 | function declared without parameters (<tt>int foo();</tt>) is | 207 | function declared without parameters (<tt>int foo();</tt>) is |
| 209 | treated as a function taking zero arguments, like in C++.</li> | 208 | treated as a function taking zero arguments, like in C++.</li> |
| 210 | 209 | ||
| @@ -312,7 +311,7 @@ C type of the destination, the | |||
| 312 | are applied. | 311 | are applied. |
| 313 | </p> | 312 | </p> |
| 314 | <p> | 313 | <p> |
| 315 | Reference types are immutable after initialization ("no reseating of | 314 | Reference types are immutable after initialization ("no re-seating of |
| 316 | references"). For initialization purposes or when passing values to | 315 | references"). For initialization purposes or when passing values to |
| 317 | reference parameters, they are treated like pointers. Note that unlike | 316 | reference parameters, they are treated like pointers. Note that unlike |
| 318 | in C++, there's no way to implement automatic reference generation of | 317 | in C++, there's no way to implement automatic reference generation of |
| @@ -652,8 +651,8 @@ variable argument part of vararg C function use | |||
| 652 | <a href="#convert_vararg">special conversion rules</a>. This | 651 | <a href="#convert_vararg">special conversion rules</a>. This |
| 653 | C function is called and the return value (if any) is | 652 | C function is called and the return value (if any) is |
| 654 | <a href="#convert_tolua">converted to a Lua object</a>.<br> | 653 | <a href="#convert_tolua">converted to a Lua object</a>.<br> |
| 655 | On Windows/x86 systems, <tt>stdcall</tt> functions are automatically | 654 | On Windows/x86 systems, <tt>__stdcall</tt> functions are automatically |
| 656 | detected and a function declared as <tt>cdecl</tt> (the default) is | 655 | detected and a function declared as <tt>__cdecl</tt> (the default) is |
| 657 | silently fixed up after the first call.</li> | 656 | silently fixed up after the first call.</li> |
| 658 | 657 | ||
| 659 | </ul> | 658 | </ul> |
| @@ -790,7 +789,7 @@ local s = ffi.new("foo_t", a) | |||
| 790 | Similar rules apply for Lua strings which are implicitly converted to | 789 | Similar rules apply for Lua strings which are implicitly converted to |
| 791 | <tt>"const char *"</tt>: the string object itself must be | 790 | <tt>"const char *"</tt>: the string object itself must be |
| 792 | referenced somewhere or it'll be garbage collected eventually. The | 791 | referenced somewhere or it'll be garbage collected eventually. The |
| 793 | pointer will then point to stale data, which may have already beeen | 792 | pointer will then point to stale data, which may have already been |
| 794 | overwritten. Note that <em>string literals</em> are automatically kept | 793 | overwritten. Note that <em>string literals</em> are automatically kept |
| 795 | alive as long as the function containing it (actually its prototype) | 794 | alive as long as the function containing it (actually its prototype) |
| 796 | is not garbage collected. | 795 | is not garbage collected. |
| @@ -951,7 +950,7 @@ storing and initializing them are supported, yet.</li> | |||
| 951 | <li>The <tt>volatile</tt> type qualifier is currently ignored by | 950 | <li>The <tt>volatile</tt> type qualifier is currently ignored by |
| 952 | compiled code.</li> | 951 | compiled code.</li> |
| 953 | <li><a href="ext_ffi_api.html#ffi_cdef"><tt>ffi.cdef</tt></a> silently | 952 | <li><a href="ext_ffi_api.html#ffi_cdef"><tt>ffi.cdef</tt></a> silently |
| 954 | ignores all redeclarations.</li> | 953 | ignores all re-declarations.</li> |
| 955 | </ul> | 954 | </ul> |
| 956 | <p> | 955 | <p> |
| 957 | The JIT compiler already handles a large subset of all FFI operations. | 956 | The JIT compiler already handles a large subset of all FFI operations. |
