Mercurial > hg > nginx-quic
annotate src/os/win32/ngx_files.h @ 3435:d65ba5392f59 stable-0.7
merge r3138, r3139, r3157, r3158, r3159, r3164, r3165,
r3202, r3203, r3383, r3388, r3417, r3418:
Win32 (mostly) and some Unix file related fixes:
*) preserve errno while ngx_free()
*) win32 ngx_file_info() utf8 support
*) delete Win95 code
*) log file name for read/write errors
*) test incomplete WriteFile()
*) handle short pwrite() to log an error cause: ENOSPC, EDQUOT, or EFBIG
*) uniform ngx_directio_on/off() interface with other file functions
*) do not create Win32 drive letter in ngx_create_full_path()
*) ignore EACCES errors for top level directories in ngx_create_full_path()
*) fix Win32 error messages when an temporary file replaces an existent file:
*) do not rename an already renamed file
*) now ngx_win32_rename_file() returns error code
*) do not log failure inside ngx_win32_rename_file()
*) fix Win32 error message when an temporary file replaces an existent file:
return at once if ngx_win32_rename_file() was not failed
and do not try to delete already the renamed temporary file
*) skip URI trailing spaces under Win32
*) disable Win32 short file names
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 01 Feb 2010 15:06:25 +0000 |
parents | 6b8284fc958d |
children | 8944c3e318ab |
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:
336
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:
336
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:
336
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:
336
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:
336
diff
changeset
|
6 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
7 #ifndef _NGX_FILES_H_INCLUDED_ |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
8 #define _NGX_FILES_H_INCLUDED_ |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
12 #include <ngx_core.h> |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
28
diff
changeset
|
13 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
15 typedef HANDLE ngx_fd_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
16 typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
17 typedef uint64_t ngx_file_uniq_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
18 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
19 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
20 HANDLE dir; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
21 WIN32_FIND_DATA finddata; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
22 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
23 unsigned valid_info:1; |
3433 | 24 unsigned type:1; |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
25 unsigned ready:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
26 } ngx_dir_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
27 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
28 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
29 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
30 HANDLE dir; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
31 WIN32_FIND_DATA finddata; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
32 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
33 unsigned ready:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
34 unsigned test:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
35 unsigned no_match:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
36 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
37 u_char *pattern; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
38 ngx_str_t name; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
39 size_t last; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
40 ngx_log_t *log; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
41 } ngx_glob_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
42 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
43 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
44 |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
45 /* INVALID_FILE_ATTRIBUTES is specified but not defined at least in MSVC6SP2 */ |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 #ifndef INVALID_FILE_ATTRIBUTES |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
47 #define INVALID_FILE_ATTRIBUTES 0xffffffff |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 #endif |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
50 /* INVALID_SET_FILE_POINTER is not defined at least in MSVC6SP2 */ |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
51 #ifndef INVALID_SET_FILE_POINTER |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
52 #define INVALID_SET_FILE_POINTER 0xffffffff |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
53 #endif |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
54 |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
55 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
56 #define NGX_INVALID_FILE INVALID_HANDLE_VALUE |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
57 #define NGX_FILE_ERROR 0 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
58 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 |
2628
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
60 ngx_fd_t ngx_open_file(u_char *name, u_long mode, u_long create, u_long access); |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
61 #define ngx_open_file_n "CreateFile()" |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
62 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
63 #define NGX_FILE_RDONLY GENERIC_READ |
1054 | 64 #define NGX_FILE_WRONLY GENERIC_WRITE |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
65 #define NGX_FILE_RDWR GENERIC_READ|GENERIC_WRITE |
2628
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
66 #define NGX_FILE_APPEND FILE_APPEND_DATA|SYNCHRONIZE |
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
67 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
68 #define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
69 #define NGX_FILE_OPEN OPEN_EXISTING |
2686
9e0ae986b587
adopt NGX_FILE_TRUNCATE for win32
Igor Sysoev <igor@sysoev.ru>
parents:
2628
diff
changeset
|
70 #define NGX_FILE_TRUNCATE CREATE_ALWAYS |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
71 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1047
diff
changeset
|
72 #define NGX_FILE_DEFAULT_ACCESS 0 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2461
diff
changeset
|
73 #define NGX_FILE_OWNER_ACCESS 0 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1047
diff
changeset
|
74 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
75 |
1047 | 76 #define ngx_open_tempfile(name, persistent, access) \ |
77 CreateFile((const char *) name, \ | |
78 GENERIC_READ|GENERIC_WRITE, \ | |
79 FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, \ | |
80 NULL, \ | |
81 CREATE_NEW, \ | |
82 persistent ? 0: \ | |
83 FILE_ATTRIBUTE_TEMPORARY|FILE_FLAG_DELETE_ON_CLOSE, \ | |
497 | 84 NULL); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
85 |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
86 #define ngx_open_tempfile_n "CreateFile()" |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
87 |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
88 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
89 #define ngx_close_file CloseHandle |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
90 #define ngx_close_file_n "CloseHandle()" |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
91 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
92 |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
93 ssize_t ngx_read_fd(ngx_fd_t fd, void *buf, size_t size); |
1055 | 94 #define ngx_read_fd_n "ReadFile()" |
95 | |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
96 |
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
97 ssize_t ngx_write_fd(ngx_fd_t fd, void *buf, size_t size); |
1055 | 98 #define ngx_write_fd_n "WriteFile()" |
99 | |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
100 |
2769
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
101 ssize_t ngx_write_console(ngx_fd_t fd, void *buf, size_t size); |
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
102 |
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
103 |
571 | 104 #define ngx_linefeed(p) *p++ = CR; *p++ = LF; |
105 #define NGX_LINEFEED_SIZE 2 | |
106 | |
107 | |
292
a472bfb778b3
nginx-0.0.3-2004-03-17-00:26:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
108 #define ngx_delete_file(name) DeleteFile((const char *) name) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
109 #define ngx_delete_file_n "DeleteFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
110 |
180
2d143372a1ee
nginx-0.0.1-2003-11-12-01:16:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
111 |
633 | 112 #define ngx_rename_file(o, n) MoveFile((const char *) o, (const char *) n) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
113 #define ngx_rename_file_n "MoveFile()" |
3435
d65ba5392f59
merge r3138, r3139, r3157, r3158, r3159, r3164, r3165,
Igor Sysoev <igor@sysoev.ru>
parents:
3433
diff
changeset
|
114 ngx_err_t ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_log_t *log); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
115 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
116 |
681 | 117 |
118 ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s); | |
119 #define ngx_set_file_time_n "SetFileTime()" | |
120 | |
121 | |
467 | 122 ngx_int_t ngx_file_info(u_char *filename, ngx_file_info_t *fi); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
123 #define ngx_file_info_n "GetFileAttributesEx()" |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
124 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
125 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
126 #define ngx_fd_info(fd, fi) GetFileInformationByHandle(fd, fi) |
681 | 127 #define ngx_fd_info_n "GetFileInformationByHandle()" |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
128 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
129 |
2461 | 130 #define ngx_is_dir(fi) \ |
131 (((fi)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) | |
132 #define ngx_is_file(fi) \ | |
133 (((fi)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) | |
669 | 134 #define ngx_is_link(fi) 0 |
1436 | 135 #define ngx_is_exec(fi) 0 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
136 |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1050
diff
changeset
|
137 #define ngx_file_access(fi) 0 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
138 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
139 #define ngx_file_size(fi) \ |
497 | 140 (((off_t) (fi)->nFileSizeHigh << 32) | (fi)->nFileSizeLow) |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
141 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
142 #define ngx_file_uniq(fi) (*(ngx_file_uniq_t *) &(fi)->nFileIndexHigh) |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
143 |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
144 |
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
145 /* 116444736000000000 is commented in src/os/win32/ngx_time.c */ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
146 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
147 #define ngx_file_mtime(fi) \ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
148 (time_t) (((((unsigned __int64) (fi)->ftLastWriteTime.dwHighDateTime << 32) \ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
149 | (fi)->ftLastWriteTime.dwLowDateTime) \ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
150 - 116444736000000000) / 10000000) |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
151 |
3094 | 152 #define NGX_HAVE_CASELESS_FILESYSTEM 1 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
153 |
2142
be9887d15b8e
fix building by msvc8 introduced in r2127
Igor Sysoev <igor@sysoev.ru>
parents:
2134
diff
changeset
|
154 #define ngx_filename_cmp(s1, s2, n) _strnicmp((char *) s1, (char *) s2, n) |
2126
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
155 |
5e954395a15e
case insensitive file system location support provided by locale only
Igor Sysoev <igor@sysoev.ru>
parents:
1980
diff
changeset
|
156 |
2259 | 157 char *ngx_realpath(u_char *path, u_char *resolved); |
158 #define ngx_realpath_n "" | |
2758 | 159 #define ngx_getcwd(buf, size) GetCurrentDirectory(size, (char *) buf) |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
160 #define ngx_getcwd_n "GetCurrentDirectory()" |
2744 | 161 #define ngx_path_separator(c) ((c) == '/' || (c) == '\\') |
162 | |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
163 #define NGX_MAX_PATH MAX_PATH |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
164 |
292
a472bfb778b3
nginx-0.0.3-2004-03-17-00:26:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
165 #define NGX_DIR_MASK (u_char *) "/*" |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
166 #define NGX_DIR_MASK_LEN 2 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
167 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
168 |
467 | 169 ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
170 #define ngx_open_dir_n "FindFirstFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
171 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
172 |
467 | 173 ngx_int_t ngx_read_dir(ngx_dir_t *dir); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
174 #define ngx_read_dir_n "FindNextFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
175 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
176 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
177 #define ngx_close_dir(d) FindClose((d)->dir) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
178 #define ngx_close_dir_n "FindClose()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
179 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
180 |
669 | 181 #define ngx_create_dir(name, access) CreateDirectory((const char *) name, NULL) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
182 #define ngx_create_dir_n "CreateDirectory()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
183 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
184 |
292
a472bfb778b3
nginx-0.0.3-2004-03-17-00:26:01 import
Igor Sysoev <igor@sysoev.ru>
parents:
290
diff
changeset
|
185 #define ngx_delete_dir(name) RemoveDirectory((const char *) name) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
186 #define ngx_delete_dir_n "RemoveDirectory()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
187 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
188 |
1089
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
189 #define ngx_dir_access(a) (a) |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
190 |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
191 |
727 | 192 #define ngx_de_name(dir) ((u_char *) (dir)->finddata.cFileName) |
193 #define ngx_de_namelen(dir) ngx_strlen((dir)->finddata.cFileName) | |
501 | 194 |
195 ngx_int_t ngx_de_info(u_char *name, ngx_dir_t *dir); | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
196 #define ngx_de_info_n "dummy()" |
501 | 197 |
198 ngx_int_t ngx_de_link_info(u_char *name, ngx_dir_t *dir); | |
497 | 199 #define ngx_de_link_info_n "dummy()" |
501 | 200 |
1047 | 201 #define ngx_de_is_dir(dir) \ |
2461 | 202 (((dir)->finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) |
1047 | 203 #define ngx_de_is_file(dir) \ |
2461 | 204 (((dir)->finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) |
497 | 205 #define ngx_de_is_link(dir) 0 |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1050
diff
changeset
|
206 #define ngx_de_access(dir) 0 |
1047 | 207 #define ngx_de_size(dir) \ |
727 | 208 (((off_t) (dir)->finddata.nFileSizeHigh << 32) | (dir)->finddata.nFileSizeLow) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
209 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
210 /* 116444736000000000 is commented in src/os/win32/ngx_time.c */ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
211 |
1047 | 212 #define ngx_de_mtime(dir) \ |
213 (time_t) (((((unsigned __int64) \ | |
214 (dir)->finddata.ftLastWriteTime.dwHighDateTime << 32) \ | |
215 | (dir)->finddata.ftLastWriteTime.dwLowDateTime) \ | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
216 - 116444736000000000) / 10000000) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
217 |
727 | 218 |
219 ngx_int_t ngx_open_glob(ngx_glob_t *gl); | |
2129 | 220 #define ngx_open_glob_n "FindFirstFile()" |
727 | 221 |
222 ngx_int_t ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name); | |
223 void ngx_close_glob(ngx_glob_t *gl); | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
224 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
225 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
226 ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset); |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
227 #define ngx_read_file_n "ReadFile()" |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
228 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
229 ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, |
497 | 230 off_t offset); |
182
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
231 |
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
232 ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce, |
497 | 233 off_t offset, ngx_pool_t *pool); |
182
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
234 |
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
235 |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
236 ngx_int_t ngx_directio_on(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
237 #define ngx_directio_on_n "ngx_directio_on_n" |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
238 |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
239 ngx_int_t ngx_directio_off(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
240 #define ngx_directio_off_n "ngx_directio_off_n" |
2129 | 241 |
2615 | 242 size_t ngx_fs_bsize(u_char *name); |
243 | |
2129 | 244 |
2743
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
245 #define ngx_stderr GetStdHandle(STD_ERROR_HANDLE) |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
246 #define ngx_set_stderr(fd) SetStdHandle(STD_ERROR_HANDLE, fd) |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
247 #define ngx_set_stderr_n "SetStdHandle(STD_ERROR_HANDLE)" |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
248 |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
249 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
250 #endif /* _NGX_FILES_H_INCLUDED_ */ |