diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-11-04 13:27:53 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-11-04 13:27:53 -0200 |
commit | 45cad43c3fedb13a5e424429fe94dc78ba01a118 (patch) | |
tree | e5dae021aa66accc06b6941add38bf2d495c6440 /lbuiltin.c | |
parent | dad5a01fb07e8a654f195ec3a9ca271cd5ee32e3 (diff) | |
download | lua-45cad43c3fedb13a5e424429fe94dc78ba01a118.tar.gz lua-45cad43c3fedb13a5e424429fe94dc78ba01a118.tar.bz2 lua-45cad43c3fedb13a5e424429fe94dc78ba01a118.zip |
"lua_open": now lua has an explicit open operation.
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.4 1997/10/23 16:28:48 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.5 1997/10/24 17:17:24 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -455,23 +455,11 @@ static struct luaL_reg int_funcs[] = { | |||
455 | 455 | ||
456 | void luaB_predefine (void) | 456 | void luaB_predefine (void) |
457 | { | 457 | { |
458 | int i; | ||
459 | TaggedString *ts; | ||
460 | TObject o; | ||
461 | /* pre-register mem error messages, to avoid loop when error arises */ | 458 | /* pre-register mem error messages, to avoid loop when error arises */ |
462 | luaS_newfixedstring(tableEM); | 459 | luaS_newfixedstring(tableEM); |
463 | luaS_newfixedstring(memEM); | 460 | luaS_newfixedstring(memEM); |
464 | for (i=0; i<INTFUNCSIZE; i++) { | 461 | luaL_openlib(int_funcs, (sizeof(int_funcs)/sizeof(int_funcs[0]))); |
465 | ts = luaS_new(int_funcs[i].name); | 462 | lua_pushstring(LUA_VERSION); |
466 | fvalue(&o) = int_funcs[i].func; | 463 | lua_setglobal("_VERSION"); |
467 | ttype(&o) = LUA_T_CPROTO; | ||
468 | luaF_simpleclosure(&o); | ||
469 | luaS_rawsetglobal(ts, &o); | ||
470 | } | ||
471 | ts = luaS_new("_VERSION"); | ||
472 | ttype(&o) = LUA_T_STRING; | ||
473 | tsvalue(&o) = luaS_new(LUA_VERSION); | ||
474 | luaS_rawsetglobal(ts, &o); | ||
475 | } | 464 | } |
476 | 465 | ||
477 | |||