Comparison

util-src/encodings.c @ 6411:6c8f6364bc48

util-src/*.c: Don't create globals when loaded
author Kim Alvefur <zash@zash.se>
date Tue, 16 Sep 2014 21:56:18 +0200
parent 4302:bbb0bf0a09f5
child 6412:0e94f89d0e62
comparison
equal deleted inserted replaced
6407:4bbd198cf3e6 6411:6c8f6364bc48
359 { NULL, NULL } 359 { NULL, NULL }
360 }; 360 };
361 361
362 /***************** end *****************/ 362 /***************** end *****************/
363 363
364 static const luaL_Reg Reg[] =
365 {
366 { NULL, NULL }
367 };
368
369 LUALIB_API int luaopen_util_encodings(lua_State *L) 364 LUALIB_API int luaopen_util_encodings(lua_State *L)
370 { 365 {
371 #ifdef USE_STRINGPREP_ICU 366 #ifdef USE_STRINGPREP_ICU
372 init_icu(); 367 init_icu();
373 #endif 368 #endif
374 luaL_register(L, "encodings", Reg); 369 lua_newtable(L);
375 370
376 lua_pushliteral(L, "base64"); 371 lua_pushliteral(L, "base64");
377 lua_newtable(L); 372 lua_newtable(L);
378 luaL_register(L, NULL, Reg_base64); 373 luaL_register(L, NULL, Reg_base64);
379 lua_settable(L,-3); 374 lua_settable(L,-3);