Mercurial > hg > nginx-quic
annotate src/core/ngx_file.h @ 1306:56af40ef3a08
Solaris compatibility
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 15 Jul 2007 14:45:51 +0000 |
parents | 13a4ce6e7f1e |
children | e958b3cab51a |
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 |
499 | 29 ngx_uint_t valid_info; /* unsigned valid_info:1; */ |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 }; |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 |
185
d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
170
diff
changeset
|
32 #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
|
33 |
190
02a715e85df1
nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
34 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
|
35 ngx_str_t name; |
517 | 36 size_t len; |
37 size_t level[3]; | |
479 | 38 ngx_gc_handler_pt cleaner; |
467 | 39 |
40 u_char *conf_file; | |
41 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
|
42 }; |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
43 |
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
44 |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
45 typedef struct { |
467 | 46 ngx_file_t file; |
47 off_t offset; | |
48 ngx_path_t *path; | |
49 ngx_pool_t *pool; | |
50 char *warn; | |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
51 |
1046 | 52 ngx_uint_t access; |
633 | 53 |
637 | 54 unsigned log_level:8; |
467 | 55 unsigned persistent:1; |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
1058
diff
changeset
|
56 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
|
57 } 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
|
58 |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
59 |
956 | 60 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t; |
61 | |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
62 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev); |
956 | 63 typedef ngx_int_t (*ngx_tree_handler_pt) (ngx_tree_ctx_t *ctx, ngx_str_t *name); |
64 | |
65 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
|
66 off_t size; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
67 ngx_uint_t access; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
68 time_t mtime; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
69 |
956 | 70 ngx_tree_init_handler_pt init_handler; |
71 ngx_tree_handler_pt file_handler; | |
72 ngx_tree_handler_pt pre_tree_handler; | |
73 ngx_tree_handler_pt post_tree_handler; | |
74 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
|
75 |
956 | 76 void *data; |
1058
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
77 size_t alloc; |
01f818c6f7de
add size, access, and mtime to ngx_walk_tree()
Igor Sysoev <igor@sysoev.ru>
parents:
1046
diff
changeset
|
78 |
956 | 79 ngx_log_t *log; |
80 }; | |
81 | |
82 | |
467 | 83 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain); |
84 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
|
85 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
|
86 ngx_uint_t access); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
87 void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path); |
467 | 88 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); |
669 | 89 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); |
479 | 90 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); |
467 | 91 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user); |
956 | 92 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
|
93 |
499 | 94 void ngx_init_temp_number(void); |
495 | 95 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
|
96 |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
97 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
|
98 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
|
99 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
100 |
479 | 101 #define ngx_conf_merge_path_value(curr, prev, path, l1, l2, l3, clean, cf) \ |
102 if (curr == NULL) { \ | |
103 if (prev == NULL) { \ | |
501 | 104 curr = ngx_palloc(cf->pool, sizeof(ngx_path_t)); \ |
105 if (curr == NULL) { \ | |
479 | 106 return NGX_CONF_ERROR; \ |
107 } \ | |
108 \ | |
109 curr->name.len = sizeof(path) - 1; \ | |
110 curr->name.data = (u_char *) path; \ | |
111 \ | |
112 if (ngx_conf_full_name(cf->cycle, &curr->name) == NGX_ERROR) { \ | |
113 return NGX_CONF_ERROR; \ | |
114 } \ | |
115 \ | |
116 curr->level[0] = l1; \ | |
117 curr->level[1] = l2; \ | |
118 curr->level[2] = l3; \ | |
119 curr->len = l1 + l2 + l3 + (l1 ? 1:0) + (l2 ? 1:0) + (l3 ? 1:0); \ | |
120 curr->cleaner = clean; \ | |
121 curr->conf_file = NULL; \ | |
122 \ | |
123 if (ngx_add_path(cf, &curr) == NGX_ERROR) { \ | |
124 return NGX_CONF_ERROR; \ | |
125 } \ | |
126 \ | |
127 } else { \ | |
128 curr = prev; \ | |
129 } \ | |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
130 } |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
131 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
132 |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
133 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
134 #endif /* _NGX_FILE_H_INCLUDED_ */ |