aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-30 11:41:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-30 11:41:39 -0300
commitd1e677c52be3b107a7a29fdc482158f6d9251e79 (patch)
tree6b201f229a9dc1f0752f6544b71498a4d528941d /lapi.c
parentf7439112a5469078ac4f444106242cf1c1d3fe8a (diff)
downloadlua-d1e677c52be3b107a7a29fdc482158f6d9251e79.tar.gz
lua-d1e677c52be3b107a7a29fdc482158f6d9251e79.tar.bz2
lua-d1e677c52be3b107a7a29fdc482158f6d9251e79.zip
New type 'TStatus' for thread status/error codes
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lapi.c b/lapi.c
index 7b30617f..b3062072 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1070,7 +1070,7 @@ static void f_call (lua_State *L, void *ud) {
1070LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, 1070LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
1071 lua_KContext ctx, lua_KFunction k) { 1071 lua_KContext ctx, lua_KFunction k) {
1072 struct CallS c; 1072 struct CallS c;
1073 int status; 1073 TStatus status;
1074 ptrdiff_t func; 1074 ptrdiff_t func;
1075 lua_lock(L); 1075 lua_lock(L);
1076 api_check(L, k == NULL || !isLua(L->ci), 1076 api_check(L, k == NULL || !isLua(L->ci),
@@ -1107,14 +1107,14 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
1107 } 1107 }
1108 adjustresults(L, nresults); 1108 adjustresults(L, nresults);
1109 lua_unlock(L); 1109 lua_unlock(L);
1110 return status; 1110 return APIstatus(status);
1111} 1111}
1112 1112
1113 1113
1114LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, 1114LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
1115 const char *chunkname, const char *mode) { 1115 const char *chunkname, const char *mode) {
1116 ZIO z; 1116 ZIO z;
1117 int status; 1117 TStatus status;
1118 lua_lock(L); 1118 lua_lock(L);
1119 if (!chunkname) chunkname = "?"; 1119 if (!chunkname) chunkname = "?";
1120 luaZ_init(L, &z, reader, data); 1120 luaZ_init(L, &z, reader, data);
@@ -1131,7 +1131,7 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
1131 } 1131 }
1132 } 1132 }
1133 lua_unlock(L); 1133 lua_unlock(L);
1134 return status; 1134 return APIstatus(status);
1135} 1135}
1136 1136
1137 1137
@@ -1154,7 +1154,7 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) {
1154 1154
1155 1155
1156LUA_API int lua_status (lua_State *L) { 1156LUA_API int lua_status (lua_State *L) {
1157 return L->status; 1157 return APIstatus(L->status);
1158} 1158}
1159 1159
1160 1160