summaryrefslogtreecommitdiff
path: root/src/mod_magnet_cache.h
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:03:41 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:03:41 +0100
commit6a6df8dc258631c6eaccb03bf08845241f6dfa4a (patch)
tree01eee8de64a85e5e2fef929050663ea2d3c850bd /src/mod_magnet_cache.h
parentec2cb646eff482dfe32955d01781b01211b0a77c (diff)
downloadlighttpd-6a6df8dc258631c6eaccb03bf08845241f6dfa4a.tar.gz
Imported Upstream version 1.4.12upstream/1.4.12
Diffstat (limited to 'src/mod_magnet_cache.h')
-rw-r--r--src/mod_magnet_cache.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mod_magnet_cache.h b/src/mod_magnet_cache.h
new file mode 100644
index 0000000..50c9e44
--- /dev/null
+++ b/src/mod_magnet_cache.h
@@ -0,0 +1,33 @@
+#ifndef _MOD_MAGNET_CACHE_H_
+#define _MOD_MAGNET_CACHE_H_
+
+#include "buffer.h"
+#include "base.h"
+
+#ifdef HAVE_LUA_H
+#include <lua.h>
+
+typedef struct {
+ buffer *name;
+ buffer *etag;
+
+ lua_State *L;
+
+ time_t last_used; /* LRU */
+} script;
+
+typedef struct {
+ script **ptr;
+
+ size_t used;
+ size_t size;
+} script_cache;
+
+script_cache *script_cache_init(void);
+void script_cache_free(script_cache *cache);
+
+lua_State *script_cache_get_script(server *srv, connection *con,
+ script_cache *cache, buffer *name);
+
+#endif
+#endif