Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_RADIX_TREE_H_INCLUDED_
0009 #define _NGX_RADIX_TREE_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 
0015 
0016 #define NGX_RADIX_NO_VALUE   (uintptr_t) -1
0017 
0018 typedef struct ngx_radix_node_s  ngx_radix_node_t;
0019 
0020 struct ngx_radix_node_s {
0021     ngx_radix_node_t  *right;
0022     ngx_radix_node_t  *left;
0023     ngx_radix_node_t  *parent;
0024     uintptr_t          value;
0025 };
0026 
0027 
0028 typedef struct {
0029     ngx_radix_node_t  *root;
0030     ngx_pool_t        *pool;
0031     ngx_radix_node_t  *free;
0032     char              *start;
0033     size_t             size;
0034 } ngx_radix_tree_t;
0035 
0036 
0037 ngx_radix_tree_t *ngx_radix_tree_create(ngx_pool_t *pool,
0038     ngx_int_t preallocate);
0039 
0040 ngx_int_t ngx_radix32tree_insert(ngx_radix_tree_t *tree,
0041     uint32_t key, uint32_t mask, uintptr_t value);
0042 ngx_int_t ngx_radix32tree_delete(ngx_radix_tree_t *tree,
0043     uint32_t key, uint32_t mask);
0044 uintptr_t ngx_radix32tree_find(ngx_radix_tree_t *tree, uint32_t key);
0045 
0046 #if (NGX_HAVE_INET6)
0047 ngx_int_t ngx_radix128tree_insert(ngx_radix_tree_t *tree,
0048     u_char *key, u_char *mask, uintptr_t value);
0049 ngx_int_t ngx_radix128tree_delete(ngx_radix_tree_t *tree,
0050     u_char *key, u_char *mask);
0051 uintptr_t ngx_radix128tree_find(ngx_radix_tree_t *tree, u_char *key);
0052 #endif
0053 
0054 
0055 #endif /* _NGX_RADIX_TREE_H_INCLUDED_ */