lua_config.c revision e0e7a4768845d518c21ce98d359d2ba8314832ba
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "lua_config.h"
#include "lua_vmprep.h"
return cfg;
}
return cmd;
}
static int apw_toscope(const char *name) {
return APW_SCOPE_ONCE;
}
const char *file,
const char *function,
const char *pattern,
const char *scope) {
return rv;
}
return APR_SUCCESS;
}
/* Change to use apw_lua_map_handler */
static int cfg_lua_map_handler(lua_State *L) {
if (lua_isstring(L, -1)) {
}
lua_pop(L, 1);
if (lua_isstring(L, -1)) {
}
}
lua_pop(L, 1);
if (lua_isstring(L, -1)) {
}
else {
}
lua_pop(L, 1);
if (lua_isstring(L, -1)) {
}
else {
}
lua_pop(L, 1);
return 0;
}
static int cfg_directory(lua_State *L) {
return 1;
}
/*static int cfg_root(lua_State *L) {
apw_dir_cfg *cfg = check_dir_config(L, 1);
lua_pushstring(L, cfg->root_path);
return 1;
}*/
static const struct luaL_Reg cfg_methods[] = {
{"match_handler", cfg_lua_map_handler},
{"directory", cfg_directory},
/* {"root", cfg_root}, */
};
return 0;
}
/* helper function for the logging functions below */
return 0;
}
/* r:debug(String) and friends which use apache logging */
static const struct luaL_Reg cmd_methods[] = {
{"foo", cmd_foo},
{"debug", cmd_debug},
{"info", cmd_info},
{"notice", cmd_notice},
{"warn", cmd_warn},
{"err", cmd_err},
{"crit", cmd_crit},
{"alert", cmd_alert},
{"emerg", cmd_emerg},
};
void apw_load_config_lmodule(lua_State *L) {
lua_pushvalue(L, -1);
luaL_newmetatable(L, "Apache2.CommandParameters");
lua_pushvalue(L, -1);
}