summaryrefslogtreecommitdiff
path: root/src/keyvalue.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2018-04-17 00:53:40 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2018-08-05 03:44:15 -0400
commitcf9474aa2ccfff8a76684ed484a626ffabf86444 (patch)
tree4862e2a4209bb7adfc03780bff8f49a77e9555fe /src/keyvalue.h
parent22f3f436211b82918271af76caacc7408b8a7f49 (diff)
downloadlighttpd-git-cf9474aa2ccfff8a76684ed484a626ffabf86444.tar.gz
[mod_redirect, mod_rewrite] code reuse (sharing)
Diffstat (limited to 'src/keyvalue.h')
-rw-r--r--src/keyvalue.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/keyvalue.h b/src/keyvalue.h
index 25fe64b0..7a9eac6d 100644
--- a/src/keyvalue.h
+++ b/src/keyvalue.h
@@ -63,26 +63,18 @@ typedef enum { HTTP_VERSION_UNSET = -1, HTTP_VERSION_1_0, HTTP_VERSION_1_1 } htt
typedef struct {
int key;
-
const char *value;
} keyvalue;
+struct pcre_keyvalue; /* declaration */
-#ifdef HAVE_PCRE_H
-struct pcre_extra; /* declaration */
-#endif
-
-typedef struct {
-#ifdef HAVE_PCRE_H
- void *key;
- struct pcre_extra *key_extra;
-#endif
-
- buffer *value;
-} pcre_keyvalue;
+typedef struct pcre_keyvalue_ctx {
+ struct cond_cache_t *cache;
+ int m;
+} pcre_keyvalue_ctx;
typedef struct {
- pcre_keyvalue **kv;
+ struct pcre_keyvalue **kv;
size_t used;
size_t size;
} pcre_keyvalue_buffer;
@@ -95,8 +87,8 @@ int get_http_version_key(const char *s);
http_method_t get_http_method_key(const char *s);
pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void);
-int pcre_keyvalue_buffer_append(struct server *srv, pcre_keyvalue_buffer *kvb, const char *key, const char *value);
+int pcre_keyvalue_buffer_append(struct server *srv, pcre_keyvalue_buffer *kvb, buffer *key, buffer *value);
void pcre_keyvalue_buffer_free(pcre_keyvalue_buffer *kvb);
-void pcre_keyvalue_buffer_subst(buffer *b, const buffer *patternb, const char **list, int n, struct cond_cache_t *cache);
+handler_t pcre_keyvalue_buffer_process(pcre_keyvalue_buffer *kvb, pcre_keyvalue_ctx *ctx, buffer *input, buffer *result);
#endif