Debian Codegraph @

bin/w32/w32.h

raw symbols SCIP
1 /*
2 * w32.h
3 *
4 * Author: Shuichi Kitaguchi <[email protected]>
5 * Created: Jun 17, 2001
6 * Revised:
7 *
8 * Code:
9 */
10
11
12 /*
13 * Typedefs, definitions and functions for Win32 environment.
14 */
15
16 #ifndef __W32_H__
17 #define __W32_H__
18
19
20 /* includes */
21 #include <direct.h> /* for chdir()/mkdir()/... */
22
23 /* additional types for sys/types.h */
24
25 #ifndef _POSIX_SOURCE
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 */
32 #endif
33
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;
42
43 typedef u_int32_t pid_t; /* process ID */
44
45 /* Borland C++ has uid_t and gid_t. Why? */
46 #ifndef __BORLANDC__
47 typedef u_int32_t uid_t; /* user ID */
48 typedef u_int32_t gid_t; /* group ID */
49 #endif
50
51 /* definitions */
52
53 #ifndef inline
54 #define inline __inline
55 #endif
56
57 /* POSIX macros */
58
59 #include <sys/stat.h>
60
61 #ifndef S_IFLNK
62 #define S_IFLNK 0120000 /* symbolic link */
63 #endif
64 #ifndef S_ISUID
65 #define S_ISUID 0004000 /* set user id on execution */
66 #endif
67 #ifndef S_ISGID
68 #define S_ISGID 0002000 /* set group id on execution */
69 #endif
70 #ifndef S_IRWXU
71 #define S_IRWXU 0000700 /* RWX for owner */
72 #endif
73 #ifndef S_IRUSR
74 #define S_IRUSR 0000400 /* R for owner */
75 #endif
76 #ifndef S_IWUSR
77 #define S_IWUSR 0000200 /* W for owner */
78 #endif
79 #ifndef S_IXUSR
80 #define S_IXUSR 0000100 /* E for owner */
81 #endif
82 #ifndef S_IRWXG
83 #define S_IRWXG 0000070 /* RWX for group */
84 #endif
85 #ifndef S_IRGRP
86 #define S_IRGRP 0000040 /* R for group */
87 #endif
88 #ifndef S_IWGRP
89 #define S_IWGRP 0000020 /* W for group */
90 #endif
91 #ifndef S_IXGRP
92 #define S_IXGRP 0000010 /* X for group */
93 #endif
94 #ifndef S_IRWXO
95 #define S_IRWXO 0000007 /* RWX for other */
96 #endif
97 #ifndef S_IROTH
98 #define S_IROTH 0000004 /* R for other */
99 #endif
100 #ifndef S_IWOTH
101 #define S_IWOTH 0000002 /* W for other */
102 #endif
103 #ifndef S_IXOTH
104 #define S_IXOTH 0000001 /* E for other */
105 #endif
106
107 #ifndef S_ISDIR
108 #define S_ISDIR(mode) (((mode)&(_S_IFMT))==(_S_IFDIR))
109 #endif
110 #ifndef S_ISREG
111 #define S_ISREG(mode) (((mode)&(_S_IFMT))==(_S_IFREG))
112 #endif
113
114
115 /* supplements for string.h */
116
117 #define strcasecmp stricmp
118 #define strncasecmp strnicmp
119 #define snprintf _snprintf
120 #if _MSC_VER < 1500
121 #define vsnprintf _vsnprintf
122 #endif
123 #define lstat stat
124
125 size_t strlcpy(char *, const char*, size_t);
126 size_t strlcat(char *, const char*, size_t);
127
128 char *realpath(const char *, char*);
129
130 #ifdef INET6
131 #include <winsock2.h>
132 #else
133 #include <winsock.h>
134 #endif
135
136 int wsa_socketpair(SOCKET *);
137 void wsa_create_terminal(SOCKET);
138 char *wsa_strerror(int);
139 void wsa_perror(char *);
140 #define wsa_lasterror() WSAGetLastError()
141
142
143 /* On Win32 environment, uid/gid does not exist. */
144 #define _W32_USER_ID 0
145 #define _W32_GROUP_ID 0
146
147
148
149 #endif /* __W32_H__ */
150
151 /*
152 * Copyright (C) 2001-2003 Mew developing team.
153 * All rights reserved.
154 *
155 * Redistribution and use in source and binary forms, with or without
156 * modification, are permitted provided that the following conditions
157 * are met:
158 *
159 * 1. Redistributions of source code must retain the above copyright
160 * notice, this list of conditions and the following disclaimer.
161 * 2. Redistributions in binary form must reproduce the above copyright
162 * notice, this list of conditions and the following disclaimer in the
163 * documentation and/or other materials provided with the distribution.
164 * 3. Neither the name of the team nor the names of its contributors
165 * may be used to endorse or promote products derived from this software
166 * without specific prior written permission.
167 *
168 * THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
169 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
170 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
171 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
172 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
173 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
174 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
175 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
176 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
177 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
178 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
179 */
180
181 /*
182 * w32.h ends here
183 */