comparison src/core/ngx_hunk.h @ 1:d220029ac7f3

nginx-0.0.1-2002-08-15-21:20:26 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 15 Aug 2002 17:20:26 +0000
parents 4eff17414a43
children 34a521b1a148
comparison
equal deleted inserted replaced
0:4eff17414a43 1:d220029ac7f3
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_types.h> 6 #include <ngx_types.h>
7 #include <ngx_alloc.h> 7 #include <ngx_alloc.h>
8 8
9 9
10 /* type */ 10 /* hunk type */
11
12 /* temp means that hunk's content can be changed */
13 /* other type means that hunk's content can not be changed */
11 #define NGX_HUNK_TEMP 0x0001 14 #define NGX_HUNK_TEMP 0x0001
12 #define NGX_HUNK_MEMORY 0x0002 15 #define NGX_HUNK_MEMORY 0x0002
13 #define NGX_HUNK_MMAP 0x0004 16 #define NGX_HUNK_MMAP 0x0004
14 #define NGX_HUNK_FILE 0x0008 17 #define NGX_HUNK_FILE 0x0008
15 #define NGX_HUNK_FLUSH 0x0010
16 /* in thread state flush means to write the hunk completely before return
17 in event-driven state flush means to start to write the hunk */
18 #define NGX_HUNK_LAST 0x0020
19 18
20 #define NGX_HUNK_IN_MEMORY (NGX_HUNK_TEMP | NGX_HUNK_MEMORY | NGX_HUNK_MMAP ) 19 /* hunk flags */
21 #define NGX_HUNK_TYPE 0x0ffff
22 20
23 /* flags */ 21 /* in thread state flush means to write the hunk completely before return */
24 #define NGX_HUNK_SHUTDOWN 0x10000 22 /* in event state flush means to start to write the hunk */
23 #define NGX_HUNK_FLUSH 0x0100
24 /* last hunk */
25 #define NGX_HUNK_LAST 0x0200
25 /* can be used with NGX_HUNK_LAST only */ 26 /* can be used with NGX_HUNK_LAST only */
27 #define NGX_HUNK_SHUTDOWN 0x0400
28
29
30 #define NGX_HUNK_IN_MEMORY (NGX_HUNK_TEMP|NGX_HUNK_MEMORY|NGX_HUNK_MMAP)
31
26 32
27 33
28 typedef struct ngx_hunk_s ngx_hunk_t; 34 typedef struct ngx_hunk_s ngx_hunk_t;
29 struct ngx_hunk_s { 35 struct ngx_hunk_s {
30 union { 36 union {
31 char *p; /* start of current data */ 37 char *mem; /* start of current data */
32 off_t f; 38 off_t file;
33 } pos; 39 } pos;
34 union { 40 union {
35 char *p; /* end of current data */ 41 char *mem; /* end of current data */
36 off_t f; 42 off_t file;
37 } last; 43 } last;
38 int type; 44 int type;
39 char *start; /* start of hunk */ 45 char *start; /* start of hunk */
40 char *end; /* end of hunk */ 46 char *end; /* end of hunk */
41 char *pre_start; /* start of pre-allocated hunk */ 47 char *pre_start; /* start of pre-allocated hunk */