Mercurial > hg > nginx
comparison src/core/ngx_buf.h @ 441:da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 28 Sep 2004 08:34:51 +0000 |
parents | 4e21d1291a14 |
children | 42d11f017717 |
comparison
equal
deleted
inserted
replaced
440:f390d1775430 | 441:da8c5707af39 |
---|---|
1 | |
2 /* | |
3 * Copyright (C) 2002-2004 Igor Sysoev | |
4 */ | |
5 | |
6 | |
1 #ifndef _NGX_BUF_H_INCLUDED_ | 7 #ifndef _NGX_BUF_H_INCLUDED_ |
2 #define _NGX_BUF_H_INCLUDED_ | 8 #define _NGX_BUF_H_INCLUDED_ |
3 | 9 |
4 | 10 |
5 #include <ngx_config.h> | 11 #include <ngx_config.h> |
6 #include <ngx_core.h> | 12 #include <ngx_core.h> |
7 | 13 |
8 | 14 |
9 #if 0 | 15 typedef void * ngx_buf_tag_t; |
10 /* the buf type */ | |
11 | 16 |
12 /* the buf's content is in memory */ | 17 typedef struct ngx_buf_s ngx_buf_t; |
13 #define NGX_HUNK_IN_MEMORY 0x0001 | |
14 /* the buf's content can be changed */ | |
15 #define NGX_HUNK_TEMP 0x0002 | |
16 /* the buf's content is in cache and can not be changed */ | |
17 #define NGX_HUNK_MEMORY 0x0004 | |
18 #define NGX_HUNK_MMAP 0x0008 | |
19 | |
20 /* the buf's content is recycled */ | |
21 #define NGX_HUNK_RECYCLED 0x0010 | |
22 | |
23 /* the buf's content is in a file */ | |
24 #define NGX_HUNK_FILE 0x0020 | |
25 | |
26 #define NGX_HUNK_STORAGE (NGX_HUNK_IN_MEMORY \ | |
27 |NGX_HUNK_TEMP|NGX_HUNK_MEMORY|NGX_HUNK_MMAP \ | |
28 |NGX_HUNK_RECYCLED|NGX_HUNK_FILE) | |
29 | |
30 /* the buf flags */ | |
31 | |
32 /* in thread state flush means to write the buf completely before return */ | |
33 /* in event state flush means to start to write the buf */ | |
34 #define NGX_HUNK_FLUSH 0x0100 | |
35 | |
36 /* the last buf */ | |
37 #define NGX_HUNK_LAST 0x0200 | |
38 | |
39 | |
40 #define NGX_HUNK_PREREAD 0x2000 | |
41 #define NGX_HUNK_LAST_SHADOW 0x4000 | |
42 #define NGX_HUNK_TEMP_FILE 0x8000 | |
43 #endif | |
44 | |
45 | |
46 typedef void * ngx_buf_tag_t; | |
47 | |
48 typedef struct ngx_buf_s ngx_buf_t; | |
49 | 18 |
50 struct ngx_buf_s { | 19 struct ngx_buf_s { |
51 u_char *pos; | 20 u_char *pos; |
52 u_char *last; | 21 u_char *last; |
53 off_t file_pos; | 22 off_t file_pos; |
59 ngx_buf_tag_t tag; | 28 ngx_buf_tag_t tag; |
60 ngx_file_t *file; | 29 ngx_file_t *file; |
61 ngx_buf_t *shadow; | 30 ngx_buf_t *shadow; |
62 | 31 |
63 | 32 |
64 /* the buf's content can be changed */ | 33 /* the buf's content could be changed */ |
65 unsigned temporary:1; | 34 unsigned temporary:1; |
66 | 35 |
67 /* | 36 /* |
68 * the buf's content is in a memory cache or in a read only memory | 37 * the buf's content is in a memory cache or in a read only memory |
69 * and can not be changed | 38 * and must not be changed |
70 */ | 39 */ |
71 unsigned memory:1; | 40 unsigned memory:1; |
72 | 41 |
73 /* the buf's content is mmap()ed and can not be changed */ | 42 /* the buf's content is mmap()ed and must not be changed */ |
74 unsigned mmap:1; | 43 unsigned mmap:1; |
44 | |
75 unsigned recycled:1; | 45 unsigned recycled:1; |
76 unsigned in_file:1; | 46 unsigned in_file:1; |
77 unsigned flush:1; | 47 unsigned flush:1; |
78 unsigned last_buf:1; | 48 unsigned last_buf:1; |
79 | 49 |