Lua to C conversion rules
These conversion rules apply when using/writing Lua values to C types :
- Calling a C function with Lua arguments
- Setting arrays or struct/union fields
Lua type | C type |
---|---|
number |
C integral type (depends on the signature character) |
boolean |
int (bool in C++) |
nil |
NULL |
string |
char * or wchar_t * (depends on the signature character) |
Value | Corresponding C value, or as pointer for "p" signature character |
Struct | struct as value, or as pointer for "p" signature character |
Union | union as value, or as pointer for "p" signature character |
Pointer | void* |
[ ] Array | void* |