diff options
author | Paul Querna <pquerna@apache.org> | 2008-12-21 22:29:11 +0100 |
---|---|---|
committer | Paul Querna <pquerna@apache.org> | 2008-12-21 22:29:11 +0100 |
commit | 21b46796ac94649986131efefa6246b04c0f7146 (patch) | |
tree | a57bb0a43777aaefcd7beb8c351fbf79d589bbb0 /modules/lua | |
parent | Rename all files in mod_lua to have a lua_ prefix, as things like 'config.h' ... (diff) | |
download | apache2-21b46796ac94649986131efefa6246b04c0f7146.tar.xz apache2-21b46796ac94649986131efefa6246b04c0f7146.zip |
Fixup lua_config.c with prefix rename, and make mod_lua.c so it compiles again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728509 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/lua')
-rw-r--r-- | modules/lua/lua_config.c | 44 | ||||
-rw-r--r-- | modules/lua/mod_lua.c | 2 |
2 files changed, 23 insertions, 23 deletions
diff --git a/modules/lua/lua_config.c b/modules/lua/lua_config.c index 7848b06a47..46fa419a5e 100644 --- a/modules/lua/lua_config.c +++ b/modules/lua/lua_config.c @@ -18,9 +18,9 @@ #include "lua_config.h" #include "lua_vmprep.h" -static apw_dir_cfg* check_dir_config(lua_State* L, int index) { +static apl_dir_cfg* check_dir_config(lua_State* L, int index) { luaL_checkudata(L, index, "Apache2.DirConfig"); - apw_dir_cfg *cfg = (apw_dir_cfg*)lua_unboxpointer(L, index); + apl_dir_cfg *cfg = (apl_dir_cfg*)lua_unboxpointer(L, index); return cfg; } @@ -30,22 +30,22 @@ static cmd_parms* check_cmd_parms(lua_State* L, int index) { return cmd; } -static int apw_toscope(const char *name) { - if (0 == apr_strnatcmp("once", name)) return APW_SCOPE_ONCE; - if (0 == apr_strnatcmp("request", name)) return APW_SCOPE_REQUEST; - if (0 == apr_strnatcmp("connection", name)) return APW_SCOPE_CONN; - if (0 == apr_strnatcmp("conn", name)) return APW_SCOPE_CONN; - if (0 == apr_strnatcmp("server", name)) return APW_SCOPE_SERVER; - return APW_SCOPE_ONCE; +static int apl_toscope(const char *name) { + if (0 == apr_strnatcmp("once", name)) return APL_SCOPE_ONCE; + if (0 == apr_strnatcmp("request", name)) return APL_SCOPE_REQUEST; + if (0 == apr_strnatcmp("connection", name)) return APL_SCOPE_CONN; + if (0 == apr_strnatcmp("conn", name)) return APL_SCOPE_CONN; + if (0 == apr_strnatcmp("server", name)) return APL_SCOPE_SERVER; + return APL_SCOPE_ONCE; } -apr_status_t apw_lua_map_handler(apw_dir_cfg *cfg, +apr_status_t apl_lua_map_handler(apl_dir_cfg *cfg, const char *file, const char *function, const char *pattern, const char *scope) { apr_status_t rv; - apw_mapped_handler_spec *handler = apr_palloc(cfg->pool, sizeof(apw_mapped_handler_spec)); + apl_mapped_handler_spec *handler = apr_palloc(cfg->pool, sizeof(apl_mapped_handler_spec)); handler->uri_pattern = NULL; handler->function_name = NULL; @@ -55,17 +55,17 @@ apr_status_t apw_lua_map_handler(apw_dir_cfg *cfg, } handler->file_name = apr_pstrdup(cfg->pool, file); handler->uri_pattern = uri_pattern; - handler->scope = apw_toscope(scope); + handler->scope = apl_toscope(scope); handler->function_name = apr_pstrdup(cfg->pool, function); - *(const apw_mapped_handler_spec**)apr_array_push(cfg->mapped_handlers) = handler; + *(const apl_mapped_handler_spec**)apr_array_push(cfg->mapped_handlers) = handler; return APR_SUCCESS; } -/* Change to use apw_lua_map_handler */ +/* Change to use apl_lua_map_handler */ static int cfg_lua_map_handler(lua_State *L) { - apw_dir_cfg *cfg = check_dir_config(L, 1); - apw_mapped_handler_spec *handler = apr_palloc(cfg->pool, sizeof(apw_mapped_handler_spec)); + apl_dir_cfg *cfg = check_dir_config(L, 1); + apl_mapped_handler_spec *handler = apr_palloc(cfg->pool, sizeof(apl_mapped_handler_spec)); handler->uri_pattern = NULL; handler->function_name = NULL; @@ -92,10 +92,10 @@ static int cfg_lua_map_handler(lua_State *L) { lua_getfield(L, 2, "scope"); if (lua_isstring(L, -1)) { const char *scope = lua_tostring(L, -1); - handler->scope = apw_toscope(scope); + handler->scope = apl_toscope(scope); } else { - handler->scope = APW_SCOPE_ONCE; + handler->scope = APL_SCOPE_ONCE; } lua_pop(L, 1); @@ -110,18 +110,18 @@ static int cfg_lua_map_handler(lua_State *L) { lua_pop(L, 1); - *(const apw_mapped_handler_spec**)apr_array_push(cfg->mapped_handlers) = handler; + *(const apl_mapped_handler_spec**)apr_array_push(cfg->mapped_handlers) = handler; return 0; } static int cfg_directory(lua_State *L) { - apw_dir_cfg *cfg = check_dir_config(L, 1); + apl_dir_cfg *cfg = check_dir_config(L, 1); lua_pushstring(L, cfg->dir); return 1; } /*static int cfg_root(lua_State *L) { - apw_dir_cfg *cfg = check_dir_config(L, 1); + apl_dir_cfg *cfg = check_dir_config(L, 1); lua_pushstring(L, cfg->root_path); return 1; }*/ @@ -180,7 +180,7 @@ static const struct luaL_Reg cmd_methods[] = { {NULL, NULL} }; -void apw_load_config_lmodule(lua_State *L) { +void apl_load_config_lmodule(lua_State *L) { luaL_newmetatable(L, "Apache2.DirConfig"); /* [metatable] */ lua_pushvalue(L, -1); diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index b7b77d6b11..62e1b5fe19 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -16,12 +16,12 @@ */ #include "mod_lua.h" -#include "config.h" #include <string.h> #include <stdlib.h> #include <ctype.h> #include "lua_apr.h" +#include "lua_config.h" APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(apl, AP_LUA, int, lua_open, (lua_State *L, apr_pool_t *p), |