lua5.4
宏定义 | 类型定义 | 函数 | 变量
loadlib.c 文件参考
#include "lprefix.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
loadlib.c 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

宏定义

#define loadlib_c
 
#define LUA_LIB
 
#define LUA_IGMARK   "-"
 
#define LUA_CSUBSEP   LUA_DIRSEP
 
#define LUA_LSUBSEP   LUA_DIRSEP
 
#define LUA_POF   "luaopen_"
 
#define LUA_OFSEP   "_"
 
#define LIB_FAIL   "open"
 
#define setprogdir(L)   ((void)0)
 
#define LIB_FAIL   "absent"
 
#define DLMSG   "dynamic libraries not enabled; check your Lua installation"
 
#define LUA_PATH_VAR   "LUA_PATH"
 
#define LUA_CPATH_VAR   "LUA_CPATH"
 
#define ERRLIB   1
 
#define ERRFUNC   2
 

类型定义

typedef void(* voidf) (void)
 

函数

static void lsys_unloadlib (void *lib)
 
static void * lsys_load (lua_State *L, const char *path, int seeglb)
 
static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym)
 
static int noenv (lua_State *L)
 
static void setpath (lua_State *L, const char *fieldname, const char *envname, const char *dft)
 
static void * checkclib (lua_State *L, const char *path)
 
static void addtoclib (lua_State *L, const char *path, void *plib)
 
static int gctm (lua_State *L)
 
static int lookforfunc (lua_State *L, const char *path, const char *sym)
 
static int ll_loadlib (lua_State *L)
 
static int readable (const char *filename)
 
static const char * getnextfilename (char **path, char *end)
 
static void pusherrornotfound (lua_State *L, const char *path)
 
static const char * searchpath (lua_State *L, const char *name, const char *path, const char *sep, const char *dirsep)
 
static int ll_searchpath (lua_State *L)
 
static const char * findfile (lua_State *L, const char *name, const char *pname, const char *dirsep)
 
static int checkload (lua_State *L, int stat, const char *filename)
 
static int searcher_Lua (lua_State *L)
 
static int loadfunc (lua_State *L, const char *filename, const char *modname)
 
static int searcher_C (lua_State *L)
 
static int searcher_Croot (lua_State *L)
 
static int searcher_preload (lua_State *L)
 
static void findloader (lua_State *L, const char *name)
 
static int ll_require (lua_State *L)
 
static void createsearcherstable (lua_State *L)
 
static void createclibstable (lua_State *L)
 
LUAMOD_API int luaopen_package (lua_State *L)
 

变量

static const char *const CLIBS = "_CLIBS"
 
static const luaL_Reg pk_funcs []
 
static const luaL_Reg ll_funcs []
 

宏定义说明

◆ DLMSG

#define DLMSG   "dynamic libraries not enabled; check your Lua installation"

◆ ERRFUNC

#define ERRFUNC   2

◆ ERRLIB

#define ERRLIB   1

◆ LIB_FAIL [1/2]

#define LIB_FAIL   "open"

◆ LIB_FAIL [2/2]

#define LIB_FAIL   "absent"

◆ loadlib_c

#define loadlib_c

◆ LUA_CPATH_VAR

#define LUA_CPATH_VAR   "LUA_CPATH"

◆ LUA_CSUBSEP

#define LUA_CSUBSEP   LUA_DIRSEP

◆ LUA_IGMARK

#define LUA_IGMARK   "-"

◆ LUA_LIB

#define LUA_LIB

◆ LUA_LSUBSEP

#define LUA_LSUBSEP   LUA_DIRSEP

◆ LUA_OFSEP

#define LUA_OFSEP   "_"

◆ LUA_PATH_VAR

#define LUA_PATH_VAR   "LUA_PATH"

◆ LUA_POF

#define LUA_POF   "luaopen_"

◆ setprogdir

#define setprogdir (   L)    ((void)0)

类型定义说明

◆ voidf

typedef void(* voidf) (void)

函数说明

◆ addtoclib()

static void addtoclib ( lua_State L,
const char *  path,
void *  plib 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ checkclib()

static void* checkclib ( lua_State L,
const char *  path 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ checkload()

static int checkload ( lua_State L,
int  stat,
const char *  filename 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ createclibstable()

static void createclibstable ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ createsearcherstable()

static void createsearcherstable ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ findfile()

static const char* findfile ( lua_State L,
const char *  name,
const char *  pname,
const char *  dirsep 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ findloader()

static void findloader ( lua_State L,
const char *  name 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ gctm()

static int gctm ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ getnextfilename()

static const char* getnextfilename ( char **  path,
char *  end 
)
static
这是这个函数的调用关系图:

◆ ll_loadlib()

static int ll_loadlib ( lua_State L)
static
函数调用图:

◆ ll_require()

static int ll_require ( lua_State L)
static
函数调用图:

◆ ll_searchpath()

static int ll_searchpath ( lua_State L)
static
函数调用图:

◆ loadfunc()

static int loadfunc ( lua_State L,
const char *  filename,
const char *  modname 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ lookforfunc()

static int lookforfunc ( lua_State L,
const char *  path,
const char *  sym 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ lsys_load()

static void * lsys_load ( lua_State L,
const char *  path,
int  seeglb 
)
static
这是这个函数的调用关系图:

◆ lsys_sym()

static lua_CFunction lsys_sym ( lua_State L,
void *  lib,
const char *  sym 
)
static
这是这个函数的调用关系图:

◆ lsys_unloadlib()

static void lsys_unloadlib ( void *  lib)
static
这是这个函数的调用关系图:

◆ luaopen_package()

LUAMOD_API int luaopen_package ( lua_State L)
函数调用图:

◆ noenv()

static int noenv ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ pusherrornotfound()

static void pusherrornotfound ( lua_State L,
const char *  path 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ readable()

static int readable ( const char *  filename)
static
这是这个函数的调用关系图:

◆ searcher_C()

static int searcher_C ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ searcher_Croot()

static int searcher_Croot ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ searcher_Lua()

static int searcher_Lua ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ searcher_preload()

static int searcher_preload ( lua_State L)
static
函数调用图:
这是这个函数的调用关系图:

◆ searchpath()

static const char* searchpath ( lua_State L,
const char *  name,
const char *  path,
const char *  sep,
const char *  dirsep 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ setpath()

static void setpath ( lua_State L,
const char *  fieldname,
const char *  envname,
const char *  dft 
)
static
函数调用图:
这是这个函数的调用关系图:

变量说明

◆ CLIBS

const char* const CLIBS = "_CLIBS"
static

◆ ll_funcs

const luaL_Reg ll_funcs[]
static
初始值:
= {
{"require", ll_require},
{NULL, NULL}
}

◆ pk_funcs

const luaL_Reg pk_funcs[]
static
初始值:
= {
{"loadlib", ll_loadlib},
{"searchpath", ll_searchpath},
{"preload", NULL},
{"cpath", NULL},
{"path", NULL},
{"searchers", NULL},
{"loaded", NULL},
{NULL, NULL}
}
ll_require
static int ll_require(lua_State *L)
Definition: loadlib.c:654
ll_searchpath
static int ll_searchpath(lua_State *L)
Definition: loadlib.c:506
ll_loadlib
static int ll_loadlib(lua_State *L)
Definition: loadlib.c:409