diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_lib.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lj_lib.h b/src/lj_lib.h index 2fe6d2a8..f9377bad 100644 --- a/src/lj_lib.h +++ b/src/lj_lib.h | |||
@@ -41,7 +41,6 @@ LJ_FUNC void lj_lib_checknumber(lua_State *L, int narg); | |||
41 | LJ_FUNC lua_Number lj_lib_checknum(lua_State *L, int narg); | 41 | LJ_FUNC lua_Number lj_lib_checknum(lua_State *L, int narg); |
42 | LJ_FUNC int32_t lj_lib_checkint(lua_State *L, int narg); | 42 | LJ_FUNC int32_t lj_lib_checkint(lua_State *L, int narg); |
43 | LJ_FUNC int32_t lj_lib_optint(lua_State *L, int narg, int32_t def); | 43 | LJ_FUNC int32_t lj_lib_optint(lua_State *L, int narg, int32_t def); |
44 | LJ_FUNC int32_t lj_lib_checkbit(lua_State *L, int narg); | ||
45 | LJ_FUNC GCfunc *lj_lib_checkfunc(lua_State *L, int narg); | 44 | LJ_FUNC GCfunc *lj_lib_checkfunc(lua_State *L, int narg); |
46 | LJ_FUNC GCtab *lj_lib_checktab(lua_State *L, int narg); | 45 | LJ_FUNC GCtab *lj_lib_checktab(lua_State *L, int narg); |
47 | LJ_FUNC GCtab *lj_lib_checktabornil(lua_State *L, int narg); | 46 | LJ_FUNC GCtab *lj_lib_checktabornil(lua_State *L, int narg); |
@@ -61,14 +60,15 @@ LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst); | |||
61 | #endif | 60 | #endif |
62 | 61 | ||
63 | /* Push internal function on the stack. */ | 62 | /* Push internal function on the stack. */ |
64 | static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f, | 63 | static LJ_AINLINE GCfunc *lj_lib_pushcc(lua_State *L, lua_CFunction f, |
65 | int id, int n) | 64 | int id, int n) |
66 | { | 65 | { |
67 | GCfunc *fn; | 66 | GCfunc *fn; |
68 | lua_pushcclosure(L, f, n); | 67 | lua_pushcclosure(L, f, n); |
69 | fn = funcV(L->top-1); | 68 | fn = funcV(L->top-1); |
70 | fn->c.ffid = (uint8_t)id; | 69 | fn->c.ffid = (uint8_t)id; |
71 | setmref(fn->c.pc, &G(L)->bc_cfunc_int); | 70 | setmref(fn->c.pc, &G(L)->bc_cfunc_int); |
71 | return fn; | ||
72 | } | 72 | } |
73 | 73 | ||
74 | #define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0)) | 74 | #define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0)) |
@@ -77,6 +77,7 @@ static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f, | |||
77 | #define LJLIB_CF(name) static int lj_cf_##name(lua_State *L) | 77 | #define LJLIB_CF(name) static int lj_cf_##name(lua_State *L) |
78 | #define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L) | 78 | #define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L) |
79 | #define LJLIB_ASM_(name) | 79 | #define LJLIB_ASM_(name) |
80 | #define LJLIB_LUA(name) | ||
80 | #define LJLIB_SET(name) | 81 | #define LJLIB_SET(name) |
81 | #define LJLIB_PUSH(arg) | 82 | #define LJLIB_PUSH(arg) |
82 | #define LJLIB_REC(handler) | 83 | #define LJLIB_REC(handler) |
@@ -88,6 +89,8 @@ static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f, | |||
88 | 89 | ||
89 | LJ_FUNC void lj_lib_register(lua_State *L, const char *libname, | 90 | LJ_FUNC void lj_lib_register(lua_State *L, const char *libname, |
90 | const uint8_t *init, const lua_CFunction *cf); | 91 | const uint8_t *init, const lua_CFunction *cf); |
92 | LJ_FUNC void lj_lib_prereg(lua_State *L, const char *name, lua_CFunction f, | ||
93 | GCtab *env); | ||
91 | 94 | ||
92 | /* Library init data tags. */ | 95 | /* Library init data tags. */ |
93 | #define LIBINIT_LENMASK 0x3f | 96 | #define LIBINIT_LENMASK 0x3f |
@@ -96,7 +99,8 @@ LJ_FUNC void lj_lib_register(lua_State *L, const char *libname, | |||
96 | #define LIBINIT_ASM 0x40 | 99 | #define LIBINIT_ASM 0x40 |
97 | #define LIBINIT_ASM_ 0x80 | 100 | #define LIBINIT_ASM_ 0x80 |
98 | #define LIBINIT_STRING 0xc0 | 101 | #define LIBINIT_STRING 0xc0 |
99 | #define LIBINIT_MAXSTR 0x39 | 102 | #define LIBINIT_MAXSTR 0x38 |
103 | #define LIBINIT_LUA 0xf9 | ||
100 | #define LIBINIT_SET 0xfa | 104 | #define LIBINIT_SET 0xfa |
101 | #define LIBINIT_NUMBER 0xfb | 105 | #define LIBINIT_NUMBER 0xfb |
102 | #define LIBINIT_COPY 0xfc | 106 | #define LIBINIT_COPY 0xfc |