Mercurial > hg > nginx-quic
comparison src/core/ngx_hunk.h @ 155:46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 22 Oct 2003 16:38:26 +0000 |
parents | eac26585476e |
children | e7e094d34162 |
comparison
equal
deleted
inserted
replaced
154:eac26585476e | 155:46eb23d9471d |
---|---|
97 int before, int after); | 97 int before, int after); |
98 | 98 |
99 #define ngx_alloc_hunk(pool) ngx_palloc(pool, sizeof(ngx_hunk_t)) | 99 #define ngx_alloc_hunk(pool) ngx_palloc(pool, sizeof(ngx_hunk_t)) |
100 #define ngx_calloc_hunk(pool) ngx_pcalloc(pool, sizeof(ngx_hunk_t)) | 100 #define ngx_calloc_hunk(pool) ngx_pcalloc(pool, sizeof(ngx_hunk_t)) |
101 | 101 |
102 #define ngx_alloc_chain_entry(pool) ngx_palloc(pool, sizeof(ngx_chain_t)) | |
103 | 102 |
104 #define ngx_add_hunk_to_chain(chain, h, pool, error) \ | 103 #define ngx_alloc_chain_link(pool) ngx_palloc(pool, sizeof(ngx_chain_t)) |
104 | |
105 | |
106 #define ngx_alloc_link_and_set_hunk(chain, h, pool, error) \ | |
105 do { \ | 107 do { \ |
106 ngx_test_null(chain, ngx_alloc_chain_entry(pool), error); \ | 108 ngx_test_null(chain, ngx_alloc_chain_link(pool), error); \ |
107 chain->hunk = h; \ | 109 chain->hunk = h; \ |
108 chain->next = NULL; \ | 110 chain->next = NULL; \ |
109 } while (0); | 111 } while (0); |
110 | 112 |
111 #define ngx_alloc_ce_and_set_hunk ngx_add_hunk_to_chain | 113 |
114 #define ngx_chain_add_link(chain, last, cl) \ | |
115 if (chain) { \ | |
116 *last = cl; \ | |
117 } else { \ | |
118 chain = cl; \ | |
119 } \ | |
120 last = &cl->next | |
112 | 121 |
113 | 122 |
114 #define ngx_chain_add_ce(chain, last, ce) \ | 123 int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in); |
115 if (chain) { \ | |
116 *last = ce; \ | |
117 } else { \ | |
118 chain = ce; \ | |
119 } \ | |
120 last = &ce->next | |
121 | |
122 | |
123 int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **ch, ngx_chain_t *in); | |
124 void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, | 124 void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, |
125 ngx_chain_t **out, ngx_hunk_tag_t tag); | 125 ngx_chain_t **out, ngx_hunk_tag_t tag); |
126 | 126 |
127 | 127 |
128 | |
129 #endif /* _NGX_HUNK_H_INCLUDED_ */ | 128 #endif /* _NGX_HUNK_H_INCLUDED_ */ |