summaryrefslogtreecommitdiff
path: root/modules/lua/lua_vmprep.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lua/lua_vmprep.h')
-rw-r--r--modules/lua/lua_vmprep.h53
1 files changed, 43 insertions, 10 deletions
diff --git a/modules/lua/lua_vmprep.h b/modules/lua/lua_vmprep.h
index 1d3758ca..e46ac9b8 100644
--- a/modules/lua/lua_vmprep.h
+++ b/modules/lua/lua_vmprep.h
@@ -29,6 +29,7 @@
#include "apr_file_info.h"
#include "apr_time.h"
#include "apr_pools.h"
+#include "apr_reslist.h"
#ifndef VMPREP_H
@@ -39,11 +40,18 @@
#define AP_LUA_SCOPE_REQUEST 2
#define AP_LUA_SCOPE_CONN 3
#define AP_LUA_SCOPE_THREAD 4
+#define AP_LUA_SCOPE_SERVER 5
+#define AP_LUA_CACHE_UNSET 0
+#define AP_LUA_CACHE_NEVER 1
+#define AP_LUA_CACHE_STAT 2
+#define AP_LUA_CACHE_FOREVER 3
+
+#define AP_LUA_FILTER_INPUT 1
+#define AP_LUA_FILTER_OUTPUT 2
typedef void (*ap_lua_state_open_callback) (lua_State *L, apr_pool_t *p,
void *ctx);
-
/**
* Specification for a lua virtual machine
*/
@@ -56,8 +64,10 @@ typedef struct
/* name of base file to load in the vm */
const char *file;
- /* APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_THREAD */
+ /* APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_THREAD | APL_SCOPE_SERVER */
int scope;
+ unsigned int vm_min;
+ unsigned int vm_max;
ap_lua_state_open_callback cb;
void* cb_arg;
@@ -71,6 +81,8 @@ typedef struct
*/
const char *bytecode;
apr_size_t bytecode_len;
+
+ int codecache;
} ap_lua_vm_spec;
typedef struct
@@ -81,18 +93,32 @@ typedef struct
ap_regex_t *uri_pattern;
const char *bytecode;
apr_size_t bytecode_len;
+ int codecache;
} ap_lua_mapped_handler_spec;
-/* remove and make static once out of mod_wombat.c */
-AP_LUA_DECLARE(void) ap_lua_openlibs(lua_State *L);
+typedef struct
+{
+ const char *function_name;
+ const char *file_name;
+ const char* filter_name;
+ int direction; /* AP_LUA_FILTER_INPUT | AP_LUA_FILTER_OUTPUT */
+} ap_lua_filter_handler_spec;
-/* remove and make static once out of mod_wombat.c */
-AP_LUA_DECLARE(void) ap_lua_registerlib(lua_State *L, char *name, lua_CFunction f);
+typedef struct {
+ apr_size_t runs;
+ apr_time_t modified;
+ apr_off_t size;
+} ap_lua_finfo;
+
+typedef struct {
+ lua_State* L;
+ ap_lua_finfo* finfo;
+} ap_lua_server_spec;
/**
* Fake out addition of the "apache2" module
*/
-AP_LUA_DECLARE(void) ap_lua_load_apache2_lmodule(lua_State *L);
+void ap_lua_load_apache2_lmodule(lua_State *L);
/*
* alternate means of getting lua_State (preferred eventually)
@@ -106,9 +132,16 @@ AP_LUA_DECLARE(void) ap_lua_load_apache2_lmodule(lua_State *L);
* @cb callback for vm initialization called *before* the file is opened
* @ctx a baton passed to cb
*/
-AP_LUA_DECLARE(lua_State*) ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
- ap_lua_vm_spec *spec);
-
+lua_State *ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
+ ap_lua_vm_spec *spec, request_rec* r);
+#if APR_HAS_THREADS || defined(DOXYGEN)
+/*
+ * Initialize mod_lua mutex.
+ * @pool pool for mutex
+ * @s server_rec for logging
+ */
+void ap_lua_init_mutex(apr_pool_t *pool, server_rec *s);
+#endif
#endif