| 461 | |
| 462 | |
| 463 | static int searcher_Lua(lua_State *L) { |
| 464 | const char *filename; |
| 465 | const char *name = luaL_checkstring(L, 1); |
| 466 | filename = findfile(L, name, "path", LUA_LSUBSEP); |
| 467 | if (filename == nullptr) return 1; /* module not found in this path */ |
| 468 | return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename); |
| 469 | } |
| 470 | |
| 471 | /** |
| 472 | * module searcher from thinkyoung api |