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

Function read_cfg_tree

modules/lua/lua_request.c:2619–2646  ·  view source on GitHub ↗

helper function for walking config trees */

Source from the content-addressed store, hash-verified

2617
2618/* helper function for walking config trees */
2619static void read_cfg_tree(lua_State *L, request_rec *r, ap_directive_t *rcfg) {
2620 int x = 0;
2621 const char* value;
2622 ap_directive_t *cfg;
2623 lua_newtable(L);
2624
2625 for (cfg = rcfg; cfg; cfg = cfg->next) {
2626 x++;
2627 lua_pushnumber(L, x);
2628 lua_newtable(L);
2629 value = apr_psprintf(r->pool, "%s %s", cfg->directive, cfg->args);
2630 lua_pushstring(L, "directive");
2631 lua_pushstring(L, value);
2632 lua_settable(L, -3);
2633 lua_pushstring(L, "file");
2634 lua_pushstring(L, cfg->filename);
2635 lua_settable(L, -3);
2636 lua_pushstring(L, "line");
2637 lua_pushnumber(L, cfg->line_num);
2638 lua_settable(L, -3);
2639 if (cfg->first_child) {
2640 lua_pushstring(L, "children");
2641 read_cfg_tree(L, r, cfg->first_child);
2642 lua_settable(L, -3);
2643 }
2644 lua_settable(L, -3);
2645 }
2646}
2647
2648static int lua_ap_get_config(lua_State *L) {
2649 request_rec *r = ap_lua_check_request_rec(L, 1);

Callers 2

lua_ap_get_configFunction · 0.85
lua_ap_get_active_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected