Mercurial > hg > nginx-quic
annotate src/core/ngx_file.h @ 2741:cda3738a85bd
use ngx_str_t for error levels
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 23 Apr 2009 08:05:54 +0000 |
parents | d19979e0d980 |
children | 8fc7b94f647b |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
6 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #ifndef _NGX_FILE_H_INCLUDED_ |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #define _NGX_FILE_H_INCLUDED_ |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
11 #include <ngx_config.h> |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
12 #include <ngx_core.h> |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 struct ngx_file_s { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
16 ngx_fd_t fd; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
17 ngx_str_t name; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
18 ngx_file_info_t info; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
19 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
20 off_t offset; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
21 off_t sys_offset; |
35
79c1fce18e71
nginx-0.0.1-2002-12-21-20:14:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
22 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
23 ngx_log_t *log; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
24 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
25 unsigned valid_info:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
26 unsigned directio:1; |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
27 }; |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
28 |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
29 #define NGX_MAX_PATH_LEVEL 3 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
31 |
2616
d19979e0d980
introduce cache manager instead of cache cleaner
Igor Sysoev <igor@sysoev.ru>
parents:
2592
diff
changeset
|
32 typedef time_t (*ngx_path_manager_pt) (void *data); |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
33 |
467 | 34 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
35 typedef struct { |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
36 ngx_str_t name; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
37 size_t len; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
38 size_t level[3]; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
39 |
2616
d19979e0d980
introduce cache manager instead of cache cleaner
Igor Sysoev <igor@sysoev.ru>
parents:
2592
diff
changeset
|
40 ngx_path_manager_pt manager; |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
41 void *data; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
42 |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
43 u_char *conf_file; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
44 ngx_uint_t line; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
45 } ngx_path_t; |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
46 |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
47 |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
48 typedef struct { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
49 ngx_str_t name; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
50 size_t level[3]; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
51 } ngx_path_init_t; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
52 |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
53 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
54 typedef struct { |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
55 ngx_file_t file; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
56 off_t offset; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
57 ngx_path_t *path; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
58 ngx_pool_t *pool; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
59 char *warn; |
633 | 60 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
61 ngx_uint_t access; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
62 |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
63 unsigned log_level:8; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
64 unsigned persistent:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
65 unsigned clean:1; |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
66 } ngx_temp_file_t; |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
67 |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
68 |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
69 typedef struct { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
70 ngx_uint_t access; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
71 ngx_uint_t path_access; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
72 time_t time; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
73 ngx_fd_t fd; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
74 ngx_err_t rename_error; |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
75 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
76 unsigned create_path:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
77 unsigned delete_file:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
78 unsigned log_rename_error:1; |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
79 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
80 ngx_log_t *log; |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
81 } ngx_ext_rename_file_t; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
82 |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
83 |
956 | 84 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t; |
85 | |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
86 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev); |
956 | 87 typedef ngx_int_t (*ngx_tree_handler_pt) (ngx_tree_ctx_t *ctx, ngx_str_t *name); |
88 | |
89 struct ngx_tree_ctx_s { | |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
90 off_t size; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
91 ngx_uint_t access; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
92 time_t mtime; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
93 |
956 | 94 ngx_tree_init_handler_pt init_handler; |
95 ngx_tree_handler_pt file_handler; | |
96 ngx_tree_handler_pt pre_tree_handler; | |
97 ngx_tree_handler_pt post_tree_handler; | |
98 ngx_tree_handler_pt spec_handler; | |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
99 |
956 | 100 void *data; |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
101 size_t alloc; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
102 |
956 | 103 ngx_log_t *log; |
104 }; | |
105 | |
106 | |
467 | 107 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain); |
108 ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, | |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1058
diff
changeset
|
109 ngx_pool_t *pool, ngx_uint_t persistent, ngx_uint_t clean, |
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1058
diff
changeset
|
110 ngx_uint_t access); |
1748
91d381e4e691
ngx_create_hashed_filename() does not need ngx_file_t
Igor Sysoev <igor@sysoev.ru>
parents:
1695
diff
changeset
|
111 void ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len); |
467 | 112 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); |
669 | 113 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); |
479 | 114 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); |
467 | 115 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user); |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
116 ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
117 ngx_ext_rename_file_t *ext); |
956 | 118 ngx_int_t ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
119 |
499 | 120 void ngx_init_temp_number(void); |
495 | 121 ngx_atomic_uint_t ngx_next_temp_number(ngx_uint_t collision); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
122 |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
123 char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
124 char *ngx_conf_merge_path_value(ngx_conf_t *cf, ngx_path_t **path, |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2394
diff
changeset
|
125 ngx_path_t *prev, ngx_path_init_t *init); |
1291
13a4ce6e7f1e
proxy_store and fastcgi_store
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
126 char *ngx_conf_set_access_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
127 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
128 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
129 #endif /* _NGX_FILE_H_INCLUDED_ */ |