forked from laocai/tcp-nginx-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngx_map.h
72 lines (58 loc) · 3.26 KB
/
ngx_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef _NGX_MAP_H_INCLUDED_
#define _NGX_MAP_H_INCLUDED_
#include <ngx_core.h>
/* uintptr_t is the real ngx_rbtree_key_t type */
#define NGX_MAP_TYPE_MIN 1
#define NGX_MAP_TYPE_MAX 4
#define NGX_MAP_UINTPTR_T NGX_MAP_TYPE_MIN
#define NGX_MAP_PTR_T 2
#define NGX_MAP_STR_T 3
#define NGX_MAP_NGXSTR_T NGX_MAP_TYPE_MAX
typedef struct ngx_map_s ngx_map_t;
typedef void *(*ngx_palloc_pt)(void *pool, size_t size);
typedef ngx_int_t (*ngx_pfree_pt)(void *pool, void *p);
ngx_map_t *ngx_map_create(u_char key_type, u_char val_type, void *pool,
ngx_palloc_pt palloc, ngx_pfree_pt pfree);
void ngx_map_destroy(ngx_map_t *ngx_map);
ngx_int_t ngx_map_set_uintptr_uintptr(ngx_map_t *ngx_map, uintptr_t k, uintptr_t v);
ngx_int_t ngx_map_set_uintptr_ptr(ngx_map_t *ngx_map, uintptr_t k, void *v);
ngx_int_t ngx_map_set_uintptr_str(ngx_map_t *ngx_map, uintptr_t k, const char *v);
ngx_int_t ngx_map_set_uintptr_ngxstr(ngx_map_t *ngx_map, uintptr_t k, ngx_str_t *v);
ngx_int_t ngx_map_find_uintptr_uintptr(ngx_map_t *ngx_map, uintptr_t k, uintptr_t *v);
ngx_int_t ngx_map_find_uintptr_ptr(ngx_map_t *ngx_map, uintptr_t k, void **v);
ngx_int_t ngx_map_find_uintptr_str(ngx_map_t *ngx_map, uintptr_t k, char **v);
ngx_int_t ngx_map_find_uintptr_ngxstr(ngx_map_t *ngx_map, uintptr_t k, ngx_str_t **v);
ngx_int_t ngx_map_set_ptr_uintptr(ngx_map_t *ngx_map, void *k, uintptr_t v);
ngx_int_t ngx_map_set_ptr_ptr(ngx_map_t *ngx_map, void *k, void *v);
ngx_int_t ngx_map_set_ptr_str(ngx_map_t *ngx_map, void *k, const char *v);
ngx_int_t ngx_map_set_ptr_ngxstr(ngx_map_t *ngx_map, void *k, ngx_str_t *v);
ngx_int_t ngx_map_find_ptr_uintptr(ngx_map_t *ngx_map, void *k, uintptr_t *v);
ngx_int_t ngx_map_find_ptr_ptr(ngx_map_t *ngx_map, void *k, void **v);
ngx_int_t ngx_map_find_ptr_str(ngx_map_t *ngx_map, void *k, char **v);
ngx_int_t ngx_map_find_ptr_ngxstr(ngx_map_t *ngx_map, void *k, ngx_str_t **v);
ngx_int_t ngx_map_set_str_uintptr(ngx_map_t *ngx_map, const char *k, uintptr_t v);
ngx_int_t ngx_map_set_str_ptr(ngx_map_t *ngx_map, const char *k, void *v);
ngx_int_t ngx_map_set_str_str(ngx_map_t *ngx_map, const char *k, const char *v);
ngx_int_t ngx_map_set_str_ngxstr(ngx_map_t *ngx_map, const char *k, ngx_str_t *v);
ngx_int_t ngx_map_find_str_uintptr(ngx_map_t *ngx_map, const char *k, uintptr_t *v);
ngx_int_t ngx_map_find_str_ptr(ngx_map_t *ngx_map, const char *k, void **v);
ngx_int_t ngx_map_find_str_str(ngx_map_t *ngx_map, const char *k, char **v);
ngx_int_t ngx_map_find_str_ngxstr(ngx_map_t *ngx_map, const char *k, ngx_str_t **v);
ngx_int_t ngx_map_set_ngxstr_uintptr(ngx_map_t *ngx_map, const ngx_str_t *k,
uintptr_t v);
ngx_int_t ngx_map_set_ngxstr_ptr(ngx_map_t *ngx_map, const ngx_str_t *k,
void *v);
ngx_int_t ngx_map_set_ngxstr_str(ngx_map_t *ngx_map, const ngx_str_t *k,
const char *v);
ngx_int_t ngx_map_set_ngxstr_ngxstr(ngx_map_t *ngx_map, const ngx_str_t *k,
ngx_str_t *v);
ngx_int_t ngx_map_find_ngxstr_uintptr(ngx_map_t *ngx_map, const ngx_str_t *k,
uintptr_t *v);
ngx_int_t ngx_map_find_ngxstr_ptr(ngx_map_t *ngx_map, const ngx_str_t *k,
void **v);
ngx_int_t ngx_map_find_ngxstr_str(ngx_map_t *ngx_map, const ngx_str_t *k,
char **v);
ngx_int_t ngx_map_find_ngxstr_ngxstr(ngx_map_t *ngx_map, const ngx_str_t *k,
ngx_str_t **v);
void ngx_map_test(void);
#endif