mirror of
https://github.com/lua/lua
synced 2025-03-24 14:42:58 +03:00
'lua_Ctx' -> 'lua_Kcontext'
This commit is contained in:
parent
f5c690b684
commit
2be88d5084
8
lapi.c
8
lapi.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.231 2014/07/22 18:07:47 roberto Exp roberto $
|
** $Id: lapi.c,v 2.232 2014/07/30 14:00:14 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -854,8 +854,8 @@ LUA_API void lua_setuservalue (lua_State *L, int idx) {
|
|||||||
"results from function overflow current stack size")
|
"results from function overflow current stack size")
|
||||||
|
|
||||||
|
|
||||||
LUA_API void lua_callk (lua_State *L, int nargs, int nresults, lua_Ctx ctx,
|
LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
|
||||||
lua_KFunction k) {
|
lua_Kcontext ctx, lua_KFunction k) {
|
||||||
StkId func;
|
StkId func;
|
||||||
lua_lock(L);
|
lua_lock(L);
|
||||||
api_check(k == NULL || !isLua(L->ci),
|
api_check(k == NULL || !isLua(L->ci),
|
||||||
@ -894,7 +894,7 @@ static void f_call (lua_State *L, void *ud) {
|
|||||||
|
|
||||||
|
|
||||||
LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
|
LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
|
||||||
lua_Ctx ctx, lua_KFunction k) {
|
lua_Kcontext ctx, lua_KFunction k) {
|
||||||
struct CallS c;
|
struct CallS c;
|
||||||
int status;
|
int status;
|
||||||
ptrdiff_t func;
|
ptrdiff_t func;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lbaselib.c,v 1.293 2014/07/24 19:33:29 roberto Exp roberto $
|
** $Id: lbaselib.c,v 1.294 2014/08/01 17:22:57 roberto Exp roberto $
|
||||||
** Basic library
|
** Basic library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -380,7 +380,7 @@ static int luaB_load (lua_State *L) {
|
|||||||
/* }====================================================== */
|
/* }====================================================== */
|
||||||
|
|
||||||
|
|
||||||
static int dofilecont (lua_State *L, int d1, lua_Ctx d2) {
|
static int dofilecont (lua_State *L, int d1, lua_Kcontext d2) {
|
||||||
(void)d1; (void)d2; /* only to match 'lua_Kfunction' prototype */
|
(void)d1; (void)d2; /* only to match 'lua_Kfunction' prototype */
|
||||||
return lua_gettop(L) - 1;
|
return lua_gettop(L) - 1;
|
||||||
}
|
}
|
||||||
@ -431,7 +431,7 @@ static int luaB_select (lua_State *L) {
|
|||||||
** 'extra' values (where 'extra' is exactly the number of items to be
|
** 'extra' values (where 'extra' is exactly the number of items to be
|
||||||
** ignored).
|
** ignored).
|
||||||
*/
|
*/
|
||||||
static int finishpcall (lua_State *L, int status, lua_Ctx extra) {
|
static int finishpcall (lua_State *L, int status, lua_Kcontext extra) {
|
||||||
if (status != LUA_OK && status != LUA_YIELD) { /* error? */
|
if (status != LUA_OK && status != LUA_YIELD) { /* error? */
|
||||||
lua_pushboolean(L, 0); /* first result (false) */
|
lua_pushboolean(L, 0); /* first result (false) */
|
||||||
lua_pushvalue(L, -2); /* error message */
|
lua_pushvalue(L, -2); /* error message */
|
||||||
|
4
ldo.c
4
ldo.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.c,v 2.125 2014/07/15 21:26:50 roberto Exp roberto $
|
** $Id: ldo.c,v 2.126 2014/07/17 13:53:37 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -593,7 +593,7 @@ LUA_API int lua_isyieldable (lua_State *L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LUA_API int lua_yieldk (lua_State *L, int nresults, lua_Ctx ctx,
|
LUA_API int lua_yieldk (lua_State *L, int nresults, lua_Kcontext ctx,
|
||||||
lua_KFunction k) {
|
lua_KFunction k) {
|
||||||
CallInfo *ci = L->ci;
|
CallInfo *ci = L->ci;
|
||||||
luai_userstateyield(L, nresults);
|
luai_userstateyield(L, nresults);
|
||||||
|
4
lstate.h
4
lstate.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lstate.h,v 2.113 2014/07/18 14:46:47 roberto Exp roberto $
|
** $Id: lstate.h,v 2.114 2014/07/23 17:15:43 roberto Exp roberto $
|
||||||
** Global State
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -68,7 +68,7 @@ typedef struct CallInfo {
|
|||||||
struct { /* only for C functions */
|
struct { /* only for C functions */
|
||||||
lua_KFunction k; /* continuation in case of yields */
|
lua_KFunction k; /* continuation in case of yields */
|
||||||
ptrdiff_t old_errfunc;
|
ptrdiff_t old_errfunc;
|
||||||
lua_Ctx ctx; /* context info. in case of yields */
|
lua_Kcontext ctx; /* context info. in case of yields */
|
||||||
} c;
|
} c;
|
||||||
} u;
|
} u;
|
||||||
ptrdiff_t extra;
|
ptrdiff_t extra;
|
||||||
|
6
ltests.c
6
ltests.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ltests.c,v 2.181 2014/07/19 15:14:46 roberto Exp roberto $
|
** $Id: ltests.c,v 2.182 2014/07/23 16:44:30 roberto Exp roberto $
|
||||||
** Internal Module for Debugging of the Lua Implementation
|
** Internal Module for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -979,7 +979,7 @@ static void pushcode (lua_State *L, int code) {
|
|||||||
|
|
||||||
|
|
||||||
static int testC (lua_State *L);
|
static int testC (lua_State *L);
|
||||||
static int Cfunck (lua_State *L, int status, lua_Ctx ctx);
|
static int Cfunck (lua_State *L, int status, lua_Kcontext ctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** arithmetic operation encoding for 'arith' instruction
|
** arithmetic operation encoding for 'arith' instruction
|
||||||
@ -1316,7 +1316,7 @@ static int Cfunc (lua_State *L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int Cfunck (lua_State *L, int status, lua_Ctx ctx) {
|
static int Cfunck (lua_State *L, int status, lua_Kcontext ctx) {
|
||||||
pushcode(L, status);
|
pushcode(L, status);
|
||||||
lua_setglobal(L, "status");
|
lua_setglobal(L, "status");
|
||||||
lua_pushinteger(L, ctx);
|
lua_pushinteger(L, ctx);
|
||||||
|
14
lua.h
14
lua.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lua.h,v 1.311 2014/07/24 14:00:16 roberto Exp roberto $
|
** $Id: lua.h,v 1.312 2014/07/31 13:44:30 roberto Exp roberto $
|
||||||
** Lua - A Scripting Language
|
** Lua - A Scripting Language
|
||||||
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
|
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
|
||||||
** See Copyright Notice at the end of this file
|
** See Copyright Notice at the end of this file
|
||||||
@ -94,7 +94,7 @@ typedef LUA_INTEGER lua_Integer;
|
|||||||
typedef LUA_UNSIGNED lua_Unsigned;
|
typedef LUA_UNSIGNED lua_Unsigned;
|
||||||
|
|
||||||
/* type for continuation-function contexts */
|
/* type for continuation-function contexts */
|
||||||
typedef LUA_CTXT lua_Ctx;
|
typedef LUA_KCONTEXT lua_Kcontext;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -105,7 +105,7 @@ typedef int (*lua_CFunction) (lua_State *L);
|
|||||||
/*
|
/*
|
||||||
** Type for continuation functions
|
** Type for continuation functions
|
||||||
*/
|
*/
|
||||||
typedef int (*lua_KFunction) (lua_State *L, int status, lua_Ctx ctx);
|
typedef int (*lua_KFunction) (lua_State *L, int status, lua_Kcontext ctx);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -265,12 +265,12 @@ LUA_API void (lua_setuservalue) (lua_State *L, int idx);
|
|||||||
/*
|
/*
|
||||||
** 'load' and 'call' functions (load and run Lua code)
|
** 'load' and 'call' functions (load and run Lua code)
|
||||||
*/
|
*/
|
||||||
LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, lua_Ctx ctx,
|
LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults,
|
||||||
lua_KFunction k);
|
lua_Kcontext ctx, lua_KFunction k);
|
||||||
#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL)
|
#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL)
|
||||||
|
|
||||||
LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
|
LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
|
||||||
lua_Ctx ctx, lua_KFunction k);
|
lua_Kcontext ctx, lua_KFunction k);
|
||||||
#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
|
#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
|
||||||
|
|
||||||
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
|
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
|
||||||
@ -283,7 +283,7 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip);
|
|||||||
/*
|
/*
|
||||||
** coroutine functions
|
** coroutine functions
|
||||||
*/
|
*/
|
||||||
LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_Ctx ctx,
|
LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_Kcontext ctx,
|
||||||
lua_KFunction k);
|
lua_KFunction k);
|
||||||
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
|
#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
|
||||||
LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg);
|
LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg);
|
||||||
|
15
luaconf.h
15
luaconf.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: luaconf.h,v 1.211 2014/07/24 14:00:16 roberto Exp roberto $
|
** $Id: luaconf.h,v 1.212 2014/07/24 19:33:29 roberto Exp roberto $
|
||||||
** Configuration file for Lua
|
** Configuration file for Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -263,19 +263,20 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ LUA_CTXT is the type of the context ('ctx') for continuation functions.
|
@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation
|
||||||
@@ It must be a numerical type; Lua will use 'intptr_t' if available.
|
@@ functions. It must be a numerical type; Lua will use 'intptr_t' if
|
||||||
|
@@ available.
|
||||||
*/
|
*/
|
||||||
#if defined (LUA_USE_C99)
|
#if defined (LUA_USE_C99)
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#if defined (INTPTR_MAX) /* even in C99 this type is optional */
|
#if defined (INTPTR_MAX) /* even in C99 this type is optional */
|
||||||
#define LUA_CTXT intptr_t
|
#define LUA_KCONTEXT intptr_t
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(LUA_CTXT)
|
#if !defined(LUA_KCONTEXT)
|
||||||
/* default definition (the nearest thing to 'intptr_t' in C89) */
|
/* default definition (the nearest thing to 'intptr_t' in C89) */
|
||||||
#define LUA_CTXT ptrdiff_t
|
#define LUA_KCONTEXT ptrdiff_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -305,7 +306,7 @@
|
|||||||
#define LUA_COMPAT_BITLIB
|
#define LUA_COMPAT_BITLIB
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ LUA_COMPAT_IPAIRS controls the effectivness of the __ipairs metamethod.
|
@@ LUA_COMPAT_IPAIRS controls the effectivnness of the __ipairs metamethod.
|
||||||
*/
|
*/
|
||||||
#define LUA_COMPAT_IPAIRS
|
#define LUA_COMPAT_IPAIRS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user