comparison src/core/ngx_hunk.h @ 8:708f8bb772ec

nginx-0.0.1-2002-09-02-18:48:24 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 02 Sep 2002 14:48:24 +0000
parents b5481d6fbbd4
children d81326c3b21b
comparison
equal deleted inserted replaced
7:b5481d6fbbd4 8:708f8bb772ec
25 /* last hunk */ 25 /* last hunk */
26 #define NGX_HUNK_LAST 0x0200 26 #define NGX_HUNK_LAST 0x0200
27 /* can be used with NGX_HUNK_LAST only */ 27 /* can be used with NGX_HUNK_LAST only */
28 #define NGX_HUNK_SHUTDOWN 0x0400 28 #define NGX_HUNK_SHUTDOWN 0x0400
29 29
30 #define NGX_HUNK_RECYCLED 0x0800
31
30 32
31 #define NGX_HUNK_IN_MEMORY (NGX_HUNK_TEMP|NGX_HUNK_MEMORY|NGX_HUNK_MMAP) 33 #define NGX_HUNK_IN_MEMORY (NGX_HUNK_TEMP|NGX_HUNK_MEMORY|NGX_HUNK_MMAP)
32 34
33 35
34 36
46 char *start; /* start of hunk */ 48 char *start; /* start of hunk */
47 char *end; /* end of hunk */ 49 char *end; /* end of hunk */
48 char *pre_start; /* start of pre-allocated hunk */ 50 char *pre_start; /* start of pre-allocated hunk */
49 char *post_end; /* end of post-allocated hunk */ 51 char *post_end; /* end of post-allocated hunk */
50 int tag; 52 int tag;
51 ngx_fd_t fd; 53 ngx_file_t *file;
52 }; 54 };
53 55
54 typedef struct ngx_chain_s ngx_chain_t; 56 typedef struct ngx_chain_s ngx_chain_t;
55 struct ngx_chain_s { 57 struct ngx_chain_s {
56 ngx_hunk_t *hunk; 58 ngx_hunk_t *hunk;
57 ngx_chain_t *next; 59 ngx_chain_t *next;
58 }; 60 };
59 61
60 #define ngx_create_temp_hunk(pool, size, before, after) \ 62
61 ngx_get_hunk(pool, size, before, after) 63 ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size,
64 int before, int after);
65
66 #define ngx_create_chain_entry(pool) ngx_palloc(pool, sizeof(ngx_chain_t))
62 67
63 #define ngx_add_hunk_to_chain(chain, h, pool, error) \ 68 #define ngx_add_hunk_to_chain(chain, h, pool, error) \
64 do { \ 69 do { \
65 ngx_test_null(chain, ngx_create_chain_entry(pool), error); \ 70 ngx_test_null(chain, ngx_create_chain_entry(pool), error); \
66 chain->hunk = h; \ 71 chain->hunk = h; \
68 } while (0); 73 } while (0);
69 74
70 75
71 76
72 77
73 ngx_hunk_t *ngx_get_hunk(ngx_pool_t *pool, int size, int before, int after);
74 78
75 79
76 #endif /* _NGX_CHUNK_H_INCLUDED_ */ 80 #endif /* _NGX_CHUNK_H_INCLUDED_ */