comparison src/core/ngx_hunk.h @ 166:389d7ee9fa60

nginx-0.0.1-2003-10-30-11:51:06 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 30 Oct 2003 08:51:06 +0000
parents 96993d4d5067
children 8aef3c72e5da
comparison
equal deleted inserted replaced
165:894a01c6aea3 166:389d7ee9fa60
48 off_t file_last; 48 off_t file_last;
49 49
50 int type; 50 int type;
51 char *start; /* start of hunk */ 51 char *start; /* start of hunk */
52 char *end; /* end of hunk */ 52 char *end; /* end of hunk */
53 char *pre_start; /* start of pre-allocated hunk */
54 char *post_end; /* end of post-allocated hunk */
55 ngx_hunk_tag_t tag; 53 ngx_hunk_tag_t tag;
56 ngx_file_t *file; 54 ngx_file_t *file;
57 ngx_hunk_t *shadow; 55 ngx_hunk_t *shadow;
58 /* STUB */ int num; 56 /* STUB */ int num;
59 }; 57 };
98 typedef struct { 96 typedef struct {
99 ngx_chain_t *out; 97 ngx_chain_t *out;
100 ngx_chain_t **last; 98 ngx_chain_t **last;
101 ngx_connection_t *connection; 99 ngx_connection_t *connection;
102 ngx_pool_t *pool; 100 ngx_pool_t *pool;
103 } ngx_chain_write_ctx_t; 101 } ngx_chain_writer_ctx_t;
104 102
105 103
106 #define NGX_CHAIN_ERROR (ngx_chain_t *) NGX_ERROR 104 #define NGX_CHAIN_ERROR (ngx_chain_t *) NGX_ERROR
107 105
108 106
121 #define ngx_hunk_size(h) \ 119 #define ngx_hunk_size(h) \
122 ((h->type & NGX_HUNK_IN_MEMORY) ? h->last - h->pos: \ 120 ((h->type & NGX_HUNK_IN_MEMORY) ? h->last - h->pos: \
123 (size_t) (h->file_last - h->file_pos)) 121 (size_t) (h->file_last - h->file_pos))
124 122
125 123
126 ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size, 124 ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size);
127 int before, int after);
128 125
129 #define ngx_alloc_hunk(pool) ngx_palloc(pool, sizeof(ngx_hunk_t)) 126 #define ngx_alloc_hunk(pool) ngx_palloc(pool, sizeof(ngx_hunk_t))
130 #define ngx_calloc_hunk(pool) ngx_pcalloc(pool, sizeof(ngx_hunk_t)) 127 #define ngx_calloc_hunk(pool) ngx_pcalloc(pool, sizeof(ngx_hunk_t))
131 128
132 129
149 } \ 146 } \
150 last = &cl->next 147 last = &cl->next
151 148
152 149
153 int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in); 150 int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in);
154 int ngx_chain_write(void *data, ngx_chain_t *in); 151 int ngx_chain_writer(void *data, ngx_chain_t *in);
155 152
156 int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in); 153 int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in);
157 void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, 154 void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy,
158 ngx_chain_t **out, ngx_hunk_tag_t tag); 155 ngx_chain_t **out, ngx_hunk_tag_t tag);
159 156