4
* Author: Shuichi Kitaguchi <kit@Mew.org>
5
* Created: Jun 17, 2001
13
* Typedefs, definitions and functions for Win32 environment.
21
#include <direct.h> /* for chdir()/mkdir()/... */
23
/* additional types for sys/types.h */
26
typedef unsigned char u_char;
27
typedef unsigned short u_short;
28
typedef unsigned int u_int;
29
typedef unsigned long u_long;
30
typedef unsigned short ushort; /* Sys V compatibility */
31
typedef unsigned int uint; /* Sys V compatibility */
34
typedef unsigned char u_int8_t;
35
typedef unsigned short u_int16_t;
36
typedef unsigned long u_int32_t;
37
typedef unsigned __int64 u_int64_t;
38
typedef signed char int8_t;
39
typedef signed short int16_t;
40
typedef signed long int32_t;
41
typedef signed __int64 int64_t;
43
typedef u_int32_t pid_t; /* process ID */
45
/* Borland C++ has uid_t and gid_t. Why? */
47
typedef u_int32_t uid_t; /* user ID */
48
typedef u_int32_t gid_t; /* group ID */
54
#define inline __inline
62
#define S_IFLNK 0120000 /* symbolic link */
65
#define S_ISUID 0004000 /* set user id on execution */
68
#define S_ISGID 0002000 /* set group id on execution */
71
#define S_IRWXU 0000700 /* RWX for owner */
74
#define S_IRUSR 0000400 /* R for owner */
77
#define S_IWUSR 0000200 /* W for owner */
80
#define S_IXUSR 0000100 /* E for owner */
83
#define S_IRWXG 0000070 /* RWX for group */
86
#define S_IRGRP 0000040 /* R for group */
89
#define S_IWGRP 0000020 /* W for group */
92
#define S_IXGRP 0000010 /* X for group */
95
#define S_IRWXO 0000007 /* RWX for other */
98
#define S_IROTH 0000004 /* R for other */
101
#define S_IWOTH 0000002 /* W for other */
104
#define S_IXOTH 0000001 /* E for other */
108
#define S_ISDIR(mode) (((mode)&(_S_IFMT))==(_S_IFDIR))
111
#define S_ISREG(mode) (((mode)&(_S_IFMT))==(_S_IFREG))
115
/* supplements for string.h */
117
#define strcasecmp stricmp
118
#define strncasecmp strnicmp
119
#define snprintf _snprintf
120
#define vsnprintf _vsnprintf
123
size_t strlcpy(char *, const char*, size_t);
124
size_t strlcat(char *, const char*, size_t);
126
char *realpath(const char *, char*);
129
#include <winsock2.h>
134
int wsa_socketpair(SOCKET *);
135
void wsa_create_terminal(SOCKET);
136
char *wsa_strerror(int);
137
void wsa_perror(char *);
138
#define wsa_lasterror() WSAGetLastError()
141
/* On Win32 environment, uid/gid does not exist. */
142
#define _W32_USER_ID 0
143
#define _W32_GROUP_ID 0
147
#endif /* __W32_H__ */
150
* Copyright (C) 2001-2003 Mew developing team.
151
* All rights reserved.
153
* Redistribution and use in source and binary forms, with or without
154
* modification, are permitted provided that the following conditions
157
* 1. Redistributions of source code must retain the above copyright
158
* notice, this list of conditions and the following disclaimer.
159
* 2. Redistributions in binary form must reproduce the above copyright
160
* notice, this list of conditions and the following disclaimer in the
161
* documentation and/or other materials provided with the distribution.
162
* 3. Neither the name of the team nor the names of its contributors
163
* may be used to endorse or promote products derived from this software
164
* without specific prior written permission.
166
* THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
167
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
168
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
169
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
170
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
171
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
172
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
173
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
174
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
175
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
176
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.