1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-27 16:39:29 +00:00

Renamed item.fileSize to item.size in fs.list() return value, enabled 3D in the editor, added a lot of missing documentation

For the return values, I followed this rule: if the fuction returns true on success, it should return false, error on error; for every other case it should return nil, error on error.

Also, who doesn't want to edit code in 3D ? The line depth depends on the indentation level.
This commit is contained in:
Reuh 2016-04-22 13:42:59 +02:00
parent 2b7d37304d
commit 358b68c643
13 changed files with 143 additions and 72 deletions

View file

@ -109,7 +109,9 @@ static int socket_shutdown(lua_State *L) {
/***
Return a TCP socket.
@function tcp
@treturn TCPMaster TCP socket
@treturn[1] TCPMaster TCP socket
@treturn[2] nil in case of error
@treturn[2] string error message
*/
static int socket_tcp(lua_State *L) {
socket_userdata *userdata = lua_newuserdata(L, sizeof(*userdata));
@ -134,7 +136,9 @@ static int socket_tcp(lua_State *L) {
/***
Return an UDP socket.
@function udp
@treturn UDPMaster UDP socket
@treturn[1] UDPMaster UDP socket
@treturn[2] nil in case of error
@treturn[2] string error message
*/
static int socket_udp(lua_State *L) {
socket_userdata *userdata = lua_newuserdata(L, sizeof(*userdata));
@ -371,7 +375,9 @@ If no data is avaible, it returns an empty string (non-blocking).
"a" to receive everything,
"l" to receive the next line, skipping the end of line,
"L" to receive the next line, keeping the end of line.
@treturn string data
@treturn[1] string data
@treturn[2] nil in case of error
@treturn[2] integer error code
*/
static int socket_receive(lua_State *L) {
socket_userdata *userdata = luaL_checkudata(L, 1, "LSocket");
@ -440,7 +446,9 @@ static int socket_receive(lua_State *L) {
Send some data over the TCP socket.
@function :send
@tparam string data data to send
@treturn number amount of data sent
@treturn[1] number amount of data sent
@treturn[2] nil in case of error
@treturn[2] integer/string error code/message
*/
static int socket_send(lua_State *L) {
socket_userdata *userdata = luaL_checkudata(L, 1, "LSocket");