Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include "lprefix.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Go to the source code of this file.
Macros | |
#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 |
Typedefs | |
typedef void(* | voidf) (void) |
Functions | |
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) |
Variables | |
static const char *const | CLIBS = "_CLIBS" |
static const luaL_Reg | pk_funcs [] |
static const luaL_Reg | ll_funcs [] |
#define DLMSG "dynamic libraries not enabled; check your Lua installation" |
Definition at line 237 of file lua-5.4.3/src/loadlib.c.
Referenced by lsys_load(), and lsys_sym().
#define ERRFUNC 2 |
Definition at line 377 of file lua-5.4.3/src/loadlib.c.
Referenced by loadfunc(), lookforfunc(), and searcher_Croot().
#define ERRLIB 1 |
Definition at line 376 of file lua-5.4.3/src/loadlib.c.
Referenced by ll_loadlib(), and lookforfunc().
#define LIB_FAIL "open" |
Definition at line 64 of file lua-5.4.3/src/loadlib.c.
Referenced by ll_loadlib().
#define LIB_FAIL "absent" |
Definition at line 64 of file lua-5.4.3/src/loadlib.c.
#define loadlib_c |
Definition at line 11 of file lua-5.4.3/src/loadlib.c.
#define LUA_CPATH_VAR "LUA_CPATH" |
Definition at line 277 of file lua-5.4.3/src/loadlib.c.
Referenced by luaopen_package().
#define LUA_CSUBSEP LUA_DIRSEP |
Definition at line 43 of file lua-5.4.3/src/loadlib.c.
Referenced by searcher_C(), and searcher_Croot().
#define LUA_IGMARK "-" |
Definition at line 32 of file lua-5.4.3/src/loadlib.c.
Referenced by loadfunc(), and luaopen_package().
#define LUA_LIB |
Definition at line 12 of file lua-5.4.3/src/loadlib.c.
#define LUA_LSUBSEP LUA_DIRSEP |
Definition at line 47 of file lua-5.4.3/src/loadlib.c.
Referenced by searcher_Lua().
#define LUA_OFSEP "_" |
Definition at line 55 of file lua-5.4.3/src/loadlib.c.
Referenced by loadfunc().
#define LUA_PATH_VAR "LUA_PATH" |
Definition at line 273 of file lua-5.4.3/src/loadlib.c.
Referenced by luaopen_package().
#define LUA_POF "luaopen_" |
Definition at line 52 of file lua-5.4.3/src/loadlib.c.
Referenced by loadfunc().
#define setprogdir | ( | L | ) | ((void)0) |
Definition at line 67 of file lua-5.4.3/src/loadlib.c.
Referenced by setpath().
typedef void(* voidf) (void) |
Definition at line 74 of file lua-5.4.3/src/loadlib.c.
|
static |
Definition at line 349 of file lua-5.4.3/src/loadlib.c.
References CLIBS, lua_getfield(), lua_pop, lua_pushlightuserdata(), lua_pushvalue(), lua_rawseti(), LUA_REGISTRYINDEX, lua_setfield(), and luaL_len().
Referenced by lookforfunc().
|
static |
Definition at line 335 of file lua-5.4.3/src/loadlib.c.
References CLIBS, lua_getfield(), lua_pop, LUA_REGISTRYINDEX, and lua_touserdata().
Referenced by lookforfunc().
|
static |
Definition at line 534 of file lua-5.4.3/src/loadlib.c.
References lua_pushstring(), lua_tostring, and luaL_error().
Referenced by searcher_C(), searcher_Croot(), and searcher_Lua().
|
static |
Definition at line 730 of file lua-5.4.3/src/loadlib.c.
References CLIBS, gctm(), lua_createtable(), lua_pushcfunction, LUA_REGISTRYINDEX, lua_setfield(), lua_setmetatable(), and luaL_getsubtable().
Referenced by luaopen_package().
|
static |
Definition at line 710 of file lua-5.4.3/src/loadlib.c.
References lua_createtable(), lua_pushcclosure(), lua_pushvalue(), lua_rawseti(), lua_setfield(), NULL, searcher_C(), searcher_Croot(), searcher_Lua(), and searcher_preload().
Referenced by luaopen_package().
|
static |
Definition at line 522 of file lua-5.4.3/src/loadlib.c.
References lua_getfield(), lua_tostring, lua_upvalueindex, luaL_error(), name, NULL, and searchpath().
Referenced by searcher_C(), searcher_Croot(), and searcher_Lua().
|
static |
Definition at line 624 of file lua-5.4.3/src/loadlib.c.
References lua_call, lua_getfield(), lua_isfunction, lua_isstring(), lua_pop, lua_pushstring(), lua_rawgeti(), LUA_TNIL, lua_tostring, LUA_TTABLE, lua_upvalueindex, luaL_addstring(), luaL_addvalue(), luaL_buffinit(), luaL_buffsub, luaL_error(), luaL_pushresult(), and name.
Referenced by ll_require().
|
static |
Definition at line 363 of file lua-5.4.3/src/loadlib.c.
References lsys_unloadlib(), lua_pop, lua_rawgeti(), lua_touserdata(), and luaL_len().
Referenced by createclibstable().
|
static |
Definition at line 447 of file lua-5.4.3/src/loadlib.c.
References LUA_PATH_SEP, name, and NULL.
Referenced by searchpath().
|
static |
Definition at line 411 of file lua-5.4.3/src/loadlib.c.
References ERRLIB, LIB_FAIL, lookforfunc(), lua_insert, lua_pushstring(), luaL_checkstring, and luaL_pushfail.
|
static |
Definition at line 657 of file lua-5.4.3/src/loadlib.c.
References findloader(), lua_call, lua_copy(), lua_getfield(), lua_isnil, LUA_LOADED_TABLE, lua_pop, lua_pushboolean(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_rotate(), lua_setfield(), lua_settop(), LUA_TNIL, lua_toboolean(), luaL_checkstring, and name.
|
static |
Definition at line 508 of file lua-5.4.3/src/loadlib.c.
References LUA_DIRSEP, lua_insert, luaL_checkstring, luaL_optstring, luaL_pushfail, NULL, and searchpath().
|
static |
Definition at line 562 of file lua-5.4.3/src/loadlib.c.
References ERRFUNC, lookforfunc(), LUA_IGMARK, LUA_OFSEP, LUA_POF, lua_pushfstring(), lua_pushlstring(), and luaL_gsub().
Referenced by searcher_C(), and searcher_Croot().
|
static |
Definition at line 390 of file lua-5.4.3/src/loadlib.c.
References addtoclib(), checkclib(), ERRFUNC, ERRLIB, lsys_load(), lsys_sym(), lua_pushboolean(), lua_pushcfunction, and NULL.
Referenced by ll_loadlib(), and loadfunc().
|
static |
Definition at line 245 of file lua-5.4.3/src/loadlib.c.
References DLMSG, lua_pushliteral, and NULL.
Referenced by lookforfunc().
|
static |
Definition at line 252 of file lua-5.4.3/src/loadlib.c.
References DLMSG, lua_pushliteral, and NULL.
Referenced by lookforfunc().
|
static |
Definition at line 240 of file lua-5.4.3/src/loadlib.c.
Referenced by gctm().
LUAMOD_API int luaopen_package | ( | lua_State * | L | ) |
Definition at line 739 of file lua-5.4.3/src/loadlib.c.
References createclibstable(), createsearcherstable(), ll_funcs, LUA_CPATH_DEFAULT, LUA_CPATH_VAR, LUA_DIRSEP, LUA_EXEC_DIR, LUA_IGMARK, LUA_LOADED_TABLE, LUA_PATH_DEFAULT, LUA_PATH_MARK, LUA_PATH_SEP, LUA_PATH_VAR, lua_pop, LUA_PRELOAD_TABLE, lua_pushglobaltable, lua_pushliteral, lua_pushvalue(), LUA_REGISTRYINDEX, lua_setfield(), luaL_getsubtable(), luaL_newlib, luaL_setfuncs(), pk_funcs, and setpath().
|
static |
Definition at line 285 of file lua-5.4.3/src/loadlib.c.
References lua_getfield(), lua_pop, LUA_REGISTRYINDEX, and lua_toboolean().
Referenced by setpath().
|
static |
Definition at line 471 of file lua-5.4.3/src/loadlib.c.
References LUA_PATH_SEP, luaL_addgsub(), luaL_addstring(), luaL_buffinit(), and luaL_pushresult().
Referenced by searchpath().
|
static |
Definition at line 434 of file lua-5.4.3/src/loadlib.c.
References NULL.
Referenced by searchpath().
|
static |
Definition at line 580 of file lua-5.4.3/src/loadlib.c.
References checkload(), findfile(), loadfunc(), LUA_CSUBSEP, luaL_checkstring, name, and NULL.
Referenced by createsearcherstable().
|
static |
Definition at line 588 of file lua-5.4.3/src/loadlib.c.
References checkload(), ERRFUNC, findfile(), loadfunc(), LUA_CSUBSEP, lua_pushfstring(), lua_pushlstring(), lua_pushstring(), lua_tostring, luaL_checkstring, name, and NULL.
Referenced by createsearcherstable().
|
static |
Definition at line 545 of file lua-5.4.3/src/loadlib.c.
References checkload(), findfile(), LUA_LSUBSEP, LUA_OK, luaL_checkstring, luaL_loadfile, name, and NULL.
Referenced by createsearcherstable().
|
static |
Definition at line 610 of file lua-5.4.3/src/loadlib.c.
References lua_getfield(), LUA_PRELOAD_TABLE, lua_pushfstring(), lua_pushliteral, LUA_REGISTRYINDEX, LUA_TNIL, luaL_checkstring, and name.
Referenced by createsearcherstable().
|
static |
Definition at line 481 of file lua-5.4.3/src/loadlib.c.
References getnextfilename(), LUA_PATH_MARK, lua_pushstring(), lua_tostring, luaL_addchar, luaL_addgsub(), luaL_buffaddr, luaL_buffinit(), luaL_bufflen, luaL_gsub(), luaL_pushresult(), name, NULL, pusherrornotfound(), and readable().
Referenced by findfile(), and ll_searchpath().
|
static |
Definition at line 297 of file lua-5.4.3/src/loadlib.c.
References LUA_PATH_SEP, lua_pop, lua_pushfstring(), lua_pushstring(), lua_setfield(), LUA_VERSUFFIX, luaL_addchar, luaL_addlstring(), luaL_addstring(), luaL_buffinit(), luaL_pushresult(), noenv(), NULL, and setprogdir.
Referenced by luaopen_package().
|
static |
Definition at line 62 of file lua-5.4.3/src/loadlib.c.
Referenced by addtoclib(), checkclib(), and createclibstable().
|
static |
Definition at line 704 of file lua-5.4.3/src/loadlib.c.
Referenced by luaopen_package().
|
static |
Definition at line 691 of file lua-5.4.3/src/loadlib.c.
Referenced by luaopen_package().