annotate src/core/ngx_file.h @ 468:56baf312c1b5 NGINX_0_7_46

nginx 0.7.46 *) Bugfix: the previous release tarball was incorrect.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents c8cfb6c462ef
children 43cc6f0b77ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
4 */
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7 #ifndef _NGX_FILE_H_INCLUDED_
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #define _NGX_FILE_H_INCLUDED_
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11 #include <ngx_config.h>
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_core.h>
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15 struct ngx_file_s {
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
16 ngx_fd_t fd;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
17 ngx_str_t name;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
18 ngx_file_info_t info;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
19
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
20 off_t offset;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
21 off_t sys_offset;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
22
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
23 ngx_log_t *log;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
24
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
25 unsigned valid_info:1;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
26 unsigned directio:1;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
27 };
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
28
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
29 #define NGX_MAX_PATH_LEVEL 3
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
30
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
31
468
56baf312c1b5 nginx 0.7.46
Igor Sysoev <http://sysoev.ru>
parents: 464
diff changeset
32 typedef time_t (*ngx_path_manager_pt) (void *data);
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
33
16
74b1868dd3cd nginx 0.1.8
Igor Sysoev <http://sysoev.ru>
parents: 6
diff changeset
34
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
35 typedef struct {
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
36 ngx_str_t name;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
37 size_t len;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
38 size_t level[3];
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
39
468
56baf312c1b5 nginx 0.7.46
Igor Sysoev <http://sysoev.ru>
parents: 464
diff changeset
40 ngx_path_manager_pt manager;
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
41 void *data;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
42
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
43 u_char *conf_file;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
44 ngx_uint_t line;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
45 } ngx_path_t;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
46
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
47
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
48 typedef struct {
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
49 ngx_str_t name;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
50 size_t level[3];
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
51 } ngx_path_init_t;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
52
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
53
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
54 typedef struct {
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
55 ngx_file_t file;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
56 off_t offset;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
57 ngx_path_t *path;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
58 ngx_pool_t *pool;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
59 char *warn;
182
13710a1813ad nginx 0.3.38
Igor Sysoev <http://sysoev.ru>
parents: 110
diff changeset
60
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
61 ngx_uint_t access;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
62
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
63 unsigned log_level:8;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
64 unsigned persistent:1;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
65 unsigned clean:1;
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
66 } ngx_temp_file_t;
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
67
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
68
362
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
69 typedef struct {
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
70 ngx_uint_t access;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
71 ngx_uint_t path_access;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
72 time_t time;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
73 ngx_fd_t fd;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
74 ngx_err_t rename_error;
362
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
75
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
76 unsigned create_path:1;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
77 unsigned delete_file:1;
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
78 unsigned log_rename_error:1;
362
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
79
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
80 ngx_log_t *log;
362
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
81 } ngx_ext_rename_file_t;
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
82
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
83
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
84 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
85
276
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
86 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev);
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
87 typedef ngx_int_t (*ngx_tree_handler_pt) (ngx_tree_ctx_t *ctx, ngx_str_t *name);
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
88
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
89 struct ngx_tree_ctx_s {
276
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
90 off_t size;
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
91 ngx_uint_t access;
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
92 time_t mtime;
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
93
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
94 ngx_tree_init_handler_pt init_handler;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
95 ngx_tree_handler_pt file_handler;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
96 ngx_tree_handler_pt pre_tree_handler;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
97 ngx_tree_handler_pt post_tree_handler;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
98 ngx_tree_handler_pt spec_handler;
276
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
99
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
100 void *data;
276
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
101 size_t alloc;
c5c2b2883984 nginx 0.5.8
Igor Sysoev <http://sysoev.ru>
parents: 272
diff changeset
102
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
103 ngx_log_t *log;
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
104 };
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
105
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
106
16
74b1868dd3cd nginx 0.1.8
Igor Sysoev <http://sysoev.ru>
parents: 6
diff changeset
107 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain);
74b1868dd3cd nginx 0.1.8
Igor Sysoev <http://sysoev.ru>
parents: 6
diff changeset
108 ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path,
278
704622b2528a nginx 0.5.9
Igor Sysoev <http://sysoev.ru>
parents: 276
diff changeset
109 ngx_pool_t *pool, ngx_uint_t persistent, ngx_uint_t clean,
704622b2528a nginx 0.5.9
Igor Sysoev <http://sysoev.ru>
parents: 276
diff changeset
110 ngx_uint_t access);
356
b743d290eb3b nginx 0.6.22
Igor Sysoev <http://sysoev.ru>
parents: 324
diff changeset
111 void ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len);
16
74b1868dd3cd nginx 0.1.8
Igor Sysoev <http://sysoev.ru>
parents: 6
diff changeset
112 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path);
218
1bf60f8c5c9e nginx 0.3.56
Igor Sysoev <http://sysoev.ru>
parents: 186
diff changeset
113 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
28
7ca9bdc82b3f nginx 0.1.14
Igor Sysoev <http://sysoev.ru>
parents: 16
diff changeset
114 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot);
16
74b1868dd3cd nginx 0.1.8
Igor Sysoev <http://sysoev.ru>
parents: 6
diff changeset
115 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user);
362
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
116 ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to,
54fad6c4b555 nginx 0.6.25
Igor Sysoev <http://sysoev.ru>
parents: 356
diff changeset
117 ngx_ext_rename_file_t *ext);
272
29a6403156b0 nginx 0.5.6
Igor Sysoev <http://sysoev.ru>
parents: 218
diff changeset
118 ngx_int_t ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree);
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
119
48
6cfc63e68377 nginx 0.1.24
Igor Sysoev <http://sysoev.ru>
parents: 44
diff changeset
120 void ngx_init_temp_number(void);
44
4989c3d25945 nginx 0.1.22
Igor Sysoev <http://sysoev.ru>
parents: 42
diff changeset
121 ngx_atomic_uint_t ngx_next_temp_number(ngx_uint_t collision);
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
122
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
123 char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
464
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
124 char *ngx_conf_merge_path_value(ngx_conf_t *cf, ngx_path_t **path,
c8cfb6c462ef nginx 0.7.44
Igor Sysoev <http://sysoev.ru>
parents: 430
diff changeset
125 ngx_path_t *prev, ngx_path_init_t *init);
318
fc223117327f nginx 0.6.3
Igor Sysoev <http://sysoev.ru>
parents: 278
diff changeset
126 char *ngx_conf_set_access_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
0
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
127
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
128
f0b350454894 nginx 0.1.0
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
129 #endif /* _NGX_FILE_H_INCLUDED_ */