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