1 | /* $Id: crtdll.cpp,v 1.22 2000-02-03 21:37:48 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * The C RunTime DLL
|
---|
5 | *
|
---|
6 | * Implements C run-time functionality as known from UNIX.
|
---|
7 | *
|
---|
8 | * TODO: Check setjmp(3)
|
---|
9 | *
|
---|
10 | * Partialy based on Wine
|
---|
11 | *
|
---|
12 | * Copyright 1996,1998 Marcus Meissner
|
---|
13 | * Copyright 1996 Jukka Iivonen
|
---|
14 | * Copyright 1997 Uwe Bonnes
|
---|
15 | * Copyright 1999-2000 Jens Wiessner
|
---|
16 | */
|
---|
17 |
|
---|
18 | #include <os2win.h>
|
---|
19 | #include <stdio.h>
|
---|
20 | #include <stdlib.h>
|
---|
21 | #include <string.h>
|
---|
22 | #include <odinwrap.h>
|
---|
23 | #include <misc.h>
|
---|
24 | #include <unicode.h>
|
---|
25 | #include <heapstring.h>
|
---|
26 | #include <ctype.h>
|
---|
27 | #include <setjmp.h>
|
---|
28 | #include <ntddk.h>
|
---|
29 | #include <debugtools.h>
|
---|
30 |
|
---|
31 | #include <math.h>
|
---|
32 | #include <libc\locale.h>
|
---|
33 | #include <signal.h>
|
---|
34 | #include <io.h>
|
---|
35 | #include <assert.h>
|
---|
36 | #include <process.h>
|
---|
37 | #include <float.h>
|
---|
38 | #include <conio.h>
|
---|
39 | #include <direct.h>
|
---|
40 | #include <malloc.h>
|
---|
41 | #include <drive.h>
|
---|
42 | #include <fcntl.h>
|
---|
43 | #include <search.h>
|
---|
44 | #include <heap.h>
|
---|
45 | #include <errno.h>
|
---|
46 | #include <sys\utime.h>
|
---|
47 | #include <sys\stat.h>
|
---|
48 | #include "signal.h"
|
---|
49 |
|
---|
50 | #include <crtdll.h>
|
---|
51 | // #include <ieee.h>
|
---|
52 | #include <asmhlp.h>
|
---|
53 | #include "crtinc.h"
|
---|
54 |
|
---|
55 |
|
---|
56 | DEFAULT_DEBUG_CHANNEL(crtdll)
|
---|
57 |
|
---|
58 |
|
---|
59 | /*********************************************************************
|
---|
60 | * CRTDLL_MainInit (CRTDLL.init)
|
---|
61 | */
|
---|
62 | BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
---|
63 | {
|
---|
64 | if (fdwReason == DLL_PROCESS_ATTACH) {
|
---|
65 | _fdopen(0,"r");
|
---|
66 | _fdopen(1,"w");
|
---|
67 | _fdopen(2,"w");
|
---|
68 | CRTDLL_hHeap = HeapCreate(0, 0x10000, 0);
|
---|
69 | }
|
---|
70 | else
|
---|
71 | if (fdwReason == DLL_PROCESS_DETACH) {
|
---|
72 | HeapDestroy(CRTDLL_hHeap);
|
---|
73 | CRTDLL_hHeap = 0;
|
---|
74 | }
|
---|
75 | return TRUE;
|
---|
76 | }
|
---|
77 |
|
---|
78 |
|
---|
79 | /*********************************************************************
|
---|
80 | * new (CRTDLL.001)
|
---|
81 | */
|
---|
82 | VOID* CDECL CRTDLL_new(DWORD size)
|
---|
83 | {
|
---|
84 | dprintf2(("CRTDLL: ??2@YAPAXI@Z\n"));
|
---|
85 | VOID* result;
|
---|
86 | if(!(result = Heap_Alloc(size)) && new_handler)
|
---|
87 | (*new_handler)();
|
---|
88 | return result;
|
---|
89 | }
|
---|
90 |
|
---|
91 |
|
---|
92 | /*********************************************************************
|
---|
93 | * delete (CRTDLL.002)
|
---|
94 | */
|
---|
95 | VOID CDECL CRTDLL_delete(VOID* ptr)
|
---|
96 | {
|
---|
97 | dprintf2(("CRTDLL: ??3@YAXPAX@Z\n"));
|
---|
98 | Heap_Free(ptr);
|
---|
99 | }
|
---|
100 |
|
---|
101 |
|
---|
102 | /*********************************************************************
|
---|
103 | * set_new_handler(CRTDLL.003)
|
---|
104 | */
|
---|
105 | new_handler_type CDECL CRTDLL_set_new_handler(new_handler_type func)
|
---|
106 | {
|
---|
107 | dprintf2(("CRTDLL: ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z\n"));
|
---|
108 | new_handler_type old_handler = new_handler;
|
---|
109 | new_handler = func;
|
---|
110 | return old_handler;
|
---|
111 | }
|
---|
112 |
|
---|
113 |
|
---|
114 | /*********************************************************************
|
---|
115 | * _CIacos (CRTDLL.004)
|
---|
116 | */
|
---|
117 | double CDECL CRTDLL__CIacos()
|
---|
118 | {
|
---|
119 | double x;
|
---|
120 | dprintf2(("CRTDLL: _CIacos\n"));
|
---|
121 | POP_FPU(x);
|
---|
122 | return acos(x);
|
---|
123 | }
|
---|
124 |
|
---|
125 |
|
---|
126 | /*********************************************************************
|
---|
127 | * _CIasin (CRTDLL.005)
|
---|
128 | */
|
---|
129 | double CDECL CRTDLL__CIasin()
|
---|
130 | {
|
---|
131 | double x;
|
---|
132 | dprintf2(("CRTDLL: _CIasin\n"));
|
---|
133 | POP_FPU(x);
|
---|
134 | return asin(x);
|
---|
135 | }
|
---|
136 |
|
---|
137 |
|
---|
138 | /*********************************************************************
|
---|
139 | * _CIatan (CRTDLL.006)
|
---|
140 | */
|
---|
141 | double CDECL CRTDLL__CIatan()
|
---|
142 | {
|
---|
143 | double x;
|
---|
144 | dprintf2(("CRTDLL: _CIatan\n"));
|
---|
145 | POP_FPU(x);
|
---|
146 | return atan(x);
|
---|
147 | }
|
---|
148 |
|
---|
149 |
|
---|
150 | /*********************************************************************
|
---|
151 | * _CIatan2 (CRTDLL.007)
|
---|
152 | */
|
---|
153 | double CDECL CRTDLL__CIatan2()
|
---|
154 | {
|
---|
155 | double x, y;
|
---|
156 | dprintf2(("CRTDLL: _CIatan2\n"));
|
---|
157 | POP_FPU(y);
|
---|
158 | POP_FPU(x);
|
---|
159 | return atan2(x,y);
|
---|
160 | }
|
---|
161 |
|
---|
162 |
|
---|
163 | /*********************************************************************
|
---|
164 | * _CIcos (CRTDLL.008)
|
---|
165 | */
|
---|
166 | double CDECL CRTDLL__CIcos()
|
---|
167 | {
|
---|
168 | double x;
|
---|
169 | dprintf2(("CRTDLL: _CIcos\n"));
|
---|
170 | POP_FPU(x);
|
---|
171 | return cos(x);
|
---|
172 | }
|
---|
173 |
|
---|
174 |
|
---|
175 | /*********************************************************************
|
---|
176 | * _CIcosh (CRTDLL.009)
|
---|
177 | */
|
---|
178 | double CDECL CRTDLL__CIcosh()
|
---|
179 | {
|
---|
180 | double x;
|
---|
181 | dprintf2(("CRTDLL: _CIcosh\n"));
|
---|
182 | POP_FPU(x);
|
---|
183 | return cosh(x);
|
---|
184 | }
|
---|
185 |
|
---|
186 |
|
---|
187 | /*********************************************************************
|
---|
188 | * _CIexp (CRTDLL.010)
|
---|
189 | */
|
---|
190 | double CDECL CRTDLL__CIexp()
|
---|
191 | {
|
---|
192 | double x;
|
---|
193 | dprintf2(("CRTDLL: _CIexp\n"));
|
---|
194 | POP_FPU(x);
|
---|
195 | return exp(x);
|
---|
196 | }
|
---|
197 |
|
---|
198 |
|
---|
199 | /*********************************************************************
|
---|
200 | * _CIfmod (CRTDLL.011)
|
---|
201 | */
|
---|
202 | double CDECL CRTDLL__CIfmod( )
|
---|
203 | {
|
---|
204 | double x, y;
|
---|
205 | dprintf2(("CRTDLL: _CIfmod\n"));
|
---|
206 | POP_FPU(y);
|
---|
207 | POP_FPU(x);
|
---|
208 | return fmod(x,y);
|
---|
209 | }
|
---|
210 |
|
---|
211 |
|
---|
212 | /*********************************************************************
|
---|
213 | * _CIlog (CRTDLL.012)
|
---|
214 | */
|
---|
215 | double CDECL CRTDLL__CIlog()
|
---|
216 | {
|
---|
217 | double x;
|
---|
218 | dprintf2(("CRTDLL: _CIlog\n"));
|
---|
219 | POP_FPU(x);
|
---|
220 | return log(x);
|
---|
221 | }
|
---|
222 |
|
---|
223 |
|
---|
224 | /*********************************************************************
|
---|
225 | * _CIlog10 (CRTDLL.013)
|
---|
226 | */
|
---|
227 | double CDECL CRTDLL__CIlog10()
|
---|
228 | {
|
---|
229 | double x;
|
---|
230 | dprintf2(("CRTDLL: _CIlog10\n"));
|
---|
231 | POP_FPU(x);
|
---|
232 | return log10(x);
|
---|
233 | }
|
---|
234 |
|
---|
235 |
|
---|
236 | /*********************************************************************
|
---|
237 | * _CIpow (CRTDLL.014)
|
---|
238 | */
|
---|
239 | LONG CDECL CRTDLL__CIpow()
|
---|
240 | {
|
---|
241 | double x,y;
|
---|
242 | dprintf2(("CRTDLL: _CIpow\n"));
|
---|
243 | POP_FPU(y);
|
---|
244 | POP_FPU(x);
|
---|
245 | return pow(x,y);
|
---|
246 | }
|
---|
247 |
|
---|
248 |
|
---|
249 |
|
---|
250 |
|
---|
251 | /*********************************************************************
|
---|
252 | * _CIsin (CRTDLL.015)
|
---|
253 | */
|
---|
254 | double CDECL CRTDLL__CIsin()
|
---|
255 | {
|
---|
256 | double x;
|
---|
257 | dprintf2(("CRTDLL: _CIsin\n"));
|
---|
258 | POP_FPU(x);
|
---|
259 | return sin(x);
|
---|
260 | }
|
---|
261 |
|
---|
262 |
|
---|
263 | /*********************************************************************
|
---|
264 | * _CIsinh (CRTDLL.016)
|
---|
265 | */
|
---|
266 | double CDECL CRTDLL__CIsinh()
|
---|
267 | {
|
---|
268 | double x;
|
---|
269 | dprintf2(("CRTDLL: _CIsinh\n"));
|
---|
270 | POP_FPU(x);
|
---|
271 | return sinh(x);
|
---|
272 | }
|
---|
273 |
|
---|
274 |
|
---|
275 | /*********************************************************************
|
---|
276 | * _CIsqrt (CRTDLL.017)
|
---|
277 | */
|
---|
278 | double CDECL CRTDLL__CIsqrt()
|
---|
279 | {
|
---|
280 | double x;
|
---|
281 | dprintf2(("CRTDLL: _CIsqrt\n"));
|
---|
282 | POP_FPU(x);
|
---|
283 | return sqrt(x);
|
---|
284 | }
|
---|
285 |
|
---|
286 |
|
---|
287 | /*********************************************************************
|
---|
288 | * _CItan (CRTDLL.018)
|
---|
289 | */
|
---|
290 | double CDECL CRTDLL__CItan()
|
---|
291 | {
|
---|
292 | double x;
|
---|
293 | dprintf2(("CRTDLL: _CItan\n"));
|
---|
294 | POP_FPU(x);
|
---|
295 | return tan(x);
|
---|
296 | }
|
---|
297 |
|
---|
298 |
|
---|
299 | /*********************************************************************
|
---|
300 | * _CItanh (CRTDLL.019)
|
---|
301 | */
|
---|
302 | double CDECL CRTDLL__CItanh()
|
---|
303 | {
|
---|
304 | double x;
|
---|
305 | dprintf2(("CRTDLL: _CItanh\n"));
|
---|
306 | POP_FPU(x);
|
---|
307 | return tanh(x);
|
---|
308 | }
|
---|
309 |
|
---|
310 |
|
---|
311 | /*********************************************************************
|
---|
312 | * _XcptFilter (CRTDLL.21)
|
---|
313 | */
|
---|
314 | INT CDECL CRTDLL__XcptFilter(DWORD ret, struct _EXCEPTION_POINTERS * ExceptionInfo )
|
---|
315 | {
|
---|
316 | dprintf2(("CRTDLL: _XcptFilter\n"));
|
---|
317 | return UnhandledExceptionFilter(ExceptionInfo);
|
---|
318 | }
|
---|
319 |
|
---|
320 |
|
---|
321 | /*********************************************************************
|
---|
322 | * _GetMainArgs (CRTDLL.22)
|
---|
323 | */
|
---|
324 | DWORD CDECL CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
|
---|
325 | LPSTR *environ,DWORD flag)
|
---|
326 | {
|
---|
327 | char *cmdline;
|
---|
328 | char **xargv;
|
---|
329 | int xargc,i,afterlastspace;
|
---|
330 | DWORD version;
|
---|
331 |
|
---|
332 | dprintf2(("CRTDLL: GetMainArgs\n"));
|
---|
333 |
|
---|
334 | CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0,
|
---|
335 | GetCommandLineA() );
|
---|
336 |
|
---|
337 | version = GetVersion();
|
---|
338 | CRTDLL_osver_dll = version >> 16;
|
---|
339 | CRTDLL_winminor_dll = version & 0xFF;
|
---|
340 | CRTDLL_winmajor_dll = (version>>8) & 0xFF;
|
---|
341 | CRTDLL_baseversion_dll = version >> 16;
|
---|
342 | CRTDLL_winver_dll = ((version >> 8) & 0xFF) + ((version & 0xFF) << 8);
|
---|
343 | CRTDLL_baseminor_dll = (version >> 16) & 0xFF;
|
---|
344 | CRTDLL_basemajor_dll = (version >> 24) & 0xFF;
|
---|
345 | CRTDLL_osversion_dll = version & 0xFFFF;
|
---|
346 | CRTDLL_osminor_dll = version & 0xFF;
|
---|
347 | CRTDLL_osmajor_dll = (version>>8) & 0xFF;
|
---|
348 |
|
---|
349 | /* missing threading init */
|
---|
350 |
|
---|
351 | i=0;xargv=NULL;xargc=0;afterlastspace=0;
|
---|
352 | /*
|
---|
353 | while (cmdline[i]) {
|
---|
354 | if (cmdline[i]==' ') {
|
---|
355 | xargv=(char**)HeapReAlloc( GetProcessHeap(), 0, xargv,
|
---|
356 | sizeof(char*)*(++xargc));
|
---|
357 | cmdline[i]='\0';
|
---|
358 | xargv[xargc-1] = HEAP_strdupA( GetProcessHeap(), 0,
|
---|
359 | cmdline+afterlastspace);
|
---|
360 | i++;
|
---|
361 | while (cmdline[i]==' ')
|
---|
362 | i++;
|
---|
363 | if (cmdline[i])
|
---|
364 | afterlastspace=i;
|
---|
365 |
|
---|
366 | } else
|
---|
367 | i++;
|
---|
368 |
|
---|
369 | }
|
---|
370 |
|
---|
371 | xargv=(char**)HeapReAlloc( GetProcessHeap(), 0, xargv,
|
---|
372 | sizeof(char*)*(++xargc));
|
---|
373 | cmdline[i]='\0';
|
---|
374 | xargv[xargc-1] = HEAP_strdupA( GetProcessHeap(), 0,
|
---|
375 | cmdline+afterlastspace);
|
---|
376 | */
|
---|
377 | CRTDLL_argc_dll = xargc;
|
---|
378 | *argc = xargc;
|
---|
379 | CRTDLL_argv_dll = xargv;
|
---|
380 | *argv = xargv;
|
---|
381 | CRTDLL_environ_dll = *environ = GetEnvironmentStringsA();
|
---|
382 | dprintf2(("CRTDLL: GetMainArgs end\n"));
|
---|
383 | return 0;
|
---|
384 | }
|
---|
385 |
|
---|
386 |
|
---|
387 | /*********************************************************************
|
---|
388 | * __doserrno (CRTDLL.26)
|
---|
389 | */
|
---|
390 | int * CDECL CRTDLL___doserrno()
|
---|
391 | {
|
---|
392 | dprintf2(("CRTDLL: __doserrno\n"));
|
---|
393 | return (__doserrno());
|
---|
394 | }
|
---|
395 |
|
---|
396 |
|
---|
397 | /*********************************************************************
|
---|
398 | * CRTDLL___isascii (CRTDLL.28)
|
---|
399 | */
|
---|
400 | int CDECL CRTDLL___isascii(int i)
|
---|
401 | {
|
---|
402 | //TODO: Check if really ok.
|
---|
403 | dprintf(("CRTDLL: __isascii -> _isascii\n"));
|
---|
404 | return (_isascii(i));
|
---|
405 | }
|
---|
406 |
|
---|
407 |
|
---|
408 | /*********************************************************************
|
---|
409 | * CRTDLL___iscsym (CRTDLL.29)
|
---|
410 | */
|
---|
411 | int CDECL CRTDLL___iscsym(int c)
|
---|
412 | {
|
---|
413 | //TODO: Check if really ok.
|
---|
414 | dprintf(("CRTDLL: __iscsym -> _iscsym\n"));
|
---|
415 | return (_iscsym(c));
|
---|
416 | }
|
---|
417 |
|
---|
418 |
|
---|
419 | /*********************************************************************
|
---|
420 | * CRTDLL___iscsymf (CRTDLL.30)
|
---|
421 | */
|
---|
422 | int CDECL CRTDLL___iscsymf(int c)
|
---|
423 | {
|
---|
424 | //TODO: Check if really ok.
|
---|
425 | dprintf(("CRTDLL: __iscsymf -> _iscsymf\n"));
|
---|
426 | return (_iscsymf(c));
|
---|
427 | }
|
---|
428 |
|
---|
429 |
|
---|
430 | /*********************************************************************
|
---|
431 | * CRTDLL___threadhandle (CRTDLL.33)
|
---|
432 | */
|
---|
433 | unsigned long CDECL CRTDLL___threadhandle( void )
|
---|
434 | {
|
---|
435 | dprintf2(("CRTDLL: __threadhandle\n"));
|
---|
436 | return GetCurrentThread();
|
---|
437 | }
|
---|
438 |
|
---|
439 |
|
---|
440 | /*********************************************************************
|
---|
441 | * CRTDLL___threadid (CRTDLL.34)
|
---|
442 | */
|
---|
443 | unsigned long CDECL CRTDLL___threadid(void)
|
---|
444 | {
|
---|
445 | dprintf2(("CRTDLL: __threadid\n"));
|
---|
446 | return GetCurrentThreadId();
|
---|
447 | }
|
---|
448 |
|
---|
449 |
|
---|
450 | /*********************************************************************
|
---|
451 | * CRTDLL__access (CRTDLL.37)
|
---|
452 | */
|
---|
453 | int CDECL CRTDLL__access(const char *path,int mode)
|
---|
454 | {
|
---|
455 | dprintf2(("CRTDLL: _access\n"));
|
---|
456 | return (_access(path, mode));
|
---|
457 | }
|
---|
458 |
|
---|
459 |
|
---|
460 | /*********************************************************************
|
---|
461 | * CRTDLL___toascii (CRTDLL.38)
|
---|
462 | */
|
---|
463 | int CDECL CRTDLL___toascii(int c)
|
---|
464 | {
|
---|
465 | //TODO: Check if really ok.
|
---|
466 | dprintf(("CRTDLL: __toascii -> _toascii\n"));
|
---|
467 | return (_toascii(c));
|
---|
468 | }
|
---|
469 |
|
---|
470 |
|
---|
471 | /*********************************************************************
|
---|
472 | * _aexit_rtn_dll (CRTDLL.39)
|
---|
473 | */
|
---|
474 | VOID CDECL CRTDLL__aexit_rtn_dll(int exitcode)
|
---|
475 | {
|
---|
476 | dprintf2(("CRTDLL: _aexit_rtn_dll\n"));
|
---|
477 | ExitProcess(exitcode);
|
---|
478 | }
|
---|
479 |
|
---|
480 |
|
---|
481 | /*********************************************************************
|
---|
482 | * _amsg_exit (CRTDLL.40)
|
---|
483 | */
|
---|
484 | VOID CDECL CRTDLL__amsg_exit(int errnum)
|
---|
485 | {
|
---|
486 | dprintf2(("CRTDLL: _amsg_exit\n"));
|
---|
487 | fprintf(stderr,strerror(errnum));
|
---|
488 | ExitProcess(-1);
|
---|
489 | }
|
---|
490 |
|
---|
491 |
|
---|
492 | /*********************************************************************
|
---|
493 | * CRTDLL__assert (CRTDLL.41)
|
---|
494 | */
|
---|
495 | void CDECL CRTDLL__assert( char *s1, char *s2, int i)
|
---|
496 | {
|
---|
497 | dprintf2(("CRTDLL: _assert\n"));
|
---|
498 | _assert(s1, s2, i);
|
---|
499 | }
|
---|
500 |
|
---|
501 |
|
---|
502 | /*********************************************************************
|
---|
503 | * CRTDLL__beep (CRTDLL.45)
|
---|
504 | */
|
---|
505 | void CDECL CRTDLL__beep(unsigned nFreq, unsigned nDur)
|
---|
506 | {
|
---|
507 | dprintf2(("_beep\n"));
|
---|
508 | Beep(nFreq,nDur);
|
---|
509 | }
|
---|
510 |
|
---|
511 |
|
---|
512 | /*********************************************************************
|
---|
513 | * _beginthread (CRTDLL.46)
|
---|
514 | */
|
---|
515 | int CDECL CRTDLL__beginthread (void (*start)(void *arg), void *stack, unsigned stack_size,
|
---|
516 | void *arg_list)
|
---|
517 | {
|
---|
518 | dprintf(("CRTDLL: _beginthread\n"));
|
---|
519 | /*
|
---|
520 | ULONG rc;
|
---|
521 | TID tid;
|
---|
522 | struct _thread *tp;
|
---|
523 | tp = __alloc_thread ();
|
---|
524 | if (tp == NULL)
|
---|
525 | {
|
---|
526 | errno = ENOMEM;
|
---|
527 | return -1;
|
---|
528 | }
|
---|
529 | tp->_th_start = start;
|
---|
530 | tp->_th_arg = arg_list;
|
---|
531 | rc = DosCreateThread (&tid, (PFNTHREAD)start_thread, (ULONG)tp,
|
---|
532 | 3, stack_size);
|
---|
533 | if (rc != 0)
|
---|
534 | {
|
---|
535 | if (rc == ERROR_NOT_ENOUGH_MEMORY)
|
---|
536 | errno = ENOMEM;
|
---|
537 | else if (rc == ERROR_MAX_THRDS_REACHED)
|
---|
538 | errno = EAGAIN;
|
---|
539 | else
|
---|
540 | errno = EINVAL;
|
---|
541 | DosFreeMem (tp);
|
---|
542 | return -1;
|
---|
543 | }
|
---|
544 | if (tid > MAX_THREADS)
|
---|
545 | {
|
---|
546 | DosKillThread (tid);
|
---|
547 | errno = EAGAIN;
|
---|
548 | DosFreeMem (tp);
|
---|
549 | return -1;
|
---|
550 | }
|
---|
551 | if (__newthread (tid) != 0)
|
---|
552 | {
|
---|
553 | DosKillThread (tid);
|
---|
554 | DosFreeMem (tp);
|
---|
555 | return -1;
|
---|
556 | }
|
---|
557 | _thread_tab[tid] = tp;
|
---|
558 | rc = DosResumeThread (tid);
|
---|
559 | if (rc != 0)
|
---|
560 | {
|
---|
561 | errno = ESRCH;
|
---|
562 | DosFreeMem (tp);
|
---|
563 | return -1;
|
---|
564 | }
|
---|
565 | return tid;
|
---|
566 | */
|
---|
567 | return 0;
|
---|
568 | }
|
---|
569 |
|
---|
570 |
|
---|
571 | /*********************************************************************
|
---|
572 | * _c_exit (CRTDLL.47)
|
---|
573 | *
|
---|
574 | */
|
---|
575 | void CDECL CRTDLL__c_exit(INT ret)
|
---|
576 | {
|
---|
577 | dprintf2(("_c_exit(%d)\n",ret));
|
---|
578 | ExitProcess(ret);
|
---|
579 | }
|
---|
580 |
|
---|
581 |
|
---|
582 | /*********************************************************************
|
---|
583 | * _cabs (CRTDLL.48)
|
---|
584 | */
|
---|
585 | double CDECL CRTDLL__cabs(struct complex z)
|
---|
586 | {
|
---|
587 | dprintf2(("CRTDLL: _cabs\n"));
|
---|
588 | return (_cabs(z));
|
---|
589 | }
|
---|
590 |
|
---|
591 |
|
---|
592 | /*********************************************************************
|
---|
593 | * _cexit (CRTDLL.49)
|
---|
594 | */
|
---|
595 | void CDECL CRTDLL__cexit(INT ret)
|
---|
596 | {
|
---|
597 | dprintf2(("_cexit(%d)\n",ret));
|
---|
598 | ExitProcess(ret);
|
---|
599 | }
|
---|
600 |
|
---|
601 |
|
---|
602 | /*********************************************************************
|
---|
603 | * CRTDLL__cgets (CRTDLL.50)
|
---|
604 | */
|
---|
605 | char * CDECL CRTDLL__cgets( char *s )
|
---|
606 | {
|
---|
607 | dprintf2(("CRTDLL: _cgets\n"));
|
---|
608 | return (_cgets(s));
|
---|
609 | }
|
---|
610 |
|
---|
611 |
|
---|
612 | /*********************************************************************
|
---|
613 | * _chdir (CRTDLL.51)
|
---|
614 | */
|
---|
615 | INT CDECL CRTDLL__chdir(LPCSTR newdir)
|
---|
616 | {
|
---|
617 | dprintf2(("CRTDLL: _chdir\n"));
|
---|
618 | if (!SetCurrentDirectoryA(newdir))
|
---|
619 | return 1;
|
---|
620 | return 0;
|
---|
621 | }
|
---|
622 |
|
---|
623 |
|
---|
624 | /*********************************************************************
|
---|
625 | * _chdrive (CRTDLL.52)
|
---|
626 | *
|
---|
627 | * newdir [I] drive to change to, A=1
|
---|
628 | *
|
---|
629 | */
|
---|
630 | BOOL CDECL CRTDLL__chdrive(INT newdrive)
|
---|
631 | {
|
---|
632 | /* FIXME: generates errnos */
|
---|
633 | dprintf2(("CRTDLL: _chdrive\n"));
|
---|
634 | return DRIVE_SetCurrentDrive(newdrive-1);
|
---|
635 | }
|
---|
636 |
|
---|
637 |
|
---|
638 | /*********************************************************************
|
---|
639 | * CRTDLL__chmod (CRTDLL.54)
|
---|
640 | */
|
---|
641 | int CDECL CRTDLL__chmod( const char *s, int i)
|
---|
642 | {
|
---|
643 | dprintf2(("CRTDLL: _chmod\n"));
|
---|
644 | return (_chmod(s, i));
|
---|
645 | }
|
---|
646 |
|
---|
647 |
|
---|
648 | /*********************************************************************
|
---|
649 | * CRTDLL__chsize (CRTDLL.55)
|
---|
650 | */
|
---|
651 | int CDECL CRTDLL__chsize( int i, long l )
|
---|
652 | {
|
---|
653 | dprintf2(("CRTDLL: _chsize\n"));
|
---|
654 | return (_chsize(i, l));
|
---|
655 | }
|
---|
656 |
|
---|
657 |
|
---|
658 | /*********************************************************************
|
---|
659 | * CRTDLL__clearfp (CRTDLL.56)
|
---|
660 | */
|
---|
661 | unsigned int CDECL CRTDLL__clearfp( void )
|
---|
662 | {
|
---|
663 | dprintf2(("CRTDLL: _clearfp\n"));
|
---|
664 | return (_clear87());
|
---|
665 | }
|
---|
666 |
|
---|
667 |
|
---|
668 | /*********************************************************************
|
---|
669 | * CRTDLL__close (CRTDLL.57)
|
---|
670 | */
|
---|
671 | int CDECL CRTDLL__close(int handle)
|
---|
672 | {
|
---|
673 | dprintf2(("CRTDLL: _close\n"));
|
---|
674 | return (_close(handle));
|
---|
675 | }
|
---|
676 |
|
---|
677 |
|
---|
678 | /*********************************************************************
|
---|
679 | * CRTDLL__control87 (CRTDLL.60)
|
---|
680 | */
|
---|
681 | unsigned CDECL CRTDLL__control87(unsigned i1,unsigned i2)
|
---|
682 | {
|
---|
683 | dprintf2(("CRTDLL: _control87\n"));
|
---|
684 | return (_control87(i1, i2));
|
---|
685 | }
|
---|
686 |
|
---|
687 |
|
---|
688 | /*********************************************************************
|
---|
689 | * CRTDLL__controlfp (CRTDLL.61)
|
---|
690 | */
|
---|
691 | unsigned CDECL CRTDLL__controlfp(unsigned i1,unsigned i2)
|
---|
692 | {
|
---|
693 | dprintf2(("CRTDLL: _controlfp\n"));
|
---|
694 | return (_control87(i1, i2));
|
---|
695 | }
|
---|
696 |
|
---|
697 |
|
---|
698 | /*********************************************************************
|
---|
699 | * _cprintf (CRTDLL.63)
|
---|
700 | */
|
---|
701 | INT CDECL CRTDLL__cprintf( char *fmt, va_list arg )
|
---|
702 | {
|
---|
703 | dprintf2(("CRTDLL: _cprintf.\n"));
|
---|
704 | return (_cprintf(fmt, arg));
|
---|
705 | }
|
---|
706 |
|
---|
707 |
|
---|
708 | /*********************************************************************
|
---|
709 | * CRTDLL__cputs (CRTDLL.65)
|
---|
710 | */
|
---|
711 | INT CDECL CRTDLL__cputs( char * s )
|
---|
712 | {
|
---|
713 | dprintf2(("CRTDLL: _cputs\n"));
|
---|
714 | return (_cputs(s));
|
---|
715 | }
|
---|
716 |
|
---|
717 |
|
---|
718 | /*********************************************************************
|
---|
719 | * CRTDLL__creat (CRTDLL.66)
|
---|
720 | */
|
---|
721 | INT CDECL CRTDLL__creat( const char *s, int i )
|
---|
722 | {
|
---|
723 | dprintf2(("CRTDLL: _creat\n"));
|
---|
724 | return (_creat(s, i));
|
---|
725 | }
|
---|
726 |
|
---|
727 |
|
---|
728 | /*********************************************************************
|
---|
729 | * _cscanf (CRTDLL.67)
|
---|
730 | */
|
---|
731 | INT CDECL CRTDLL__cscanf( char *s, va_list arg )
|
---|
732 | {
|
---|
733 | dprintf(("CRTDLL: _cscanf\n"));
|
---|
734 | return (_cscanf(s, arg));
|
---|
735 | }
|
---|
736 |
|
---|
737 |
|
---|
738 | /*********************************************************************
|
---|
739 | * CRTDLL__cwait (CRTDLL.69)
|
---|
740 | */
|
---|
741 | int CDECL CRTDLL__cwait( int *status, int process_id, int action_code )
|
---|
742 | {
|
---|
743 | dprintf2(("CRTDLL: _cwait\n"));
|
---|
744 | return (_cwait(status, process_id, action_code));
|
---|
745 | }
|
---|
746 |
|
---|
747 |
|
---|
748 | /*********************************************************************
|
---|
749 | * CRTDLL__dup (CRTDLL.71)
|
---|
750 | */
|
---|
751 | int CDECL CRTDLL__dup(int handle)
|
---|
752 | {
|
---|
753 | dprintf2(("CRTDLL: _dup\n"));
|
---|
754 | return (_dup(handle));
|
---|
755 | }
|
---|
756 |
|
---|
757 |
|
---|
758 | /*********************************************************************
|
---|
759 | * CRTDLL__dup2 (CRTDLL.72)
|
---|
760 | */
|
---|
761 | int CDECL CRTDLL__dup2(int handle1,int handle2)
|
---|
762 | {
|
---|
763 | dprintf2(("CRTDLL: _dup2\n"));
|
---|
764 | return (_dup2(handle1, handle2));
|
---|
765 | }
|
---|
766 |
|
---|
767 |
|
---|
768 | /*********************************************************************
|
---|
769 | * CRTDLL__ecvt (CRTDLL.73)
|
---|
770 | */
|
---|
771 | char * CDECL CRTDLL__ecvt( double val, int ndig, int *dec, int *sign )
|
---|
772 | {
|
---|
773 | dprintf2(("CRTDLL: _ecvt\n"));
|
---|
774 | return (_ecvt(val, ndig, dec, sign));
|
---|
775 | }
|
---|
776 |
|
---|
777 |
|
---|
778 | /*********************************************************************
|
---|
779 | * CRTDLL__endthread (CRTDLL.74)
|
---|
780 | */
|
---|
781 | void CDECL CRTDLL__endthread(void)
|
---|
782 | {
|
---|
783 | dprintf2(("CRTDLL: _endthread\n"));
|
---|
784 | _endthread ();
|
---|
785 | }
|
---|
786 |
|
---|
787 |
|
---|
788 | /*********************************************************************
|
---|
789 | * _eof (CRTDLL.76)
|
---|
790 | */
|
---|
791 | int CDECL CRTDLL__eof( int _fd )
|
---|
792 | {
|
---|
793 | dprintf2(("CRTDLL: _eof\n"));
|
---|
794 | return (__eof(_fd));
|
---|
795 | }
|
---|
796 |
|
---|
797 |
|
---|
798 | /*********************************************************************
|
---|
799 | * CRTDLL__errno (CRTDLL.77)
|
---|
800 | */
|
---|
801 | int * CDECL CRTDLL__errno(void)
|
---|
802 | {
|
---|
803 | dprintf2(("CRTDLL: _errno\n"));
|
---|
804 | return (_errno());
|
---|
805 | }
|
---|
806 |
|
---|
807 |
|
---|
808 | /*********************************************************************
|
---|
809 | * _except_handler2 (CRTDLL.78)
|
---|
810 | */
|
---|
811 | INT CDECL CRTDLL__except_handler2 ( PEXCEPTION_RECORD rec,
|
---|
812 | PEXCEPTION_FRAME frame, PCONTEXT context,
|
---|
813 | PEXCEPTION_FRAME *dispatcher)
|
---|
814 | {
|
---|
815 | dprintf (("exception %lx flags=%lx at %p handler=%p %p %p stub\n",
|
---|
816 | rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
|
---|
817 | frame->Handler, context, dispatcher));
|
---|
818 | return ExceptionContinueSearch;
|
---|
819 | }
|
---|
820 |
|
---|
821 |
|
---|
822 | /*********************************************************************
|
---|
823 | * _execl (CRTDLL.79)
|
---|
824 | */
|
---|
825 | int CDECL CRTDLL__execl(char* szPath, char* szArgv0, va_list arg)
|
---|
826 | {
|
---|
827 | dprintf2(("CRTDLL: _execl\n"));
|
---|
828 | return (_execl(szPath, szArgv0, arg));
|
---|
829 | }
|
---|
830 |
|
---|
831 |
|
---|
832 | /*********************************************************************
|
---|
833 | * _execle (CRTDLL.80)
|
---|
834 | */
|
---|
835 | int CDECL CRTDLL__execle(char *path, char *szArgv0, va_list arg)
|
---|
836 | {
|
---|
837 | dprintf2(("CRTDLL: _execle\n"));
|
---|
838 | return (_execle(path, szArgv0, arg));
|
---|
839 | }
|
---|
840 |
|
---|
841 |
|
---|
842 | /*********************************************************************
|
---|
843 | * CRTDLL__execlp (CRTDLL.81)
|
---|
844 | */
|
---|
845 | int CDECL CRTDLL__execlp( char *szPath, char *szArgv0, va_list arg)
|
---|
846 | {
|
---|
847 | dprintf2(("CRTDLL: _execlp\n"));
|
---|
848 | return (_execlp(szPath, szArgv0, arg));
|
---|
849 | }
|
---|
850 |
|
---|
851 |
|
---|
852 | /*********************************************************************
|
---|
853 | * CRTDLL__execlpe (CRTDLL.82)
|
---|
854 | */
|
---|
855 | int CDECL CRTDLL__execlpe( char *path, char *szArgv0, va_list arg)
|
---|
856 | {
|
---|
857 | dprintf2(("CRTDLL: _execlpe\n"));
|
---|
858 | return (_execlpe(path, szArgv0, arg));
|
---|
859 | }
|
---|
860 |
|
---|
861 |
|
---|
862 | /*********************************************************************
|
---|
863 | * CRTDLL__execv (CRTDLL.83)
|
---|
864 | */
|
---|
865 | int CDECL CRTDLL__execv( char *s1, char **s2)
|
---|
866 | {
|
---|
867 | dprintf2(("CRTDLL: _execv\n"));
|
---|
868 | return (_execv(s1, s2));
|
---|
869 | }
|
---|
870 |
|
---|
871 |
|
---|
872 | /*********************************************************************
|
---|
873 | * CRTDLL__execve (CRTDLL.84)
|
---|
874 | */
|
---|
875 | int CDECL CRTDLL__execve( char *s1, char **s2, char **s3)
|
---|
876 | {
|
---|
877 | dprintf2(("CRTDLL: _execve\n"));
|
---|
878 | return (_execve(s1, s2, s3));
|
---|
879 | }
|
---|
880 |
|
---|
881 |
|
---|
882 | /*********************************************************************
|
---|
883 | * CRTDLL__execvp (CRTDLL.85)
|
---|
884 | */
|
---|
885 | int CDECL CRTDLL__execvp( char *s1, char **s2)
|
---|
886 | {
|
---|
887 | dprintf2(("CRTDLL: _execvp\n"));
|
---|
888 | return (_execvp(s1, s2));
|
---|
889 | }
|
---|
890 |
|
---|
891 |
|
---|
892 | /*********************************************************************
|
---|
893 | * CRTDLL__execvpe (CRTDLL.86)
|
---|
894 | */
|
---|
895 | int CDECL CRTDLL__execvpe( char *s1, char **s2, char **s3)
|
---|
896 | {
|
---|
897 | dprintf2(("CRTDLL: _execvpe\n"));
|
---|
898 | return (_execvpe(s1, s2, s3));
|
---|
899 | }
|
---|
900 |
|
---|
901 |
|
---|
902 | /*********************************************************************
|
---|
903 | * _exit (CRTDLL.87)
|
---|
904 | */
|
---|
905 | VOID CDECL CRTDLL__exit(DWORD ret)
|
---|
906 | {
|
---|
907 | dprintf2(("CRTDLL: _exit\n"));
|
---|
908 | ExitProcess(ret);
|
---|
909 | }
|
---|
910 |
|
---|
911 |
|
---|
912 | /*********************************************************************
|
---|
913 | * _fcloseall (CRTDLL.89)
|
---|
914 | */
|
---|
915 | int CDECL CRTDLL__fcloseall( void )
|
---|
916 | {
|
---|
917 | dprintf2(("CRTDLL: _fcloseall\n"));
|
---|
918 | return (_fcloseall());
|
---|
919 | }
|
---|
920 |
|
---|
921 |
|
---|
922 | /*********************************************************************
|
---|
923 | * _fcvt (CRTDLL.90)
|
---|
924 | */
|
---|
925 | char * CDECL CRTDLL__fcvt( double val, int ndig, int *dec, int *sign )
|
---|
926 | {
|
---|
927 | dprintf2(("CRTDLL: _fcvt\n"));
|
---|
928 | return (_fcvt(val, ndig, dec, sign));
|
---|
929 | }
|
---|
930 |
|
---|
931 |
|
---|
932 | /*********************************************************************
|
---|
933 | * _fdopen (CRTDLL.91)
|
---|
934 | */
|
---|
935 | FILE * CDECL CRTDLL__fdopen(INT handle, LPCSTR mode)
|
---|
936 | {
|
---|
937 | dprintf2(("CRTDLL: _fdopen\n"));
|
---|
938 | return (_fdopen(handle, mode));
|
---|
939 | }
|
---|
940 |
|
---|
941 |
|
---|
942 | /*********************************************************************
|
---|
943 | * _fgetchar (CRTDLL.92)
|
---|
944 | */
|
---|
945 | int CDECL CRTDLL__fgetchar( void )
|
---|
946 | {
|
---|
947 | dprintf2(("CRTDLL: _fgetchar\n"));
|
---|
948 | return (_fgetchar());
|
---|
949 | }
|
---|
950 |
|
---|
951 |
|
---|
952 | /*********************************************************************
|
---|
953 | * CRTDLL__filelength (CRTDLL.96)
|
---|
954 | */
|
---|
955 | long CDECL CRTDLL__filelength( int i )
|
---|
956 | {
|
---|
957 | dprintf2(("CRTDLL: _filelength\n"));
|
---|
958 | return (_filelength(i));
|
---|
959 | }
|
---|
960 |
|
---|
961 |
|
---|
962 | /*********************************************************************
|
---|
963 | * _fileno (CRTDLL.97)
|
---|
964 | */
|
---|
965 | int CDECL CRTDLL__fileno(FILE * f)
|
---|
966 | {
|
---|
967 | dprintf2(("CRTDLL: _fileno\n"));
|
---|
968 | return (_fileno(f));
|
---|
969 | }
|
---|
970 |
|
---|
971 |
|
---|
972 | /*********************************************************************
|
---|
973 | * _flushall (CRTDLL.103)
|
---|
974 | */
|
---|
975 | INT CDECL CRTDLL__flushall(void)
|
---|
976 | {
|
---|
977 | dprintf2(("CRTDLL: _flushall\n"));
|
---|
978 | return (_flushall());
|
---|
979 | }
|
---|
980 |
|
---|
981 |
|
---|
982 | /*********************************************************************
|
---|
983 | * _fputchar (CRTDLL.108)
|
---|
984 | */
|
---|
985 | INT CDECL CRTDLL__fputchar( int c )
|
---|
986 | {
|
---|
987 | dprintf2(("CRTDLL: _fputchar\n"));
|
---|
988 | return(_fputchar(c));
|
---|
989 | }
|
---|
990 |
|
---|
991 |
|
---|
992 | /*********************************************************************
|
---|
993 | * _ftol (CRTDLL.113)
|
---|
994 | */
|
---|
995 | LONG CDECL CRTDLL__ftol(void)
|
---|
996 | {
|
---|
997 | /* don't just do DO_FPU("fistp",retval), because the rounding
|
---|
998 | * mode must also be set to "round towards zero"... */
|
---|
999 | double fl;
|
---|
1000 | POP_FPU(fl);
|
---|
1001 | return (LONG)fl;
|
---|
1002 | }
|
---|
1003 |
|
---|
1004 |
|
---|
1005 | /*********************************************************************
|
---|
1006 | * _fullpath (CRTDLL.114)
|
---|
1007 | */
|
---|
1008 | char * CDECL CRTDLL__fullpath( char *buf, char *path, size_t size )
|
---|
1009 | {
|
---|
1010 | dprintf2(("CRTDLL: _fullpath\n"));
|
---|
1011 | return (_fullpath(buf, path, size));
|
---|
1012 | }
|
---|
1013 |
|
---|
1014 |
|
---|
1015 | /*********************************************************************
|
---|
1016 | * _gcvt (CRTDLL.116)
|
---|
1017 | */
|
---|
1018 | char * CDECL CRTDLL__gcvt( double val, int ndig, char *buf )
|
---|
1019 | {
|
---|
1020 | dprintf2(("CRTDLL: _gcvt\n"));
|
---|
1021 | return (_gcvt(val, ndig, buf));
|
---|
1022 | }
|
---|
1023 |
|
---|
1024 |
|
---|
1025 | /*********************************************************************
|
---|
1026 | * _getch (CRTDLL.118)
|
---|
1027 | */
|
---|
1028 | int CDECL CRTDLL__getch(void)
|
---|
1029 | {
|
---|
1030 | dprintf2(("CRTDLL: _getch\n"));
|
---|
1031 | return (_getch());
|
---|
1032 | }
|
---|
1033 |
|
---|
1034 |
|
---|
1035 | /*********************************************************************
|
---|
1036 | * _getche (CRTDLL.119)
|
---|
1037 | */
|
---|
1038 | int CDECL CRTDLL__getche(void)
|
---|
1039 | {
|
---|
1040 | dprintf2(("CRTDLL: _getche\n"));
|
---|
1041 | return (_getche());
|
---|
1042 | }
|
---|
1043 |
|
---|
1044 |
|
---|
1045 | /*********************************************************************
|
---|
1046 | * _getcwd (CRTDLL.120)
|
---|
1047 | */
|
---|
1048 | char * CDECL CRTDLL__getcwd( char *buf, size_t size )
|
---|
1049 | {
|
---|
1050 | dprintf2(("CRTDLL: _getcwd\n"));
|
---|
1051 | return (_getcwd(buf, size));
|
---|
1052 | }
|
---|
1053 |
|
---|
1054 |
|
---|
1055 | /*********************************************************************
|
---|
1056 | * _getdcwd (CRTDLL.121)
|
---|
1057 | */
|
---|
1058 | char * CDECL CRTDLL__getdcwd( int drive, char *buffer, size_t maxlen )
|
---|
1059 | {
|
---|
1060 | dprintf2(("CRTDLL: _getdcwd\n"));
|
---|
1061 | return (_getdcwd(drive, buffer, maxlen));
|
---|
1062 | }
|
---|
1063 |
|
---|
1064 |
|
---|
1065 | /*********************************************************************
|
---|
1066 | * _getdrive (CRTDLL.124)
|
---|
1067 | */
|
---|
1068 | unsigned CDECL CRTDLL__getdrive( void )
|
---|
1069 | {
|
---|
1070 | dprintf2(("CRTDLL: _getdrive\n"));
|
---|
1071 | return DRIVE_GetCurrentDrive() + 1;
|
---|
1072 | }
|
---|
1073 |
|
---|
1074 |
|
---|
1075 | /*********************************************************************
|
---|
1076 | * _getdrives (CRTDLL.125)
|
---|
1077 | */
|
---|
1078 | unsigned long CDECL CRTDLL__getdrives(void)
|
---|
1079 | {
|
---|
1080 | dprintf2(("CRTDLL: _getdrives\n"));
|
---|
1081 | return GetLogicalDrives();
|
---|
1082 | }
|
---|
1083 |
|
---|
1084 |
|
---|
1085 | /*********************************************************************
|
---|
1086 | * _getpid (CRTDLL.126)
|
---|
1087 | */
|
---|
1088 | int CDECL CRTDLL__getpid( void )
|
---|
1089 | {
|
---|
1090 | dprintf2(("CRTDLL: _getpid\n"));
|
---|
1091 | return (_getpid());
|
---|
1092 | }
|
---|
1093 |
|
---|
1094 |
|
---|
1095 | /*********************************************************************
|
---|
1096 | * _getw (CRTDLL.128)
|
---|
1097 | */
|
---|
1098 | int CDECL CRTDLL__getw( FILE *stream )
|
---|
1099 | {
|
---|
1100 | dprintf2(("CRTDLL: _getw\n"));
|
---|
1101 | int x;
|
---|
1102 | return (fread (&x, sizeof (x), 1, stream) == 1 ? x : EOF);
|
---|
1103 | }
|
---|
1104 |
|
---|
1105 |
|
---|
1106 | /*******************************************************************
|
---|
1107 | * _global_unwind2 (CRTDLL.129)
|
---|
1108 | */
|
---|
1109 | void CDECL CRTDLL__global_unwind2( PEXCEPTION_FRAME frame )
|
---|
1110 | {
|
---|
1111 | dprintf2(("CRTDLL: _global_unwind2\n"));
|
---|
1112 | RtlUnwind( frame, 0, NULL, 0 );
|
---|
1113 | }
|
---|
1114 |
|
---|
1115 |
|
---|
1116 | /*********************************************************************
|
---|
1117 | * _heapchk (CRTDLL.130)
|
---|
1118 | */
|
---|
1119 | int CDECL CRTDLL__heapchk( void )
|
---|
1120 | {
|
---|
1121 | dprintf2(("CRTDLL: _heapchk\n"));
|
---|
1122 | return (_heapchk());
|
---|
1123 | }
|
---|
1124 |
|
---|
1125 |
|
---|
1126 | /*********************************************************************
|
---|
1127 | * _heapmin (CRTDLL.131)
|
---|
1128 | */
|
---|
1129 | int CDECL CRTDLL__heapmin( void )
|
---|
1130 | {
|
---|
1131 | dprintf2(("CRTDLL: _heapmin\n"));
|
---|
1132 | return (_heapmin());
|
---|
1133 | }
|
---|
1134 |
|
---|
1135 |
|
---|
1136 | /*********************************************************************
|
---|
1137 | * _heapset (CRTDLL.132)
|
---|
1138 | */
|
---|
1139 | int CDECL CRTDLL__heapset( unsigned int fill )
|
---|
1140 | {
|
---|
1141 | dprintf2(("CRTDLL: _heapset\n"));
|
---|
1142 | return (_heapset(fill));
|
---|
1143 | }
|
---|
1144 |
|
---|
1145 |
|
---|
1146 | /*********************************************************************
|
---|
1147 | * _hypot (CRTDLL.134)
|
---|
1148 | */
|
---|
1149 | double CDECL CRTDLL__hypot(double x1, double x2)
|
---|
1150 | {
|
---|
1151 | dprintf2(("CRTDLL: _hypot\n"));
|
---|
1152 | return (_hypot(x1, x2));
|
---|
1153 | }
|
---|
1154 |
|
---|
1155 |
|
---|
1156 | /*********************************************************************
|
---|
1157 | * _initterm (CRTDLL.135)
|
---|
1158 | */
|
---|
1159 | DWORD CDECL CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end)
|
---|
1160 | {
|
---|
1161 | dprintf2(("CRTDLL: initterm\n"));
|
---|
1162 | _INITTERMFUN *current;
|
---|
1163 |
|
---|
1164 | current=start;
|
---|
1165 | while (current<end) {
|
---|
1166 | if (*current) (*current)();
|
---|
1167 | current++;
|
---|
1168 | }
|
---|
1169 | return 0;
|
---|
1170 | }
|
---|
1171 |
|
---|
1172 |
|
---|
1173 | /*********************************************************************
|
---|
1174 | * _isctype (CRTDLL.138)
|
---|
1175 | */
|
---|
1176 | BOOL CDECL CRTDLL__isctype(CHAR x,CHAR type)
|
---|
1177 | {
|
---|
1178 | dprintf2(("CRTDLL: isctype\n"));
|
---|
1179 | if ((type & CRTDLL_SPACE) && isspace(x))
|
---|
1180 | return TRUE;
|
---|
1181 | if ((type & CRTDLL_PUNCT) && ispunct(x))
|
---|
1182 | return TRUE;
|
---|
1183 | if ((type & CRTDLL_LOWER) && islower(x))
|
---|
1184 | return TRUE;
|
---|
1185 | if ((type & CRTDLL_UPPER) && isupper(x))
|
---|
1186 | return TRUE;
|
---|
1187 | if ((type & CRTDLL_ALPHA) && isalpha(x))
|
---|
1188 | return TRUE;
|
---|
1189 | if ((type & CRTDLL_DIGIT) && isdigit(x))
|
---|
1190 | return TRUE;
|
---|
1191 | if ((type & CRTDLL_CONTROL) && iscntrl(x))
|
---|
1192 | return TRUE;
|
---|
1193 | /* check CRTDLL_LEADBYTE */
|
---|
1194 | return FALSE;
|
---|
1195 | }
|
---|
1196 |
|
---|
1197 |
|
---|
1198 | /*********************************************************************
|
---|
1199 | * _itoa (CRTDLL.165)
|
---|
1200 | */
|
---|
1201 | char * CDECL CRTDLL__itoa(int i, char *s, int r)
|
---|
1202 | {
|
---|
1203 | dprintf2(("CRTDLL: _itoa(%08xh, %08xh, %08xh)\n",
|
---|
1204 | i,
|
---|
1205 | s,
|
---|
1206 | r));
|
---|
1207 |
|
---|
1208 | return (itoa(i,s,r));
|
---|
1209 | }
|
---|
1210 |
|
---|
1211 | /*********************************************************************
|
---|
1212 | * _j0 (CRTDLL.166)
|
---|
1213 | */
|
---|
1214 | double CDECL CRTDLL__j0(double x)
|
---|
1215 | {
|
---|
1216 | dprintf2(("CRTDLL: _j0\n"));
|
---|
1217 | return (_j0(x));
|
---|
1218 | }
|
---|
1219 |
|
---|
1220 |
|
---|
1221 | /*********************************************************************
|
---|
1222 | * _j1 (CRTDLL.167)
|
---|
1223 | */
|
---|
1224 | double CDECL CRTDLL__j1(double x)
|
---|
1225 | {
|
---|
1226 | dprintf2(("CRTDLL: _j1\n"));
|
---|
1227 | return (_j1(x));}
|
---|
1228 |
|
---|
1229 |
|
---|
1230 | /*********************************************************************
|
---|
1231 | * _jn (CRTDLL.168)
|
---|
1232 | */
|
---|
1233 | double CDECL CRTDLL__jn(int i, double x)
|
---|
1234 | {
|
---|
1235 | dprintf2(("CRTDLL: _jn\n"));
|
---|
1236 | return (_jn(i, x));
|
---|
1237 | }
|
---|
1238 |
|
---|
1239 |
|
---|
1240 | /*********************************************************************
|
---|
1241 | * _kbhit (CRTDLL.169)
|
---|
1242 | */
|
---|
1243 | int CDECL CRTDLL__kbhit( void )
|
---|
1244 | {
|
---|
1245 | dprintf2(("CRTDLL: _kbhit\n"));
|
---|
1246 | return (_kbhit());
|
---|
1247 | }
|
---|
1248 |
|
---|
1249 |
|
---|
1250 | /*********************************************************************
|
---|
1251 | * _loaddll (CRTDLL.171)
|
---|
1252 | */
|
---|
1253 | void * CDECL CRTDLL__loaddll (char *name)
|
---|
1254 | {
|
---|
1255 | dprintf2(("CRTDLL: _loaddll\n"));
|
---|
1256 | return (void*)LoadLibraryA(name);
|
---|
1257 | }
|
---|
1258 |
|
---|
1259 |
|
---|
1260 | /*******************************************************************
|
---|
1261 | * _local_unwind2 (CRTDLL.172)
|
---|
1262 | */
|
---|
1263 | void CDECL CRTDLL__local_unwind2( PEXCEPTION_FRAME endframe, DWORD nr )
|
---|
1264 | {
|
---|
1265 | dprintf2(("CRTDLL: _local_unwind2\n"));
|
---|
1266 | }
|
---|
1267 |
|
---|
1268 |
|
---|
1269 | /*********************************************************************
|
---|
1270 | * _lrotl (CRTDLL.175)
|
---|
1271 | */
|
---|
1272 | unsigned long CDECL CRTDLL__lrotl( unsigned long value, unsigned int shift )
|
---|
1273 | {
|
---|
1274 | dprintf2(("CRTDLL: _lrotl\n"));
|
---|
1275 | return (_lrotl(value, shift));
|
---|
1276 | }
|
---|
1277 |
|
---|
1278 |
|
---|
1279 | /*********************************************************************
|
---|
1280 | * _lrotr (CRTDLL.176)
|
---|
1281 | */
|
---|
1282 | unsigned long CDECL CRTDLL__lrotr( unsigned long value, unsigned int shift )
|
---|
1283 | {
|
---|
1284 | dprintf2(("CRTDLL: _lrotr\n"));
|
---|
1285 | return (_lrotr(value, shift));
|
---|
1286 | }
|
---|
1287 |
|
---|
1288 |
|
---|
1289 | /*********************************************************************
|
---|
1290 | * _lseek (CRTDLL.178)
|
---|
1291 | */
|
---|
1292 | long CDECL CRTDLL__lseek(int handle,long offset,int origin)
|
---|
1293 | {
|
---|
1294 | dprintf2(("CRTDLL: _lssek\n"));
|
---|
1295 | return (_lseek(handle, offset, origin));
|
---|
1296 | }
|
---|
1297 |
|
---|
1298 |
|
---|
1299 | /*********************************************************************
|
---|
1300 | * _ltoa (CRTDLL.179)
|
---|
1301 | */
|
---|
1302 | LPSTR CDECL CRTDLL__ltoa(long x,LPSTR buf,INT radix)
|
---|
1303 | {
|
---|
1304 | return ltoa(x,buf,radix);
|
---|
1305 | }
|
---|
1306 |
|
---|
1307 |
|
---|
1308 | /*********************************************************************
|
---|
1309 | * _makepath (CRTDLL.180)
|
---|
1310 | */
|
---|
1311 | void CDECL CRTDLL__makepath( char *path, char *drive,
|
---|
1312 | char *dir, char *fname, char *ext )
|
---|
1313 | {
|
---|
1314 | dprintf2(("CRTDLL: _makepath\n"));
|
---|
1315 | _makepath(path, drive, dir, fname, ext);
|
---|
1316 | }
|
---|
1317 |
|
---|
1318 |
|
---|
1319 | /*********************************************************************
|
---|
1320 | * _matherr (CRTDLL.181)
|
---|
1321 | */
|
---|
1322 | double CDECL CRTDLL__matherr( struct exception * excep )
|
---|
1323 | {
|
---|
1324 | dprintf2(("CRTDLL: _matherr\n"));
|
---|
1325 | return (_matherr(excep));
|
---|
1326 | }
|
---|
1327 |
|
---|
1328 |
|
---|
1329 | /*********************************************************************
|
---|
1330 | * _mkdir (CRTDLL.232)
|
---|
1331 | */
|
---|
1332 | INT CDECL CRTDLL__mkdir(LPCSTR newdir)
|
---|
1333 | {
|
---|
1334 | dprintf2(("CRTDLL: _mkdir\n"));
|
---|
1335 | if (!CreateDirectoryA(newdir,NULL))
|
---|
1336 | return -1;
|
---|
1337 | return 0;
|
---|
1338 | }
|
---|
1339 |
|
---|
1340 |
|
---|
1341 | /*********************************************************************
|
---|
1342 | * _mktemp (CRTDLL.233)
|
---|
1343 | */
|
---|
1344 | char * CDECL CRTDLL__mktemp( char *string )
|
---|
1345 | {
|
---|
1346 | dprintf2(("CRTDLL: _mktemp\n"));
|
---|
1347 | int pid, n, saved_errno;
|
---|
1348 | char *s;
|
---|
1349 |
|
---|
1350 | pid = _getpid ();
|
---|
1351 | s = strchr (string, 0);
|
---|
1352 | n = 0;
|
---|
1353 | while (s != string && s[-1] == 'X')
|
---|
1354 | {
|
---|
1355 | --s; ++n;
|
---|
1356 | *s = (char)(pid % 10) + '0';
|
---|
1357 | pid /= 10;
|
---|
1358 | }
|
---|
1359 | if (n < 2)
|
---|
1360 | return NULL;
|
---|
1361 | *s = 'a'; saved_errno = errno;
|
---|
1362 | for (;;)
|
---|
1363 | {
|
---|
1364 | errno = 0;
|
---|
1365 | if (_access (string, 0) != 0 && errno == ENOENT)
|
---|
1366 | {
|
---|
1367 | errno = saved_errno;
|
---|
1368 | return string;
|
---|
1369 | }
|
---|
1370 | if (*s == 'z')
|
---|
1371 | {
|
---|
1372 | errno = saved_errno;
|
---|
1373 | return NULL;
|
---|
1374 | }
|
---|
1375 | ++*s;
|
---|
1376 | }
|
---|
1377 | }
|
---|
1378 |
|
---|
1379 |
|
---|
1380 | /*********************************************************************
|
---|
1381 | * _msize (CRTDLL.234)
|
---|
1382 | */
|
---|
1383 | size_t CDECL CRTDLL__msize( void *ptr )
|
---|
1384 | {
|
---|
1385 | dprintf2(("CRTDLL: _msize\n"));
|
---|
1386 | return (_msize(ptr));
|
---|
1387 | }
|
---|
1388 |
|
---|
1389 |
|
---|
1390 | /*********************************************************************
|
---|
1391 | * _onexit (CRTDLL.236)
|
---|
1392 | */
|
---|
1393 | onexit_t CDECL CRTDLL__onexit(onexit_t t)
|
---|
1394 | {
|
---|
1395 | dprintf2(("CRTDLL: _onexit\n"));
|
---|
1396 | return (_onexit(t));
|
---|
1397 | }
|
---|
1398 |
|
---|
1399 |
|
---|
1400 | /*********************************************************************
|
---|
1401 | * _open (CRTDLL.237)
|
---|
1402 | */
|
---|
1403 | HFILE CDECL CRTDLL__open(LPCSTR path,INT flags)
|
---|
1404 | {
|
---|
1405 | dprintf2(("CRTDLL: _open\n"));
|
---|
1406 | DWORD access = 0, creation = 0;
|
---|
1407 | HFILE ret;
|
---|
1408 |
|
---|
1409 | switch(flags & 3)
|
---|
1410 | {
|
---|
1411 | case O_RDONLY: access |= GENERIC_READ; break;
|
---|
1412 | case O_WRONLY: access |= GENERIC_WRITE; break;
|
---|
1413 | case O_RDWR: access |= GENERIC_WRITE | GENERIC_READ; break;
|
---|
1414 | }
|
---|
1415 |
|
---|
1416 | if (flags & 0x0100) /* O_CREAT */
|
---|
1417 | {
|
---|
1418 | if (flags & 0x0400) /* O_EXCL */
|
---|
1419 | creation = CREATE_NEW;
|
---|
1420 | else if (flags & 0x0200) /* O_TRUNC */
|
---|
1421 | creation = CREATE_ALWAYS;
|
---|
1422 | else
|
---|
1423 | creation = OPEN_ALWAYS;
|
---|
1424 | }
|
---|
1425 | else /* no O_CREAT */
|
---|
1426 | {
|
---|
1427 | if (flags & 0x0200) /* O_TRUNC */
|
---|
1428 | creation = TRUNCATE_EXISTING;
|
---|
1429 | else
|
---|
1430 | creation = OPEN_EXISTING;
|
---|
1431 | }
|
---|
1432 | if (flags & 0x0008) /* O_APPEND */
|
---|
1433 | dprintf2(("O_APPEND not supported\n" ));
|
---|
1434 | if (flags & 0xf0f4)
|
---|
1435 | dprintf2(("CRTDLL_open file unsupported flags 0x%04x\n",flags));
|
---|
1436 | /* End Fixme */
|
---|
1437 |
|
---|
1438 | ret = CreateFileA( path, access, FILE_SHARE_READ | FILE_SHARE_WRITE,
|
---|
1439 | NULL, creation, FILE_ATTRIBUTE_NORMAL, -1 );
|
---|
1440 | dprintf2(("CRTDLL_open file %s mode 0x%04x got handle %d\n", path,flags,ret));
|
---|
1441 | return ret;
|
---|
1442 | }
|
---|
1443 |
|
---|
1444 |
|
---|
1445 | /*********************************************************************
|
---|
1446 | * _open_osfhandle (CRTDLL.238)
|
---|
1447 | */
|
---|
1448 | INT CDECL CRTDLL__open_osfhandle( long osfhandle, int flags )
|
---|
1449 | {
|
---|
1450 | dprintf2(("CRTDLL: _open_osfhandle\n"));
|
---|
1451 | HFILE handle;
|
---|
1452 |
|
---|
1453 | switch (osfhandle) {
|
---|
1454 | case STD_INPUT_HANDLE :
|
---|
1455 | case 0 :
|
---|
1456 | handle=0;
|
---|
1457 | break;
|
---|
1458 | case STD_OUTPUT_HANDLE:
|
---|
1459 | case 1:
|
---|
1460 | handle=1;
|
---|
1461 | break;
|
---|
1462 | case STD_ERROR_HANDLE:
|
---|
1463 | case 2:
|
---|
1464 | handle=2;
|
---|
1465 | break;
|
---|
1466 | default:
|
---|
1467 | return (-1);
|
---|
1468 | }
|
---|
1469 | dprintf2(("(handle %08lx,flags %d) return %d\n",
|
---|
1470 | osfhandle,flags,handle));
|
---|
1471 | return handle;
|
---|
1472 | }
|
---|
1473 |
|
---|
1474 |
|
---|
1475 | /*********************************************************************
|
---|
1476 | * _purecall (CRTDLL.249)
|
---|
1477 | */
|
---|
1478 | void CDECL CRTDLL__purecall(void)
|
---|
1479 | {
|
---|
1480 | dprintf2(("CRTDLL: _purecall\n"));
|
---|
1481 | }
|
---|
1482 |
|
---|
1483 |
|
---|
1484 | /*********************************************************************
|
---|
1485 | * _putch (CRTDLL.250)
|
---|
1486 | */
|
---|
1487 | INT CDECL CRTDLL__putch( int i )
|
---|
1488 | {
|
---|
1489 | dprintf2(("CRTDLL: _putch\n"));
|
---|
1490 | return (_putch(i));
|
---|
1491 | }
|
---|
1492 |
|
---|
1493 |
|
---|
1494 | /*********************************************************************
|
---|
1495 | * _putenv (CRTDLL.251)
|
---|
1496 | */
|
---|
1497 | INT CDECL CRTDLL__putenv(const char *s)
|
---|
1498 | {
|
---|
1499 | dprintf2(("CRTDLL: _putenv\n"));
|
---|
1500 | return (_putenv(s));
|
---|
1501 | }
|
---|
1502 |
|
---|
1503 |
|
---|
1504 | /*********************************************************************
|
---|
1505 | * _putw (CRTDLL.252)
|
---|
1506 | */
|
---|
1507 | INT CDECL CRTDLL__putw( int x, FILE *stream )
|
---|
1508 | {
|
---|
1509 | dprintf2(("CRTDLL: _putw\n"));
|
---|
1510 | return (fwrite (&x, sizeof (x), 1, stream) == 1 ? x : EOF);
|
---|
1511 | }
|
---|
1512 |
|
---|
1513 |
|
---|
1514 | /*********************************************************************
|
---|
1515 | * _read (CRTDLL.254)
|
---|
1516 | */
|
---|
1517 | INT CDECL CRTDLL__read(int handle, void *buf, size_t nbyte)
|
---|
1518 | {
|
---|
1519 | dprintf(("CRTDLL: _read\n"));
|
---|
1520 | /*
|
---|
1521 | int n, *pflags, *pla;
|
---|
1522 | size_t j, k;
|
---|
1523 | char *dst, c;
|
---|
1524 |
|
---|
1525 | if ((pflags = _fd_flags (handle)) == NULL
|
---|
1526 | || (pla = _fd_lookahead (handle)) == NULL)
|
---|
1527 | {
|
---|
1528 | errno = EBADF;
|
---|
1529 | return -1;
|
---|
1530 | }
|
---|
1531 |
|
---|
1532 | *pflags &= ~F_CRLF;
|
---|
1533 | if (nbyte > 0 && (*pflags & F_EOF))
|
---|
1534 | return 0;
|
---|
1535 | dst = buf;
|
---|
1536 | n = read_lookahead (handle, dst, nbyte, pla);
|
---|
1537 | if (n == -1)
|
---|
1538 | return -1;
|
---|
1539 | if ((*pflags & O_TEXT) && !(*pflags & F_TERMIO) && n > 0)
|
---|
1540 | {
|
---|
1541 | if (!(*pflags & (F_PIPE|F_SOCKET|F_DEV)) && dst[n-1] == 0x1a &&
|
---|
1542 | _eof (handle))
|
---|
1543 | {
|
---|
1544 | --n;
|
---|
1545 | *pflags |= F_EOF;
|
---|
1546 | if (n == 0)
|
---|
1547 | return 0;
|
---|
1548 | }
|
---|
1549 | if (n == 1 && dst[0] == '\r')
|
---|
1550 | {
|
---|
1551 | int saved_errno = errno;
|
---|
1552 | j = read_lookahead (handle, &c, 1, pla);
|
---|
1553 | if (j == -1 && errno == EAGAIN)
|
---|
1554 | {
|
---|
1555 | *pla = dst[0];
|
---|
1556 | return -1;
|
---|
1557 | }
|
---|
1558 | errno = saved_errno;
|
---|
1559 | if (j == 1 && c == '\n')
|
---|
1560 | {
|
---|
1561 | dst[0] = '\n';
|
---|
1562 | *pflags |= F_CRLF;
|
---|
1563 | }
|
---|
1564 | else
|
---|
1565 | *pla = c;
|
---|
1566 | }
|
---|
1567 | else
|
---|
1568 | {
|
---|
1569 |
|
---|
1570 | if (_crlf (dst, n, &k))
|
---|
1571 | {
|
---|
1572 |
|
---|
1573 | *pla = '\r';
|
---|
1574 | --n;
|
---|
1575 | }
|
---|
1576 | if (k != n)
|
---|
1577 | *pflags |= F_CRLF;
|
---|
1578 | n = k;
|
---|
1579 | }
|
---|
1580 | }
|
---|
1581 | return n;
|
---|
1582 | */
|
---|
1583 | return 0;
|
---|
1584 | }
|
---|
1585 |
|
---|
1586 |
|
---|
1587 | /*********************************************************************
|
---|
1588 | * _rmdir (CRTDLL.255)
|
---|
1589 | */
|
---|
1590 | INT CDECL CRTDLL__rmdir(const char *path)
|
---|
1591 | {
|
---|
1592 | dprintf2(("CRTDLL: _rmdir\n"));
|
---|
1593 | if (!RemoveDirectoryA(path))
|
---|
1594 | return -1;
|
---|
1595 | return 0;
|
---|
1596 | }
|
---|
1597 |
|
---|
1598 |
|
---|
1599 | /*********************************************************************
|
---|
1600 | * _rmtmp (CRTDLL.256)
|
---|
1601 | */
|
---|
1602 | INT CDECL CRTDLL__rmtmp(void)
|
---|
1603 | {
|
---|
1604 | dprintf2(("CRTDLL: _rmtmp\n"));
|
---|
1605 | return(_rmtmp());
|
---|
1606 | }
|
---|
1607 |
|
---|
1608 |
|
---|
1609 | /*********************************************************************
|
---|
1610 | * CRTDLL__rotl (CRTDLL.257)
|
---|
1611 | */
|
---|
1612 | unsigned int CDECL CRTDLL__rotl( unsigned int value, unsigned int shift )
|
---|
1613 | {
|
---|
1614 | dprintf2(("CRTDLL: _rotl\n"));
|
---|
1615 | return (_rotl(value, shift));
|
---|
1616 | }
|
---|
1617 |
|
---|
1618 |
|
---|
1619 | /*********************************************************************
|
---|
1620 | * CRTDLL__rotr (CRTDLL.258)
|
---|
1621 | */
|
---|
1622 | unsigned int CDECL CRTDLL__rotr( unsigned int value, unsigned int shift )
|
---|
1623 | {
|
---|
1624 | dprintf2(("CRTDLL: _rotr\n"));
|
---|
1625 | return (_rotr(value, shift));
|
---|
1626 | }
|
---|
1627 |
|
---|
1628 |
|
---|
1629 | /*********************************************************************
|
---|
1630 | * CRTDLL__searchenv (CRTDLL.260)
|
---|
1631 | */
|
---|
1632 | void CDECL CRTDLL__searchenv(char *file, char *var,char *path )
|
---|
1633 | {
|
---|
1634 | dprintf2(("CRTDLL: _searchenv\n"));
|
---|
1635 | _searchenv(file, var, path);
|
---|
1636 | }
|
---|
1637 |
|
---|
1638 |
|
---|
1639 | /*********************************************************************
|
---|
1640 | * CRTDLL__seterrormode (CRTDLL.261)
|
---|
1641 | */
|
---|
1642 | void CDECL CRTDLL__seterrormode(int uMode)
|
---|
1643 | {
|
---|
1644 | dprintf2(("CRTDLL: _seterrormode\n"));
|
---|
1645 | SetErrorMode(uMode);
|
---|
1646 | return;
|
---|
1647 | }
|
---|
1648 |
|
---|
1649 |
|
---|
1650 | /*********************************************************************
|
---|
1651 | * CRTDLL__setjmp (CRTDLL.262)
|
---|
1652 | */
|
---|
1653 | int CDECL CRTDLL__setjmp( jmp_buf env )
|
---|
1654 | {
|
---|
1655 | //TODO:
|
---|
1656 | dprintf2(("CRTDLL: _setjmp -> setjmp (NOT IDENTICAL!!!)\n"));
|
---|
1657 | return(setjmp( env));
|
---|
1658 | }
|
---|
1659 |
|
---|
1660 |
|
---|
1661 | /*********************************************************************
|
---|
1662 | * _setmode (CRTDLL.263)
|
---|
1663 | */
|
---|
1664 | INT CDECL CRTDLL__setmode( INT fh,INT mode)
|
---|
1665 | {
|
---|
1666 | dprintf2(("CRTDLL: _setmode\n"));
|
---|
1667 | return (_setmode(fh, mode));
|
---|
1668 | }
|
---|
1669 |
|
---|
1670 |
|
---|
1671 | /*********************************************************************
|
---|
1672 | * _sleep (CRTDLL.265)
|
---|
1673 | */
|
---|
1674 | VOID CDECL CRTDLL__sleep(unsigned long timeout)
|
---|
1675 | {
|
---|
1676 | dprintf2(("_sleep for %ld milliseconds\n",timeout));
|
---|
1677 | Sleep((timeout)?timeout:1);
|
---|
1678 | }
|
---|
1679 |
|
---|
1680 |
|
---|
1681 | /*********************************************************************
|
---|
1682 | * CRTDLL__spawnl (CRTDLL.269)
|
---|
1683 | */
|
---|
1684 | int CDECL CRTDLL__spawnl(int nMode, char* szPath, char* szArgv0, va_list arg)
|
---|
1685 | {
|
---|
1686 | dprintf2(("CRTDLL: _spawnl\n"));
|
---|
1687 | return (_spawnl(nMode, szPath, szArgv0, arg));
|
---|
1688 | }
|
---|
1689 |
|
---|
1690 |
|
---|
1691 | /*********************************************************************
|
---|
1692 | * CRTDLL__spawnle (CRTDLL.270)
|
---|
1693 | */
|
---|
1694 | int CDECL CRTDLL__spawnle( int mode, char *path, char **szArgv0, va_list arg )
|
---|
1695 | {
|
---|
1696 | dprintf2(("CRTDLL: _spawnle\n"));
|
---|
1697 | return (_spawnle(mode, path, (char*)szArgv0, arg));
|
---|
1698 | }
|
---|
1699 |
|
---|
1700 |
|
---|
1701 | /*********************************************************************
|
---|
1702 | * CRTDLL__spawnlp (CRTDLL.271)
|
---|
1703 | */
|
---|
1704 | int CDECL CRTDLL__spawnlp(int nMode, char* szPath, char* szArgv0, va_list arg)
|
---|
1705 | {
|
---|
1706 | dprintf2(("CRTDLL: _spawnlp\n"));
|
---|
1707 | return (_spawnlp(nMode, szPath, szArgv0, arg));
|
---|
1708 | }
|
---|
1709 |
|
---|
1710 |
|
---|
1711 | /*********************************************************************
|
---|
1712 | * CRTDLL__spawnlpe (CRTDLL.272)
|
---|
1713 | */
|
---|
1714 | int CDECL CRTDLL__spawnlpe( int mode, char *path, char *szArgv0, va_list arg )
|
---|
1715 | {
|
---|
1716 | dprintf2(("CRTDLL: _spawnlpe\n"));
|
---|
1717 | return (_spawnlpe(mode, path, szArgv0, arg));
|
---|
1718 | }
|
---|
1719 |
|
---|
1720 |
|
---|
1721 | /*********************************************************************
|
---|
1722 | * CRTDLL__spawnv (CRTDLL.273)
|
---|
1723 | */
|
---|
1724 | int CDECL CRTDLL__spawnv( int i, char *s1, char ** s2 )
|
---|
1725 | {
|
---|
1726 | dprintf2(("CRTDLL: _spawnv\n"));
|
---|
1727 | return (_spawnv(i, s1, s2));
|
---|
1728 | }
|
---|
1729 |
|
---|
1730 |
|
---|
1731 | /*********************************************************************
|
---|
1732 | * CRTDLL__spawnve (CRTDLL.274)
|
---|
1733 | */
|
---|
1734 | int CDECL CRTDLL__spawnve( int i, char *s1, char ** s2, char ** s3 )
|
---|
1735 | {
|
---|
1736 | dprintf2(("CRTDLL: _spawnve\n"));
|
---|
1737 | return (_spawnve(i, s1, s2, s3));
|
---|
1738 | }
|
---|
1739 |
|
---|
1740 |
|
---|
1741 | /*********************************************************************
|
---|
1742 | * CRTDLL__spawnvp (CRTDLL.275)
|
---|
1743 | */
|
---|
1744 | int CDECL CRTDLL__spawnvp( int i, char *s1, char ** s2 )
|
---|
1745 | {
|
---|
1746 | dprintf2(("CRTDLL: _spawnvp\n"));
|
---|
1747 | return (_spawnvp(i, s1, s2));
|
---|
1748 | }
|
---|
1749 |
|
---|
1750 | /*********************************************************************
|
---|
1751 | * CRTDLL__spawnv (CRTDLL.276)
|
---|
1752 | */
|
---|
1753 | int CDECL CRTDLL__spawnvpe( int i, char *s1, char ** s2, char ** s3 )
|
---|
1754 | {
|
---|
1755 | dprintf2(("CRTDLL: _spawnvpe\n"));
|
---|
1756 | return (_spawnvpe(i, s1, s2, s3));
|
---|
1757 | }
|
---|
1758 |
|
---|
1759 |
|
---|
1760 | /*********************************************************************
|
---|
1761 | * _splitpath (CRTDLL.277)
|
---|
1762 | */
|
---|
1763 | void CDECL CRTDLL__splitpath( char *path, char *drive, char *dir, char *fname, char *ext )
|
---|
1764 | {
|
---|
1765 | dprintf2(("CRTDLL: _splitpath"));
|
---|
1766 | _splitpath( path, drive, dir, fname, ext);
|
---|
1767 | }
|
---|
1768 |
|
---|
1769 |
|
---|
1770 | /*********************************************************************
|
---|
1771 | * CRTDLL__stat (CRTDLL.278)
|
---|
1772 | */
|
---|
1773 | int CDECL CRTDLL__stat( const char *s1, struct stat * n )
|
---|
1774 | {
|
---|
1775 | dprintf2(("CRTDLL: _stat\n"));
|
---|
1776 | return(_stat(s1, n));
|
---|
1777 | }
|
---|
1778 |
|
---|
1779 |
|
---|
1780 | /*********************************************************************
|
---|
1781 | * CRTDLL__statusfp (CRTDLL.279)
|
---|
1782 | */
|
---|
1783 | unsigned int CDECL CRTDLL__statusfp( void )
|
---|
1784 | {
|
---|
1785 | dprintf2(("CRTDLL: _statusfp\n"));
|
---|
1786 | return (_status87());
|
---|
1787 | }
|
---|
1788 |
|
---|
1789 |
|
---|
1790 | /*********************************************************************
|
---|
1791 | * CRTDLL__swab (CRTDLL.299)
|
---|
1792 | */
|
---|
1793 | void CDECL CRTDLL__swab(char *s1, char *s2, int i)
|
---|
1794 | {
|
---|
1795 | dprintf2(("CRTDLL: _swab\n"));
|
---|
1796 | _swab(s1, s2, i);
|
---|
1797 | }
|
---|
1798 |
|
---|
1799 |
|
---|
1800 | /*********************************************************************
|
---|
1801 | * CRTDLL__tell (CRTDLL.302)
|
---|
1802 | */
|
---|
1803 | long CDECL CRTDLL__tell( int i )
|
---|
1804 | {
|
---|
1805 | dprintf2(("CRTDLL: _tell\n"));
|
---|
1806 | return (_tell(i));
|
---|
1807 | }
|
---|
1808 |
|
---|
1809 |
|
---|
1810 | /*********************************************************************
|
---|
1811 | * CRTDLL__tempnam (CRTDLL.303)
|
---|
1812 | */
|
---|
1813 | char * CDECL CRTDLL__tempnam( char *dir, char *prefix )
|
---|
1814 | {
|
---|
1815 | dprintf2(("CRTDLL: _tempnam\n"));
|
---|
1816 | return (_tempnam(dir, prefix));
|
---|
1817 | }
|
---|
1818 |
|
---|
1819 |
|
---|
1820 | /*********************************************************************
|
---|
1821 | * CRTDLL__tolower (CRTDLL.305)
|
---|
1822 | */
|
---|
1823 | int CDECL CRTDLL__tolower(int n)
|
---|
1824 | {
|
---|
1825 | dprintf2(("CRTDLL: _tolower\n"));
|
---|
1826 | return (_tolower(n));
|
---|
1827 | }
|
---|
1828 |
|
---|
1829 |
|
---|
1830 | /*********************************************************************
|
---|
1831 | * CRTDLL__toupper (CRTDLL.306)
|
---|
1832 | */
|
---|
1833 | int CDECL CRTDLL__toupper(int n)
|
---|
1834 | {
|
---|
1835 | dprintf2(("CRTDLL: _toupper\n"));
|
---|
1836 | return (_toupper(n));
|
---|
1837 | }
|
---|
1838 |
|
---|
1839 |
|
---|
1840 | /*********************************************************************
|
---|
1841 | * _ultoa (CRTDLL.309)
|
---|
1842 | */
|
---|
1843 | LPSTR CDECL CRTDLL__ultoa(long x,LPSTR buf,INT radix)
|
---|
1844 | {
|
---|
1845 | dprintf2(("CRTDLL: _ultoa\n"));
|
---|
1846 | return _ultoa(x,buf,radix);
|
---|
1847 | }
|
---|
1848 |
|
---|
1849 |
|
---|
1850 | /*********************************************************************
|
---|
1851 | * CRTDLL__umask (CRTDLL.310)
|
---|
1852 | */
|
---|
1853 | int CDECL CRTDLL__umask( int i )
|
---|
1854 | {
|
---|
1855 | dprintf2(("CRTDLL: _umask\n"));
|
---|
1856 | return (_umask(i));
|
---|
1857 | }
|
---|
1858 |
|
---|
1859 |
|
---|
1860 | /*********************************************************************
|
---|
1861 | * CRTDLL__ungetch (CRTDLL.311)
|
---|
1862 | */
|
---|
1863 | int CDECL CRTDLL__ungetch( int i )
|
---|
1864 | {
|
---|
1865 | dprintf2(("CRTDLL: _ungetch\n"));
|
---|
1866 | return (_ungetch(i));
|
---|
1867 | }
|
---|
1868 |
|
---|
1869 |
|
---|
1870 | /*********************************************************************
|
---|
1871 | * _unlink (CRTDLL.312)
|
---|
1872 | */
|
---|
1873 | INT CDECL CRTDLL__unlink(LPCSTR pathname)
|
---|
1874 | {
|
---|
1875 | dprintf2(("CRTDLL: _unlink\n"));
|
---|
1876 | int ret=0;
|
---|
1877 | DOS_FULL_NAME full_name;
|
---|
1878 |
|
---|
1879 | if (!DOSFS_GetFullName( pathname, FALSE, (CHAR*)&full_name )) {
|
---|
1880 | dprintf2(("CRTDLL_unlink file %s bad name\n",pathname));
|
---|
1881 | return EOF;
|
---|
1882 | }
|
---|
1883 |
|
---|
1884 | ret=unlink(full_name.long_name);
|
---|
1885 | dprintf2(("(%s unix %s)\n",
|
---|
1886 | pathname,full_name.long_name));
|
---|
1887 | if(ret)
|
---|
1888 | dprintf2((" Failed!\n"));
|
---|
1889 |
|
---|
1890 | return ret;
|
---|
1891 | }
|
---|
1892 |
|
---|
1893 |
|
---|
1894 | /*********************************************************************
|
---|
1895 | * _unloaddll (CRTDLL.313)
|
---|
1896 | */
|
---|
1897 | int CDECL CRTDLL__unloaddll(void *handle)
|
---|
1898 | {
|
---|
1899 | dprintf2(("CRTDLL: _unloaddll\n"));
|
---|
1900 | return FreeLibrary((HMODULE)handle);
|
---|
1901 | }
|
---|
1902 |
|
---|
1903 |
|
---|
1904 | /*********************************************************************
|
---|
1905 | * _utime (CRTDLL.314)
|
---|
1906 | */
|
---|
1907 | int CDECL CRTDLL__utime( char *path, struct utimbuf * times )
|
---|
1908 | {
|
---|
1909 | dprintf2(("CRTDLL: _utime\n"));
|
---|
1910 | return (_utime(path, times));
|
---|
1911 | }
|
---|
1912 |
|
---|
1913 |
|
---|
1914 | /*********************************************************************
|
---|
1915 | * _vsnprintf (CRTDLL.315)
|
---|
1916 | */
|
---|
1917 | int CDECL CRTDLL__vsnprintf( char *s, size_t bufsize, const char *format, va_list arg )
|
---|
1918 | {
|
---|
1919 | dprintf2(("CRTDLL: _vsnprintf(%08xh, %08xh, %08xh)\n",
|
---|
1920 | s,
|
---|
1921 | bufsize,
|
---|
1922 | format));
|
---|
1923 |
|
---|
1924 | return wvsnprintfA(s, bufsize, format, arg);
|
---|
1925 | }
|
---|
1926 |
|
---|
1927 |
|
---|
1928 | /*********************************************************************
|
---|
1929 | * _write (CRTDLL.329)
|
---|
1930 | */
|
---|
1931 | INT CDECL CRTDLL__write(INT fd,LPCVOID buf,UINT count)
|
---|
1932 | {
|
---|
1933 | dprintf2(("CRTDLL: _write\n"));
|
---|
1934 | INT len=0;
|
---|
1935 |
|
---|
1936 | if (fd == -1)
|
---|
1937 | len = -1;
|
---|
1938 | else if (fd<=2)
|
---|
1939 | len = (UINT)write(fd,buf,(LONG)count);
|
---|
1940 | else
|
---|
1941 | len = _lwrite(fd,(LPCSTR)buf,count);
|
---|
1942 | dprintf2(("%d/%d byte to dfh %d from %p,\n",
|
---|
1943 | len,count,fd,buf));
|
---|
1944 | return len;
|
---|
1945 | }
|
---|
1946 |
|
---|
1947 |
|
---|
1948 | /*********************************************************************
|
---|
1949 | * _y0 (CRTDLL.332)
|
---|
1950 | */
|
---|
1951 | double CDECL CRTDLL__y0(double x)
|
---|
1952 | {
|
---|
1953 | dprintf2(("CRTDLL: _y0\n"));
|
---|
1954 | return (_y0(x));
|
---|
1955 | }
|
---|
1956 |
|
---|
1957 |
|
---|
1958 | /*********************************************************************
|
---|
1959 | * _y1 (CRTDLL.333)
|
---|
1960 | */
|
---|
1961 | double CDECL CRTDLL__y1(double x)
|
---|
1962 | {
|
---|
1963 | dprintf2(("CRTDLL: _y1\n"));
|
---|
1964 | return (_y1(x));
|
---|
1965 | }
|
---|
1966 |
|
---|
1967 |
|
---|
1968 | /*********************************************************************
|
---|
1969 | * _yn (CRTDLL.334)
|
---|
1970 | */
|
---|
1971 | double CDECL CRTDLL__yn(int i, double x)
|
---|
1972 | {
|
---|
1973 | dprintf2(("CRTDLL: _yn\n"));
|
---|
1974 | return (_yn(i, x));
|
---|
1975 | }
|
---|
1976 |
|
---|
1977 |
|
---|
1978 | /*********************************************************************
|
---|
1979 | * abort (CRTDLL.335)
|
---|
1980 | */
|
---|
1981 | void CDECL CRTDLL_abort( void )
|
---|
1982 | {
|
---|
1983 | dprintf2(("CRTDLL: abort\n"));
|
---|
1984 | abort();
|
---|
1985 | }
|
---|
1986 |
|
---|
1987 |
|
---|
1988 | /*********************************************************************
|
---|
1989 | * abs (CRTDLL.336)
|
---|
1990 | */
|
---|
1991 | double CDECL CRTDLL_abs(double d)
|
---|
1992 | {
|
---|
1993 | dprintf2(("CRTDLL: abs(%f)\n",
|
---|
1994 | d));
|
---|
1995 |
|
---|
1996 | return (abs(d));
|
---|
1997 | }
|
---|
1998 |
|
---|
1999 |
|
---|
2000 | /*********************************************************************
|
---|
2001 | * acos (CRTDLL.337)
|
---|
2002 | */
|
---|
2003 | double CDECL CRTDLL_acos( double x )
|
---|
2004 | {
|
---|
2005 | dprintf2(("CRTDLL: acos\n"));
|
---|
2006 | return (acos(x));
|
---|
2007 | }
|
---|
2008 |
|
---|
2009 |
|
---|
2010 | /*********************************************************************
|
---|
2011 | * asctime (CRTDLL.338)
|
---|
2012 | */
|
---|
2013 | char * CDECL CRTDLL_asctime( const struct tm *timeptr )
|
---|
2014 | {
|
---|
2015 | dprintf2(("CRTDLL: asctime\n"));
|
---|
2016 | return (asctime(timeptr));
|
---|
2017 | }
|
---|
2018 |
|
---|
2019 |
|
---|
2020 | /*********************************************************************
|
---|
2021 | * asin (CRTDLL.339)
|
---|
2022 | */
|
---|
2023 | double CDECL CRTDLL_asin( double x )
|
---|
2024 | {
|
---|
2025 | dprintf2(("CRTDLL: asin\n"));
|
---|
2026 | return (asin(x));
|
---|
2027 | }
|
---|
2028 |
|
---|
2029 |
|
---|
2030 | /*********************************************************************
|
---|
2031 | * atan (CRTDLL.340)
|
---|
2032 | */
|
---|
2033 | double CDECL CRTDLL_atan(double d)
|
---|
2034 | {
|
---|
2035 | dprintf2(("CRTDLL: atan(%f)\n",
|
---|
2036 | d));
|
---|
2037 |
|
---|
2038 | return (atan(d));
|
---|
2039 | }
|
---|
2040 |
|
---|
2041 |
|
---|
2042 | /*********************************************************************
|
---|
2043 | * atan2 (CRTDLL.341)
|
---|
2044 | */
|
---|
2045 | double CDECL CRTDLL_atan2( double y, double x )
|
---|
2046 | {
|
---|
2047 | dprintf2(("CRTDLL: atan2\n"));
|
---|
2048 | return (atan2(y, x));
|
---|
2049 | }
|
---|
2050 |
|
---|
2051 |
|
---|
2052 | /*********************************************************************
|
---|
2053 | * atexit (CRTDLL.342)
|
---|
2054 | */
|
---|
2055 | int CDECL CRTDLL_atexit(void (*func)(void))
|
---|
2056 | {
|
---|
2057 | dprintf(("CRTDLL: atexit\n"));
|
---|
2058 | if (_atexit_n >= sizeof (_atexit_v) / sizeof (_atexit_v[0]))
|
---|
2059 | return -1;
|
---|
2060 | _atexit_v[_atexit_n++] = func;
|
---|
2061 | return 0;
|
---|
2062 | }
|
---|
2063 |
|
---|
2064 |
|
---|
2065 | /*********************************************************************
|
---|
2066 | * atof (CRTDLL.343)
|
---|
2067 | */
|
---|
2068 | double CDECL CRTDLL_atof( const char *nptr )
|
---|
2069 | {
|
---|
2070 | dprintf2(("CRTDLL: atof\n"));
|
---|
2071 | return (atof(nptr));
|
---|
2072 | }
|
---|
2073 |
|
---|
2074 |
|
---|
2075 | /*********************************************************************
|
---|
2076 | * atoi (CRTDLL.344)
|
---|
2077 | */
|
---|
2078 | int CDECL CRTDLL_atoi(LPSTR str)
|
---|
2079 | {
|
---|
2080 | dprintf2(("CRTDLL: atoi(%s)\n",
|
---|
2081 | str));
|
---|
2082 |
|
---|
2083 | return (atoi(str));
|
---|
2084 | }
|
---|
2085 |
|
---|
2086 |
|
---|
2087 | /*********************************************************************
|
---|
2088 | * atol (CRTDLL.345)
|
---|
2089 | */
|
---|
2090 | long CDECL CRTDLL_atol(LPSTR str)
|
---|
2091 | {
|
---|
2092 | dprintf2(("CRTDLL: atol(%s)\n",
|
---|
2093 | str));
|
---|
2094 |
|
---|
2095 | return (atol(str));
|
---|
2096 | }
|
---|
2097 |
|
---|
2098 |
|
---|
2099 | /*********************************************************************
|
---|
2100 | * bsearch (CRTDLL.346)
|
---|
2101 | */
|
---|
2102 | void *CDECL CRTDLL_bsearch (const void *key, const void *base, size_t num, size_t width,
|
---|
2103 | int (* CDECL compare)(const void *key, const void *element))
|
---|
2104 | {
|
---|
2105 | int left, right, median, sign;
|
---|
2106 | const void *element;
|
---|
2107 |
|
---|
2108 | if (width == 0)
|
---|
2109 | return 0;
|
---|
2110 | left = 1; right = num;
|
---|
2111 | while (left <= right)
|
---|
2112 | {
|
---|
2113 | median = (left + right) / 2;
|
---|
2114 | element = (void *)((char *)base + (median-1)*width);
|
---|
2115 | sign = compare (key, element);
|
---|
2116 | if (sign == 0)
|
---|
2117 | return (void *)element;
|
---|
2118 | if (sign > 0)
|
---|
2119 | left = median + 1;
|
---|
2120 | else
|
---|
2121 | right = median - 1;
|
---|
2122 | }
|
---|
2123 | return 0;
|
---|
2124 | }
|
---|
2125 |
|
---|
2126 |
|
---|
2127 | /*********************************************************************
|
---|
2128 | * calloc (CRTDLL.347)
|
---|
2129 | */
|
---|
2130 | void * CDECL CRTDLL_calloc( size_t n, size_t size )
|
---|
2131 | {
|
---|
2132 | // dprintf2(("CRTDLL: calloc\n"));
|
---|
2133 | return Heap_Alloc(size*n);
|
---|
2134 | }
|
---|
2135 |
|
---|
2136 |
|
---|
2137 | /*********************************************************************
|
---|
2138 | * ceil (CRTDLL.348)
|
---|
2139 | */
|
---|
2140 | double CDECL CRTDLL_ceil(double d)
|
---|
2141 | {
|
---|
2142 | dprintf2(("CRTDLL: ceil(%f)\n",
|
---|
2143 | d));
|
---|
2144 | return (ceil(d));
|
---|
2145 | }
|
---|
2146 |
|
---|
2147 |
|
---|
2148 | /*********************************************************************
|
---|
2149 | * clearerr (CRTDLL.349)
|
---|
2150 | */
|
---|
2151 | void CDECL CRTDLL_clearerr( FILE *fp )
|
---|
2152 | {
|
---|
2153 | dprintf2(("CRTDLL: clearerr\n"));
|
---|
2154 | clearerr(fp);
|
---|
2155 | }
|
---|
2156 |
|
---|
2157 |
|
---|
2158 | /*********************************************************************
|
---|
2159 | * clock (CRTDLL.350)
|
---|
2160 | */
|
---|
2161 | clock_t CDECL CRTDLL_clock( void )
|
---|
2162 | {
|
---|
2163 | dprintf2(("CRTDLL: clock\n"));
|
---|
2164 | return (clock());
|
---|
2165 | }
|
---|
2166 |
|
---|
2167 |
|
---|
2168 | /*********************************************************************
|
---|
2169 | * cos (CRTDLL.351)
|
---|
2170 | */
|
---|
2171 | double CDECL CRTDLL_cos(double d)
|
---|
2172 | {
|
---|
2173 | dprintf2(("CRTDLL: cos(%f)\n",
|
---|
2174 | d));
|
---|
2175 |
|
---|
2176 | return (cos(d));
|
---|
2177 | }
|
---|
2178 |
|
---|
2179 |
|
---|
2180 | /*********************************************************************
|
---|
2181 | * cosh (CRTDLL.352)
|
---|
2182 | */
|
---|
2183 | double CDECL CRTDLL_cosh( double x )
|
---|
2184 | {
|
---|
2185 | dprintf2(("CRTDLL: cosh\n"));
|
---|
2186 | return (cosh(x));
|
---|
2187 | }
|
---|
2188 |
|
---|
2189 |
|
---|
2190 | /*********************************************************************
|
---|
2191 | * ctime (CRTDLL.353)
|
---|
2192 | */
|
---|
2193 | char * CDECL CRTDLL_ctime( const time_t *timer )
|
---|
2194 | {
|
---|
2195 | dprintf2(("CRTDLL: ctime\n"));
|
---|
2196 | return (ctime(timer));
|
---|
2197 | }
|
---|
2198 |
|
---|
2199 |
|
---|
2200 | /*********************************************************************
|
---|
2201 | * difftime (CRTDLL.354)
|
---|
2202 | */
|
---|
2203 | double CDECL CRTDLL_difftime( time_t t1, time_t t0 )
|
---|
2204 | {
|
---|
2205 | dprintf2(("CRTDLL: difftime\n"));
|
---|
2206 | return (difftime(t1, t0));
|
---|
2207 | }
|
---|
2208 |
|
---|
2209 |
|
---|
2210 | /*********************************************************************
|
---|
2211 | * div (CRTDLL.355)
|
---|
2212 | */
|
---|
2213 | div_t CDECL CRTDLL_div( int numer, int denom )
|
---|
2214 | {
|
---|
2215 | dprintf2(("CRTDLL: div\n"));
|
---|
2216 | return (div(numer, denom));
|
---|
2217 | }
|
---|
2218 |
|
---|
2219 |
|
---|
2220 | /*********************************************************************
|
---|
2221 | * exit (CRTDLL.356)
|
---|
2222 | */
|
---|
2223 | void CDECL CRTDLL_exit(DWORD ret)
|
---|
2224 | {
|
---|
2225 | dprintf2(("CRTDLL: exit\n"));
|
---|
2226 | ExitProcess(ret);
|
---|
2227 | }
|
---|
2228 |
|
---|
2229 |
|
---|
2230 | /*********************************************************************
|
---|
2231 | * exp (CRTDLL.357)
|
---|
2232 | */
|
---|
2233 | double CDECL CRTDLL_exp( double x )
|
---|
2234 | {
|
---|
2235 | dprintf2(("CRTDLL: exp\n"));
|
---|
2236 | return (exp(x));
|
---|
2237 | }
|
---|
2238 |
|
---|
2239 |
|
---|
2240 | /*********************************************************************
|
---|
2241 | * fabs (CRTDLL.358)
|
---|
2242 | */
|
---|
2243 | double CDECL CRTDLL_fabs(double d)
|
---|
2244 | {
|
---|
2245 | dprintf2(("CRTDLL: fabs(%f)\n",
|
---|
2246 | d));
|
---|
2247 |
|
---|
2248 | return (fabs(d));
|
---|
2249 | }
|
---|
2250 |
|
---|
2251 |
|
---|
2252 | /*********************************************************************
|
---|
2253 | * fclose (CRTDLL.359)
|
---|
2254 | */
|
---|
2255 | int CDECL CRTDLL_fclose( FILE *fp )
|
---|
2256 | {
|
---|
2257 | dprintf2(("CRTDLL: fclose\n"));
|
---|
2258 | return (fclose(fp));
|
---|
2259 | }
|
---|
2260 |
|
---|
2261 |
|
---|
2262 | /*********************************************************************
|
---|
2263 | * feof (CRTDLL.360)
|
---|
2264 | */
|
---|
2265 | int CDECL CRTDLL_feof( FILE *fp )
|
---|
2266 | {
|
---|
2267 | dprintf2(("CRTDLL: feof\n"));
|
---|
2268 | return (feof(fp));
|
---|
2269 | }
|
---|
2270 |
|
---|
2271 |
|
---|
2272 | /*********************************************************************
|
---|
2273 | * ferror (CRTDLL.361)
|
---|
2274 | */
|
---|
2275 | int CDECL CRTDLL_ferror( FILE *fp )
|
---|
2276 | {
|
---|
2277 | dprintf2(("CRTDLL: ferror\n"));
|
---|
2278 | return (ferror(fp));
|
---|
2279 | }
|
---|
2280 |
|
---|
2281 |
|
---|
2282 | /*********************************************************************
|
---|
2283 | * fflush (CRTDLL.362)
|
---|
2284 | */
|
---|
2285 | int CDECL CRTDLL_fflush( FILE *fp )
|
---|
2286 | {
|
---|
2287 | dprintf2(("CRTDLL: fflush\n"));
|
---|
2288 | return (fflush(fp));
|
---|
2289 | }
|
---|
2290 |
|
---|
2291 |
|
---|
2292 | /*********************************************************************
|
---|
2293 | * fgetc (CRTDLL.363)
|
---|
2294 | */
|
---|
2295 | int CDECL CRTDLL_fgetc( FILE *fp )
|
---|
2296 | {
|
---|
2297 | dprintf2(("CRTDLL: fgetc\n"));
|
---|
2298 | return (fgetc(fp));
|
---|
2299 | }
|
---|
2300 |
|
---|
2301 |
|
---|
2302 | /*********************************************************************
|
---|
2303 | * fgetpos (CRTDLL.364)
|
---|
2304 | */
|
---|
2305 | int CDECL CRTDLL_fgetpos( FILE *fp, fpos_t *pos )
|
---|
2306 | {
|
---|
2307 | dprintf2(("CRTDLL: fgetpos\n"));
|
---|
2308 | return (fgetpos(fp, pos));
|
---|
2309 | }
|
---|
2310 |
|
---|
2311 |
|
---|
2312 | /*********************************************************************
|
---|
2313 | * fgets (CRTDLL.365)
|
---|
2314 | */
|
---|
2315 | char * CDECL CRTDLL_fgets( char *s, int n, FILE *fp )
|
---|
2316 | {
|
---|
2317 | dprintf2(("CRTDLL: fgets\n"));
|
---|
2318 | return (fgets(s, n, fp));
|
---|
2319 | }
|
---|
2320 |
|
---|
2321 |
|
---|
2322 | /*********************************************************************
|
---|
2323 | * floor (CRTDLL.367)
|
---|
2324 | */
|
---|
2325 | double CDECL CRTDLL_floor(double d)
|
---|
2326 | {
|
---|
2327 | dprintf2(("CRTDLL: floor(%f)\n",
|
---|
2328 | d));
|
---|
2329 |
|
---|
2330 | return (floor(d));
|
---|
2331 | }
|
---|
2332 |
|
---|
2333 |
|
---|
2334 | /*********************************************************************
|
---|
2335 | * fmod (CRTDLL.368)
|
---|
2336 | */
|
---|
2337 | double CDECL CRTDLL_fmod(double x, double y )
|
---|
2338 | {
|
---|
2339 | dprintf2(("CRTDLL: fmod\n"));
|
---|
2340 | return (fmod(x,y));
|
---|
2341 | }
|
---|
2342 |
|
---|
2343 |
|
---|
2344 | /*********************************************************************
|
---|
2345 | * fopen (CRTDLL.369)
|
---|
2346 | */
|
---|
2347 | FILE * CDECL CRTDLL_fopen( const char *filename, const char *mode )
|
---|
2348 | {
|
---|
2349 | dprintf2(("CRTDLL: fopen\n"));
|
---|
2350 | return (fopen( filename, mode));
|
---|
2351 | }
|
---|
2352 |
|
---|
2353 |
|
---|
2354 | /*********************************************************************
|
---|
2355 | * fprintf (CRTDLL.370)
|
---|
2356 | */
|
---|
2357 | INT CDECL CRTDLL_fprintf( FILE *file, LPSTR format, va_list arg )
|
---|
2358 | {
|
---|
2359 | dprintf2(("CRTDLL: fprintf\n"));
|
---|
2360 | return (fprintf(file, format, arg));
|
---|
2361 | }
|
---|
2362 |
|
---|
2363 |
|
---|
2364 | /*********************************************************************
|
---|
2365 | * fputc (CRTDLL.371)
|
---|
2366 | */
|
---|
2367 | int CDECL CRTDLL_fputc( int c, FILE *fp )
|
---|
2368 | {
|
---|
2369 | dprintf2(("CRTDLL: fputc\n"));
|
---|
2370 | return (fputc(c, fp));
|
---|
2371 | }
|
---|
2372 |
|
---|
2373 |
|
---|
2374 | /*********************************************************************
|
---|
2375 | * fputs (CRTDLL.372)
|
---|
2376 | */
|
---|
2377 | int CDECL CRTDLL_fputs( const char *s, FILE *fp )
|
---|
2378 | {
|
---|
2379 | dprintf2(("CRTDLL: fputs\n"));
|
---|
2380 | return (fputs(s, fp));
|
---|
2381 | }
|
---|
2382 |
|
---|
2383 |
|
---|
2384 |
|
---|
2385 | /*********************************************************************
|
---|
2386 | * fread (CRTDLL.374)
|
---|
2387 | */
|
---|
2388 | size_t CDECL CRTDLL_fread( void *ptr, size_t size, size_t n, FILE *fp )
|
---|
2389 | {
|
---|
2390 | // dprintf2(("CRTDLL: fread\n"));
|
---|
2391 | return (fread(ptr, size, n, fp));
|
---|
2392 | }
|
---|
2393 |
|
---|
2394 |
|
---|
2395 | /*********************************************************************
|
---|
2396 | * free (CRTDLL.375)
|
---|
2397 | */
|
---|
2398 | VOID CDECL CRTDLL_free(LPVOID ptr)
|
---|
2399 | {
|
---|
2400 | // dprintf2(("CRTDLL: free\n"));
|
---|
2401 | Heap_Free(ptr);
|
---|
2402 | }
|
---|
2403 |
|
---|
2404 |
|
---|
2405 | /*********************************************************************
|
---|
2406 | * freopen (CRTDLL.376)
|
---|
2407 | */
|
---|
2408 | FILE * CDECL CRTDLL_freopen( const char *filename, const char *mode, FILE *fp )
|
---|
2409 | {
|
---|
2410 | dprintf2(("CRTDLL: freopen\n"));
|
---|
2411 | return (freopen(filename, mode, fp));
|
---|
2412 | }
|
---|
2413 |
|
---|
2414 |
|
---|
2415 | /*********************************************************************
|
---|
2416 | * frexp (CRTDLL.377)
|
---|
2417 | */
|
---|
2418 | double CDECL CRTDLL_frexp( double value, int *exp )
|
---|
2419 | {
|
---|
2420 | dprintf2(("CRTDLL: frexp\n"));
|
---|
2421 | return (frexp(value, exp));
|
---|
2422 | }
|
---|
2423 |
|
---|
2424 |
|
---|
2425 | /*********************************************************************
|
---|
2426 | * fscanf (CRTDLL.378)
|
---|
2427 | */
|
---|
2428 | int CDECL CRTDLL_fscanf( FILE*fp, const char *format, va_list arg )
|
---|
2429 | {
|
---|
2430 | dprintf2(("CRTDLL: fscanf\n"));
|
---|
2431 | return (fscanf(fp, format, arg));
|
---|
2432 | }
|
---|
2433 |
|
---|
2434 |
|
---|
2435 | /*********************************************************************
|
---|
2436 | * fseek (CRTDLL.379)
|
---|
2437 | */
|
---|
2438 | int CDECL CRTDLL_fseek( FILE *file, long int offset, int whence )
|
---|
2439 | {
|
---|
2440 | dprintf2(("CRTDLL: fseek\n"));
|
---|
2441 | return (fseek(file, offset, whence));
|
---|
2442 | }
|
---|
2443 |
|
---|
2444 |
|
---|
2445 | /*********************************************************************
|
---|
2446 | * fsetpos (CRTDLL.380)
|
---|
2447 | */
|
---|
2448 | int CDECL CRTDLL_fsetpos( FILE *fp, const fpos_t *pos )
|
---|
2449 | {
|
---|
2450 | dprintf2(("CRTDLL: fsetpos\n"));
|
---|
2451 | return (fsetpos(fp, pos));
|
---|
2452 | }
|
---|
2453 |
|
---|
2454 |
|
---|
2455 | /*********************************************************************
|
---|
2456 | * ftell (CRTDLL.381)
|
---|
2457 | */
|
---|
2458 | long int CDECL CRTDLL_ftell( FILE *fp )
|
---|
2459 | {
|
---|
2460 | dprintf2(("CRTDLL: ftell\n"));
|
---|
2461 | return (ftell(fp));
|
---|
2462 | }
|
---|
2463 |
|
---|
2464 |
|
---|
2465 | /*********************************************************************
|
---|
2466 | * fwrite (CRTDLL.383)
|
---|
2467 | */
|
---|
2468 | DWORD CDECL CRTDLL_fwrite( LPVOID ptr, INT size, INT nmemb, FILE *file )
|
---|
2469 | {
|
---|
2470 | dprintf2(("CRTDLL: fwrite\n"));
|
---|
2471 | return (fwrite( ptr, size, nmemb, file));
|
---|
2472 | }
|
---|
2473 |
|
---|
2474 |
|
---|
2475 | /*********************************************************************
|
---|
2476 | * getc (CRTDLL.385)
|
---|
2477 | */
|
---|
2478 | int CDECL CRTDLL_getc( FILE *fp )
|
---|
2479 | {
|
---|
2480 | dprintf2(("CRTDLL: getc\n"));
|
---|
2481 | return (getc(fp));
|
---|
2482 | }
|
---|
2483 |
|
---|
2484 |
|
---|
2485 | /*********************************************************************
|
---|
2486 | * getchar (CRTDLL.386)
|
---|
2487 | */
|
---|
2488 | int CDECL CRTDLL_getchar( void )
|
---|
2489 | {
|
---|
2490 | dprintf2(("CRTDLL: getchar\n"));
|
---|
2491 | return (getchar());
|
---|
2492 | }
|
---|
2493 |
|
---|
2494 |
|
---|
2495 | /*********************************************************************
|
---|
2496 | * getenv (CRTDLL.387)
|
---|
2497 | */
|
---|
2498 | char * CDECL CRTDLL_getenv( const char *name )
|
---|
2499 | {
|
---|
2500 | dprintf2(("CRTDLL: getenv\n"));
|
---|
2501 | return (getenv(name));
|
---|
2502 | }
|
---|
2503 |
|
---|
2504 |
|
---|
2505 | /*********************************************************************
|
---|
2506 | * gets (CRTDLL.388)
|
---|
2507 | */
|
---|
2508 | char * CDECL CRTDLL_gets( char *s )
|
---|
2509 | {
|
---|
2510 | dprintf2(("CRTDLL: gets\n"));
|
---|
2511 | return (gets(s));
|
---|
2512 | }
|
---|
2513 |
|
---|
2514 |
|
---|
2515 | /*********************************************************************
|
---|
2516 | * gmtime (CRTDLL.389)
|
---|
2517 | */
|
---|
2518 | struct tm * CDECL CRTDLL_gmtime( const time_t *timer )
|
---|
2519 | {
|
---|
2520 | dprintf2(("CRTDLL: gmtime\n"));
|
---|
2521 | return (gmtime(timer));
|
---|
2522 | }
|
---|
2523 |
|
---|
2524 |
|
---|
2525 | /*********************************************************************
|
---|
2526 | * isalnum (CRTDLL.391)
|
---|
2527 | */
|
---|
2528 | int CDECL CRTDLL_isalnum(int i)
|
---|
2529 | {
|
---|
2530 | dprintf2(("CRTDLL: isalnum(%08xh)\n", i));
|
---|
2531 | return (isalnum(i));
|
---|
2532 | }
|
---|
2533 |
|
---|
2534 |
|
---|
2535 | /*********************************************************************
|
---|
2536 | * isalpha (CRTDLL.392)
|
---|
2537 | */
|
---|
2538 | int CDECL CRTDLL_isalpha(int i)
|
---|
2539 | {
|
---|
2540 | dprintf2(("CRTDLL: isalpha(%08xh)\n",
|
---|
2541 | i));
|
---|
2542 |
|
---|
2543 | return (isalpha(i));
|
---|
2544 | }
|
---|
2545 |
|
---|
2546 |
|
---|
2547 | /*********************************************************************
|
---|
2548 | * iscntrl (CRTDLL.393)
|
---|
2549 | */
|
---|
2550 | int CDECL CRTDLL_iscntrl(int i)
|
---|
2551 | {
|
---|
2552 | dprintf2(("CRTDLL: iscntrl(%08xh)\n", i));
|
---|
2553 | return (iscntrl(i));
|
---|
2554 | }
|
---|
2555 |
|
---|
2556 |
|
---|
2557 | /*********************************************************************
|
---|
2558 | * isdigit (CRTDLL.394)
|
---|
2559 | */
|
---|
2560 | int CDECL CRTDLL_isdigit(int i)
|
---|
2561 | {
|
---|
2562 | dprintf2(("CRTDLL: isdigit(%08xh)\n",
|
---|
2563 | i));
|
---|
2564 |
|
---|
2565 | return (isdigit(i));
|
---|
2566 | }
|
---|
2567 |
|
---|
2568 |
|
---|
2569 | /*********************************************************************
|
---|
2570 | * isgraph (CRTDLL.395)
|
---|
2571 | */
|
---|
2572 | int CDECL CRTDLL_isgraph(int i)
|
---|
2573 | {
|
---|
2574 | dprintf2(("CRTDLL: isgraph(%08xh)\n", i));
|
---|
2575 | return (isgraph(i));
|
---|
2576 | }
|
---|
2577 |
|
---|
2578 |
|
---|
2579 | /*********************************************************************
|
---|
2580 | * islower (CRTDLL.397)
|
---|
2581 | */
|
---|
2582 | int CDECL CRTDLL_islower(int i)
|
---|
2583 | {
|
---|
2584 | dprintf2(("CRTDLL: islower(%08xh)\n",
|
---|
2585 | i));
|
---|
2586 |
|
---|
2587 | return (islower(i));
|
---|
2588 | }
|
---|
2589 |
|
---|
2590 |
|
---|
2591 | /*********************************************************************
|
---|
2592 | * isprint (CRTDLL.398)
|
---|
2593 | */
|
---|
2594 | int CDECL CRTDLL_isprint(int i)
|
---|
2595 | {
|
---|
2596 | dprintf2(("CRTDLL: isprint(%08xh)\n",
|
---|
2597 | i));
|
---|
2598 |
|
---|
2599 | return (isprint(i));
|
---|
2600 | }
|
---|
2601 |
|
---|
2602 |
|
---|
2603 | /*********************************************************************
|
---|
2604 | * ispunct (CRTDLL.399)
|
---|
2605 | */
|
---|
2606 | int CDECL CRTDLL_ispunct(int i)
|
---|
2607 | {
|
---|
2608 | dprintf2(("CRTDLL: ispunct(%08xh)\n", i));
|
---|
2609 | return (ispunct(i));
|
---|
2610 | }
|
---|
2611 |
|
---|
2612 |
|
---|
2613 | /*********************************************************************
|
---|
2614 | * isspace (CRTDLL.400)
|
---|
2615 | */
|
---|
2616 | int CDECL CRTDLL_isspace(int i)
|
---|
2617 | {
|
---|
2618 | dprintf2(("CRTDLL: isspace(%08xh)\n",
|
---|
2619 | i));
|
---|
2620 |
|
---|
2621 | return (isspace(i));
|
---|
2622 | }
|
---|
2623 |
|
---|
2624 |
|
---|
2625 | /*********************************************************************
|
---|
2626 | * isupper (CRTDLL.401)
|
---|
2627 | */
|
---|
2628 | int CDECL CRTDLL_isupper(int i)
|
---|
2629 | {
|
---|
2630 | dprintf2(("CRTDLL: isupper(%08xh)\n",
|
---|
2631 | i));
|
---|
2632 |
|
---|
2633 | return (isupper(i));
|
---|
2634 | }
|
---|
2635 |
|
---|
2636 |
|
---|
2637 | /*********************************************************************
|
---|
2638 | * isxdigit (CRTDLL.415)
|
---|
2639 | */
|
---|
2640 | int CDECL CRTDLL_isxdigit(int i)
|
---|
2641 | {
|
---|
2642 | dprintf2(("CRTDLL: isxdigit(%08xh)\n", i));
|
---|
2643 | return (isxdigit(i));
|
---|
2644 | }
|
---|
2645 |
|
---|
2646 |
|
---|
2647 | /*********************************************************************
|
---|
2648 | * labs (CRTDLL.416)
|
---|
2649 | */
|
---|
2650 | long int CDECL CRTDLL_labs( long int j )
|
---|
2651 | {
|
---|
2652 | dprintf2(("CRTDLL: labs(%08xh)\n", j));
|
---|
2653 | return (labs(j));
|
---|
2654 | }
|
---|
2655 |
|
---|
2656 |
|
---|
2657 | /*********************************************************************
|
---|
2658 | * ldexp (CRTDLL.417)
|
---|
2659 | */
|
---|
2660 | double CDECL CRTDLL_ldexp( double x, int exp )
|
---|
2661 | {
|
---|
2662 | dprintf2(("CRTDLL: ldexp\n"));
|
---|
2663 | return (ldexp(x, exp));
|
---|
2664 | }
|
---|
2665 |
|
---|
2666 |
|
---|
2667 | /*********************************************************************
|
---|
2668 | * ldiv (CRTDLL.418)
|
---|
2669 | */
|
---|
2670 | ldiv_t CDECL CRTDLL_ldiv( long int numer, long int denom )
|
---|
2671 | {
|
---|
2672 | dprintf2(("CRTDLL: ldiv\n"));
|
---|
2673 | return (ldiv(numer, denom));
|
---|
2674 | }
|
---|
2675 |
|
---|
2676 |
|
---|
2677 | /*********************************************************************
|
---|
2678 | * localeconv (CRTDLL.419)
|
---|
2679 | */
|
---|
2680 | struct lconv * CDECL CRTDLL_localeconv(void)
|
---|
2681 | {
|
---|
2682 | dprintf2(("CRTDLL: localeconv\n"));
|
---|
2683 | return (localeconv());
|
---|
2684 | }
|
---|
2685 |
|
---|
2686 |
|
---|
2687 | /*********************************************************************
|
---|
2688 | * localtime (CRTDLL.420)
|
---|
2689 | */
|
---|
2690 | struct tm * CDECL CRTDLL_localtime( const time_t *timer )
|
---|
2691 | {
|
---|
2692 | dprintf2(("CRTDLL: localtime\n"));
|
---|
2693 | return (localtime(timer));
|
---|
2694 | }
|
---|
2695 |
|
---|
2696 |
|
---|
2697 | /*********************************************************************
|
---|
2698 | * log (CRTDLL.421)
|
---|
2699 | */
|
---|
2700 | double CDECL CRTDLL_log( double x )
|
---|
2701 | {
|
---|
2702 | dprintf2(("CRTDLL: log(%08xh)\n", x));
|
---|
2703 | return (log(x));
|
---|
2704 | }
|
---|
2705 |
|
---|
2706 |
|
---|
2707 | /*********************************************************************
|
---|
2708 | * log10 (CRTDLL.422)
|
---|
2709 | */
|
---|
2710 | double CDECL CRTDLL_log10( double x )
|
---|
2711 | {
|
---|
2712 | dprintf2(("CRTDLL: log10\n"));
|
---|
2713 | return (log10(x));
|
---|
2714 | }
|
---|
2715 |
|
---|
2716 |
|
---|
2717 | /*********************************************************************
|
---|
2718 | * longjmp (CRTDLL.423)
|
---|
2719 | */
|
---|
2720 | VOID CDECL CRTDLL_longjmp(jmp_buf env, int val)
|
---|
2721 | {
|
---|
2722 | dprintf2(("CRTDLL: longjmp\n"));
|
---|
2723 | longjmp(env, val);
|
---|
2724 | }
|
---|
2725 |
|
---|
2726 |
|
---|
2727 | /*********************************************************************
|
---|
2728 | * malloc (CRTDLL.424)
|
---|
2729 | */
|
---|
2730 | VOID* CDECL CRTDLL_malloc(DWORD size)
|
---|
2731 | {
|
---|
2732 | // dprintf2(("CRTDLL: malloc\n"));
|
---|
2733 | return Heap_Alloc(size);
|
---|
2734 | }
|
---|
2735 |
|
---|
2736 |
|
---|
2737 | /*********************************************************************
|
---|
2738 | * mktime (CRTDLL.433)
|
---|
2739 | */
|
---|
2740 | time_t CDECL CRTDLL_mktime( struct tm *timeptr )
|
---|
2741 | {
|
---|
2742 | dprintf2(("CRTDLL: mktime\n"));
|
---|
2743 | return mktime( timeptr );
|
---|
2744 | }
|
---|
2745 |
|
---|
2746 |
|
---|
2747 | /*********************************************************************
|
---|
2748 | * modf (CRTDLL.434)
|
---|
2749 | */
|
---|
2750 | double CDECL CRTDLL_modf( double value, double *iptr )
|
---|
2751 | {
|
---|
2752 | dprintf2(("CRTDLL: modf\n"));
|
---|
2753 | return modf( value, iptr );
|
---|
2754 | }
|
---|
2755 |
|
---|
2756 |
|
---|
2757 | /*********************************************************************
|
---|
2758 | * perror (CRTDLL.435)
|
---|
2759 | */
|
---|
2760 | void CDECL CRTDLL_perror( const char *s )
|
---|
2761 | {
|
---|
2762 | dprintf2(("CRTDLL: perror\n"));
|
---|
2763 | perror( s );
|
---|
2764 | }
|
---|
2765 |
|
---|
2766 |
|
---|
2767 | /*********************************************************************
|
---|
2768 | * pow (CRTDLL.436)
|
---|
2769 | */
|
---|
2770 | double CDECL CRTDLL_pow( double x, double y )
|
---|
2771 | {
|
---|
2772 | dprintf2(("CRTDLL: pow(%08xh, %08xh)\n",x, y));
|
---|
2773 | return pow( x, y );
|
---|
2774 | }
|
---|
2775 |
|
---|
2776 |
|
---|
2777 | /*********************************************************************
|
---|
2778 | * printf (CRTDLL.437)
|
---|
2779 | */
|
---|
2780 | int CDECL CRTDLL_printf( const char *format, va_list arg )
|
---|
2781 | {
|
---|
2782 | dprintf2(("CRTDLL: printf\n"));
|
---|
2783 | return (printf(format, arg));
|
---|
2784 | }
|
---|
2785 |
|
---|
2786 |
|
---|
2787 | /*********************************************************************
|
---|
2788 | * putc (CRTDLL.438)
|
---|
2789 | */
|
---|
2790 | int CDECL CRTDLL_putc( int c, FILE *fp )
|
---|
2791 | {
|
---|
2792 | dprintf2(("CRTDLL: putc\n"));
|
---|
2793 | return putc( c, fp );
|
---|
2794 | }
|
---|
2795 |
|
---|
2796 |
|
---|
2797 | /*********************************************************************
|
---|
2798 | * putchar (CRTDLL.439)
|
---|
2799 | */
|
---|
2800 | int CDECL CRTDLL_putchar( int c )
|
---|
2801 | {
|
---|
2802 | dprintf2(("CRTDLL: putchar\n"));
|
---|
2803 | return putchar( c );
|
---|
2804 | }
|
---|
2805 |
|
---|
2806 |
|
---|
2807 | /*********************************************************************
|
---|
2808 | * puts (CRTDLL.440)
|
---|
2809 | */
|
---|
2810 | int CDECL CRTDLL_puts( const char *s )
|
---|
2811 | {
|
---|
2812 | dprintf2(("CRTDLL: puts\n"));
|
---|
2813 | return puts( s );
|
---|
2814 | }
|
---|
2815 |
|
---|
2816 |
|
---|
2817 | /*********************************************************************
|
---|
2818 | * qsort (CRTDLL.441)
|
---|
2819 | */
|
---|
2820 | void CDECL CRTDLL_qsort (void *base, size_t num, size_t width,
|
---|
2821 | int (*CDECL compare)(const void *x1, const void *x2))
|
---|
2822 | {
|
---|
2823 | dprintf2(("CRTDLL: qsort\n"));
|
---|
2824 | if (width > 0 && num > 1 && base != 0)
|
---|
2825 | qsort1 ((char *)base, (char *)base+(num-1)*width, width, compare);
|
---|
2826 | }
|
---|
2827 |
|
---|
2828 |
|
---|
2829 | /*********************************************************************
|
---|
2830 | * raise (CRTDLL.442)
|
---|
2831 | */
|
---|
2832 | int CDECL CRTDLL_raise( int sig )
|
---|
2833 | {
|
---|
2834 | dprintf2(("CRTDLL: raise\n"));
|
---|
2835 | return raise( sig );
|
---|
2836 | }
|
---|
2837 |
|
---|
2838 |
|
---|
2839 | /*********************************************************************
|
---|
2840 | * rand (CRTDLL.443)
|
---|
2841 | */
|
---|
2842 | int CDECL CRTDLL_rand( void )
|
---|
2843 | {
|
---|
2844 | // dprintf2(("CRTDLL: rand\n"));
|
---|
2845 | return (rand());
|
---|
2846 | }
|
---|
2847 |
|
---|
2848 |
|
---|
2849 | /*********************************************************************
|
---|
2850 | * realloc (CRTDLL.444)
|
---|
2851 | */
|
---|
2852 | void * CDECL CRTDLL_realloc( void *ptr, size_t size )
|
---|
2853 | {
|
---|
2854 | dprintf2(("CRTDLL: realloc\n"));
|
---|
2855 | return HeapReAlloc( GetProcessHeap(), 0, ptr, size );
|
---|
2856 | }
|
---|
2857 |
|
---|
2858 |
|
---|
2859 | /*********************************************************************
|
---|
2860 | * remove (CRTDLL.445)
|
---|
2861 | */
|
---|
2862 | INT CDECL CRTDLL_remove(const char* file)
|
---|
2863 | {
|
---|
2864 | dprintf2(("CRTDLL: remove\n"));
|
---|
2865 | return (remove(file));
|
---|
2866 | }
|
---|
2867 |
|
---|
2868 |
|
---|
2869 | /*********************************************************************
|
---|
2870 | * rename (CRTDLL.446)
|
---|
2871 | */
|
---|
2872 | int CDECL CRTDLL_rename (const char *old, const char *new2)
|
---|
2873 | {
|
---|
2874 | dprintf2(("CRTDLL: rename\n"));
|
---|
2875 | return (rename(old, new2));
|
---|
2876 | }
|
---|
2877 |
|
---|
2878 |
|
---|
2879 | /*********************************************************************
|
---|
2880 | * rewind (CRTDLL.447)
|
---|
2881 | */
|
---|
2882 | void CDECL CRTDLL_rewind( FILE *fp )
|
---|
2883 | {
|
---|
2884 | dprintf2(("CRTDLL: rewind\n"));
|
---|
2885 | rewind(fp);
|
---|
2886 | }
|
---|
2887 |
|
---|
2888 |
|
---|
2889 | /*********************************************************************
|
---|
2890 | * scanf (CRTDLL.448)
|
---|
2891 | */
|
---|
2892 | int CDECL CRTDLL_scanf( const char *format, va_list arg )
|
---|
2893 | {
|
---|
2894 | dprintf(("CRTDLL: scanf\n"));
|
---|
2895 | return (scanf(format, arg));
|
---|
2896 | }
|
---|
2897 |
|
---|
2898 |
|
---|
2899 | /*********************************************************************
|
---|
2900 | * setbuf (CRTDLL.449)
|
---|
2901 | */
|
---|
2902 | void CDECL CRTDLL_setbuf( FILE *fp, char *buf )
|
---|
2903 | {
|
---|
2904 | dprintf2(("CRTDLL: setbuf\n"));
|
---|
2905 | setbuf(fp, buf);
|
---|
2906 | }
|
---|
2907 |
|
---|
2908 |
|
---|
2909 | /*********************************************************************
|
---|
2910 | * setlocale (CRTDLL.450)
|
---|
2911 | */
|
---|
2912 | char * CDECL CRTDLL_setlocale(int category,const char *locale)
|
---|
2913 | {
|
---|
2914 | dprintf2(("CRTDLL: setlocale\n"));
|
---|
2915 | return (setlocale(category, locale));
|
---|
2916 | }
|
---|
2917 |
|
---|
2918 |
|
---|
2919 | /*********************************************************************
|
---|
2920 | * setvbuf (CRTDLL.451)
|
---|
2921 | */
|
---|
2922 | int CDECL CRTDLL_setvbuf( FILE *fp, char *buf, int mode, size_t size )
|
---|
2923 | {
|
---|
2924 | dprintf2(("CRTDLL: setvbuf\n"));
|
---|
2925 | return (setvbuf(fp, buf, mode, size));
|
---|
2926 | }
|
---|
2927 |
|
---|
2928 |
|
---|
2929 | /*********************************************************************
|
---|
2930 | * signal (CRTDLL.452)
|
---|
2931 | */
|
---|
2932 | _SigFunc CDECL CRTDLL_signal(int sig, _SigFunc func)
|
---|
2933 | {
|
---|
2934 | dprintf(("CRTDLL: signal\n"));
|
---|
2935 | return (signal(sig, func));
|
---|
2936 | }
|
---|
2937 |
|
---|
2938 |
|
---|
2939 | /*********************************************************************
|
---|
2940 | * sin (CRTDLL.453)
|
---|
2941 | */
|
---|
2942 | double CDECL CRTDLL_sin( double x )
|
---|
2943 | {
|
---|
2944 | dprintf2(("CRTDLL: sin(%08xh)\n", x));
|
---|
2945 | return (sin(x));
|
---|
2946 | }
|
---|
2947 |
|
---|
2948 |
|
---|
2949 | /*********************************************************************
|
---|
2950 | * sinh (CRTDLL.454)
|
---|
2951 | */
|
---|
2952 | double CDECL CRTDLL_sinh( double x )
|
---|
2953 | {
|
---|
2954 | dprintf2(("CRTDLL: sinh\n"));
|
---|
2955 | return (sinh(x));
|
---|
2956 | }
|
---|
2957 |
|
---|
2958 |
|
---|
2959 | /*********************************************************************
|
---|
2960 | * sprintf (CRTDLL.455)
|
---|
2961 | */
|
---|
2962 | LPSTR CDECL CRTDLL_sprintf(LPSTR lpstrBuffer,
|
---|
2963 | LPSTR lpstrFormat,
|
---|
2964 | ...)
|
---|
2965 | {
|
---|
2966 | va_list argptr; /* -> variable argument list */
|
---|
2967 |
|
---|
2968 | dprintf2(("CRTDLL: sprintf(%08xh,%s)\n",
|
---|
2969 | lpstrBuffer,
|
---|
2970 | lpstrFormat));
|
---|
2971 |
|
---|
2972 | va_start(argptr,
|
---|
2973 | lpstrFormat); /* get pointer to argument list */
|
---|
2974 | vsprintf(lpstrBuffer,
|
---|
2975 | lpstrFormat,
|
---|
2976 | argptr);
|
---|
2977 | va_end(argptr); /* done with variable arguments */
|
---|
2978 |
|
---|
2979 | return (lpstrBuffer);
|
---|
2980 | }
|
---|
2981 |
|
---|
2982 |
|
---|
2983 | /*********************************************************************
|
---|
2984 | * sqrt (CRTDLL.456)
|
---|
2985 | */
|
---|
2986 | double CDECL CRTDLL_sqrt( double x )
|
---|
2987 | {
|
---|
2988 | dprintf2(("CRTDLL: sqrt(%08xh)\n", x));
|
---|
2989 | return (sqrt(x));
|
---|
2990 | }
|
---|
2991 |
|
---|
2992 |
|
---|
2993 | /*********************************************************************
|
---|
2994 | * srand (CRTDLL.457)
|
---|
2995 | */
|
---|
2996 | void CDECL CRTDLL_srand( unsigned int seed )
|
---|
2997 | {
|
---|
2998 | dprintf2(("CRTDLL: srand\n"));
|
---|
2999 | srand(seed);
|
---|
3000 | }
|
---|
3001 |
|
---|
3002 |
|
---|
3003 | /*********************************************************************
|
---|
3004 | * sscanf (CRTDLL.458)
|
---|
3005 | */
|
---|
3006 | int CDECL CRTDLL_sscanf( const char *s, const char *format, va_list arg )
|
---|
3007 | {
|
---|
3008 | dprintf(("CRTDLL: sscanf\n"));
|
---|
3009 | return (sscanf(s, format, arg));
|
---|
3010 | }
|
---|
3011 |
|
---|
3012 |
|
---|
3013 | /*********************************************************************
|
---|
3014 | * system (CRTDLL.482)
|
---|
3015 | */
|
---|
3016 | int CDECL CRTDLL_system( const char *string )
|
---|
3017 | {
|
---|
3018 | dprintf2(("CRTDLL: system\n"));
|
---|
3019 | return system(string);
|
---|
3020 | }
|
---|
3021 |
|
---|
3022 |
|
---|
3023 | /*********************************************************************
|
---|
3024 | * tan (CRTDLL.483)
|
---|
3025 | */
|
---|
3026 | double CDECL CRTDLL_tan(double d)
|
---|
3027 | {
|
---|
3028 | dprintf2(("CRTDLL: tan(%f)\n",
|
---|
3029 | d));
|
---|
3030 |
|
---|
3031 | return (tan(d));
|
---|
3032 | }
|
---|
3033 |
|
---|
3034 |
|
---|
3035 | /*********************************************************************
|
---|
3036 | * tanh (CRTDLL.484)
|
---|
3037 | */
|
---|
3038 | double CDECL CRTDLL_tanh( double x )
|
---|
3039 | {
|
---|
3040 | dprintf2(("CRTDLL: tanh\n"));
|
---|
3041 | return tanh(x);
|
---|
3042 | }
|
---|
3043 |
|
---|
3044 |
|
---|
3045 | /*********************************************************************
|
---|
3046 | * time (CRTDLL.485)
|
---|
3047 | */
|
---|
3048 | time_t CDECL CRTDLL_time( time_t *timer )
|
---|
3049 | {
|
---|
3050 | dprintf2(("CRTDLL: time\n"));
|
---|
3051 |
|
---|
3052 | return time(timer);
|
---|
3053 | }
|
---|
3054 |
|
---|
3055 |
|
---|
3056 | /*********************************************************************
|
---|
3057 | * tmpfile (CRTDLL.486)
|
---|
3058 | */
|
---|
3059 | FILE * CDECL CRTDLL_tmpfile( void )
|
---|
3060 | {
|
---|
3061 | dprintf2(("CRTDLL: tmpfile\n"));
|
---|
3062 | return (tmpfile());
|
---|
3063 | }
|
---|
3064 |
|
---|
3065 |
|
---|
3066 | /*********************************************************************
|
---|
3067 | * tmpnam (CRTDLL.487)
|
---|
3068 | */
|
---|
3069 | char * CDECL CRTDLL_tmpnam( char *s )
|
---|
3070 | {
|
---|
3071 | dprintf2(("CRTDLL: tmpnam\n"));
|
---|
3072 | return (tmpnam(s));
|
---|
3073 | }
|
---|
3074 |
|
---|
3075 |
|
---|
3076 | /*********************************************************************
|
---|
3077 | * tolower (CRTDLL.488)
|
---|
3078 | */
|
---|
3079 | int CDECL CRTDLL_tolower(int c)
|
---|
3080 | {
|
---|
3081 | dprintf2(("CRTDLL: tolower(%c)\n",
|
---|
3082 | c));
|
---|
3083 |
|
---|
3084 | return (tolower(c));
|
---|
3085 | }
|
---|
3086 |
|
---|
3087 |
|
---|
3088 | /*********************************************************************
|
---|
3089 | * toupper (CRTDLL.489)
|
---|
3090 | */
|
---|
3091 | int CDECL CRTDLL_toupper(int c)
|
---|
3092 | {
|
---|
3093 | dprintf2(("CRTDLL: toupper(%c)\n",
|
---|
3094 | c));
|
---|
3095 |
|
---|
3096 | return (toupper(c));
|
---|
3097 | }
|
---|
3098 |
|
---|
3099 |
|
---|
3100 | /*********************************************************************
|
---|
3101 | * vfprintf (CRTDLL.494)
|
---|
3102 | */
|
---|
3103 | INT CDECL CRTDLL_vfprintf( FILE *file, LPSTR format, va_list args )
|
---|
3104 | {
|
---|
3105 | dprintf2(("CRTDLL: vfprintf\n"));
|
---|
3106 | return (vfprintf(file, format, args));
|
---|
3107 | }
|
---|
3108 |
|
---|
3109 |
|
---|
3110 | /*********************************************************************
|
---|
3111 | * vprintf (CRTDLL.496)
|
---|
3112 | */
|
---|
3113 | int CDECL CRTDLL_vprintf( const char *format, __va_list arg )
|
---|
3114 | {
|
---|
3115 | dprintf2(("CRTDLL: vprintf\n"));
|
---|
3116 | return (vprintf(format, arg));
|
---|
3117 | }
|
---|
3118 |
|
---|
3119 |
|
---|
3120 | /*********************************************************************
|
---|
3121 | * vsprintf (CRTDLL.497)
|
---|
3122 | */
|
---|
3123 | int CDECL CRTDLL_vsprintf( char *s, const char *format, va_list arg )
|
---|
3124 | {
|
---|
3125 | dprintf2(("CRTDLL: vsprintf(%08xh, %08xh)\n", s, format));
|
---|
3126 | return (vsprintf(s, format, arg));
|
---|
3127 | }
|
---|
3128 |
|
---|
3129 |
|
---|
3130 | /*********************************************************************
|
---|
3131 | * CRTDLL__itow (CRTDLL.600)
|
---|
3132 | */
|
---|
3133 | char * CDECL CRTDLL__itow(int i, char *s, int r)
|
---|
3134 | {
|
---|
3135 | dprintf(("CRTDLL: _itow(%08xh, %08xh, %08xh) no unicode support !\n",
|
---|
3136 | i,
|
---|
3137 | s,
|
---|
3138 | r));
|
---|
3139 |
|
---|
3140 | return (itoa(i,s,r));
|
---|
3141 | }
|
---|
3142 |
|
---|
3143 |
|
---|
3144 | /*********************************************************************
|
---|
3145 | * CRTDLL__setjmp3 (CRTDLL.600)
|
---|
3146 | */
|
---|
3147 | int CDECL CRTDLL__setjmp3( jmp_buf env )
|
---|
3148 | {
|
---|
3149 | //TODO:
|
---|
3150 | dprintf2(("CRTDLL: _setjmp3 -> setjmp (NOT IDENTICAL!!!)\n"));
|
---|
3151 | return(setjmp( env));
|
---|
3152 | }
|
---|