|
|
| version 1.1, 2013/10/14 10:32:47 | version 1.1.1.2, 2016/11/02 10:35:00 |
|---|---|
| Line 1 | Line 1 |
| #ifndef _KEY_VALUE_H_ | #ifndef _KEY_VALUE_H_ |
| #define _KEY_VALUE_H_ | #define _KEY_VALUE_H_ |
| #include "first.h" | |
| #ifdef HAVE_CONFIG_H | |
| # include "config.h" | |
| #endif | |
| #ifdef HAVE_PCRE_H | #ifdef HAVE_PCRE_H |
| # include <pcre.h> | # include <pcre.h> |
| #endif | #endif |
| Line 72 typedef struct { | Line 69 typedef struct { |
| } keyvalue; | } keyvalue; |
| typedef struct { | typedef struct { |
| char *key; | |
| char *value; | |
| } s_keyvalue; | |
| typedef struct { | |
| #ifdef HAVE_PCRE_H | #ifdef HAVE_PCRE_H |
| pcre *key; | pcre *key; |
| pcre_extra *key_extra; | pcre_extra *key_extra; |
| Line 86 typedef struct { | Line 77 typedef struct { |
| buffer *value; | buffer *value; |
| } pcre_keyvalue; | } pcre_keyvalue; |
| typedef enum { HTTP_AUTH_BASIC, HTTP_AUTH_DIGEST } httpauth_type; | |
| typedef struct { | typedef struct { |
| char *key; | pcre_keyvalue **kv; |
| size_t used; | |
| size_t size; | |
| } pcre_keyvalue_buffer; | |
| char *realm; | |
| httpauth_type type; | |
| } httpauth_keyvalue; | |
| #define KVB(x) \ | |
| typedef struct {\ | |
| x **kv; \ | |
| size_t used;\ | |
| size_t size;\ | |
| } x ## _buffer | |
| KVB(keyvalue); | |
| KVB(s_keyvalue); | |
| KVB(httpauth_keyvalue); | |
| KVB(pcre_keyvalue); | |
| const char *get_http_status_name(int i); | const char *get_http_status_name(int i); |
| const char *get_http_version_name(int i); | const char *get_http_version_name(int i); |
| const char *get_http_method_name(http_method_t i); | const char *get_http_method_name(http_method_t i); |
| Line 116 http_method_t get_http_method_key(const char *s); | Line 92 http_method_t get_http_method_key(const char *s); |
| const char *keyvalue_get_value(keyvalue *kv, int k); | const char *keyvalue_get_value(keyvalue *kv, int k); |
| int keyvalue_get_key(keyvalue *kv, const char *s); | int keyvalue_get_key(keyvalue *kv, const char *s); |
| keyvalue_buffer *keyvalue_buffer_init(void); | |
| int keyvalue_buffer_append(keyvalue_buffer *kvb, int k, const char *value); | |
| void keyvalue_buffer_free(keyvalue_buffer *kvb); | |
| s_keyvalue_buffer *s_keyvalue_buffer_init(void); | |
| int s_keyvalue_buffer_append(s_keyvalue_buffer *kvb, const char *key, const char *value); | |
| void s_keyvalue_buffer_free(s_keyvalue_buffer *kvb); | |
| httpauth_keyvalue_buffer *httpauth_keyvalue_buffer_init(void); | |
| int httpauth_keyvalue_buffer_append(httpauth_keyvalue_buffer *kvb, const char *key, const char *realm, httpauth_type type); | |
| void httpauth_keyvalue_buffer_free(httpauth_keyvalue_buffer *kvb); | |
| pcre_keyvalue_buffer *pcre_keyvalue_buffer_init(void); | 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, const char *key, const char *value); |