diff options
author | sanine <sanine.not@pm.me> | 2023-03-11 15:58:20 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-11 15:58:20 -0600 |
commit | ebc50b387ab209c9f9a0d92e340ac293d5697274 (patch) | |
tree | ea8c8b3677a18c994d2b9d33dbef3461dcf18113 /libs/luajit-cmake/luajit/src/lj_clib.h | |
parent | c2329b4c8258baa9429c77566c9def97d00e96d7 (diff) |
build & link with luajit instead of lua5.1
Diffstat (limited to 'libs/luajit-cmake/luajit/src/lj_clib.h')
-rw-r--r-- | libs/luajit-cmake/luajit/src/lj_clib.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/luajit-cmake/luajit/src/lj_clib.h b/libs/luajit-cmake/luajit/src/lj_clib.h new file mode 100644 index 0000000..4429486 --- /dev/null +++ b/libs/luajit-cmake/luajit/src/lj_clib.h @@ -0,0 +1,29 @@ +/* +** FFI C library loader. +** Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h +*/ + +#ifndef _LJ_CLIB_H +#define _LJ_CLIB_H + +#include "lj_obj.h" + +#if LJ_HASFFI + +/* Namespace for C library indexing. */ +#define CLNS_INDEX ((1u<<CT_FUNC)|(1u<<CT_EXTERN)|(1u<<CT_CONSTVAL)) + +/* C library namespace. */ +typedef struct CLibrary { + void *handle; /* Opaque handle for dynamic library loader. */ + GCtab *cache; /* Cache for resolved symbols. Anchored in ud->env. */ +} CLibrary; + +LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name); +LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global); +LJ_FUNC void lj_clib_unload(CLibrary *cl); +LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt); + +#endif + +#endif |