From a6f465f55802989c1656d1a3b030c315c8ef2690 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 24 Nov 2009 10:05:44 -0200 Subject: [PATCH] new mark LUAMOD_API for all luaopen_* functions --- lbaselib.c | 4 ++-- lbitlib.c | 4 ++-- ldblib.c | 4 ++-- liolib.c | 4 ++-- lmathlib.c | 4 ++-- loadlib.c | 4 ++-- loslib.c | 4 ++-- lstrlib.c | 4 ++-- ltablib.c | 4 ++-- luaconf.h | 6 ++++-- lualib.h | 20 ++++++++++---------- 11 files changed, 32 insertions(+), 30 deletions(-) diff --git a/lbaselib.c b/lbaselib.c index b639222b..16b58cf5 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.224 2009/11/16 15:51:03 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.225 2009/11/19 16:26:29 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -716,7 +716,7 @@ static void base_open (lua_State *L) { } -LUALIB_API int luaopen_base (lua_State *L) { +LUAMOD_API int luaopen_base (lua_State *L) { base_open(L); luaL_register(L, LUA_COLIBNAME, co_funcs); return 2; diff --git a/lbitlib.c b/lbitlib.c index 4f715288..3aaec229 100644 --- a/lbitlib.c +++ b/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: $ +** $Id: lbitlib.c,v 1.1 2009/07/01 16:17:08 roberto Exp roberto $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ @@ -117,7 +117,7 @@ static const luaL_Reg bitlib[] = { -LUALIB_API int luaopen_bit (lua_State *L) { +LUAMOD_API int luaopen_bit (lua_State *L) { luaL_register(L, LUA_BITLIBNAME, bitlib); return 1; } diff --git a/ldblib.c b/ldblib.c index 671972df..c2294613 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.115 2009/11/09 19:10:48 roberto Exp roberto $ +** $Id: ldblib.c,v 1.116 2009/11/18 15:50:18 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -377,7 +377,7 @@ static const luaL_Reg dblib[] = { }; -LUALIB_API int luaopen_debug (lua_State *L) { +LUAMOD_API int luaopen_debug (lua_State *L) { luaL_register(L, LUA_DBLIBNAME, dblib); return 1; } diff --git a/liolib.c b/liolib.c index 7427806c..767f7979 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.81 2009/08/28 13:51:57 roberto Exp roberto $ +** $Id: liolib.c,v 2.82 2009/09/01 19:10:48 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -548,7 +548,7 @@ static void newfenv (lua_State *L, lua_CFunction cls) { } -LUALIB_API int luaopen_io (lua_State *L) { +LUAMOD_API int luaopen_io (lua_State *L) { createmeta(L); /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ newfenv(L, io_fclose); diff --git a/lmathlib.c b/lmathlib.c index eca93ecc..391a31e7 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.72 2009/02/18 13:17:10 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.73 2009/03/17 17:55:39 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -262,7 +262,7 @@ static const luaL_Reg mathlib[] = { /* ** Open math library */ -LUALIB_API int luaopen_math (lua_State *L) { +LUAMOD_API int luaopen_math (lua_State *L) { luaL_register(L, LUA_MATHLIBNAME, mathlib); lua_pushnumber(L, PI); lua_setfield(L, -2, "pi"); diff --git a/loadlib.c b/loadlib.c index 65182591..0c3db013 100644 --- a/loadlib.c +++ b/loadlib.c @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.66 2009/10/05 16:44:33 roberto Exp roberto $ +** $Id: loadlib.c,v 1.67 2009/11/16 15:51:19 roberto Exp roberto $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** @@ -647,7 +647,7 @@ static const lua_CFunction loaders[] = {loader_preload, loader_Lua, loader_C, loader_Croot, NULL}; -LUALIB_API int luaopen_package (lua_State *L) { +LUAMOD_API int luaopen_package (lua_State *L) { int i; /* create new type _LOADLIB */ luaL_newmetatable(L, "_LOADLIB"); diff --git a/loslib.c b/loslib.c index 7ab3c4e9..70d5b1eb 100644 --- a/loslib.c +++ b/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.25 2009/08/25 19:58:08 roberto Exp roberto $ +** $Id: loslib.c,v 1.26 2009/11/23 18:20:38 roberto Exp roberto $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -264,7 +264,7 @@ static const luaL_Reg syslib[] = { -LUALIB_API int luaopen_os (lua_State *L) { +LUAMOD_API int luaopen_os (lua_State *L) { luaL_register(L, LUA_OSLIBNAME, syslib); return 1; } diff --git a/lstrlib.c b/lstrlib.c index 6c8e1ba4..6ad7ca69 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.142 2009/02/03 19:39:19 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.143 2009/06/18 16:51:03 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -858,7 +858,7 @@ static void createmetatable (lua_State *L) { /* ** Open string library */ -LUALIB_API int luaopen_string (lua_State *L) { +LUAMOD_API int luaopen_string (lua_State *L) { luaL_register(L, LUA_STRLIBNAME, strlib); #if defined(LUA_COMPAT_GFIND) lua_getfield(L, -1, "gmatch"); diff --git a/ltablib.c b/ltablib.c index 2e747edb..e2fe976d 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.46 2009/03/23 14:26:12 roberto Exp roberto $ +** $Id: ltablib.c,v 1.47 2009/06/17 17:53:50 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -281,7 +281,7 @@ static const luaL_Reg tab_funcs[] = { }; -LUALIB_API int luaopen_table (lua_State *L) { +LUAMOD_API int luaopen_table (lua_State *L) { luaL_register(L, LUA_TABLIBNAME, tab_funcs); return 1; } diff --git a/luaconf.h b/luaconf.h index d3454d3b..3d2edf8f 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.114 2009/11/19 16:26:52 roberto Exp roberto $ +** $Id: luaconf.h,v 1.115 2009/11/19 19:06:52 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -143,7 +143,8 @@ /* @@ LUA_API is a mark for all core API functions. -@@ LUALIB_API is a mark for all standard library functions. +@@ LUALIB_API is a mark for all auxiliary library functions. +@@ LUAMOD_API is a mark for all standard library opening functions. ** CHANGE them if you need to define those functions in some special way. ** For instance, if you want to create one Windows DLL with the core and ** the libraries, you may want to use the following definition (define @@ -165,6 +166,7 @@ /* more often than not the libs go together with the core */ #define LUALIB_API LUA_API +#define LUAMOD_API LUALIB_API /* diff --git a/lualib.h b/lualib.h index bb4ea06f..178083c5 100644 --- a/lualib.h +++ b/lualib.h @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.37 2006/09/11 14:07:24 roberto Exp roberto $ +** $Id: lualib.h,v 1.38 2009/07/01 16:16:40 roberto Exp roberto $ ** Lua standard libraries ** See Copyright Notice in lua.h */ @@ -16,31 +16,31 @@ #define LUA_COLIBNAME "coroutine" -LUALIB_API int (luaopen_base) (lua_State *L); +LUAMOD_API int (luaopen_base) (lua_State *L); #define LUA_TABLIBNAME "table" -LUALIB_API int (luaopen_table) (lua_State *L); +LUAMOD_API int (luaopen_table) (lua_State *L); #define LUA_IOLIBNAME "io" -LUALIB_API int (luaopen_io) (lua_State *L); +LUAMOD_API int (luaopen_io) (lua_State *L); #define LUA_OSLIBNAME "os" -LUALIB_API int (luaopen_os) (lua_State *L); +LUAMOD_API int (luaopen_os) (lua_State *L); #define LUA_STRLIBNAME "string" -LUALIB_API int (luaopen_string) (lua_State *L); +LUAMOD_API int (luaopen_string) (lua_State *L); #define LUA_BITLIBNAME "bit" -LUALIB_API int (luaopen_bit) (lua_State *L); +LUAMOD_API int (luaopen_bit) (lua_State *L); #define LUA_MATHLIBNAME "math" -LUALIB_API int (luaopen_math) (lua_State *L); +LUAMOD_API int (luaopen_math) (lua_State *L); #define LUA_DBLIBNAME "debug" -LUALIB_API int (luaopen_debug) (lua_State *L); +LUAMOD_API int (luaopen_debug) (lua_State *L); #define LUA_LOADLIBNAME "package" -LUALIB_API int (luaopen_package) (lua_State *L); +LUAMOD_API int (luaopen_package) (lua_State *L); /* open all previous libraries */