Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ngx_hash.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) Nginx, Inc.
5  */
6 
7 
8 #ifndef _NGX_HASH_H_INCLUDED_
9 #define _NGX_HASH_H_INCLUDED_
10 
11 
12 #include <ngx_config.h>
13 #include <ngx_core.h>
14 
15 
16 typedef struct {
17  void *value;
18  u_short len;
19  u_char name[1];
21 
22 
23 typedef struct {
26 } ngx_hash_t;
27 
28 
29 typedef struct {
31  void *value;
33 
34 
35 typedef struct {
38  void *value;
40 
41 
42 typedef ngx_uint_t (*ngx_hash_key_pt) (u_char *data, size_t len);
43 
44 
45 typedef struct {
50 
51 
52 typedef struct {
55 
58 
59  char *name;
63 
64 
65 #define NGX_HASH_SMALL 1
66 #define NGX_HASH_LARGE 2
67 
68 #define NGX_HASH_LARGE_ASIZE 16384
69 #define NGX_HASH_LARGE_HSIZE 10007
70 
71 #define NGX_HASH_WILDCARD_KEY 1
72 #define NGX_HASH_READONLY_KEY 2
73 
74 
75 typedef struct {
77 
80 
83 
86 
90 
91 
92 typedef struct {
96  u_char *lowcase_key;
98 
99 
100 void *ngx_hash_find(ngx_hash_t *hash, ngx_uint_t key, u_char *name, size_t len);
101 void *ngx_hash_find_wc_head(ngx_hash_wildcard_t *hwc, u_char *name, size_t len);
102 void *ngx_hash_find_wc_tail(ngx_hash_wildcard_t *hwc, u_char *name, size_t len);
104  u_char *name, size_t len);
105 
107  ngx_uint_t nelts);
109  ngx_uint_t nelts);
110 
111 #define ngx_hash(key, c) ((ngx_uint_t) key * 31 + c)
112 ngx_uint_t ngx_hash_key(u_char *data, size_t len);
113 ngx_uint_t ngx_hash_key_lc(u_char *data, size_t len);
114 ngx_uint_t ngx_hash_strlow(u_char *dst, u_char *src, size_t n);
115 
116 
119  void *value, ngx_uint_t flags);
120 
121 
122 #endif /* _NGX_HASH_H_INCLUDED_ */