src/lj_clib.h - luajit-2.0-src

Data types defined

Macros defined

Source code

  1. /*
  2. ** FFI C library loader.
  3. ** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
  4. */

  5. #ifndef _LJ_CLIB_H
  6. #define _LJ_CLIB_H

  7. #include "lj_obj.h"

  8. #if LJ_HASFFI

  9. /* Namespace for C library indexing. */
  10. #define CLNS_INDEX        ((1u<<CT_FUNC)|(1u<<CT_EXTERN)|(1u<<CT_CONSTVAL))

  11. /* C library namespace. */
  12. typedef struct CLibrary {
  13.   void *handle;                /* Opaque handle for dynamic library loader. */
  14.   GCtab *cache;                /* Cache for resolved symbols. Anchored in ud->env. */
  15. } CLibrary;

  16. LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name);
  17. LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global);
  18. LJ_FUNC void lj_clib_unload(CLibrary *cl);
  19. LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt);

  20. #endif

  21. #endif