mirror of
https://github.com/lua/lua.git
synced 2024-11-27 12:13:38 +08:00
detail
This commit is contained in:
parent
9273fbd131
commit
3390f9a35a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lauxlib.c,v 1.149 2005/08/25 15:39:16 roberto Exp roberto $
|
||||
** $Id: lauxlib.c,v 1.150 2005/08/26 17:32:05 roberto Exp roberto $
|
||||
** Auxiliary functions for building Lua libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -222,13 +222,13 @@ LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {
|
||||
|
||||
|
||||
LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
|
||||
const luaL_reg *l) {
|
||||
const luaL_Reg *l) {
|
||||
luaI_openlib(L, libname, l, 0);
|
||||
}
|
||||
|
||||
|
||||
LUALIB_API void luaI_openlib (lua_State *L, const char *libname,
|
||||
const luaL_reg *l, int nup) {
|
||||
const luaL_Reg *l, int nup) {
|
||||
if (libname) {
|
||||
/* check whether lib already exists */
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
|
||||
|
12
lauxlib.h
12
lauxlib.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lauxlib.h,v 1.82 2005/08/18 20:36:26 roberto Exp roberto $
|
||||
** $Id: lauxlib.h,v 1.83 2005/08/26 17:32:05 roberto Exp roberto $
|
||||
** Auxiliary functions for building Lua libraries
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -29,17 +29,17 @@
|
||||
#define LUA_ERRFILE (LUA_ERRERR+1)
|
||||
|
||||
|
||||
typedef struct luaL_reg {
|
||||
typedef struct luaL_Reg {
|
||||
const char *name;
|
||||
lua_CFunction func;
|
||||
} luaL_reg;
|
||||
} luaL_Reg;
|
||||
|
||||
|
||||
|
||||
LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
|
||||
const luaL_reg *l, int nup);
|
||||
const luaL_Reg *l, int nup);
|
||||
LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
|
||||
const luaL_reg *l);
|
||||
const luaL_Reg *l);
|
||||
LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
|
||||
LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
|
||||
LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
|
||||
@ -164,6 +164,8 @@ LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
|
||||
#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
|
||||
|
||||
|
||||
#define luaL_reg luaL_Reg
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lbaselib.c,v 1.180 2005/07/12 18:15:11 roberto Exp roberto $
|
||||
** $Id: lbaselib.c,v 1.181 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Basic library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -429,7 +429,7 @@ static int luaB_newproxy (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg base_funcs[] = {
|
||||
static const luaL_Reg base_funcs[] = {
|
||||
{"assert", luaB_assert},
|
||||
{"collectgarbage", luaB_collectgarbage},
|
||||
{"dofile", luaB_dofile},
|
||||
@ -579,7 +579,7 @@ static int luaB_corunning (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg co_funcs[] = {
|
||||
static const luaL_Reg co_funcs[] = {
|
||||
{"create", luaB_cocreate},
|
||||
{"resume", luaB_coresume},
|
||||
{"running", luaB_corunning},
|
||||
|
4
ldblib.c
4
ldblib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ldblib.c,v 1.99 2005/07/12 14:32:08 roberto Exp roberto $
|
||||
** $Id: ldblib.c,v 1.100 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Interface from Lua to its debug API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -365,7 +365,7 @@ static int db_errorfb (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg dblib[] = {
|
||||
static const luaL_Reg dblib[] = {
|
||||
{"debug", db_debug},
|
||||
{"getfenv", db_getfenv},
|
||||
{"gethook", db_gethook},
|
||||
|
6
linit.c
6
linit.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: linit.c,v 1.11 2005/04/13 17:24:20 roberto Exp roberto $
|
||||
** $Id: linit.c,v 1.12 2005/08/10 18:06:58 roberto Exp roberto $
|
||||
** Initialization of libraries for lua.c
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -14,7 +14,7 @@
|
||||
#include "lauxlib.h"
|
||||
|
||||
|
||||
static const luaL_reg lualibs[] = {
|
||||
static const luaL_Reg lualibs[] = {
|
||||
{"", luaopen_base},
|
||||
{LUA_TABLIBNAME, luaopen_table},
|
||||
{LUA_IOLIBNAME, luaopen_io},
|
||||
@ -28,7 +28,7 @@ static const luaL_reg lualibs[] = {
|
||||
|
||||
|
||||
LUALIB_API void luaL_openlibs (lua_State *L) {
|
||||
const luaL_reg *lib = lualibs;
|
||||
const luaL_Reg *lib = lualibs;
|
||||
for (; lib->func; lib++) {
|
||||
lua_pushcfunction(L, lib->func);
|
||||
lua_pushstring(L, lib->name);
|
||||
|
6
liolib.c
6
liolib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: liolib.c,v 2.65 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** $Id: liolib.c,v 2.66 2005/08/17 19:05:04 roberto Exp roberto $
|
||||
** Standard I/O (and system) library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -457,7 +457,7 @@ static int f_flush (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg iolib[] = {
|
||||
static const luaL_Reg iolib[] = {
|
||||
{"close", io_close},
|
||||
{"flush", io_flush},
|
||||
{"input", io_input},
|
||||
@ -473,7 +473,7 @@ static const luaL_reg iolib[] = {
|
||||
};
|
||||
|
||||
|
||||
static const luaL_reg flib[] = {
|
||||
static const luaL_Reg flib[] = {
|
||||
{"close", io_close},
|
||||
{"flush", f_flush},
|
||||
{"lines", f_lines},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lmathlib.c,v 1.65 2005/07/11 23:58:35 roberto Exp roberto $
|
||||
** $Id: lmathlib.c,v 1.66 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Standard mathematical library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -212,7 +212,7 @@ static int math_randomseed (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg mathlib[] = {
|
||||
static const luaL_Reg mathlib[] = {
|
||||
{"abs", math_abs},
|
||||
{"acos", math_acos},
|
||||
{"asin", math_asin},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: loadlib.c,v 1.40 2005/08/25 15:39:16 roberto Exp roberto $
|
||||
** $Id: loadlib.c,v 1.41 2005/08/26 17:32:05 roberto Exp roberto $
|
||||
** Dynamic library loader for Lua
|
||||
** See Copyright Notice in lua.h
|
||||
**
|
||||
@ -567,13 +567,13 @@ static void setpath (lua_State *L, const char *fieldname, const char *envname,
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg pk_funcs[] = {
|
||||
static const luaL_Reg pk_funcs[] = {
|
||||
{"loadlib", ll_loadlib},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
static const luaL_reg ll_funcs[] = {
|
||||
static const luaL_Reg ll_funcs[] = {
|
||||
{"module", ll_module},
|
||||
{"require", ll_require},
|
||||
{NULL, NULL}
|
||||
|
4
loslib.c
4
loslib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: loslib.c,v 1.10 2005/05/25 13:21:26 roberto Exp roberto $
|
||||
** $Id: loslib.c,v 1.11 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Standard Operating System library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -209,7 +209,7 @@ static int io_exit (lua_State *L) {
|
||||
return 0; /* to avoid warnings */
|
||||
}
|
||||
|
||||
static const luaL_reg syslib[] = {
|
||||
static const luaL_Reg syslib[] = {
|
||||
{"clock", io_clock},
|
||||
{"date", io_date},
|
||||
{"difftime", io_difftime},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lstrlib.c,v 1.121 2005/08/09 17:42:02 roberto Exp roberto $
|
||||
** $Id: lstrlib.c,v 1.122 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Standard library for string operations and pattern-matching
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -782,7 +782,7 @@ static int str_format (lua_State *L) {
|
||||
}
|
||||
|
||||
|
||||
static const luaL_reg strlib[] = {
|
||||
static const luaL_Reg strlib[] = {
|
||||
{"byte", str_byte},
|
||||
{"char", str_char},
|
||||
{"dump", str_dump},
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltablib.c,v 1.33 2005/07/12 14:32:08 roberto Exp roberto $
|
||||
** $Id: ltablib.c,v 1.34 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** Library for Table Manipulation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -236,7 +236,7 @@ static int sort (lua_State *L) {
|
||||
/* }====================================================== */
|
||||
|
||||
|
||||
static const luaL_reg tab_funcs[] = {
|
||||
static const luaL_Reg tab_funcs[] = {
|
||||
{"concat", tconcat},
|
||||
{"foreach", foreach},
|
||||
{"foreachi", foreachi},
|
||||
|
6
ltests.c
6
ltests.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltests.c,v 2.28 2005/08/15 14:12:32 roberto Exp roberto $
|
||||
** $Id: ltests.c,v 2.29 2005/08/26 17:32:05 roberto Exp roberto $
|
||||
** Internal Module for Debugging of the Lua Implementation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -718,7 +718,7 @@ static int newstate (lua_State *L) {
|
||||
|
||||
|
||||
static int loadlib (lua_State *L) {
|
||||
static const luaL_reg libs[] = {
|
||||
static const luaL_Reg libs[] = {
|
||||
{"baselibopen", luaopen_base},
|
||||
{"dblibopen", luaopen_debug},
|
||||
{"iolibopen", luaopen_io},
|
||||
@ -1082,7 +1082,7 @@ static int auxgsub (lua_State *L) {
|
||||
|
||||
|
||||
|
||||
static const struct luaL_reg tests_funcs[] = {
|
||||
static const struct luaL_Reg tests_funcs[] = {
|
||||
{"checkmemory", lua_checkmemory},
|
||||
{"closestate", closestate},
|
||||
{"d2s", d2s},
|
||||
|
5
lua.h
5
lua.h
@ -1,8 +1,7 @@
|
||||
/*
|
||||
** $Id: lua.h,v 1.210 2005/08/09 17:57:54 roberto Exp roberto $
|
||||
** $Id: lua.h,v 1.211 2005/08/12 13:34:15 roberto Exp roberto $
|
||||
** Lua - An Extensible Extension Language
|
||||
** Lua.org, PUC-Rio, Brazil
|
||||
** http://www.lua.org
|
||||
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
|
||||
** See Copyright Notice at the end of this file
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user