-
Notifications
You must be signed in to change notification settings - Fork 1
w8l
To use it, include the waxL/waxL.h header.
It is divided into different sets of utilities. You can easily spot their target looking at their prefix:
-
waxL_are to simplify the code on Lua C API. -
waxC_are to simplify the common, verbose and complex C logic.
To easily explain prefixes, every ··· presense in the macro name represents
that it is a explanation on a prefix.
Register module functions.
- Lua 5.1 : luaL_register
- Lua 5.2+: luaL_newlib
Throws a Lua error with the message msg if the condition is not evaluate to
true. condition is any expression that can be used in an ordinary if
statement.
It is intended to be used always when writing a Lua function as it includes and
an return 0;
Throws a Lua error with the message. It is intended to be always used inside a
Lua C function, as it will always will include an return 0;
These macros standardize the Lua function returns and make clear on C side what is happening.
Make Lua function return two values, nil and the strerror(errno) string,
returning immediately from the C function.
Make Lua function return two values, nil and the msg string, returning
immediately from the C function.
Make Lua function return two values, false and the strerror(errno),
returning immediately from the C function.
Make Lua function return two values, false and the msg string, returning
immediately from the C function.
Registers a new userdata char *name containing the methods of the
luaL_Reg *methods.
Gets the length of the stack index, be it a string (like #) or the length
of a table ignoring its metamethods.
- Lua 5.1 :
lua_objlen - Lua 5.2+:
lua_rawlen
Helpers to set key/value to the table on top of stack; Basically ··· consists
of two letters. The first being s or i, for string or integer keys and the
second letter is for the value part of the table being one of b,i,n or s
respectively for boolean, integer, number or string Lya types.
Helpers to set key/value to the table where keys are strings;
Helpers to set index/value to the table where indexes are integers;