MCPcopy Create free account
hub / github.com/apache/httpd / lua_ap_module_info

Function lua_ap_module_info

modules/lua/lua_request.c:1426–1448  ·  view source on GitHub ↗

* lua_ap_module_info; r:module_info(mod_name) - Returns information about a * loaded module */

Source from the content-addressed store, hash-verified

1424 * loaded module
1425 */
1426static int lua_ap_module_info(lua_State *L)
1427{
1428 const char *moduleName;
1429 module *mod;
1430
1431 luaL_checktype(L, 1, LUA_TSTRING);
1432 moduleName = lua_tostring(L, 1);
1433 mod = ap_find_linked_module(moduleName);
1434 if (mod && mod->cmds) {
1435 const command_rec *cmd;
1436 lua_newtable(L);
1437 lua_pushstring(L, "commands");
1438 lua_newtable(L);
1439 for (cmd = mod->cmds; cmd->name; ++cmd) {
1440 lua_pushstring(L, cmd->name);
1441 lua_pushstring(L, cmd->errmsg);
1442 lua_settable(L, -3);
1443 }
1444 lua_settable(L, -3);
1445 return 1;
1446 }
1447 return 0;
1448}
1449
1450/*
1451 * lua_ap_runtime_dir_relative: r:runtime_dir_relative(file): Returns the

Callers

nothing calls this directly

Calls 1

ap_find_linked_moduleFunction · 0.85

Tested by

no test coverage detected