Mercurial > hg > nginx-quic
annotate src/core/ngx_file.h @ 2384:ad3164baf636
bump version
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 09 Dec 2008 11:13:12 +0000 |
parents | 8564129d49b6 |
children | dbe746851b31 |
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 |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
14 typedef struct ngx_path_s ngx_path_t; |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
15 |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
16 #include <ngx_garbage_collector.h> |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
17 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
18 |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
19 struct ngx_file_s { |
467 | 20 ngx_fd_t fd; |
21 ngx_str_t name; | |
22 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
|
23 |
467 | 24 off_t offset; |
25 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
|
26 |
467 | 27 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
|
28 |
2231
8564129d49b6
*) handle unaligned file part for directio
Igor Sysoev <igor@sysoev.ru>
parents:
1909
diff
changeset
|
29 unsigned valid_info:1; |
8564129d49b6
*) handle unaligned file part for directio
Igor Sysoev <igor@sysoev.ru>
parents:
1909
diff
changeset
|
30 unsigned directio:1; |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 }; |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
32 |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
33 #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
|
34 |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
35 struct ngx_path_s { |
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
36 ngx_str_t name; |
517 | 37 size_t len; |
38 size_t level[3]; | |
479 | 39 ngx_gc_handler_pt cleaner; |
467 | 40 |
41 u_char *conf_file; | |
42 ngx_uint_t line; | |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
43 }; |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
44 |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
45 |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
46 typedef struct { |
467 | 47 ngx_file_t file; |
48 off_t offset; | |
49 ngx_path_t *path; | |
50 ngx_pool_t *pool; | |
51 char *warn; | |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
52 |
1046 | 53 ngx_uint_t access; |
633 | 54 |
637 | 55 unsigned log_level:8; |
467 | 56 unsigned persistent:1; |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1058
diff
changeset
|
57 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
|
58 } 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
|
59 |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
60 |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
61 typedef struct { |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
62 ngx_uint_t access; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
63 time_t time; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
64 ngx_fd_t fd; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
65 |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
66 unsigned create_path:1; |
1909 | 67 unsigned delete_file:1; |
1827
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
68 |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
69 ngx_log_t *log; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
70 } ngx_ext_rename_file_t; |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
71 |
cb9d4278b476
add declaration missed in previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
1748
diff
changeset
|
72 |
956 | 73 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t; |
74 | |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
75 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev); |
956 | 76 typedef ngx_int_t (*ngx_tree_handler_pt) (ngx_tree_ctx_t *ctx, ngx_str_t *name); |
77 | |
78 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
|
79 off_t size; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
80 ngx_uint_t access; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
81 time_t mtime; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
82 |
956 | 83 ngx_tree_init_handler_pt init_handler; |
84 ngx_tree_handler_pt file_handler; | |
85 ngx_tree_handler_pt pre_tree_handler; | |
86 ngx_tree_handler_pt post_tree_handler; | |
87 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
|
88 |
956 | 89 void *data; |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
90 size_t alloc; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
91 |
956 | 92 ngx_log_t *log; |
93 }; | |
94 | |
95 | |
467 | 96 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain); |
97 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
|
98 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
|
99 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
|
100 void ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len); |
467 | 101 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); |
669 | 102 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); |
479 | 103 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); |
467 | 104 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
|
105 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
|
106 ngx_ext_rename_file_t *ext); |
956 | 107 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
|
108 |
499 | 109 void ngx_init_temp_number(void); |
495 | 110 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
|
111 |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
112 char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
1291
13a4ce6e7f1e
proxy_store and fastcgi_store
Igor Sysoev <igor@sysoev.ru>
parents:
1075
diff
changeset
|
113 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
|
114 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
115 |
479 | 116 #define ngx_conf_merge_path_value(curr, prev, path, l1, l2, l3, clean, cf) \ |
117 if (curr == NULL) { \ | |
118 if (prev == NULL) { \ | |
501 | 119 curr = ngx_palloc(cf->pool, sizeof(ngx_path_t)); \ |
120 if (curr == NULL) { \ | |
479 | 121 return NGX_CONF_ERROR; \ |
122 } \ | |
123 \ | |
124 curr->name.len = sizeof(path) - 1; \ | |
125 curr->name.data = (u_char *) path; \ | |
126 \ | |
1352 | 127 if (ngx_conf_full_name(cf->cycle, &curr->name, 0) == NGX_ERROR) { \ |
479 | 128 return NGX_CONF_ERROR; \ |
129 } \ | |
130 \ | |
131 curr->level[0] = l1; \ | |
132 curr->level[1] = l2; \ | |
133 curr->level[2] = l3; \ | |
134 curr->len = l1 + l2 + l3 + (l1 ? 1:0) + (l2 ? 1:0) + (l3 ? 1:0); \ | |
135 curr->cleaner = clean; \ | |
136 curr->conf_file = NULL; \ | |
137 \ | |
138 if (ngx_add_path(cf, &curr) == NGX_ERROR) { \ | |
139 return NGX_CONF_ERROR; \ | |
140 } \ | |
141 \ | |
142 } else { \ | |
143 curr = prev; \ | |
144 } \ | |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
145 } |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
146 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
147 |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
148 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
149 #endif /* _NGX_FILE_H_INCLUDED_ */ |