void register_extension( lua_State *L ) { REGISTER_EXTENSION( "core", "Jakob Westhoff", "*****@*****.**" ); REGISTER_GLOBAL_FUNCTION( L_var_dump, var_dump ); REGISTER_GLOBAL_FUNCTION( L_urldecode, urldecode ); REGISTER_GLOBAL_FUNCTION( L_readini, readini ); REGISTER_GLOBAL_FUNCTION( L_eval, eval ); }
TextLoader::TextLoader() { REGISTER_EXTENSION("as"); REGISTER_EXTENSION("lua"); REGISTER_EXTENSION("hlsl"); REGISTER_EXTENSION("glsl"); REGISTER_EXTENSION("cfg"); REGISTER_EXTENSION("ini"); REGISTER_EXTENSION("txt"); }
void register_extension( lua_State *L ) { REGISTER_EXTENSION( "string", "Jakob Westhoff", "*****@*****.**" ); NAMESPACE_BEGIN( "string" ); REGISTER_NAMESPACE_FUNCTION( L_split, split ); REGISTER_NAMESPACE_FUNCTION( L_split, explode ); REGISTER_NAMESPACE_FUNCTION( L_join, join ); REGISTER_NAMESPACE_FUNCTION( L_join, implode ); REGISTER_NAMESPACE_FUNCTION( L_tolower, tolower ); REGISTER_NAMESPACE_FUNCTION( L_toupper, toupper ); REGISTER_NAMESPACE_FUNCTION( L_ucfirst, ucfirst ); NAMESPACE_END( "string" ); }
void register_extension( lua_State *L ) { REGISTER_EXTENSION( "regexp", "Jakob Westhoff", "*****@*****.**" ); NAMESPACE_BEGIN( "re" ); REGISTER_NAMESPACE_FUNCTION( L_compile, compile ); NAMESPACE_END( "re" ); // We need to create our needed metatable for the regexp "object" luaL_newmetatable( L, REGEXP_REGEX_T ); // Copy the metatable lua_pushvalue( L, -1 ); // Set the metatable as index table. Using this trick we can define all the // needed functions for our userdata inside the metatable lua_setfield( L, -2, "__index" ); // Register the needed functions luaL_register( L, NULL, regexp_metatable ); }