aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lauxlib.c6
-rw-r--r--lauxlib.h12
-rw-r--r--lbaselib.c6
-rw-r--r--ldblib.c4
-rw-r--r--linit.c6
-rw-r--r--liolib.c6
-rw-r--r--lmathlib.c4
-rw-r--r--loadlib.c6
-rw-r--r--loslib.c4
-rw-r--r--lstrlib.c4
-rw-r--r--ltablib.c4
-rw-r--r--ltests.c6
-rw-r--r--lua.h5
13 files changed, 37 insertions, 36 deletions
diff --git a/lauxlib.c b/lauxlib.c
index a19cb079..58811134 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.149 2005/08/25 15:39:16 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.150 2005/08/26 17:32:05 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -222,13 +222,13 @@ LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {
222 222
223 223
224LUALIB_API void (luaL_register) (lua_State *L, const char *libname, 224LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
225 const luaL_reg *l) { 225 const luaL_Reg *l) {
226 luaI_openlib(L, libname, l, 0); 226 luaI_openlib(L, libname, l, 0);
227} 227}
228 228
229 229
230LUALIB_API void luaI_openlib (lua_State *L, const char *libname, 230LUALIB_API void luaI_openlib (lua_State *L, const char *libname,
231 const luaL_reg *l, int nup) { 231 const luaL_Reg *l, int nup) {
232 if (libname) { 232 if (libname) {
233 /* check whether lib already exists */ 233 /* check whether lib already exists */
234 lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); 234 lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
diff --git a/lauxlib.h b/lauxlib.h
index 7c1acaeb..3ead2780 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.h,v 1.82 2005/08/18 20:36:26 roberto Exp roberto $ 2** $Id: lauxlib.h,v 1.83 2005/08/26 17:32:05 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -29,17 +29,17 @@
29#define LUA_ERRFILE (LUA_ERRERR+1) 29#define LUA_ERRFILE (LUA_ERRERR+1)
30 30
31 31
32typedef struct luaL_reg { 32typedef struct luaL_Reg {
33 const char *name; 33 const char *name;
34 lua_CFunction func; 34 lua_CFunction func;
35} luaL_reg; 35} luaL_Reg;
36 36
37 37
38 38
39LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, 39LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,
40 const luaL_reg *l, int nup); 40 const luaL_Reg *l, int nup);
41LUALIB_API void (luaL_register) (lua_State *L, const char *libname, 41LUALIB_API void (luaL_register) (lua_State *L, const char *libname,
42 const luaL_reg *l); 42 const luaL_Reg *l);
43LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); 43LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);
44LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); 44LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);
45LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); 45LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);
@@ -164,6 +164,8 @@ LUALIB_API void (luaL_pushresult) (luaL_Buffer *B);
164#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) 164#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))
165 165
166 166
167#define luaL_reg luaL_Reg
168
167#endif 169#endif
168 170
169 171
diff --git a/lbaselib.c b/lbaselib.c
index d4a93005..93391550 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.180 2005/07/12 18:15:11 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.181 2005/08/15 14:12:32 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -429,7 +429,7 @@ static int luaB_newproxy (lua_State *L) {
429} 429}
430 430
431 431
432static const luaL_reg base_funcs[] = { 432static const luaL_Reg base_funcs[] = {
433 {"assert", luaB_assert}, 433 {"assert", luaB_assert},
434 {"collectgarbage", luaB_collectgarbage}, 434 {"collectgarbage", luaB_collectgarbage},
435 {"dofile", luaB_dofile}, 435 {"dofile", luaB_dofile},
@@ -579,7 +579,7 @@ static int luaB_corunning (lua_State *L) {
579} 579}
580 580
581 581
582static const luaL_reg co_funcs[] = { 582static const luaL_Reg co_funcs[] = {
583 {"create", luaB_cocreate}, 583 {"create", luaB_cocreate},
584 {"resume", luaB_coresume}, 584 {"resume", luaB_coresume},
585 {"running", luaB_corunning}, 585 {"running", luaB_corunning},
diff --git a/ldblib.c b/ldblib.c
index 3716a4dd..3ee8631b 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.99 2005/07/12 14:32:08 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.100 2005/08/15 14:12:32 roberto Exp roberto $
3** Interface from Lua to its debug API 3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -365,7 +365,7 @@ static int db_errorfb (lua_State *L) {
365} 365}
366 366
367 367
368static const luaL_reg dblib[] = { 368static const luaL_Reg dblib[] = {
369 {"debug", db_debug}, 369 {"debug", db_debug},
370 {"getfenv", db_getfenv}, 370 {"getfenv", db_getfenv},
371 {"gethook", db_gethook}, 371 {"gethook", db_gethook},
diff --git a/linit.c b/linit.c
index ad531c64..cfc47e66 100644
--- a/linit.c
+++ b/linit.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: linit.c,v 1.11 2005/04/13 17:24:20 roberto Exp roberto $ 2** $Id: linit.c,v 1.12 2005/08/10 18:06:58 roberto Exp roberto $
3** Initialization of libraries for lua.c 3** Initialization of libraries for lua.c
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -14,7 +14,7 @@
14#include "lauxlib.h" 14#include "lauxlib.h"
15 15
16 16
17static const luaL_reg lualibs[] = { 17static const luaL_Reg lualibs[] = {
18 {"", luaopen_base}, 18 {"", luaopen_base},
19 {LUA_TABLIBNAME, luaopen_table}, 19 {LUA_TABLIBNAME, luaopen_table},
20 {LUA_IOLIBNAME, luaopen_io}, 20 {LUA_IOLIBNAME, luaopen_io},
@@ -28,7 +28,7 @@ static const luaL_reg lualibs[] = {
28 28
29 29
30LUALIB_API void luaL_openlibs (lua_State *L) { 30LUALIB_API void luaL_openlibs (lua_State *L) {
31 const luaL_reg *lib = lualibs; 31 const luaL_Reg *lib = lualibs;
32 for (; lib->func; lib++) { 32 for (; lib->func; lib++) {
33 lua_pushcfunction(L, lib->func); 33 lua_pushcfunction(L, lib->func);
34 lua_pushstring(L, lib->name); 34 lua_pushstring(L, lib->name);
diff --git a/liolib.c b/liolib.c
index ceee5371..e8328fdc 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.65 2005/08/15 14:12:32 roberto Exp roberto $ 2** $Id: liolib.c,v 2.66 2005/08/17 19:05:04 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -457,7 +457,7 @@ static int f_flush (lua_State *L) {
457} 457}
458 458
459 459
460static const luaL_reg iolib[] = { 460static const luaL_Reg iolib[] = {
461 {"close", io_close}, 461 {"close", io_close},
462 {"flush", io_flush}, 462 {"flush", io_flush},
463 {"input", io_input}, 463 {"input", io_input},
@@ -473,7 +473,7 @@ static const luaL_reg iolib[] = {
473}; 473};
474 474
475 475
476static const luaL_reg flib[] = { 476static const luaL_Reg flib[] = {
477 {"close", io_close}, 477 {"close", io_close},
478 {"flush", f_flush}, 478 {"flush", f_flush},
479 {"lines", f_lines}, 479 {"lines", f_lines},
diff --git a/lmathlib.c b/lmathlib.c
index 45c204f9..9be0f160 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.65 2005/07/11 23:58:35 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.66 2005/08/15 14:12:32 roberto Exp roberto $
3** Standard mathematical library 3** Standard mathematical library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -212,7 +212,7 @@ static int math_randomseed (lua_State *L) {
212} 212}
213 213
214 214
215static const luaL_reg mathlib[] = { 215static const luaL_Reg mathlib[] = {
216 {"abs", math_abs}, 216 {"abs", math_abs},
217 {"acos", math_acos}, 217 {"acos", math_acos},
218 {"asin", math_asin}, 218 {"asin", math_asin},
diff --git a/loadlib.c b/loadlib.c
index 017564d0..d4df06ed 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loadlib.c,v 1.40 2005/08/25 15:39:16 roberto Exp roberto $ 2** $Id: loadlib.c,v 1.41 2005/08/26 17:32:05 roberto Exp roberto $
3** Dynamic library loader for Lua 3** Dynamic library loader for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5** 5**
@@ -567,13 +567,13 @@ static void setpath (lua_State *L, const char *fieldname, const char *envname,
567} 567}
568 568
569 569
570static const luaL_reg pk_funcs[] = { 570static const luaL_Reg pk_funcs[] = {
571 {"loadlib", ll_loadlib}, 571 {"loadlib", ll_loadlib},
572 {NULL, NULL} 572 {NULL, NULL}
573}; 573};
574 574
575 575
576static const luaL_reg ll_funcs[] = { 576static const luaL_Reg ll_funcs[] = {
577 {"module", ll_module}, 577 {"module", ll_module},
578 {"require", ll_require}, 578 {"require", ll_require},
579 {NULL, NULL} 579 {NULL, NULL}
diff --git a/loslib.c b/loslib.c
index 0be07e53..ca09f699 100644
--- a/loslib.c
+++ b/loslib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: loslib.c,v 1.10 2005/05/25 13:21:26 roberto Exp roberto $ 2** $Id: loslib.c,v 1.11 2005/08/15 14:12:32 roberto Exp roberto $
3** Standard Operating System library 3** Standard Operating System library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -209,7 +209,7 @@ static int io_exit (lua_State *L) {
209 return 0; /* to avoid warnings */ 209 return 0; /* to avoid warnings */
210} 210}
211 211
212static const luaL_reg syslib[] = { 212static const luaL_Reg syslib[] = {
213 {"clock", io_clock}, 213 {"clock", io_clock},
214 {"date", io_date}, 214 {"date", io_date},
215 {"difftime", io_difftime}, 215 {"difftime", io_difftime},
diff --git a/lstrlib.c b/lstrlib.c
index 1c1f9add..081de1c7 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.121 2005/08/09 17:42:02 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.122 2005/08/15 14:12:32 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -782,7 +782,7 @@ static int str_format (lua_State *L) {
782} 782}
783 783
784 784
785static const luaL_reg strlib[] = { 785static const luaL_Reg strlib[] = {
786 {"byte", str_byte}, 786 {"byte", str_byte},
787 {"char", str_char}, 787 {"char", str_char},
788 {"dump", str_dump}, 788 {"dump", str_dump},
diff --git a/ltablib.c b/ltablib.c
index a319b6b2..9d123605 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.33 2005/07/12 14:32:08 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.34 2005/08/15 14:12:32 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -236,7 +236,7 @@ static int sort (lua_State *L) {
236/* }====================================================== */ 236/* }====================================================== */
237 237
238 238
239static const luaL_reg tab_funcs[] = { 239static const luaL_Reg tab_funcs[] = {
240 {"concat", tconcat}, 240 {"concat", tconcat},
241 {"foreach", foreach}, 241 {"foreach", foreach},
242 {"foreachi", foreachi}, 242 {"foreachi", foreachi},
diff --git a/ltests.c b/ltests.c
index f27e21bd..cd595865 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.28 2005/08/15 14:12:32 roberto Exp roberto $ 2** $Id: ltests.c,v 2.29 2005/08/26 17:32:05 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -718,7 +718,7 @@ static int newstate (lua_State *L) {
718 718
719 719
720static int loadlib (lua_State *L) { 720static int loadlib (lua_State *L) {
721 static const luaL_reg libs[] = { 721 static const luaL_Reg libs[] = {
722 {"baselibopen", luaopen_base}, 722 {"baselibopen", luaopen_base},
723 {"dblibopen", luaopen_debug}, 723 {"dblibopen", luaopen_debug},
724 {"iolibopen", luaopen_io}, 724 {"iolibopen", luaopen_io},
@@ -1082,7 +1082,7 @@ static int auxgsub (lua_State *L) {
1082 1082
1083 1083
1084 1084
1085static const struct luaL_reg tests_funcs[] = { 1085static const struct luaL_Reg tests_funcs[] = {
1086 {"checkmemory", lua_checkmemory}, 1086 {"checkmemory", lua_checkmemory},
1087 {"closestate", closestate}, 1087 {"closestate", closestate},
1088 {"d2s", d2s}, 1088 {"d2s", d2s},
diff --git a/lua.h b/lua.h
index 5d068e02..aa969ae0 100644
--- a/lua.h
+++ b/lua.h
@@ -1,8 +1,7 @@
1/* 1/*
2** $Id: lua.h,v 1.210 2005/08/09 17:57:54 roberto Exp roberto $ 2** $Id: lua.h,v 1.211 2005/08/12 13:34:15 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** Lua.org, PUC-Rio, Brazil 4** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
5** http://www.lua.org
6** See Copyright Notice at the end of this file 5** See Copyright Notice at the end of this file
7*/ 6*/
8 7