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