git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@423 152afb58-edef-0310-8abb-c4023f1b3aa9svn/tags/lighttpd-1.3.15
parent
ab76910963
commit
8761a89cb2
1 changed files with 89 additions and 0 deletions
@ -0,0 +1,89 @@ |
||||
#ifndef _MOD_CACHE_H_ |
||||
#define _MOD_CACHE_H_ |
||||
|
||||
#include "buffer.h" |
||||
#include "server.h" |
||||
#include "response.h" |
||||
|
||||
#include "stream.h" |
||||
|
||||
#define plugin_data mod_cache_plugin_data |
||||
|
||||
typedef enum { UNSET, PART, TIMES, MINUS, PLUS, OR, AND, GT, LT, GE, LE, EQ, NE } tnode_op_t; |
||||
|
||||
typedef enum { T_NODE_VALUE_UNSET, T_NODE_VALUE_LONG, T_NODE_VALUE_STRING } tnode_val_t; |
||||
|
||||
typedef struct { |
||||
tnode_val_t type; |
||||
|
||||
union { |
||||
buffer *str; |
||||
long lon; |
||||
} data; |
||||
} tnode_val; |
||||
|
||||
#define VAL_LONG(x) x->value.data.lon |
||||
#define VAL_STRING(x) x->value.data.str |
||||
|
||||
#define IS_LONG(x) ((x->op == UNSET) && (x->value.type == T_NODE_VALUE_LONG)) |
||||
#define IS_STRING(x) ((x->op == UNSET) && (x->value.type == T_NODE_VALUE_STRING)) |
||||
|
||||
typedef struct tnode { |
||||
tnode_val value; |
||||
tnode_op_t op; |
||||
|
||||
struct tnode *l, *r; |
||||
} tnode; |
||||
|
||||
typedef struct { |
||||
tnode_val **ptr; |
||||
|
||||
size_t size; |
||||
size_t used; |
||||
} tnode_val_array; |
||||
|
||||
typedef struct { |
||||
buffer *ext; |
||||
|
||||
} plugin_config; |
||||
|
||||
typedef struct { |
||||
PLUGIN_DATA; |
||||
|
||||
buffer *basedir; |
||||
|
||||
buffer *trigger_handler; |
||||
|
||||
buffer *session_id; |
||||
|
||||
buffer_array *eval; |
||||
buffer_array *trigger_if; |
||||
buffer_array *output_include; |
||||
|
||||
tnode_val_array *params; |
||||
|
||||
plugin_config **config_storage; |
||||
|
||||
plugin_config conf;
|
||||
} plugin_data; |
||||
|
||||
typedef struct { |
||||
char *name; |
||||
size_t params; |
||||
int (*func)(server *srv, connection *con, plugin_data *p, tnode *result); |
||||
} cache_trigger_functions; |
||||
|
||||
int cache_parse_parameters(server *srv, connection *con, plugin_data *p, const char *params, size_t param_len, tnode_val_array *res); |
||||
int cache_parse(server *srv, connection *con, plugin_data *p, buffer *fn); |
||||
int tnode_prepare_long(tnode *t); |
||||
int tnode_prepare_string(tnode *t); |
||||
|
||||
#define CACHE_FUNC_PROTO(x) int x(server *srv, connection *con, plugin_data *p, tnode *result) |
||||
|
||||
CACHE_FUNC_PROTO(f_unix_time_now); |
||||
CACHE_FUNC_PROTO(f_file_mtime); |
||||
CACHE_FUNC_PROTO(f_mysql_escape); |
||||
CACHE_FUNC_PROTO(f_mysql_connect); |
||||
CACHE_FUNC_PROTO(f_mysql_query); |
||||
|
||||
#endif |
Loading…
Reference in new issue