diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-03-17 00:26:01 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-03-17 00:26:01 +0300 |
commit | da85f7f5fc233a10abf3cbcbda547c918b67fb27 (patch) | |
tree | cf196e3f59770ee720b4ad387eee004b4f28f762 /src/os/win32 | |
parent | 9c61095a30ed2b6bf051dacbbbd26ae2769d9e34 (diff) |
nginx-0.0.3-2004-03-17-00:26:01 import
Diffstat (limited to 'src/os/win32')
-rw-r--r-- | src/os/win32/ngx_files.c | 18 | ||||
-rw-r--r-- | src/os/win32/ngx_files.h | 10 | ||||
-rw-r--r-- | src/os/win32/ngx_os.h | 17 | ||||
-rw-r--r-- | src/os/win32/ngx_win32_config.h | 3 | ||||
-rw-r--r-- | src/os/win32/ngx_wsarecv.c | 8 | ||||
-rw-r--r-- | src/os/win32/ngx_wsarecv_chain.c | 4 | ||||
-rw-r--r-- | src/os/win32/ngx_wsasend_chain.c | 8 |
7 files changed, 30 insertions, 38 deletions
diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c index ffc09b6ed..20713ce9a 100644 --- a/src/os/win32/ngx_files.c +++ b/src/os/win32/ngx_files.c @@ -132,7 +132,7 @@ ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset) ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, off_t offset, ngx_pool_t *pool) { - char *buf, *prev; + u_char *buf, *prev; size_t size; ssize_t total, n; @@ -169,7 +169,7 @@ int ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool) { int rc, collision; u_int num; - char *name; + u_char *name; if (!(name = ngx_palloc(pool, to->len + 1 + 10 + 1 + sizeof("DELETE")))) { return NGX_ERROR; @@ -184,10 +184,10 @@ int ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool) do { num = ngx_next_temp_number(collision); - ngx_snprintf(name + to->len, 1 + 10 + 1 + sizeof("DELETE"), + ngx_snprintf((char *) name + to->len, 1 + 10 + 1 + sizeof("DELETE"), ".%010u.DELETE", num); - if (MoveFile(to->data, name) == 0) { + if (MoveFile((const char *) to->data, (const char *) name) == 0) { collision = 1; ngx_log_error(NGX_LOG_ERR, pool->log, ngx_errno, "MoveFile() failed"); @@ -195,7 +195,7 @@ int ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool) } while (collision); - if (MoveFile(from->data, to->data) == 0) { + if (MoveFile((const char *) from->data, (const char *) to->data) == 0) { rc = NGX_ERROR; } else { @@ -203,7 +203,7 @@ int ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool) } if (ngx_win32_version >= NGX_WIN_NT) { - if (DeleteFile(name) == 0) { + if (DeleteFile((const char *) name) == 0) { ngx_log_error(NGX_LOG_ERR, pool->log, ngx_errno, "DeleteFile() failed"); } @@ -247,11 +247,11 @@ int ngx_file_info(char *file, ngx_file_info_t *sb) #endif -int ngx_file_info(char *file, ngx_file_info_t *sb) +int ngx_file_info(u_char *file, ngx_file_info_t *sb) { /* Win95 */ - sb->dwFileAttributes = GetFileAttributes(file); + sb->dwFileAttributes = GetFileAttributes((const char *) file); if (sb->dwFileAttributes == INVALID_FILE_ATTRIBUTES) { return NGX_ERROR; @@ -265,7 +265,7 @@ int ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir) { ngx_cpystrn(name->data + name->len, NGX_DIR_MASK, NGX_DIR_MASK_LEN + 1); - dir->dir = FindFirstFile(name->data, &dir->fd); + dir->dir = FindFirstFile((const char *) name->data, &dir->fd); if (dir->dir == INVALID_HANDLE_VALUE) { return NGX_ERROR; diff --git a/src/os/win32/ngx_files.h b/src/os/win32/ngx_files.h index 730ee71f8..6915f97e5 100644 --- a/src/os/win32/ngx_files.h +++ b/src/os/win32/ngx_files.h @@ -59,7 +59,7 @@ int ngx_file_append_mode(ngx_fd_t fd); #define ngx_close_file_n "CloseHandle()" -#define ngx_delete_file DeleteFile +#define ngx_delete_file(name) DeleteFile((const char *) name) #define ngx_delete_file_n "DeleteFile()" @@ -68,7 +68,7 @@ int ngx_file_append_mode(ngx_fd_t fd); int ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_pool_t *pool); -int ngx_file_info(char *filename, ngx_file_info_t *fi); +int ngx_file_info(u_char *filename, ngx_file_info_t *fi); #define ngx_file_info_n "GetFileAttributesEx()" @@ -94,7 +94,7 @@ int ngx_file_info(char *filename, ngx_file_info_t *fi); - 116444736000000000) / 10000000) -#define NGX_DIR_MASK "/*" +#define NGX_DIR_MASK (u_char *) "/*" #define NGX_DIR_MASK_LEN 2 @@ -110,11 +110,11 @@ int ngx_read_dir(ngx_dir_t *dir); #define ngx_close_dir_n "FindClose()" -#define ngx_create_dir(name) CreateDirectory(name, NULL) +#define ngx_create_dir(name) CreateDirectory((const char *) name, NULL) #define ngx_create_dir_n "CreateDirectory()" -#define ngx_delete_dir RemoveDirectory +#define ngx_delete_dir(name) RemoveDirectory((const char *) name) #define ngx_delete_dir_n "RemoveDirectory()" diff --git a/src/os/win32/ngx_os.h b/src/os/win32/ngx_os.h index 39af212b3..2fae21b84 100644 --- a/src/os/win32/ngx_os.h +++ b/src/os/win32/ngx_os.h @@ -23,9 +23,9 @@ typedef struct { - ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size); + ssize_t (*recv)(ngx_connection_t *c, u_char *buf, size_t size); ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in); - ssize_t (*send)(ngx_connection_t *c, char *buf, size_t size); + ssize_t (*send)(ngx_connection_t *c, u_char *buf, size_t size); ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in); int flags; } ngx_os_io_t; @@ -33,8 +33,8 @@ typedef struct { int ngx_os_init(ngx_log_t *log); -ssize_t ngx_wsarecv(ngx_connection_t *c, char *buf, size_t size); -ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, char *buf, size_t size); +ssize_t ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size); +ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, u_char *buf, size_t size); ssize_t ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain); ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in); ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in); @@ -46,15 +46,6 @@ extern int ngx_inherited_nonblocking; extern int ngx_win32_version; -extern ngx_int_t ngx_process; - -extern ngx_int_t ngx_quit; -extern ngx_int_t ngx_terminate; - -extern ngx_int_t ngx_reconfigure; -extern ngx_int_t ngx_reopen; - - #endif /* _NGX_OS_H_INCLUDED_ */ diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h index 3b3f71145..b6388f5f7 100644 --- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -27,6 +27,7 @@ #ifdef _MSC_VER #pragma warning(default:4201) + /* disable some "-W4" level warnings */ #pragma warning(disable:4054) @@ -49,7 +50,7 @@ #include <ngx_auto_config.h> -#define ngx_inline __inline +#define ngx_inlie __inline #ifdef _MSC_VER diff --git a/src/os/win32/ngx_wsarecv.c b/src/os/win32/ngx_wsarecv.c index 040adc4da..1598c6b20 100644 --- a/src/os/win32/ngx_wsarecv.c +++ b/src/os/win32/ngx_wsarecv.c @@ -4,7 +4,7 @@ #include <ngx_event.h> -ssize_t ngx_wsarecv(ngx_connection_t *c, char *buf, size_t size) +ssize_t ngx_wsarecv(ngx_connection_t *c, u_char *buf, size_t size) { int rc; u_long bytes, flags; @@ -12,7 +12,7 @@ ssize_t ngx_wsarecv(ngx_connection_t *c, char *buf, size_t size) ngx_err_t err; ngx_event_t *rev; - wsabuf[0].buf = buf; + wsabuf[0].buf = (char *) buf; wsabuf[0].len = size; flags = 0; bytes = 0; @@ -52,7 +52,7 @@ ssize_t ngx_wsarecv(ngx_connection_t *c, char *buf, size_t size) } -ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, char *buf, size_t size) +ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, u_char *buf, size_t size) { int rc; u_long bytes, flags; @@ -95,7 +95,7 @@ ssize_t ngx_overlapped_wsarecv(ngx_connection_t *c, char *buf, size_t size) ovlp = (LPWSAOVERLAPPED) &rev->ovlp; ngx_memzero(ovlp, sizeof(WSAOVERLAPPED)); - wsabuf[0].buf = buf; + wsabuf[0].buf = (char *) buf; wsabuf[0].len = size; flags = 0; bytes = 0; diff --git a/src/os/win32/ngx_wsarecv_chain.c b/src/os/win32/ngx_wsarecv_chain.c index 4bdc5d6d8..da539281c 100644 --- a/src/os/win32/ngx_wsarecv_chain.c +++ b/src/os/win32/ngx_wsarecv_chain.c @@ -7,7 +7,7 @@ ssize_t ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain) { int rc; - char *prev; + u_char *prev; u_long bytes, flags; size_t size; WSABUF *wsabuf; @@ -31,7 +31,7 @@ ssize_t ngx_wsarecv_chain(ngx_connection_t *c, ngx_chain_t *chain) } else { ngx_test_null(wsabuf, ngx_push_array(&io), NGX_ERROR); - wsabuf->buf = chain->hunk->last; + wsabuf->buf = (char *) chain->hunk->last; wsabuf->len = chain->hunk->end - chain->hunk->last; } diff --git a/src/os/win32/ngx_wsasend_chain.c b/src/os/win32/ngx_wsasend_chain.c index 9d1812d4b..198e2b4c8 100644 --- a/src/os/win32/ngx_wsasend_chain.c +++ b/src/os/win32/ngx_wsasend_chain.c @@ -7,7 +7,7 @@ ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in) { int rc; - char *prev; + u_char *prev; size_t size; u_long sent; LPWSABUF wsabuf; @@ -42,7 +42,7 @@ ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in) } else { ngx_test_null(wsabuf, ngx_push_array(&wsabufs), NGX_CHAIN_ERROR); - wsabuf->buf = cl->hunk->pos; + wsabuf->buf = (char *) cl->hunk->pos; wsabuf->len = cl->hunk->last - cl->hunk->pos; prev = cl->hunk->last; } @@ -102,7 +102,7 @@ ngx_chain_t *ngx_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in) ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in) { int rc; - char *prev; + u_char *prev; size_t size; u_long sent; LPWSABUF wsabuf; @@ -143,7 +143,7 @@ ngx_chain_t *ngx_overlapped_wsasend_chain(ngx_connection_t *c, ngx_chain_t *in) } else { ngx_test_null(wsabuf, ngx_push_array(&wsabufs), NGX_CHAIN_ERROR); - wsabuf->buf = cl->hunk->pos; + wsabuf->buf = (char *) cl->hunk->pos; wsabuf->len = cl->hunk->last - cl->hunk->pos; prev = cl->hunk->last; } |