Macros | Typedefs | Functions | Variables
loadlib.c File Reference
#include "lprefix.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for loadlib.c:

Go to the source code of this file.

Macros

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

Typedefs

typedef void(* voidf) (void)
 

Functions

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

Variables

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

Macro Definition Documentation

◆ DLMSG

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

Definition at line 237 of file loadlib.c.

◆ ERRFUNC

#define ERRFUNC   2

Definition at line 377 of file loadlib.c.

◆ ERRLIB

#define ERRLIB   1

Definition at line 376 of file loadlib.c.

◆ LIB_FAIL [1/2]

#define LIB_FAIL   "open"

Definition at line 234 of file loadlib.c.

◆ LIB_FAIL [2/2]

#define LIB_FAIL   "absent"

Definition at line 234 of file loadlib.c.

◆ loadlib_c

#define loadlib_c

Definition at line 11 of file loadlib.c.

◆ LUA_CPATH_VAR

#define LUA_CPATH_VAR   "LUA_CPATH"

Definition at line 277 of file loadlib.c.

◆ LUA_CSUBSEP

#define LUA_CSUBSEP   LUA_DIRSEP

Definition at line 43 of file loadlib.c.

◆ LUA_IGMARK

#define LUA_IGMARK   "-"

Definition at line 32 of file loadlib.c.

◆ LUA_LIB

#define LUA_LIB

Definition at line 12 of file loadlib.c.

◆ LUA_LSUBSEP

#define LUA_LSUBSEP   LUA_DIRSEP

Definition at line 47 of file loadlib.c.

◆ LUA_OFSEP

#define LUA_OFSEP   "_"

Definition at line 55 of file loadlib.c.

◆ LUA_PATH_VAR

#define LUA_PATH_VAR   "LUA_PATH"

Definition at line 273 of file loadlib.c.

◆ LUA_POF

#define LUA_POF   "luaopen_"

Definition at line 52 of file loadlib.c.

◆ setprogdir

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

Definition at line 67 of file loadlib.c.

Typedef Documentation

◆ voidf

typedef void(* voidf) (void)

Definition at line 74 of file loadlib.c.

Function Documentation

◆ addtoclib()

static void addtoclib ( lua_State L,
const char *  path,
void *  plib 
)
static

Definition at line 349 of file loadlib.c.

◆ checkclib()

static void* checkclib ( lua_State L,
const char *  path 
)
static

Definition at line 335 of file loadlib.c.

◆ checkload()

static int checkload ( lua_State L,
int  stat,
const char *  filename 
)
static

Definition at line 534 of file loadlib.c.

◆ createclibstable()

static void createclibstable ( lua_State L)
static

Definition at line 730 of file loadlib.c.

◆ createsearcherstable()

static void createsearcherstable ( lua_State L)
static

Definition at line 710 of file loadlib.c.

◆ findfile()

static const char* findfile ( lua_State L,
const char *  name,
const char *  pname,
const char *  dirsep 
)
static

Definition at line 522 of file loadlib.c.

◆ findloader()

static void findloader ( lua_State L,
const char *  name 
)
static

Definition at line 624 of file loadlib.c.

◆ gctm()

static int gctm ( lua_State L)
static

Definition at line 363 of file loadlib.c.

◆ getnextfilename()

static const char* getnextfilename ( char **  path,
char *  end 
)
static

Definition at line 447 of file loadlib.c.

◆ ll_loadlib()

static int ll_loadlib ( lua_State L)
static

Definition at line 411 of file loadlib.c.

◆ ll_require()

static int ll_require ( lua_State L)
static

Definition at line 657 of file loadlib.c.

◆ ll_searchpath()

static int ll_searchpath ( lua_State L)
static

Definition at line 508 of file loadlib.c.

◆ loadfunc()

static int loadfunc ( lua_State L,
const char *  filename,
const char *  modname 
)
static

Definition at line 562 of file loadlib.c.

◆ lookforfunc()

static int lookforfunc ( lua_State L,
const char *  path,
const char *  sym 
)
static

Definition at line 390 of file loadlib.c.

◆ lsys_load()

static void * lsys_load ( lua_State L,
const char *  path,
int  seeglb 
)
static

Definition at line 245 of file loadlib.c.

◆ lsys_sym()

static lua_CFunction lsys_sym ( lua_State L,
void *  lib,
const char *  sym 
)
static

Definition at line 252 of file loadlib.c.

◆ lsys_unloadlib()

static void lsys_unloadlib ( void *  lib)
static

Definition at line 240 of file loadlib.c.

◆ luaopen_package()

LUAMOD_API int luaopen_package ( lua_State L)

Definition at line 739 of file loadlib.c.

◆ noenv()

static int noenv ( lua_State L)
static

Definition at line 285 of file loadlib.c.

◆ pusherrornotfound()

static void pusherrornotfound ( lua_State L,
const char *  path 
)
static

Definition at line 471 of file loadlib.c.

◆ readable()

static int readable ( const char *  filename)
static

Definition at line 434 of file loadlib.c.

◆ searcher_C()

static int searcher_C ( lua_State L)
static

Definition at line 580 of file loadlib.c.

◆ searcher_Croot()

static int searcher_Croot ( lua_State L)
static

Definition at line 588 of file loadlib.c.

◆ searcher_Lua()

static int searcher_Lua ( lua_State L)
static

Definition at line 545 of file loadlib.c.

◆ searcher_preload()

static int searcher_preload ( lua_State L)
static

Definition at line 610 of file loadlib.c.

◆ searchpath()

static const char* searchpath ( lua_State L,
const char *  name,
const char *  path,
const char *  sep,
const char *  dirsep 
)
static

Definition at line 481 of file loadlib.c.

◆ setpath()

static void setpath ( lua_State L,
const char *  fieldname,
const char *  envname,
const char *  dft 
)
static

Definition at line 297 of file loadlib.c.

Variable Documentation

◆ CLIBS

const char* const CLIBS = "_CLIBS"
static

Definition at line 62 of file loadlib.c.

◆ ll_funcs

const luaL_Reg ll_funcs[]
static
Initial value:
= {
{"require", ll_require},
{NULL, NULL}
}

Definition at line 704 of file loadlib.c.

◆ pk_funcs

const luaL_Reg pk_funcs[]
static
Initial value:
= {
{"loadlib", ll_loadlib},
{"searchpath", ll_searchpath},
{"preload", NULL},
{"cpath", NULL},
{"path", NULL},
{"searchers", NULL},
{"loaded", NULL},
{NULL, NULL}
}

Definition at line 691 of file loadlib.c.

ll_require
static int ll_require(lua_State *L)
Definition: loadlib.c:657
ll_searchpath
static int ll_searchpath(lua_State *L)
Definition: loadlib.c:508
ll_loadlib
static int ll_loadlib(lua_State *L)
Definition: loadlib.c:411


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49