diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-04-21 09:36:25 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-04-21 09:36:25 +0800 |
| commit | b7bdf7d5d36825a1a750a74641f6d374dec5d67a (patch) | |
| tree | 6b27eb6590e07c07f378305c51d0f5e0779faa83 /src/lua/lapi.h | |
| parent | b86e5af605a170a3559df0165eac3cb6b665dc49 (diff) | |
| download | yuescript-b7bdf7d5d36825a1a750a74641f6d374dec5d67a.tar.gz yuescript-b7bdf7d5d36825a1a750a74641f6d374dec5d67a.tar.bz2 yuescript-b7bdf7d5d36825a1a750a74641f6d374dec5d67a.zip | |
adjust some folder levels.
Diffstat (limited to 'src/lua/lapi.h')
| -rw-r--r-- | src/lua/lapi.h | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/lua/lapi.h b/src/lua/lapi.h deleted file mode 100644 index 9e99cc4..0000000 --- a/src/lua/lapi.h +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | /* | ||
| 2 | ** $Id: lapi.h $ | ||
| 3 | ** Auxiliary functions from Lua API | ||
| 4 | ** See Copyright Notice in lua.h | ||
| 5 | */ | ||
| 6 | |||
| 7 | #ifndef lapi_h | ||
| 8 | #define lapi_h | ||
| 9 | |||
| 10 | |||
| 11 | #include "llimits.h" | ||
| 12 | #include "lstate.h" | ||
| 13 | |||
| 14 | |||
| 15 | /* Increments 'L->top', checking for stack overflows */ | ||
| 16 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ | ||
| 17 | "stack overflow");} | ||
| 18 | |||
| 19 | |||
| 20 | /* | ||
| 21 | ** If a call returns too many multiple returns, the callee may not have | ||
| 22 | ** stack space to accommodate all results. In this case, this macro | ||
| 23 | ** increases its stack space ('L->ci->top'). | ||
| 24 | */ | ||
| 25 | #define adjustresults(L,nres) \ | ||
| 26 | { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } | ||
| 27 | |||
| 28 | |||
| 29 | /* Ensure the stack has at least 'n' elements */ | ||
| 30 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ | ||
| 31 | "not enough elements in the stack") | ||
| 32 | |||
| 33 | |||
| 34 | /* | ||
| 35 | ** To reduce the overhead of returning from C functions, the presence of | ||
| 36 | ** to-be-closed variables in these functions is coded in the CallInfo's | ||
| 37 | ** field 'nresults', in a way that functions with no to-be-closed variables | ||
| 38 | ** with zero, one, or "all" wanted results have no overhead. Functions | ||
| 39 | ** with other number of wanted results, as well as functions with | ||
| 40 | ** variables to be closed, have an extra check. | ||
| 41 | */ | ||
| 42 | |||
| 43 | #define hastocloseCfunc(n) ((n) < LUA_MULTRET) | ||
| 44 | |||
| 45 | /* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ | ||
| 46 | #define codeNresults(n) (-(n) - 3) | ||
| 47 | #define decodeNresults(n) (-(n) - 3) | ||
| 48 | |||
| 49 | #endif | ||
