| 29 | int regex_init(lua_State *L); |
| 30 | |
| 31 | void preload_modules(lua_State *L) { |
| 32 | luaL_openlibs(L); |
| 33 | |
| 34 | lua_getglobal(L, "package"); |
| 35 | lua_getfield(L, -1, "preload"); |
| 36 | |
| 37 | set_field(L, "aegisub.__re_impl", luaopen_re_impl); |
| 38 | set_field(L, "aegisub.__unicode_impl", luaopen_unicode_impl); |
| 39 | set_field(L, "aegisub.__lfs_impl", luaopen_lfs_impl); |
| 40 | set_field(L, "lpeg", luaopen_lpeg); |
| 41 | set_field(L, "luabins", luaopen_luabins); |
| 42 | |
| 43 | lua_pop(L, 2); |
| 44 | |
| 45 | register_lib_functions(L); // silence an unused static function warning |
| 46 | } |
| 47 | |
| 48 | void do_register_lib_function(lua_State *L, const char *name, const char *type_name, void *func) { |
| 49 | lua_pushvalue(L, -2); // push cast function |