Mercurial > hg > nginx-quic
annotate src/core/ngx_file.h @ 996:7fdcb5b9f063
fix label name
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 09 Jan 2007 16:02:29 +0000 |
parents | 8c3d62474df1 |
children | bb139aba3199 |
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 |
633 | 52 ngx_uint_t mode; |
53 | |
637 | 54 unsigned log_level:8; |
467 | 55 unsigned persistent:1; |
160
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
56 } 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
|
57 |
e7e094d34162
nginx-0.0.1-2003-10-27-11:53:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
58 |
956 | 59 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t; |
60 | |
61 typedef ngx_int_t (*ngx_tree_init_handler_pt) (ngx_tree_ctx_t *ctx, | |
62 ngx_tree_ctx_t *prev); | |
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 { | |
66 ngx_tree_init_handler_pt init_handler; | |
67 ngx_tree_handler_pt file_handler; | |
68 ngx_tree_handler_pt pre_tree_handler; | |
69 ngx_tree_handler_pt post_tree_handler; | |
70 ngx_tree_handler_pt spec_handler; | |
71 void *data; | |
72 size_t size; | |
73 ngx_log_t *log; | |
74 }; | |
75 | |
76 | |
467 | 77 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain); |
78 ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, | |
633 | 79 ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t mode); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
80 void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path); |
467 | 81 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); |
669 | 82 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); |
479 | 83 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); |
467 | 84 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user); |
956 | 85 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
|
86 |
499 | 87 void ngx_init_temp_number(void); |
495 | 88 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
|
89 |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
90 char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
91 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
92 |
479 | 93 #define ngx_conf_merge_path_value(curr, prev, path, l1, l2, l3, clean, cf) \ |
94 if (curr == NULL) { \ | |
95 if (prev == NULL) { \ | |
501 | 96 curr = ngx_palloc(cf->pool, sizeof(ngx_path_t)); \ |
97 if (curr == NULL) { \ | |
479 | 98 return NGX_CONF_ERROR; \ |
99 } \ | |
100 \ | |
101 curr->name.len = sizeof(path) - 1; \ | |
102 curr->name.data = (u_char *) path; \ | |
103 \ | |
104 if (ngx_conf_full_name(cf->cycle, &curr->name) == NGX_ERROR) { \ | |
105 return NGX_CONF_ERROR; \ | |
106 } \ | |
107 \ | |
108 curr->level[0] = l1; \ | |
109 curr->level[1] = l2; \ | |
110 curr->level[2] = l3; \ | |
111 curr->len = l1 + l2 + l3 + (l1 ? 1:0) + (l2 ? 1:0) + (l3 ? 1:0); \ | |
112 curr->cleaner = clean; \ | |
113 curr->conf_file = NULL; \ | |
114 \ | |
115 if (ngx_add_path(cf, &curr) == NGX_ERROR) { \ | |
116 return NGX_CONF_ERROR; \ | |
117 } \ | |
118 \ | |
119 } else { \ | |
120 curr = prev; \ | |
121 } \ | |
155
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
122 } |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
123 |
46eb23d9471d
nginx-0.0.1-2003-10-22-20:38:26 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
124 |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
125 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
126 #endif /* _NGX_FILE_H_INCLUDED_ */ |