Mercurial > dwindows
annotate compat.h @ 1550:78a2e6a51285
Added basic rich edit control support for MLEs on Windows.
This is disabled by default, I tried switching to the richedit control to work around a problem with the edit control not being able to switch word wrap modes without recreating the control. However despite rich edit messages that look like they will do just that, the rich edit controls appear to have the same problem.
Committing this code though in case we want to switch to rich edit in the future for other reasons.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 13 Jan 2012 22:01:15 +0000 |
parents | 56f311dc23f6 |
children | 1fb62c442283 |
rev | line source |
---|---|
3 | 1 /* $Id$ */ |
2 | |
174
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
3 #ifndef _COMPAT_H |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
4 #define _COMPAT_H |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
5 |
3 | 6 /* This header includes and defines everything needed for a given OS/compiler */ |
433
f225f16bebbd
Compile fixes for MacOS X.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
234
diff
changeset
|
7 #if defined(__UNIX__) || defined(__MAC__) |
3 | 8 #include "config.h" |
9 | |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
10 #include <sys/stat.h> |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
11 #include <unistd.h> |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
12 void msleep(long period); |
3 | 13 #endif /* Unix */ |
14 | |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
15 #ifndef __TARGET__ |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
16 #define __TARGET__ "dw" |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
17 #endif |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
18 |
3 | 19 #include <sys/types.h> |
20 #if HAVE_DIRENT_H | |
21 #include <dirent.h> | |
22 #define NAMLEN(dirent) strlen((dirent)->d_name) | |
23 #else | |
24 #define dirent direct | |
25 #define NAMLEN(dirent) (dirent)->d_namlen | |
26 #if HAVE_SYS_NDIR_H | |
27 #include <sys/ndir.h> | |
28 #endif /* HAVE_SYS_NDIR_H */ | |
29 #if HAVE_SYS_DIR_H | |
30 #include <sys/dir.h> | |
31 #endif /* HAVE_SYS_DIR_H */ | |
32 #if HAVE_NDIR_H | |
33 #include <ndir.h> | |
34 #endif /* HAVE_NDIR_H */ | |
35 #endif /* HAVE_DIRENT_H */ | |
36 | |
37 #ifdef DIRSEP | |
38 #undef DIRSEP | |
39 #endif | |
40 | |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
41 #if defined(__EMX__) || defined(__OS2__) || defined(__WIN32__) || defined(WINNT) |
3 | 42 #include <io.h> |
43 #include <process.h> | |
44 | |
45 #define DIRSEP "\\" | |
46 #define TYPDIR "." | |
47 #else | |
48 #define DIRSEP "/" | |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
49 #define TYPDIR "/usr/local/" __TARGET__ |
3 | 50 #endif |
908
850b2e6cfeab
Have INIDIR use the home directory on all platforms now, not just Unix and Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
597
diff
changeset
|
51 #define INIDIR "~/." __TARGET__ |
3 | 52 |
53 /* OS/2 */ | |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
54 #if defined(__EMX__) || defined(__OS2__) |
3 | 55 #define INCL_WIN |
56 #define INCL_GPI | |
57 #define INCL_VIO | |
58 #define INCL_NLS | |
59 #define INCL_DOS | |
60 #define INCL_DEV | |
61 #define INCL_DOSERRORS | |
62 | |
1404
56f311dc23f6
Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1329
diff
changeset
|
63 #ifdef __OS2__ |
56f311dc23f6
Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1329
diff
changeset
|
64 # if (defined(__IBMC__) || defined(__WATCOMC__) || defined(_System)) && !defined(API) |
56f311dc23f6
Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1329
diff
changeset
|
65 # define API _System |
56f311dc23f6
Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1329
diff
changeset
|
66 # endif |
174
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
67 #endif |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
68 |
543
8217ee5c254e
Get EMX compiling again.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
527
diff
changeset
|
69 #ifndef API |
8217ee5c254e
Get EMX compiling again.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
527
diff
changeset
|
70 #define API |
8217ee5c254e
Get EMX compiling again.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
527
diff
changeset
|
71 #endif |
8217ee5c254e
Get EMX compiling again.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
527
diff
changeset
|
72 |
3 | 73 #define msleep(a) DosSleep(a) |
74 | |
75 #ifdef __EMX__ | |
525
2ff26b697877
Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
433
diff
changeset
|
76 #include "platform/dirent.h" |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
77 #include <sys/stat.h> |
28
cd715f9036c0
Added HAVE_PIPE define for EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
24
diff
changeset
|
78 #define HAVE_PIPE |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
79 #ifdef FD_SETSIZE |
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
80 #undef FD_SETSIZE |
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
81 #endif |
3 | 82 #define FD_SETSIZE 1024 |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
83 #endif /* __EMX__ */ |
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
84 |
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
85 #if defined(__EMX__) || defined(__WATCOMC__) |
3 | 86 #define strcasecmp stricmp |
87 #define strncasecmp strnicmp | |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
88 #endif |
3 | 89 |
90 #ifndef OS2 | |
91 #define OS2 | |
92 #endif /* OS2 */ | |
93 | |
94 #include <os2.h> | |
95 | |
96 #ifndef BKS_TABBEDDIALOG | |
97 #define BKS_TABBEDDIALOG 0x0800 | |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
98 #endif |
3 | 99 |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
100 #define PIPENAME "\\socket\\" __TARGET__ "%d" |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
101 #define TPIPENAME "\\socket\\" __TARGET__ "%d" |
3 | 102 #else |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
103 #define PIPENAME "/tmp/" __TARGET__ "%d" |
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
104 #define TPIPENAME "/tmp/" __TARGET__ "%d" |
3 | 105 #endif /* __EMX__ || __IBMC__ */ |
106 | |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
107 #if defined(__OS2__) && (defined(__IBMC__) || defined(__WATCOMC__)) |
3 | 108 #define BSD_SELECT |
109 | |
110 #include <types.h> | |
111 #include <time.h> | |
112 #include <sys/stat.h> | |
113 #include <sys/select.h> | |
114 #include <sys/ioctl.h> | |
115 #include <direct.h> | |
116 #include <stdarg.h> | |
117 /* For VAC we are using the Mozilla dirent.c */ | |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
118 #ifndef __WATCOMC__ |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
119 #include "platform/dirent.h" |
3 | 120 #endif |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
121 #endif |
3 | 122 |
123 /* Windows */ | |
124 #if defined(__WIN32__) || defined(WINNT) | |
527
e0ea29c3d1eb
Fixed dw_window_pointer() so it works on Windows. Tried to fix the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
525
diff
changeset
|
125 |
e0ea29c3d1eb
Fixed dw_window_pointer() so it works on Windows. Tried to fix the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
525
diff
changeset
|
126 #if defined(MSVC) && !defined(API) |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
127 # ifdef __MINGW32__ |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
128 # ifdef BUILD_DLL |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
129 # define API APIENTRY __declspec(dllexport) |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
130 # else |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
131 # define API APIENTRY __declspec(dllimport) |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
132 # endif |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
133 # else |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
134 # define API _cdecl |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
135 # endif |
527
e0ea29c3d1eb
Fixed dw_window_pointer() so it works on Windows. Tried to fix the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
525
diff
changeset
|
136 #endif |
e0ea29c3d1eb
Fixed dw_window_pointer() so it works on Windows. Tried to fix the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
525
diff
changeset
|
137 |
3 | 138 #include <windows.h> |
139 #include <winsock.h> | |
140 #include <time.h> | |
141 #include <process.h> | |
142 #include <sys/stat.h> | |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
143 |
3 | 144 #ifdef MSVC |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
145 #include "platform/dirent.h" |
581
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
146 #define alloca _alloca |
3 | 147 #else |
148 #include <dir.h> | |
149 #include <dirent.h> | |
150 #endif | |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
151 |
3 | 152 #include <stdarg.h> |
153 | |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
154 #if defined(__CYGWIN32__) /*|| defined(__MINGW32__)*/ |
3 | 155 #include <sys/un.h> |
156 #endif /* __CYGWIN32__ || __MINGW32__ */ | |
157 | |
158 #ifndef __CYGWIN32__ | |
159 #define NO_DOMAIN_SOCKETS | |
160 #endif /* __CYGWIN32__ */ | |
161 | |
162 #if defined(_P_NOWAIT) && !defined(P_NOWAIT) | |
163 #define P_NOWAIT _P_NOWAIT | |
164 #endif | |
165 | |
166 #define strcasecmp stricmp | |
167 #define strncasecmp strnicmp | |
168 #define msleep Sleep | |
169 | |
170 #endif /* WIN32 */ | |
171 | |
172 /* Everything else ;) */ | |
173 #include <stdio.h> | |
174 #ifdef HAVE_UNISTD_H | |
175 #include <unistd.h> | |
176 #endif /* HAVE_UNISTD_H */ | |
177 #ifdef HAVE_SYS_STAT_H | |
178 #include <sys/stat.h> | |
179 #endif | |
180 #include <stdlib.h> | |
181 #include <stddef.h> | |
182 #include <signal.h> | |
183 #include <fcntl.h> | |
184 | |
185 #if !defined(__WIN32__) && !defined(WINNT) | |
186 #include <sys/time.h> | |
187 #include <sys/socket.h> | |
188 #include <sys/un.h> | |
189 #include <netinet/in.h> | |
190 #include <netdb.h> | |
1324
032037c378ef
Don't include arpa/inet.h on OS/2 with VisualAge.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1323
diff
changeset
|
191 #ifndef __IBMC__ |
1323
209d7f5137f2
Cleaned up the compatibility library header.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
908
diff
changeset
|
192 #include <arpa/inet.h> |
1324
032037c378ef
Don't include arpa/inet.h on OS/2 with VisualAge.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1323
diff
changeset
|
193 #endif |
172
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
194 #if defined(__OS2__) && defined(RES_DEFAULT) |
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
195 #undef RES_DEFAULT |
0fc45e386376
Get Dynamic Windows building with Watcom.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
101
diff
changeset
|
196 #endif |
3 | 197 #include <stdarg.h> |
198 #include <string.h> | |
199 #endif /* !WIN32 */ | |
41
af0a78aa0d45
More updates, and a more comprehensive unix install scheme. Use target
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
36
diff
changeset
|
200 #include <ctype.h> |
3 | 201 |
202 #ifndef _MAX_PATH | |
203 #define _MAX_PATH 255 | |
204 #endif | |
205 | |
206 /* IBM C doesn't allow "t" in the mode parameter | |
207 * because it violates the ANSI standard. | |
208 */ | |
209 #ifdef __IBMC__ | |
210 #define FOPEN_READ_TEXT "r" | |
211 #define FOPEN_WRITE_TEXT "w" | |
212 #define FOPEN_APPEND_TEXT "a" | |
213 #else | |
214 #define FOPEN_READ_TEXT "rt" | |
215 #define FOPEN_WRITE_TEXT "wt" | |
216 #define FOPEN_APPEND_TEXT "at" | |
217 #endif | |
218 #define FOPEN_READ_BINARY "rb" | |
219 #define FOPEN_WRITE_BINARY "wb" | |
220 #define FOPEN_APPEND_BINARY "ab" | |
221 | |
174
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
222 #ifndef API |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
223 #define API |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
224 #endif |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
225 |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
226 /* Compatibility layer for IBM C/Winsock |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
227 * Now using macros so we can allow cross |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
228 * compiler support. |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
229 */ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
230 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
231 #if defined(__IBMC__) || (defined(__WIN32__) && !defined(__CYGWIN32__)) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
232 #define sockread(a, b, c, d) recv(a, b, c, d) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
233 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
234 #define sockread(a, b, c, d) read(a, b, c) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
235 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
236 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
237 #if defined(__IBMC__) || (defined(__WIN32__) && !defined(__CYGWIN32__)) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
238 #define sockwrite(a, b, c, d) send(a, b, c, d) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
239 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
240 #define sockwrite(a, b, c, d) write(a, b, c) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
241 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
242 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
243 #ifdef __IBMC__ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
244 #define sockclose(a) soclose(a) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
245 #elif defined(__WIN32__) && !defined(__CYGWIN32__) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
246 #define sockclose(a) closesocket(a) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
247 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
248 #define sockclose(a) close(a) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
249 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
250 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
251 #if defined(__OS2__) && !defined(__EMX__) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
252 #define nonblock(a) { int _nonblock = 1; ioctl(a, FIONBIO, (char *)&_nonblock, sizeof(_nonblock)); } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
253 #elif defined(__WIN32__) && !defined(__CYGWIN32__) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
254 #define nonblock(a) { int _nonblock = 1; ioctlsocket(a, FIONBIO, (unsigned long *)&_nonblock); } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
255 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
256 #define nonblock(a) fcntl(a, F_SETFL, O_NONBLOCK) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
257 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
258 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
259 #if defined(__OS2__) && !defined(__EMX__) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
260 #define block(a) { int _block = 0; ioctl(a, FIONBIO, (char *)&_nonblock, sizeof(_block)); } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
261 #elif defined(__WIN32__) && !defined(__CYGWIN32__) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
262 #define block(a) { int _block = 0; ioctlsocket(a, FIONBIO, (unsigned long *)&_block); } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
263 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
264 #define block(a) fcntl(a, F_SETFL, 0) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
265 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
266 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
267 #ifdef __IBMC__ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
268 #define sockinit() sock_init(); |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
269 #elif defined(__WIN32__) || defined(WINNT) |
582
ce08e7a56724
Minor change to the Windows sockinit() macro.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
581
diff
changeset
|
270 #define sockinit() { static WSADATA wsa; WSAStartup(MAKEWORD (1, 1), &wsa); } |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
271 #else /* !WIN32 */ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
272 #define sockinit() |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
273 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
274 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
275 #if defined(__WIN32__) || defined(WINNT) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
276 #define sockshutdown() WSACleanup() |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
277 #else /* !WIN32 */ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
278 #define sockshutdown() |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
279 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
280 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
281 #ifdef HAVE_PIPE |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
282 #define sockpipe(pipes) { if(pipe(pipes) < 0) pipes[0] = pipes[1] = -1; } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
283 #elif !defined(NO_DOMAIN_SOCKETS) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
284 #define sockpipe(pipes) { \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
285 struct sockaddr_un un; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
286 int tmpsock = socket(AF_UNIX, SOCK_STREAM, 0); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
287 pipes[1] = socket(AF_UNIX, SOCK_STREAM, 0); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
288 memset(&un, 0, sizeof(un)); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
289 un.sun_family=AF_UNIX; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
290 sprintf(un.sun_path, PIPENAME, pipes[1]); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
291 bind(tmpsock, (struct sockaddr *)&un, sizeof(un)); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
292 listen(tmpsock, 0); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
293 connect(pipes[1], (struct sockaddr *)&un, sizeof(un)); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
294 pipes[0] = accept(tmpsock, 0, 0); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
295 sockclose(tmpsock); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
296 } |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
297 #else |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
298 #define sockpipe(pipes) { \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
299 struct sockaddr_in server_addr; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
300 struct sockaddr_in listen_addr = { 0 }; \ |
581
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
301 int tmpsock, len = sizeof(struct sockaddr_in); \ |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
302 struct hostent *he = gethostbyname("localhost"); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
303 pipes[0] = pipes[1] = -1; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
304 if(he) \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
305 { \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
306 memset(&server_addr, 0, sizeof(server_addr)); \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
307 server_addr.sin_family = AF_INET; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
308 server_addr.sin_port = 0; \ |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
309 server_addr.sin_addr.s_addr = INADDR_ANY; \ |
581
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
310 if ((tmpsock = socket(AF_INET, SOCK_STREAM, 0)) > -1 && bind(tmpsock, (struct sockaddr *)&server_addr, sizeof(server_addr)) > -1 && listen(tmpsock, 0) > -1) \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
311 { \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
312 memset(&listen_addr, 0, sizeof(listen_addr)); \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
313 getsockname(tmpsock, (struct sockaddr *)&listen_addr, &len); \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
314 server_addr.sin_family = AF_INET; \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
315 server_addr.sin_port = listen_addr.sin_port; \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
316 server_addr.sin_addr.s_addr = *((unsigned long *)he->h_addr); \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
317 if((pipes[1] = socket(AF_INET, SOCK_STREAM, 0)) > -1 && !connect(pipes[1], (struct sockaddr *)&server_addr, sizeof(server_addr))) \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
318 pipes[0] = accept(tmpsock, 0, 0); \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
319 } \ |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
320 sockclose(tmpsock); \ |
581
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
321 } \ |
53639d920735
Fixes for Windows, alloca is _alloc in MSVC, added a macro in compat.h.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
580
diff
changeset
|
322 } |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
323 #endif |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
324 |
1329
19bfcdbab74e
Hopefully the last socklen_t change... OS/2 needs it too.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1328
diff
changeset
|
325 /* Ok Windows and OS/2 both seem to be missing this */ |
19bfcdbab74e
Hopefully the last socklen_t change... OS/2 needs it too.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1328
diff
changeset
|
326 #if defined(__WIN32__) || defined(__OS2__) |
1326
03f0a57c9e87
Make sure socklen_t gets defined when building with Visual Studio.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1324
diff
changeset
|
327 typedef int socklen_t; |
03f0a57c9e87
Make sure socklen_t gets defined when building with Visual Studio.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1324
diff
changeset
|
328 #endif |
03f0a57c9e87
Make sure socklen_t gets defined when building with Visual Studio.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1324
diff
changeset
|
329 |
580
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
330 #define socksprint(a, b) sockwrite(a, b, strlen(b), 0) |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
331 |
d7c338ac926a
Sweeping changes to the compatibility module, moved all socket code out
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
571
diff
changeset
|
332 char * API vargs(char *buf, int len, char *format, ...); |
174
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
333 int API makedir(char *path); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
334 void API setfileinfo(char *filename, char *url, char *logfile); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
335 long double API drivesize(int drive); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
336 long double API drivefree(int drive); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
337 int API isdrive(int drive); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
338 void API getfsname(int drive, char *buf, int len); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
339 FILE * API fsopen(char *path, char *modes); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
340 int API fsclose(FILE *fp); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
341 char * API fsgets(char *str, int size, FILE *stream); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
342 int API fsseek(FILE *stream, long offset, int whence); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
343 int API locale_init(char *filename, int my_locale); |
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
344 char * API locale_string(char *default_text, int message); |
557
1a210e2f214b
Added a bunch of support routines I now own due to the settlement
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
543
diff
changeset
|
345 void API nice_strformat(char *dest, long double val, int dec); |
1a210e2f214b
Added a bunch of support routines I now own due to the settlement
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
543
diff
changeset
|
346 void API initdir(int argc, char *argv[]); |
1a210e2f214b
Added a bunch of support routines I now own due to the settlement
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
543
diff
changeset
|
347 int API setpath(char *path); |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
348 |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
349 #ifdef __MINGW32__ |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
350 # undef API |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
351 # define API APIENTRY |
174
75bf3051235f
Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
172
diff
changeset
|
352 #endif |
571
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
353 |
828e6a66c5c5
Add dw_listbox_list_append()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
557
diff
changeset
|
354 #endif |