| 1 | /* $Id: crtdll.cpp,v 1.27 2000-11-21 23:48:49 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * The C RunTime DLL
|
|---|
| 5 | *
|
|---|
| 6 | * Implements C run-time functionality as known from UNIX.
|
|---|
| 7 | *
|
|---|
| 8 | * TODO:
|
|---|
| 9 | * - Check setjmp(3)
|
|---|
| 10 | * - fix *ALL* functions for the FS: wrapper problem
|
|---|
| 11 | *
|
|---|
| 12 | * Partialy based on Wine
|
|---|
| 13 | *
|
|---|
| 14 | * Copyright 1996,1998 Marcus Meissner
|
|---|
| 15 | * Copyright 1996 Jukka Iivonen
|
|---|
| 16 | * Copyright 1997 Uwe Bonnes
|
|---|
| 17 | * Copyright 1999-2000 Jens Wiessner
|
|---|
| 18 | * Copyright 2000 Przemyslaw Dobrowolski
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | #include <odin.h>
|
|---|
| 23 | #include <odinwrap.h>
|
|---|
| 24 | #include <os2sel.h>
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | #include <os2win.h>
|
|---|
| 29 | #include <stdio.h>
|
|---|
| 30 | #include <stdlib.h>
|
|---|
| 31 | #include <string.h>
|
|---|
| 32 | #include <misc.h>
|
|---|
| 33 | #include <unicode.h>
|
|---|
| 34 | #include <heapstring.h>
|
|---|
| 35 | #include <ctype.h>
|
|---|
| 36 | #include <setjmp.h>
|
|---|
| 37 | #include <ntddk.h>
|
|---|
| 38 | #include <debugtools.h>
|
|---|
| 39 |
|
|---|
| 40 | #include <math.h>
|
|---|
| 41 | #include <libc\locale.h>
|
|---|
| 42 | #include <signal.h>
|
|---|
| 43 | #include <io.h>
|
|---|
| 44 | #include <assert.h>
|
|---|
| 45 | #include <process.h>
|
|---|
| 46 | #include <float.h>
|
|---|
| 47 | #include <conio.h>
|
|---|
| 48 | #include <direct.h>
|
|---|
| 49 | #include <malloc.h>
|
|---|
| 50 | #include <drive.h>
|
|---|
| 51 | #include <fcntl.h>
|
|---|
| 52 | #include <search.h>
|
|---|
| 53 | #include <heap.h>
|
|---|
| 54 | #include <errno.h>
|
|---|
| 55 | #include <sys\utime.h>
|
|---|
| 56 | #include <sys\timeb.h>
|
|---|
| 57 | #include <sys\stat.h>
|
|---|
| 58 | #include "signal.h"
|
|---|
| 59 |
|
|---|
| 60 | #include <crtdll.h>
|
|---|
| 61 | // #include <ieee.h>
|
|---|
| 62 | #include <asmhlp.h>
|
|---|
| 63 | #include "crtinc.h"
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | ODINDEBUGCHANNEL(CRTDLL)
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 | #define dprintf2 dprintf
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 | /*********************************************************************
|
|---|
| 73 | * _CIacos (CRTDLL.004)
|
|---|
| 74 | */
|
|---|
| 75 | double CDECL CRTDLL__CIacos()
|
|---|
| 76 | {
|
|---|
| 77 | double x;
|
|---|
| 78 | dprintf2(("CRTDLL: _CIacos\n"));
|
|---|
| 79 | POP_FPU(x);
|
|---|
| 80 | return acos(x);
|
|---|
| 81 | }
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 | /*********************************************************************
|
|---|
| 85 | * _CIasin (CRTDLL.005)
|
|---|
| 86 | */
|
|---|
| 87 | double CDECL CRTDLL__CIasin()
|
|---|
| 88 | {
|
|---|
| 89 | double x;
|
|---|
| 90 | dprintf2(("CRTDLL: _CIasin\n"));
|
|---|
| 91 | POP_FPU(x);
|
|---|
| 92 | return asin(x);
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 | /*********************************************************************
|
|---|
| 97 | * _CIatan (CRTDLL.006)
|
|---|
| 98 | */
|
|---|
| 99 | double CDECL CRTDLL__CIatan()
|
|---|
| 100 | {
|
|---|
| 101 | double x;
|
|---|
| 102 | dprintf2(("CRTDLL: _CIatan\n"));
|
|---|
| 103 | POP_FPU(x);
|
|---|
| 104 | return atan(x);
|
|---|
| 105 | }
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | /*********************************************************************
|
|---|
| 109 | * _CIatan2 (CRTDLL.007)
|
|---|
| 110 | */
|
|---|
| 111 | double CDECL CRTDLL__CIatan2()
|
|---|
| 112 | {
|
|---|
| 113 | double x, y;
|
|---|
| 114 | dprintf2(("CRTDLL: _CIatan2\n"));
|
|---|
| 115 | POP_FPU(y);
|
|---|
| 116 | POP_FPU(x);
|
|---|
| 117 | return atan2(x,y);
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 | /*********************************************************************
|
|---|
| 122 | * _CIcos (CRTDLL.008)
|
|---|
| 123 | */
|
|---|
| 124 | double CDECL CRTDLL__CIcos()
|
|---|
| 125 | {
|
|---|
| 126 | double x;
|
|---|
| 127 | dprintf2(("CRTDLL: _CIcos\n"));
|
|---|
| 128 | POP_FPU(x);
|
|---|
| 129 | return cos(x);
|
|---|
| 130 | }
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 | /*********************************************************************
|
|---|
| 134 | * _CIcosh (CRTDLL.009)
|
|---|
| 135 | */
|
|---|
| 136 | double CDECL CRTDLL__CIcosh()
|
|---|
| 137 | {
|
|---|
| 138 | double x;
|
|---|
| 139 | dprintf2(("CRTDLL: _CIcosh\n"));
|
|---|
| 140 | POP_FPU(x);
|
|---|
| 141 | return cosh(x);
|
|---|
| 142 | }
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 | /*********************************************************************
|
|---|
| 146 | * _CIexp (CRTDLL.010)
|
|---|
| 147 | */
|
|---|
| 148 | double CDECL CRTDLL__CIexp()
|
|---|
| 149 | {
|
|---|
| 150 | double x;
|
|---|
| 151 | dprintf2(("CRTDLL: _CIexp\n"));
|
|---|
| 152 | POP_FPU(x);
|
|---|
| 153 | return exp(x);
|
|---|
| 154 | }
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 | /*********************************************************************
|
|---|
| 158 | * _CIfmod (CRTDLL.011)
|
|---|
| 159 | */
|
|---|
| 160 | double CDECL CRTDLL__CIfmod( )
|
|---|
| 161 | {
|
|---|
| 162 | double x, y;
|
|---|
| 163 | dprintf2(("CRTDLL: _CIfmod\n"));
|
|---|
| 164 | POP_FPU(y);
|
|---|
| 165 | POP_FPU(x);
|
|---|
| 166 | return fmod(x,y);
|
|---|
| 167 | }
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 | /*********************************************************************
|
|---|
| 171 | * _CIlog (CRTDLL.012)
|
|---|
| 172 | */
|
|---|
| 173 | double CDECL CRTDLL__CIlog()
|
|---|
| 174 | {
|
|---|
| 175 | double x;
|
|---|
| 176 | dprintf2(("CRTDLL: _CIlog\n"));
|
|---|
| 177 | POP_FPU(x);
|
|---|
| 178 | return log(x);
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 | /*********************************************************************
|
|---|
| 183 | * _CIlog10 (CRTDLL.013)
|
|---|
| 184 | */
|
|---|
| 185 | double CDECL CRTDLL__CIlog10()
|
|---|
| 186 | {
|
|---|
| 187 | double x;
|
|---|
| 188 | dprintf2(("CRTDLL: _CIlog10\n"));
|
|---|
| 189 | POP_FPU(x);
|
|---|
| 190 | return log10(x);
|
|---|
| 191 | }
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 | /*********************************************************************
|
|---|
| 195 | * _CIpow (CRTDLL.014)
|
|---|
| 196 | */
|
|---|
| 197 | LONG CDECL CRTDLL__CIpow()
|
|---|
| 198 | {
|
|---|
| 199 | double x,y;
|
|---|
| 200 | dprintf2(("CRTDLL: _CIpow\n"));
|
|---|
| 201 | POP_FPU(y);
|
|---|
| 202 | POP_FPU(x);
|
|---|
| 203 | return pow(x,y);
|
|---|
| 204 | }
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 | /*********************************************************************
|
|---|
| 210 | * _CIsin (CRTDLL.015)
|
|---|
| 211 | */
|
|---|
| 212 | double CDECL CRTDLL__CIsin()
|
|---|
| 213 | {
|
|---|
| 214 | double x;
|
|---|
| 215 | dprintf2(("CRTDLL: _CIsin\n"));
|
|---|
| 216 | POP_FPU(x);
|
|---|
| 217 | return sin(x);
|
|---|
| 218 | }
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 | /*********************************************************************
|
|---|
| 222 | * _CIsinh (CRTDLL.016)
|
|---|
| 223 | */
|
|---|
| 224 | double CDECL CRTDLL__CIsinh()
|
|---|
| 225 | {
|
|---|
| 226 | double x;
|
|---|
| 227 | dprintf2(("CRTDLL: _CIsinh\n"));
|
|---|
| 228 | POP_FPU(x);
|
|---|
| 229 | return sinh(x);
|
|---|
| 230 | }
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 | /*********************************************************************
|
|---|
| 234 | * _CIsqrt (CRTDLL.017)
|
|---|
| 235 | */
|
|---|
| 236 | double CDECL CRTDLL__CIsqrt()
|
|---|
| 237 | {
|
|---|
| 238 | double x;
|
|---|
| 239 | dprintf2(("CRTDLL: _CIsqrt\n"));
|
|---|
| 240 | POP_FPU(x);
|
|---|
| 241 | return sqrt(x);
|
|---|
| 242 | }
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | /*********************************************************************
|
|---|
| 246 | * _CItan (CRTDLL.018)
|
|---|
| 247 | */
|
|---|
| 248 | double CDECL CRTDLL__CItan()
|
|---|
| 249 | {
|
|---|
| 250 | double x;
|
|---|
| 251 | dprintf2(("CRTDLL: _CItan\n"));
|
|---|
| 252 | POP_FPU(x);
|
|---|
| 253 | return tan(x);
|
|---|
| 254 | }
|
|---|
| 255 |
|
|---|
| 256 |
|
|---|
| 257 | /*********************************************************************
|
|---|
| 258 | * _CItanh (CRTDLL.019)
|
|---|
| 259 | */
|
|---|
| 260 | double CDECL CRTDLL__CItanh()
|
|---|
| 261 | {
|
|---|
| 262 | double x;
|
|---|
| 263 | dprintf2(("CRTDLL: _CItanh\n"));
|
|---|
| 264 | POP_FPU(x);
|
|---|
| 265 | return tanh(x);
|
|---|
| 266 | }
|
|---|
| 267 |
|
|---|
| 268 |
|
|---|
| 269 | /*********************************************************************
|
|---|
| 270 | * _XcptFilter (CRTDLL.21)
|
|---|
| 271 | */
|
|---|
| 272 | INT CDECL CRTDLL__XcptFilter(DWORD ret, struct _EXCEPTION_POINTERS * ExceptionInfo )
|
|---|
| 273 | {
|
|---|
| 274 | dprintf2(("CRTDLL: _XcptFilter\n"));
|
|---|
| 275 | return UnhandledExceptionFilter(ExceptionInfo);
|
|---|
| 276 | }
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 | /*********************************************************************
|
|---|
| 280 | * CRTDLL___threadhandle (CRTDLL.33)
|
|---|
| 281 | */
|
|---|
| 282 | unsigned long CDECL CRTDLL___threadhandle( void )
|
|---|
| 283 | {
|
|---|
| 284 | dprintf2(("CRTDLL: __threadhandle\n"));
|
|---|
| 285 | return GetCurrentThread();
|
|---|
| 286 | }
|
|---|
| 287 |
|
|---|
| 288 |
|
|---|
| 289 | /*********************************************************************
|
|---|
| 290 | * CRTDLL___threadid (CRTDLL.34)
|
|---|
| 291 | */
|
|---|
| 292 | unsigned long CDECL CRTDLL___threadid(void)
|
|---|
| 293 | {
|
|---|
| 294 | dprintf2(("CRTDLL: __threadid\n"));
|
|---|
| 295 | return GetCurrentThreadId();
|
|---|
| 296 | }
|
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 | /*********************************************************************
|
|---|
| 300 | * _beginthread (CRTDLL.46)
|
|---|
| 301 | */
|
|---|
| 302 | int CDECL CRTDLL__beginthread (void (*start)(void *arg), void *stack, unsigned stack_size,
|
|---|
| 303 | void *arg_list)
|
|---|
| 304 | {
|
|---|
| 305 | dprintf(("CRTDLL: _beginthread\n"));
|
|---|
| 306 | /*
|
|---|
| 307 | ULONG rc;
|
|---|
| 308 | TID tid;
|
|---|
| 309 | struct _thread *tp;
|
|---|
| 310 | tp = __alloc_thread ();
|
|---|
| 311 | if (tp == NULL)
|
|---|
| 312 | {
|
|---|
| 313 | errno = ENOMEM;
|
|---|
| 314 | return -1;
|
|---|
| 315 | }
|
|---|
| 316 | tp->_th_start = start;
|
|---|
| 317 | tp->_th_arg = arg_list;
|
|---|
| 318 | rc = DosCreateThread (&tid, (PFNTHREAD)start_thread, (ULONG)tp,
|
|---|
| 319 | 3, stack_size);
|
|---|
| 320 | if (rc != 0)
|
|---|
| 321 | {
|
|---|
| 322 | if (rc == ERROR_NOT_ENOUGH_MEMORY)
|
|---|
| 323 | errno = ENOMEM;
|
|---|
| 324 | else if (rc == ERROR_MAX_THRDS_REACHED)
|
|---|
| 325 | errno = EAGAIN;
|
|---|
| 326 | else
|
|---|
| 327 | errno = EINVAL;
|
|---|
| 328 | DosFreeMem (tp);
|
|---|
| 329 | return -1;
|
|---|
| 330 | }
|
|---|
| 331 | if (tid > MAX_THREADS)
|
|---|
| 332 | {
|
|---|
| 333 | DosKillThread (tid);
|
|---|
| 334 | errno = EAGAIN;
|
|---|
| 335 | DosFreeMem (tp);
|
|---|
| 336 | return -1;
|
|---|
| 337 | }
|
|---|
| 338 | if (__newthread (tid) != 0)
|
|---|
| 339 | {
|
|---|
| 340 | DosKillThread (tid);
|
|---|
| 341 | DosFreeMem (tp);
|
|---|
| 342 | return -1;
|
|---|
| 343 | }
|
|---|
| 344 | _thread_tab[tid] = tp;
|
|---|
| 345 | rc = DosResumeThread (tid);
|
|---|
| 346 | if (rc != 0)
|
|---|
| 347 | {
|
|---|
| 348 | errno = ESRCH;
|
|---|
| 349 | DosFreeMem (tp);
|
|---|
| 350 | return -1;
|
|---|
| 351 | }
|
|---|
| 352 | return tid;
|
|---|
| 353 | */
|
|---|
| 354 | return 0;
|
|---|
| 355 | }
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 | /*********************************************************************
|
|---|
| 359 | * CRTDLL__cgets (CRTDLL.50)
|
|---|
| 360 | */
|
|---|
| 361 | char * CDECL CRTDLL__cgets( char *s )
|
|---|
| 362 | {
|
|---|
| 363 | dprintf2(("CRTDLL: _cgets\n"));
|
|---|
| 364 | return (_cgets(s));
|
|---|
| 365 | }
|
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 | /*********************************************************************
|
|---|
| 369 | * CRTDLL__chmod (CRTDLL.54)
|
|---|
| 370 | */
|
|---|
| 371 | int CDECL CRTDLL__chmod( const char *s, int i)
|
|---|
| 372 | {
|
|---|
| 373 | dprintf2(("CRTDLL: _chmod\n"));
|
|---|
| 374 | return (_chmod(s, i));
|
|---|
| 375 | }
|
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 | /*********************************************************************
|
|---|
| 379 | * CRTDLL__chsize (CRTDLL.55)
|
|---|
| 380 | */
|
|---|
| 381 | int CDECL CRTDLL__chsize( int i, long l )
|
|---|
| 382 | {
|
|---|
| 383 | dprintf2(("CRTDLL: _chsize\n"));
|
|---|
| 384 | return (_chsize(i, l));
|
|---|
| 385 | }
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 | /*********************************************************************
|
|---|
| 389 | * CRTDLL__clearfp (CRTDLL.56)
|
|---|
| 390 | */
|
|---|
| 391 | unsigned int CDECL CRTDLL__clearfp( void )
|
|---|
| 392 | {
|
|---|
| 393 | dprintf2(("CRTDLL: _clearfp\n"));
|
|---|
| 394 | return (_clear87());
|
|---|
| 395 | }
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 | /*********************************************************************
|
|---|
| 399 | * CRTDLL__control87 (CRTDLL.60)
|
|---|
| 400 | */
|
|---|
| 401 | unsigned CDECL CRTDLL__control87(unsigned i1,unsigned i2)
|
|---|
| 402 | {
|
|---|
| 403 | dprintf2(("CRTDLL: _control87\n"));
|
|---|
| 404 | return (_control87(i1, i2));
|
|---|
| 405 | }
|
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 | /*********************************************************************
|
|---|
| 409 | * CRTDLL__controlfp (CRTDLL.61)
|
|---|
| 410 | */
|
|---|
| 411 | unsigned CDECL CRTDLL__controlfp(unsigned i1,unsigned i2)
|
|---|
| 412 | {
|
|---|
| 413 | dprintf2(("CRTDLL: _controlfp\n"));
|
|---|
| 414 | return (_control87(i1, i2));
|
|---|
| 415 | }
|
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 | /*********************************************************************
|
|---|
| 419 | * _cprintf (CRTDLL.63)
|
|---|
| 420 | */
|
|---|
| 421 | INT CDECL CRTDLL__cprintf( char *fmt, va_list arg )
|
|---|
| 422 | {
|
|---|
| 423 | dprintf2(("CRTDLL: _cprintf.\n"));
|
|---|
| 424 | return (_cprintf(fmt, arg));
|
|---|
| 425 | }
|
|---|
| 426 |
|
|---|
| 427 |
|
|---|
| 428 | /*********************************************************************
|
|---|
| 429 | * CRTDLL__cputs (CRTDLL.65)
|
|---|
| 430 | */
|
|---|
| 431 | INT CDECL CRTDLL__cputs( char * s )
|
|---|
| 432 | {
|
|---|
| 433 | dprintf2(("CRTDLL: _cputs\n"));
|
|---|
| 434 | return (_cputs(s));
|
|---|
| 435 | }
|
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 | /*********************************************************************
|
|---|
| 439 | * _cscanf (CRTDLL.67)
|
|---|
| 440 | */
|
|---|
| 441 | INT CDECL CRTDLL__cscanf( char *s, va_list arg )
|
|---|
| 442 | {
|
|---|
| 443 | dprintf(("CRTDLL: _cscanf\n"));
|
|---|
| 444 | return (_cscanf(s, arg));
|
|---|
| 445 | }
|
|---|
| 446 |
|
|---|
| 447 |
|
|---|
| 448 | /*********************************************************************
|
|---|
| 449 | * CRTDLL__cwait (CRTDLL.69)
|
|---|
| 450 | */
|
|---|
| 451 | int CDECL CRTDLL__cwait( int *status, int process_id, int action_code )
|
|---|
| 452 | {
|
|---|
| 453 | dprintf2(("CRTDLL: _cwait\n"));
|
|---|
| 454 | return (_cwait(status, process_id, action_code));
|
|---|
| 455 | }
|
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 | /*********************************************************************
|
|---|
| 459 | * CRTDLL__dup (CRTDLL.71)
|
|---|
| 460 | */
|
|---|
| 461 | int CDECL CRTDLL__dup(int handle)
|
|---|
| 462 | {
|
|---|
| 463 | dprintf2(("CRTDLL: _dup\n"));
|
|---|
| 464 | return (_dup(handle));
|
|---|
| 465 | }
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 | /*********************************************************************
|
|---|
| 469 | * CRTDLL__dup2 (CRTDLL.72)
|
|---|
| 470 | */
|
|---|
| 471 | int CDECL CRTDLL__dup2(int handle1,int handle2)
|
|---|
| 472 | {
|
|---|
| 473 | dprintf2(("CRTDLL: _dup2\n"));
|
|---|
| 474 | return (_dup2(handle1, handle2));
|
|---|
| 475 | }
|
|---|
| 476 |
|
|---|
| 477 |
|
|---|
| 478 | /*********************************************************************
|
|---|
| 479 | * CRTDLL__ecvt (CRTDLL.73)
|
|---|
| 480 | */
|
|---|
| 481 | char * CDECL CRTDLL__ecvt( double val, int ndig, int *dec, int *sign )
|
|---|
| 482 | {
|
|---|
| 483 | dprintf2(("CRTDLL: _ecvt\n"));
|
|---|
| 484 | return (_ecvt(val, ndig, dec, sign));
|
|---|
| 485 | }
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 | /*********************************************************************
|
|---|
| 489 | * CRTDLL__endthread (CRTDLL.74)
|
|---|
| 490 | */
|
|---|
| 491 | void CDECL CRTDLL__endthread(void)
|
|---|
| 492 | {
|
|---|
| 493 | dprintf2(("CRTDLL: _endthread\n"));
|
|---|
| 494 | _endthread ();
|
|---|
| 495 | }
|
|---|
| 496 |
|
|---|
| 497 |
|
|---|
| 498 | /*********************************************************************
|
|---|
| 499 | * _execl (CRTDLL.79)
|
|---|
| 500 | */
|
|---|
| 501 | int CDECL CRTDLL__execl(char* szPath, char* szArgv0, va_list arg)
|
|---|
| 502 | {
|
|---|
| 503 | dprintf2(("CRTDLL: _execl\n"));
|
|---|
| 504 | return (_execl(szPath, szArgv0, arg));
|
|---|
| 505 | }
|
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 | /*********************************************************************
|
|---|
| 509 | * _execle (CRTDLL.80)
|
|---|
| 510 | */
|
|---|
| 511 | int CDECL CRTDLL__execle(char *path, char *szArgv0, va_list arg)
|
|---|
| 512 | {
|
|---|
| 513 | dprintf2(("CRTDLL: _execle\n"));
|
|---|
| 514 | return (_execle(path, szArgv0, arg));
|
|---|
| 515 | }
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 | /*********************************************************************
|
|---|
| 519 | * CRTDLL__execlp (CRTDLL.81)
|
|---|
| 520 | */
|
|---|
| 521 | int CDECL CRTDLL__execlp( char *szPath, char *szArgv0, va_list arg)
|
|---|
| 522 | {
|
|---|
| 523 | dprintf2(("CRTDLL: _execlp\n"));
|
|---|
| 524 | return (_execlp(szPath, szArgv0, arg));
|
|---|
| 525 | }
|
|---|
| 526 |
|
|---|
| 527 |
|
|---|
| 528 | /*********************************************************************
|
|---|
| 529 | * CRTDLL__execlpe (CRTDLL.82)
|
|---|
| 530 | */
|
|---|
| 531 | int CDECL CRTDLL__execlpe( char *path, char *szArgv0, va_list arg)
|
|---|
| 532 | {
|
|---|
| 533 | dprintf2(("CRTDLL: _execlpe\n"));
|
|---|
| 534 | return (_execlpe(path, szArgv0, arg));
|
|---|
| 535 | }
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 | /*********************************************************************
|
|---|
| 539 | * CRTDLL__execv (CRTDLL.83)
|
|---|
| 540 | */
|
|---|
| 541 | int CDECL CRTDLL__execv( char *s1, char **s2)
|
|---|
| 542 | {
|
|---|
| 543 | dprintf2(("CRTDLL: _execv\n"));
|
|---|
| 544 | return (_execv(s1, s2));
|
|---|
| 545 | }
|
|---|
| 546 |
|
|---|
| 547 |
|
|---|
| 548 | /*********************************************************************
|
|---|
| 549 | * CRTDLL__execve (CRTDLL.84)
|
|---|
| 550 | */
|
|---|
| 551 | int CDECL CRTDLL__execve( char *s1, char **s2, char **s3)
|
|---|
| 552 | {
|
|---|
| 553 | dprintf2(("CRTDLL: _execve\n"));
|
|---|
| 554 | return (_execve(s1, s2, s3));
|
|---|
| 555 | }
|
|---|
| 556 |
|
|---|
| 557 |
|
|---|
| 558 | /*********************************************************************
|
|---|
| 559 | * CRTDLL__execvp (CRTDLL.85)
|
|---|
| 560 | */
|
|---|
| 561 | int CDECL CRTDLL__execvp( char *s1, char **s2)
|
|---|
| 562 | {
|
|---|
| 563 | dprintf2(("CRTDLL: _execvp\n"));
|
|---|
| 564 | return (_execvp(s1, s2));
|
|---|
| 565 | }
|
|---|
| 566 |
|
|---|
| 567 |
|
|---|
| 568 | /*********************************************************************
|
|---|
| 569 | * CRTDLL__execvpe (CRTDLL.86)
|
|---|
| 570 | */
|
|---|
| 571 | int CDECL CRTDLL__execvpe( char *s1, char **s2, char **s3)
|
|---|
| 572 | {
|
|---|
| 573 | dprintf2(("CRTDLL: _execvpe\n"));
|
|---|
| 574 | return (_execvpe(s1, s2, s3));
|
|---|
| 575 | }
|
|---|
| 576 |
|
|---|
| 577 |
|
|---|
| 578 | /*********************************************************************
|
|---|
| 579 | * _fcvt (CRTDLL.90)
|
|---|
| 580 | */
|
|---|
| 581 | char * CDECL CRTDLL__fcvt( double val, int ndig, int *dec, int *sign )
|
|---|
| 582 | {
|
|---|
| 583 | dprintf2(("CRTDLL: _fcvt\n"));
|
|---|
| 584 | return (_fcvt(val, ndig, dec, sign));
|
|---|
| 585 | }
|
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 | /*********************************************************************
|
|---|
| 589 | * CRTDLL__filelength (CRTDLL.96)
|
|---|
| 590 | */
|
|---|
| 591 | long CDECL CRTDLL__filelength( int i )
|
|---|
| 592 | {
|
|---|
| 593 | dprintf2(("CRTDLL: _filelength\n"));
|
|---|
| 594 | return (_filelength(i));
|
|---|
| 595 | }
|
|---|
| 596 |
|
|---|
| 597 |
|
|---|
| 598 | /*********************************************************************
|
|---|
| 599 | * _ftime (CRTDLL.112)
|
|---|
| 600 | */
|
|---|
| 601 | void CDECL CRTDLL__ftime( struct timeb *timebuf )
|
|---|
| 602 | {
|
|---|
| 603 | dprintf(("CRTDLL: _ftime\n"));
|
|---|
| 604 | _ftime(timebuf);
|
|---|
| 605 | }
|
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 | /*********************************************************************
|
|---|
| 609 | * _ftol (CRTDLL.113)
|
|---|
| 610 | */
|
|---|
| 611 | LONG CDECL CRTDLL__ftol(void)
|
|---|
| 612 | {
|
|---|
| 613 | /* don't just do DO_FPU("fistp",retval), because the rounding
|
|---|
| 614 | * mode must also be set to "round towards zero"... */
|
|---|
| 615 | double fl;
|
|---|
| 616 | POP_FPU(fl);
|
|---|
| 617 | return (LONG)fl;
|
|---|
| 618 | }
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 | /*********************************************************************
|
|---|
| 622 | * _gcvt (CRTDLL.116)
|
|---|
| 623 | */
|
|---|
| 624 | char * CDECL CRTDLL__gcvt( double val, int ndig, char *buf )
|
|---|
| 625 | {
|
|---|
| 626 | dprintf2(("CRTDLL: _gcvt\n"));
|
|---|
| 627 | return (_gcvt(val, ndig, buf));
|
|---|
| 628 | }
|
|---|
| 629 |
|
|---|
| 630 |
|
|---|
| 631 | /*********************************************************************
|
|---|
| 632 | * _getch (CRTDLL.118)
|
|---|
| 633 | */
|
|---|
| 634 | int CDECL CRTDLL__getch(void)
|
|---|
| 635 | {
|
|---|
| 636 | dprintf2(("CRTDLL: _getch\n"));
|
|---|
| 637 | return (_getch());
|
|---|
| 638 | }
|
|---|
| 639 |
|
|---|
| 640 |
|
|---|
| 641 | /*********************************************************************
|
|---|
| 642 | * _getche (CRTDLL.119)
|
|---|
| 643 | */
|
|---|
| 644 | int CDECL CRTDLL__getche(void)
|
|---|
| 645 | {
|
|---|
| 646 | dprintf2(("CRTDLL: _getche\n"));
|
|---|
| 647 | return (_getche());
|
|---|
| 648 | }
|
|---|
| 649 |
|
|---|
| 650 |
|
|---|
| 651 | /*********************************************************************
|
|---|
| 652 | * _getdrives (CRTDLL.125)
|
|---|
| 653 | */
|
|---|
| 654 | unsigned long CDECL CRTDLL__getdrives(void)
|
|---|
| 655 | {
|
|---|
| 656 | dprintf2(("CRTDLL: _getdrives\n"));
|
|---|
| 657 | return GetLogicalDrives();
|
|---|
| 658 | }
|
|---|
| 659 |
|
|---|
| 660 |
|
|---|
| 661 | /*********************************************************************
|
|---|
| 662 | * _getpid (CRTDLL.126)
|
|---|
| 663 | */
|
|---|
| 664 | int CDECL CRTDLL__getpid( void )
|
|---|
| 665 | {
|
|---|
| 666 | dprintf2(("CRTDLL: _getpid\n"));
|
|---|
| 667 | return (_getpid());
|
|---|
| 668 | }
|
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 | /*********************************************************************
|
|---|
| 672 | * _getsystime (CRTDLL.127)
|
|---|
| 673 | */
|
|---|
| 674 | unsigned int CDECL CRTDLL__getsystime(struct tm *tp)
|
|---|
| 675 | {
|
|---|
| 676 | SYSTEMTIME systemtime;
|
|---|
| 677 |
|
|---|
| 678 | GetLocalTime(&systemtime);
|
|---|
| 679 |
|
|---|
| 680 | tp->tm_isdst = -1; // FIXME: I don't know is there a correct value
|
|---|
| 681 | tp->tm_sec = systemtime.wSecond;
|
|---|
| 682 | tp->tm_min = systemtime.wMinute;
|
|---|
| 683 | tp->tm_hour = systemtime.wHour;
|
|---|
| 684 | tp->tm_mday = systemtime.wDay;
|
|---|
| 685 | tp->tm_mon = systemtime.wMonth - 1;
|
|---|
| 686 | // struct tm has time from 1900 -> 2000 = 100
|
|---|
| 687 | tp->tm_year = systemtime.wYear - 1900;
|
|---|
| 688 | tp->tm_wday = systemtime.wDayOfWeek;
|
|---|
| 689 |
|
|---|
| 690 | mktime(tp);
|
|---|
| 691 |
|
|---|
| 692 | return (0); // FIXME: What Can we return??
|
|---|
| 693 | }
|
|---|
| 694 |
|
|---|
| 695 |
|
|---|
| 696 | /*********************************************************************
|
|---|
| 697 | * _getw (CRTDLL.128)
|
|---|
| 698 | */
|
|---|
| 699 | int CDECL CRTDLL__getw( FILE *stream )
|
|---|
| 700 | {
|
|---|
| 701 | dprintf2(("CRTDLL: _getw\n"));
|
|---|
| 702 | int x;
|
|---|
| 703 | return (fread (&x, sizeof (x), 1, stream) == 1 ? x : EOF);
|
|---|
| 704 | }
|
|---|
| 705 |
|
|---|
| 706 |
|
|---|
| 707 | /*********************************************************************
|
|---|
| 708 | * _hypot (CRTDLL.134)
|
|---|
| 709 | */
|
|---|
| 710 | double CDECL CRTDLL__hypot(double x1, double x2)
|
|---|
| 711 | {
|
|---|
| 712 | dprintf2(("CRTDLL: _hypot\n"));
|
|---|
| 713 | return (_hypot(x1, x2));
|
|---|
| 714 | }
|
|---|
| 715 |
|
|---|
| 716 |
|
|---|
| 717 | /*********************************************************************
|
|---|
| 718 | * _itoa (CRTDLL.165)
|
|---|
| 719 | */
|
|---|
| 720 | char * CDECL CRTDLL__itoa(int i, char *s, int r)
|
|---|
| 721 | {
|
|---|
| 722 | dprintf2(("CRTDLL: _itoa(%08xh, %08xh, %08xh)\n",
|
|---|
| 723 | i,
|
|---|
| 724 | s,
|
|---|
| 725 | r));
|
|---|
| 726 |
|
|---|
| 727 | return (itoa(i,s,r));
|
|---|
| 728 | }
|
|---|
| 729 |
|
|---|
| 730 | /*********************************************************************
|
|---|
| 731 | * _j0 (CRTDLL.166)
|
|---|
| 732 | */
|
|---|
| 733 | double CDECL CRTDLL__j0(double x)
|
|---|
| 734 | {
|
|---|
| 735 | dprintf2(("CRTDLL: _j0\n"));
|
|---|
| 736 | return (_j0(x));
|
|---|
| 737 | }
|
|---|
| 738 |
|
|---|
| 739 |
|
|---|
| 740 | /*********************************************************************
|
|---|
| 741 | * _j1 (CRTDLL.167)
|
|---|
| 742 | */
|
|---|
| 743 | double CDECL CRTDLL__j1(double x)
|
|---|
| 744 | {
|
|---|
| 745 | dprintf2(("CRTDLL: _j1\n"));
|
|---|
| 746 | return (_j1(x));}
|
|---|
| 747 |
|
|---|
| 748 |
|
|---|
| 749 | /*********************************************************************
|
|---|
| 750 | * _jn (CRTDLL.168)
|
|---|
| 751 | */
|
|---|
| 752 | double CDECL CRTDLL__jn(int i, double x)
|
|---|
| 753 | {
|
|---|
| 754 | dprintf2(("CRTDLL: _jn\n"));
|
|---|
| 755 | return (_jn(i, x));
|
|---|
| 756 | }
|
|---|
| 757 |
|
|---|
| 758 |
|
|---|
| 759 | /*********************************************************************
|
|---|
| 760 | * _kbhit (CRTDLL.169)
|
|---|
| 761 | */
|
|---|
| 762 | int CDECL CRTDLL__kbhit( void )
|
|---|
| 763 | {
|
|---|
| 764 | dprintf2(("CRTDLL: _kbhit\n"));
|
|---|
| 765 | return (_kbhit());
|
|---|
| 766 | }
|
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 | /*********************************************************************
|
|---|
| 770 | * _ltoa (CRTDLL.179)
|
|---|
| 771 | */
|
|---|
| 772 | LPSTR CDECL CRTDLL__ltoa(long x,LPSTR buf,INT radix)
|
|---|
| 773 | {
|
|---|
| 774 | return ltoa(x,buf,radix);
|
|---|
| 775 | }
|
|---|
| 776 |
|
|---|
| 777 |
|
|---|
| 778 | /*********************************************************************
|
|---|
| 779 | * _matherr (CRTDLL.181)
|
|---|
| 780 | */
|
|---|
| 781 | double CDECL CRTDLL__matherr( struct exception * excep )
|
|---|
| 782 | {
|
|---|
| 783 | dprintf2(("CRTDLL: _matherr\n"));
|
|---|
| 784 | return (_matherr(excep));
|
|---|
| 785 | }
|
|---|
| 786 |
|
|---|
| 787 |
|
|---|
| 788 | /*********************************************************************
|
|---|
| 789 | * _mktemp (CRTDLL.233)
|
|---|
| 790 | */
|
|---|
| 791 | char * CDECL CRTDLL__mktemp( char *string )
|
|---|
| 792 | {
|
|---|
| 793 | dprintf2(("CRTDLL: _mktemp\n"));
|
|---|
| 794 | int pid, n, saved_errno;
|
|---|
| 795 | char *s;
|
|---|
| 796 |
|
|---|
| 797 | pid = _getpid ();
|
|---|
| 798 | s = strchr (string, 0);
|
|---|
| 799 | n = 0;
|
|---|
| 800 | while (s != string && s[-1] == 'X')
|
|---|
| 801 | {
|
|---|
| 802 | --s; ++n;
|
|---|
| 803 | *s = (char)(pid % 10) + '0';
|
|---|
| 804 | pid /= 10;
|
|---|
| 805 | }
|
|---|
| 806 | if (n < 2)
|
|---|
| 807 | return NULL;
|
|---|
| 808 | *s = 'a'; saved_errno = errno;
|
|---|
| 809 | for (;;)
|
|---|
| 810 | {
|
|---|
| 811 | errno = 0;
|
|---|
| 812 | if (_access (string, 0) != 0 && errno == ENOENT)
|
|---|
| 813 | {
|
|---|
| 814 | errno = saved_errno;
|
|---|
| 815 | return string;
|
|---|
| 816 | }
|
|---|
| 817 | if (*s == 'z')
|
|---|
| 818 | {
|
|---|
| 819 | errno = saved_errno;
|
|---|
| 820 | return NULL;
|
|---|
| 821 | }
|
|---|
| 822 | ++*s;
|
|---|
| 823 | }
|
|---|
| 824 | }
|
|---|
| 825 |
|
|---|
| 826 |
|
|---|
| 827 | /*********************************************************************
|
|---|
| 828 | * _purecall (CRTDLL.249)
|
|---|
| 829 | */
|
|---|
| 830 | void CDECL CRTDLL__purecall(void)
|
|---|
| 831 | {
|
|---|
| 832 | dprintf2(("CRTDLL: _purecall\n"));
|
|---|
| 833 | }
|
|---|
| 834 |
|
|---|
| 835 |
|
|---|
| 836 | /*********************************************************************
|
|---|
| 837 | * _putenv (CRTDLL.251)
|
|---|
| 838 | */
|
|---|
| 839 | INT CDECL CRTDLL__putenv(const char *s)
|
|---|
| 840 | {
|
|---|
| 841 | dprintf2(("CRTDLL: _putenv\n"));
|
|---|
| 842 | return (_putenv(s));
|
|---|
| 843 | }
|
|---|
| 844 |
|
|---|
| 845 |
|
|---|
| 846 | /*********************************************************************
|
|---|
| 847 | * _putw (CRTDLL.252)
|
|---|
| 848 | */
|
|---|
| 849 | INT CDECL CRTDLL__putw( int x, FILE *stream )
|
|---|
| 850 | {
|
|---|
| 851 | dprintf2(("CRTDLL: _putw\n"));
|
|---|
| 852 | return (fwrite (&x, sizeof (x), 1, stream) == 1 ? x : EOF);
|
|---|
| 853 | }
|
|---|
| 854 |
|
|---|
| 855 |
|
|---|
| 856 | /*********************************************************************
|
|---|
| 857 | * _rmtmp (CRTDLL.256)
|
|---|
| 858 | */
|
|---|
| 859 | INT CDECL CRTDLL__rmtmp(void)
|
|---|
| 860 | {
|
|---|
| 861 | dprintf2(("CRTDLL: _rmtmp\n"));
|
|---|
| 862 | return(_rmtmp());
|
|---|
| 863 | }
|
|---|
| 864 |
|
|---|
| 865 |
|
|---|
| 866 | /*********************************************************************
|
|---|
| 867 | * CRTDLL__searchenv (CRTDLL.260)
|
|---|
| 868 | */
|
|---|
| 869 | void CDECL CRTDLL__searchenv(char *file, char *var,char *path )
|
|---|
| 870 | {
|
|---|
| 871 | dprintf2(("CRTDLL: _searchenv\n"));
|
|---|
| 872 | _searchenv(file, var, path);
|
|---|
| 873 | }
|
|---|
| 874 |
|
|---|
| 875 |
|
|---|
| 876 | /*********************************************************************
|
|---|
| 877 | * CRTDLL__seterrormode (CRTDLL.261)
|
|---|
| 878 | */
|
|---|
| 879 | void CDECL CRTDLL__seterrormode(int uMode)
|
|---|
| 880 | {
|
|---|
| 881 | dprintf2(("CRTDLL: _seterrormode\n"));
|
|---|
| 882 | SetErrorMode(uMode);
|
|---|
| 883 | return;
|
|---|
| 884 | }
|
|---|
| 885 |
|
|---|
| 886 |
|
|---|
| 887 | /*********************************************************************
|
|---|
| 888 | * CRTDLL__setjmp (CRTDLL.262)
|
|---|
| 889 | */
|
|---|
| 890 | int CDECL CRTDLL__setjmp( jmp_buf env )
|
|---|
| 891 | {
|
|---|
| 892 | //TODO:
|
|---|
| 893 | dprintf2(("CRTDLL: _setjmp -> setjmp (NOT IDENTICAL!!!)\n"));
|
|---|
| 894 | return(setjmp( env));
|
|---|
| 895 | }
|
|---|
| 896 |
|
|---|
| 897 |
|
|---|
| 898 | /*********************************************************************
|
|---|
| 899 | * _setsystime (CRTDLL.264)
|
|---|
| 900 | */
|
|---|
| 901 | unsigned int CDECL CRTDLL__setsystime(struct tm *tp, unsigned int ms)
|
|---|
| 902 | {
|
|---|
| 903 | SYSTEMTIME systemtime;
|
|---|
| 904 |
|
|---|
| 905 | mktime(tp);
|
|---|
| 906 |
|
|---|
| 907 | systemtime.wMilliseconds = ms;
|
|---|
| 908 | systemtime.wSecond = tp->tm_sec;
|
|---|
| 909 | systemtime.wMinute = tp->tm_min;
|
|---|
| 910 | systemtime.wHour = tp->tm_hour;
|
|---|
| 911 | systemtime.wDay = tp->tm_mday;
|
|---|
| 912 | systemtime.wMonth = tp->tm_mon + 1;
|
|---|
| 913 | // struct tm has time from 1900 -> 2000 = 100
|
|---|
| 914 | systemtime.wYear = tp->tm_year + 1900;
|
|---|
| 915 |
|
|---|
| 916 | if (SetLocalTime(&systemtime) != 0) return GetLastError();
|
|---|
| 917 |
|
|---|
| 918 | return (0);
|
|---|
| 919 | }
|
|---|
| 920 |
|
|---|
| 921 |
|
|---|
| 922 | /*********************************************************************
|
|---|
| 923 | * _sopen (CRTDLL.268)
|
|---|
| 924 | */
|
|---|
| 925 | int CDECL CRTDLL__sopen( const char *s, int i1, int i2, va_list arg )
|
|---|
| 926 | {
|
|---|
| 927 | dprintf(("CRTDLL: _sopen\n"));
|
|---|
| 928 | return (_sopen(s, i1, i2, arg));
|
|---|
| 929 | }
|
|---|
| 930 |
|
|---|
| 931 |
|
|---|
| 932 | /*********************************************************************
|
|---|
| 933 | * CRTDLL__spawnl (CRTDLL.269)
|
|---|
| 934 | */
|
|---|
| 935 | int CDECL CRTDLL__spawnl(int nMode, char* szPath, char* szArgv0, va_list arg)
|
|---|
| 936 | {
|
|---|
| 937 | dprintf2(("CRTDLL: _spawnl\n"));
|
|---|
| 938 | return (_spawnl(nMode, szPath, szArgv0, arg));
|
|---|
| 939 | }
|
|---|
| 940 |
|
|---|
| 941 |
|
|---|
| 942 | /*********************************************************************
|
|---|
| 943 | * CRTDLL__spawnle (CRTDLL.270)
|
|---|
| 944 | */
|
|---|
| 945 | int CDECL CRTDLL__spawnle( int mode, char *path, char **szArgv0, va_list arg )
|
|---|
| 946 | {
|
|---|
| 947 | dprintf2(("CRTDLL: _spawnle\n"));
|
|---|
| 948 | return (_spawnle(mode, path, (char*)szArgv0, arg));
|
|---|
| 949 | }
|
|---|
| 950 |
|
|---|
| 951 |
|
|---|
| 952 | /*********************************************************************
|
|---|
| 953 | * CRTDLL__spawnlp (CRTDLL.271)
|
|---|
| 954 | */
|
|---|
| 955 | int CDECL CRTDLL__spawnlp(int nMode, char* szPath, char* szArgv0, va_list arg)
|
|---|
| 956 | {
|
|---|
| 957 | dprintf2(("CRTDLL: _spawnlp\n"));
|
|---|
| 958 | return (_spawnlp(nMode, szPath, szArgv0, arg));
|
|---|
| 959 | }
|
|---|
| 960 |
|
|---|
| 961 |
|
|---|
| 962 | /*********************************************************************
|
|---|
| 963 | * CRTDLL__spawnlpe (CRTDLL.272)
|
|---|
| 964 | */
|
|---|
| 965 | int CDECL CRTDLL__spawnlpe( int mode, char *path, char *szArgv0, va_list arg )
|
|---|
| 966 | {
|
|---|
| 967 | dprintf2(("CRTDLL: _spawnlpe\n"));
|
|---|
| 968 | return (_spawnlpe(mode, path, szArgv0, arg));
|
|---|
| 969 | }
|
|---|
| 970 |
|
|---|
| 971 |
|
|---|
| 972 | /*********************************************************************
|
|---|
| 973 | * CRTDLL__spawnv (CRTDLL.273)
|
|---|
| 974 | */
|
|---|
| 975 | int CDECL CRTDLL__spawnv( int i, char *s1, char ** s2 )
|
|---|
| 976 | {
|
|---|
| 977 | dprintf2(("CRTDLL: _spawnv\n"));
|
|---|
| 978 | return (_spawnv(i, s1, s2));
|
|---|
| 979 | }
|
|---|
| 980 |
|
|---|
| 981 |
|
|---|
| 982 | /*********************************************************************
|
|---|
| 983 | * CRTDLL__spawnvp (CRTDLL.275)
|
|---|
| 984 | */
|
|---|
| 985 | int CDECL CRTDLL__spawnvp( int i, char *s1, char ** s2 )
|
|---|
| 986 | {
|
|---|
| 987 | dprintf2(("CRTDLL: _spawnvp\n"));
|
|---|
| 988 | return (_spawnvp(i, s1, s2));
|
|---|
| 989 | }
|
|---|
| 990 |
|
|---|
| 991 | /*********************************************************************
|
|---|
| 992 | * CRTDLL__spawnv (CRTDLL.276)
|
|---|
| 993 | */
|
|---|
| 994 | int CDECL CRTDLL__spawnvpe( int i, char *s1, char ** s2, char ** s3 )
|
|---|
| 995 | {
|
|---|
| 996 | dprintf2(("CRTDLL: _spawnvpe\n"));
|
|---|
| 997 | return (_spawnvpe(i, s1, s2, s3));
|
|---|
| 998 | }
|
|---|
| 999 |
|
|---|
| 1000 |
|
|---|
| 1001 | /*********************************************************************
|
|---|
| 1002 | * CRTDLL__statusfp (CRTDLL.279)
|
|---|
| 1003 | */
|
|---|
| 1004 | unsigned int CDECL CRTDLL__statusfp( void )
|
|---|
| 1005 | {
|
|---|
| 1006 | dprintf2(("CRTDLL: _statusfp\n"));
|
|---|
| 1007 | return (_status87());
|
|---|
| 1008 | }
|
|---|
| 1009 |
|
|---|
| 1010 |
|
|---|
| 1011 | /*********************************************************************
|
|---|
| 1012 | * _ultoa (CRTDLL.309)
|
|---|
| 1013 | */
|
|---|
| 1014 | LPSTR CDECL CRTDLL__ultoa(long x,LPSTR buf,INT radix)
|
|---|
| 1015 | {
|
|---|
| 1016 | dprintf2(("CRTDLL: _ultoa\n"));
|
|---|
| 1017 | return _ultoa(x,buf,radix);
|
|---|
| 1018 | }
|
|---|
| 1019 |
|
|---|
| 1020 |
|
|---|
| 1021 | /*********************************************************************
|
|---|
| 1022 | * CRTDLL__ungetch (CRTDLL.311)
|
|---|
| 1023 | */
|
|---|
| 1024 | int CDECL CRTDLL__ungetch( int i )
|
|---|
| 1025 | {
|
|---|
| 1026 | dprintf2(("CRTDLL: _ungetch\n"));
|
|---|
| 1027 | return (_ungetch(i));
|
|---|
| 1028 | }
|
|---|
| 1029 |
|
|---|
| 1030 |
|
|---|
| 1031 | /*********************************************************************
|
|---|
| 1032 | * _utime (CRTDLL.314)
|
|---|
| 1033 | */
|
|---|
| 1034 | int CDECL CRTDLL__utime( char *path, struct utimbuf * times )
|
|---|
| 1035 | {
|
|---|
| 1036 | dprintf2(("CRTDLL: _utime\n"));
|
|---|
| 1037 | return (_utime(path, times));
|
|---|
| 1038 | }
|
|---|
| 1039 |
|
|---|
| 1040 |
|
|---|
| 1041 | /*********************************************************************
|
|---|
| 1042 | * _vsnprintf (CRTDLL.315)
|
|---|
| 1043 | */
|
|---|
| 1044 | int CDECL CRTDLL__vsnprintf( char *s, size_t bufsize, const char *format, va_list arg )
|
|---|
| 1045 | {
|
|---|
| 1046 | dprintf2(("CRTDLL: _vsnprintf(%08xh, %08xh, %08xh)\n",
|
|---|
| 1047 | s,
|
|---|
| 1048 | bufsize,
|
|---|
| 1049 | format));
|
|---|
| 1050 |
|
|---|
| 1051 | return wvsnprintfA(s, bufsize, format, arg);
|
|---|
| 1052 | }
|
|---|
| 1053 |
|
|---|
| 1054 |
|
|---|
| 1055 | /*********************************************************************
|
|---|
| 1056 | * _y0 (CRTDLL.332)
|
|---|
| 1057 | */
|
|---|
| 1058 | double CDECL CRTDLL__y0(double x)
|
|---|
| 1059 | {
|
|---|
| 1060 | dprintf2(("CRTDLL: _y0\n"));
|
|---|
| 1061 | return (_y0(x));
|
|---|
| 1062 | }
|
|---|
| 1063 |
|
|---|
| 1064 |
|
|---|
| 1065 | /*********************************************************************
|
|---|
| 1066 | * _y1 (CRTDLL.333)
|
|---|
| 1067 | */
|
|---|
| 1068 | double CDECL CRTDLL__y1(double x)
|
|---|
| 1069 | {
|
|---|
| 1070 | dprintf2(("CRTDLL: _y1\n"));
|
|---|
| 1071 | return (_y1(x));
|
|---|
| 1072 | }
|
|---|
| 1073 |
|
|---|
| 1074 |
|
|---|
| 1075 | /*********************************************************************
|
|---|
| 1076 | * _yn (CRTDLL.334)
|
|---|
| 1077 | */
|
|---|
| 1078 | double CDECL CRTDLL__yn(int i, double x)
|
|---|
| 1079 | {
|
|---|
| 1080 | dprintf2(("CRTDLL: _yn\n"));
|
|---|
| 1081 | return (_yn(i, x));
|
|---|
| 1082 | }
|
|---|
| 1083 |
|
|---|
| 1084 |
|
|---|
| 1085 | /*********************************************************************
|
|---|
| 1086 | * abs (CRTDLL.336)
|
|---|
| 1087 | */
|
|---|
| 1088 | double CDECL CRTDLL_abs(double d)
|
|---|
| 1089 | {
|
|---|
| 1090 | dprintf2(("CRTDLL: abs(%f)\n",
|
|---|
| 1091 | d));
|
|---|
| 1092 |
|
|---|
| 1093 | return (abs(d));
|
|---|
| 1094 | }
|
|---|
| 1095 |
|
|---|
| 1096 |
|
|---|
| 1097 | /*********************************************************************
|
|---|
| 1098 | * acos (CRTDLL.337)
|
|---|
| 1099 | */
|
|---|
| 1100 | double CDECL CRTDLL_acos( double x )
|
|---|
| 1101 | {
|
|---|
| 1102 | dprintf2(("CRTDLL: acos\n"));
|
|---|
| 1103 | return (acos(x));
|
|---|
| 1104 | }
|
|---|
| 1105 |
|
|---|
| 1106 |
|
|---|
| 1107 | /*********************************************************************
|
|---|
| 1108 | * asctime (CRTDLL.338)
|
|---|
| 1109 | */
|
|---|
| 1110 | char * CDECL CRTDLL_asctime( const struct tm *timeptr )
|
|---|
| 1111 | {
|
|---|
| 1112 | dprintf2(("CRTDLL: asctime\n"));
|
|---|
| 1113 | return (asctime(timeptr));
|
|---|
| 1114 | }
|
|---|
| 1115 |
|
|---|
| 1116 |
|
|---|
| 1117 | /*********************************************************************
|
|---|
| 1118 | * asin (CRTDLL.339)
|
|---|
| 1119 | */
|
|---|
| 1120 | double CDECL CRTDLL_asin( double x )
|
|---|
| 1121 | {
|
|---|
| 1122 | dprintf2(("CRTDLL: asin\n"));
|
|---|
| 1123 | return (asin(x));
|
|---|
| 1124 | }
|
|---|
| 1125 |
|
|---|
| 1126 |
|
|---|
| 1127 | /*********************************************************************
|
|---|
| 1128 | * atan (CRTDLL.340)
|
|---|
| 1129 | */
|
|---|
| 1130 | double CDECL CRTDLL_atan(double d)
|
|---|
| 1131 | {
|
|---|
| 1132 | dprintf2(("CRTDLL: atan(%f)\n",
|
|---|
| 1133 | d));
|
|---|
| 1134 |
|
|---|
| 1135 | return (atan(d));
|
|---|
| 1136 | }
|
|---|
| 1137 |
|
|---|
| 1138 |
|
|---|
| 1139 | /*********************************************************************
|
|---|
| 1140 | * atan2 (CRTDLL.341)
|
|---|
| 1141 | */
|
|---|
| 1142 | double CDECL CRTDLL_atan2( double y, double x )
|
|---|
| 1143 | {
|
|---|
| 1144 | dprintf2(("CRTDLL: atan2\n"));
|
|---|
| 1145 | return (atan2(y, x));
|
|---|
| 1146 | }
|
|---|
| 1147 |
|
|---|
| 1148 |
|
|---|
| 1149 | /*********************************************************************
|
|---|
| 1150 | * atof (CRTDLL.343)
|
|---|
| 1151 | */
|
|---|
| 1152 | double CDECL CRTDLL_atof( const char *nptr )
|
|---|
| 1153 | {
|
|---|
| 1154 | dprintf2(("CRTDLL: atof\n"));
|
|---|
| 1155 | return (atof(nptr));
|
|---|
| 1156 | }
|
|---|
| 1157 |
|
|---|
| 1158 |
|
|---|
| 1159 | /*********************************************************************
|
|---|
| 1160 | * atoi (CRTDLL.344)
|
|---|
| 1161 | */
|
|---|
| 1162 | int CDECL CRTDLL_atoi(LPSTR str)
|
|---|
| 1163 | {
|
|---|
| 1164 | dprintf2(("CRTDLL: atoi(%s)\n",
|
|---|
| 1165 | str));
|
|---|
| 1166 |
|
|---|
| 1167 | return (atoi(str));
|
|---|
| 1168 | }
|
|---|
| 1169 |
|
|---|
| 1170 |
|
|---|
| 1171 | /*********************************************************************
|
|---|
| 1172 | * atol (CRTDLL.345)
|
|---|
| 1173 | */
|
|---|
| 1174 | long CDECL CRTDLL_atol(LPSTR str)
|
|---|
| 1175 | {
|
|---|
| 1176 | dprintf2(("CRTDLL: atol(%s)\n",
|
|---|
| 1177 | str));
|
|---|
| 1178 |
|
|---|
| 1179 | return (atol(str));
|
|---|
| 1180 | }
|
|---|
| 1181 |
|
|---|
| 1182 |
|
|---|
| 1183 | /*********************************************************************
|
|---|
| 1184 | * bsearch (CRTDLL.346)
|
|---|
| 1185 | */
|
|---|
| 1186 | void *CDECL CRTDLL_bsearch (const void *key, const void *base, size_t num, size_t width,
|
|---|
| 1187 | int (* CDECL compare)(const void *key, const void *element))
|
|---|
| 1188 | {
|
|---|
| 1189 | int left, right, median, sign;
|
|---|
| 1190 | const void *element;
|
|---|
| 1191 |
|
|---|
| 1192 | if (width == 0)
|
|---|
| 1193 | return 0;
|
|---|
| 1194 | left = 1; right = num;
|
|---|
| 1195 | while (left <= right)
|
|---|
| 1196 | {
|
|---|
| 1197 | median = (left + right) / 2;
|
|---|
| 1198 | element = (void *)((char *)base + (median-1)*width);
|
|---|
| 1199 | sign = compare (key, element);
|
|---|
| 1200 | if (sign == 0)
|
|---|
| 1201 | return (void *)element;
|
|---|
| 1202 | if (sign > 0)
|
|---|
| 1203 | left = median + 1;
|
|---|
| 1204 | else
|
|---|
| 1205 | right = median - 1;
|
|---|
| 1206 | }
|
|---|
| 1207 | return 0;
|
|---|
| 1208 | }
|
|---|
| 1209 |
|
|---|
| 1210 |
|
|---|
| 1211 | /*********************************************************************
|
|---|
| 1212 | * ceil (CRTDLL.348)
|
|---|
| 1213 | */
|
|---|
| 1214 | double CDECL CRTDLL_ceil(double d)
|
|---|
| 1215 | {
|
|---|
| 1216 | dprintf2(("CRTDLL: ceil(%f)\n",
|
|---|
| 1217 | d));
|
|---|
| 1218 | return (ceil(d));
|
|---|
| 1219 | }
|
|---|
| 1220 |
|
|---|
| 1221 |
|
|---|
| 1222 | /*********************************************************************
|
|---|
| 1223 | * clock (CRTDLL.350)
|
|---|
| 1224 | */
|
|---|
| 1225 | clock_t CDECL CRTDLL_clock( void )
|
|---|
| 1226 | {
|
|---|
| 1227 | dprintf2(("CRTDLL: clock\n"));
|
|---|
| 1228 | return (clock());
|
|---|
| 1229 | }
|
|---|
| 1230 |
|
|---|
| 1231 |
|
|---|
| 1232 | /*********************************************************************
|
|---|
| 1233 | * cos (CRTDLL.351)
|
|---|
| 1234 | */
|
|---|
| 1235 | double CDECL CRTDLL_cos(double d)
|
|---|
| 1236 | {
|
|---|
| 1237 | dprintf2(("CRTDLL: cos(%f)\n",
|
|---|
| 1238 | d));
|
|---|
| 1239 |
|
|---|
| 1240 | return (cos(d));
|
|---|
| 1241 | }
|
|---|
| 1242 |
|
|---|
| 1243 |
|
|---|
| 1244 | /*********************************************************************
|
|---|
| 1245 | * cosh (CRTDLL.352)
|
|---|
| 1246 | */
|
|---|
| 1247 | double CDECL CRTDLL_cosh( double x )
|
|---|
| 1248 | {
|
|---|
| 1249 | dprintf2(("CRTDLL: cosh\n"));
|
|---|
| 1250 | return (cosh(x));
|
|---|
| 1251 | }
|
|---|
| 1252 |
|
|---|
| 1253 |
|
|---|
| 1254 | /*********************************************************************
|
|---|
| 1255 | * ctime (CRTDLL.353)
|
|---|
| 1256 | */
|
|---|
| 1257 | char * CDECL CRTDLL_ctime( const time_t *timer )
|
|---|
| 1258 | {
|
|---|
| 1259 | dprintf2(("CRTDLL: ctime\n"));
|
|---|
| 1260 | return (ctime(timer));
|
|---|
| 1261 | }
|
|---|
| 1262 |
|
|---|
| 1263 |
|
|---|
| 1264 | /*********************************************************************
|
|---|
| 1265 | * difftime (CRTDLL.354)
|
|---|
| 1266 | */
|
|---|
| 1267 | double CDECL CRTDLL_difftime( time_t t1, time_t t0 )
|
|---|
| 1268 | {
|
|---|
| 1269 | dprintf2(("CRTDLL: difftime\n"));
|
|---|
| 1270 | return (difftime(t1, t0));
|
|---|
| 1271 | }
|
|---|
| 1272 |
|
|---|
| 1273 |
|
|---|
| 1274 | /*********************************************************************
|
|---|
| 1275 | * div (CRTDLL.355)
|
|---|
| 1276 | */
|
|---|
| 1277 | ULONG CDECL CRTDLL_div( int number, int denom )
|
|---|
| 1278 | {
|
|---|
| 1279 | div_t divt;
|
|---|
| 1280 |
|
|---|
| 1281 | dprintf2(("CRTDLL: div\n"));
|
|---|
| 1282 | divt = (div(number, denom));
|
|---|
| 1283 | SetEDX(divt.rem); //NOTE: make sure the compiler doesn't overwrite edx!
|
|---|
| 1284 | return divt.quot;
|
|---|
| 1285 | }
|
|---|
| 1286 |
|
|---|
| 1287 |
|
|---|
| 1288 | /*********************************************************************
|
|---|
| 1289 | * exp (CRTDLL.357)
|
|---|
| 1290 | */
|
|---|
| 1291 | double CDECL CRTDLL_exp( double x )
|
|---|
| 1292 | {
|
|---|
| 1293 | dprintf2(("CRTDLL: exp\n"));
|
|---|
| 1294 | return (exp(x));
|
|---|
| 1295 | }
|
|---|
| 1296 |
|
|---|
| 1297 |
|
|---|
| 1298 | /*********************************************************************
|
|---|
| 1299 | * fabs (CRTDLL.358)
|
|---|
| 1300 | */
|
|---|
| 1301 | double CDECL CRTDLL_fabs(double d)
|
|---|
| 1302 | {
|
|---|
| 1303 | dprintf2(("CRTDLL: fabs(%f)\n",
|
|---|
| 1304 | d));
|
|---|
| 1305 |
|
|---|
| 1306 | return (fabs(d));
|
|---|
| 1307 | }
|
|---|
| 1308 |
|
|---|
| 1309 |
|
|---|
| 1310 | /*********************************************************************
|
|---|
| 1311 | * floor (CRTDLL.367)
|
|---|
| 1312 | */
|
|---|
| 1313 | double CDECL CRTDLL_floor(double d)
|
|---|
| 1314 | {
|
|---|
| 1315 | dprintf2(("CRTDLL: floor(%f)\n",
|
|---|
| 1316 | d));
|
|---|
| 1317 |
|
|---|
| 1318 | return (floor(d));
|
|---|
| 1319 | }
|
|---|
| 1320 |
|
|---|
| 1321 |
|
|---|
| 1322 | /*********************************************************************
|
|---|
| 1323 | * fmod (CRTDLL.368)
|
|---|
| 1324 | */
|
|---|
| 1325 | double CDECL CRTDLL_fmod(double x, double y )
|
|---|
| 1326 | {
|
|---|
| 1327 | dprintf2(("CRTDLL: fmod\n"));
|
|---|
| 1328 | return (fmod(x,y));
|
|---|
| 1329 | }
|
|---|
| 1330 |
|
|---|
| 1331 |
|
|---|
| 1332 | /*********************************************************************
|
|---|
| 1333 | * frexp (CRTDLL.377)
|
|---|
| 1334 | */
|
|---|
| 1335 | double CDECL CRTDLL_frexp( double value, int *exp )
|
|---|
| 1336 | {
|
|---|
| 1337 | dprintf2(("CRTDLL: frexp\n"));
|
|---|
| 1338 | return (frexp(value, exp));
|
|---|
| 1339 | }
|
|---|
| 1340 |
|
|---|
| 1341 |
|
|---|
| 1342 | /*********************************************************************
|
|---|
| 1343 | * gmtime (CRTDLL.389)
|
|---|
| 1344 | */
|
|---|
| 1345 | struct tm * CDECL CRTDLL_gmtime( const time_t *timer )
|
|---|
| 1346 | {
|
|---|
| 1347 | dprintf2(("CRTDLL: gmtime\n"));
|
|---|
| 1348 | return (gmtime(timer));
|
|---|
| 1349 | }
|
|---|
| 1350 |
|
|---|
| 1351 |
|
|---|
| 1352 | /*********************************************************************
|
|---|
| 1353 | * isalnum (CRTDLL.391)
|
|---|
| 1354 | */
|
|---|
| 1355 | int CDECL CRTDLL_isalnum(int i)
|
|---|
| 1356 | {
|
|---|
| 1357 | dprintf2(("CRTDLL: isalnum(%08xh)\n", i));
|
|---|
| 1358 | return (isalnum(i));
|
|---|
| 1359 | }
|
|---|
| 1360 |
|
|---|
| 1361 |
|
|---|
| 1362 | /*********************************************************************
|
|---|
| 1363 | * isalpha (CRTDLL.392)
|
|---|
| 1364 | */
|
|---|
| 1365 | int CDECL CRTDLL_isalpha(int i)
|
|---|
| 1366 | {
|
|---|
| 1367 | dprintf2(("CRTDLL: isalpha(%08xh)\n",
|
|---|
| 1368 | i));
|
|---|
| 1369 |
|
|---|
| 1370 | return (isalpha(i));
|
|---|
| 1371 | }
|
|---|
| 1372 |
|
|---|
| 1373 |
|
|---|
| 1374 | /*********************************************************************
|
|---|
| 1375 | * iscntrl (CRTDLL.393)
|
|---|
| 1376 | */
|
|---|
| 1377 | int CDECL CRTDLL_iscntrl(int i)
|
|---|
| 1378 | {
|
|---|
| 1379 | dprintf2(("CRTDLL: iscntrl(%08xh)\n", i));
|
|---|
| 1380 | return (iscntrl(i));
|
|---|
| 1381 | }
|
|---|
| 1382 |
|
|---|
| 1383 |
|
|---|
| 1384 | /*********************************************************************
|
|---|
| 1385 | * isdigit (CRTDLL.394)
|
|---|
| 1386 | */
|
|---|
| 1387 | int CDECL CRTDLL_isdigit(int i)
|
|---|
| 1388 | {
|
|---|
| 1389 | dprintf2(("CRTDLL: isdigit(%08xh)\n",
|
|---|
| 1390 | i));
|
|---|
| 1391 |
|
|---|
| 1392 | return (isdigit(i));
|
|---|
| 1393 | }
|
|---|
| 1394 |
|
|---|
| 1395 |
|
|---|
| 1396 | /*********************************************************************
|
|---|
| 1397 | * isgraph (CRTDLL.395)
|
|---|
| 1398 | */
|
|---|
| 1399 | int CDECL CRTDLL_isgraph(int i)
|
|---|
| 1400 | {
|
|---|
| 1401 | dprintf2(("CRTDLL: isgraph(%08xh)\n", i));
|
|---|
| 1402 | return (isgraph(i));
|
|---|
| 1403 | }
|
|---|
| 1404 |
|
|---|
| 1405 |
|
|---|
| 1406 | /*********************************************************************
|
|---|
| 1407 | * islower (CRTDLL.397)
|
|---|
| 1408 | */
|
|---|
| 1409 | int CDECL CRTDLL_islower(int i)
|
|---|
| 1410 | {
|
|---|
| 1411 | dprintf2(("CRTDLL: islower(%08xh)\n",
|
|---|
| 1412 | i));
|
|---|
| 1413 |
|
|---|
| 1414 | return (islower(i));
|
|---|
| 1415 | }
|
|---|
| 1416 |
|
|---|
| 1417 |
|
|---|
| 1418 | /*********************************************************************
|
|---|
| 1419 | * isprint (CRTDLL.398)
|
|---|
| 1420 | */
|
|---|
| 1421 | int CDECL CRTDLL_isprint(int i)
|
|---|
| 1422 | {
|
|---|
| 1423 | dprintf2(("CRTDLL: isprint(%08xh)\n",
|
|---|
| 1424 | i));
|
|---|
| 1425 |
|
|---|
| 1426 | return (isprint(i));
|
|---|
| 1427 | }
|
|---|
| 1428 |
|
|---|
| 1429 |
|
|---|
| 1430 | /*********************************************************************
|
|---|
| 1431 | * ispunct (CRTDLL.399)
|
|---|
| 1432 | */
|
|---|
| 1433 | int CDECL CRTDLL_ispunct(int i)
|
|---|
| 1434 | {
|
|---|
| 1435 | dprintf2(("CRTDLL: ispunct(%08xh)\n", i));
|
|---|
| 1436 | return (ispunct(i));
|
|---|
| 1437 | }
|
|---|
| 1438 |
|
|---|
| 1439 |
|
|---|
| 1440 | /*********************************************************************
|
|---|
| 1441 | * isspace (CRTDLL.400)
|
|---|
| 1442 | */
|
|---|
| 1443 | int CDECL CRTDLL_isspace(int i)
|
|---|
| 1444 | {
|
|---|
| 1445 | dprintf2(("CRTDLL: isspace(%08xh)\n",
|
|---|
| 1446 | i));
|
|---|
| 1447 |
|
|---|
| 1448 | return (isspace(i));
|
|---|
| 1449 | }
|
|---|
| 1450 |
|
|---|
| 1451 |
|
|---|
| 1452 | /*********************************************************************
|
|---|
| 1453 | * isupper (CRTDLL.401)
|
|---|
| 1454 | */
|
|---|
| 1455 | int CDECL CRTDLL_isupper(int i)
|
|---|
| 1456 | {
|
|---|
| 1457 | dprintf2(("CRTDLL: isupper(%08xh)\n",
|
|---|
| 1458 | i));
|
|---|
| 1459 |
|
|---|
| 1460 | return (isupper(i));
|
|---|
| 1461 | }
|
|---|
| 1462 |
|
|---|
| 1463 |
|
|---|
| 1464 | /*********************************************************************
|
|---|
| 1465 | * isxdigit (CRTDLL.415)
|
|---|
| 1466 | */
|
|---|
| 1467 | int CDECL CRTDLL_isxdigit(int i)
|
|---|
| 1468 | {
|
|---|
| 1469 | dprintf2(("CRTDLL: isxdigit(%08xh)\n", i));
|
|---|
| 1470 | return (isxdigit(i));
|
|---|
| 1471 | }
|
|---|
| 1472 |
|
|---|
| 1473 |
|
|---|
| 1474 | /*********************************************************************
|
|---|
| 1475 | * labs (CRTDLL.416)
|
|---|
| 1476 | */
|
|---|
| 1477 | long int CDECL CRTDLL_labs( long int j )
|
|---|
| 1478 | {
|
|---|
| 1479 | dprintf2(("CRTDLL: labs(%08xh)\n", j));
|
|---|
| 1480 | return (labs(j));
|
|---|
| 1481 | }
|
|---|
| 1482 |
|
|---|
| 1483 |
|
|---|
| 1484 | /*********************************************************************
|
|---|
| 1485 | * ldexp (CRTDLL.417)
|
|---|
| 1486 | */
|
|---|
| 1487 | double CDECL CRTDLL_ldexp( double x, int exp )
|
|---|
| 1488 | {
|
|---|
| 1489 | dprintf2(("CRTDLL: ldexp\n"));
|
|---|
| 1490 | return (ldexp(x, exp));
|
|---|
| 1491 | }
|
|---|
| 1492 |
|
|---|
| 1493 |
|
|---|
| 1494 | /*********************************************************************
|
|---|
| 1495 | * ldiv (CRTDLL.418)
|
|---|
| 1496 | */
|
|---|
| 1497 | ldiv_t CDECL CRTDLL_ldiv( long int numer, long int denom )
|
|---|
| 1498 | {
|
|---|
| 1499 | dprintf2(("CRTDLL: ldiv\n"));
|
|---|
| 1500 | return (ldiv(numer, denom));
|
|---|
| 1501 | }
|
|---|
| 1502 |
|
|---|
| 1503 |
|
|---|
| 1504 | /*********************************************************************
|
|---|
| 1505 | * localeconv (CRTDLL.419)
|
|---|
| 1506 | */
|
|---|
| 1507 | struct lconv * CDECL CRTDLL_localeconv(void)
|
|---|
| 1508 | {
|
|---|
| 1509 | dprintf2(("CRTDLL: localeconv\n"));
|
|---|
| 1510 | return (localeconv());
|
|---|
| 1511 | }
|
|---|
| 1512 |
|
|---|
| 1513 |
|
|---|
| 1514 | /*********************************************************************
|
|---|
| 1515 | * localtime (CRTDLL.420)
|
|---|
| 1516 | */
|
|---|
| 1517 | struct tm * CDECL CRTDLL_localtime( const time_t *timer )
|
|---|
| 1518 | {
|
|---|
| 1519 | dprintf2(("CRTDLL: localtime\n"));
|
|---|
| 1520 | return (localtime(timer));
|
|---|
| 1521 | }
|
|---|
| 1522 |
|
|---|
| 1523 |
|
|---|
| 1524 | /*********************************************************************
|
|---|
| 1525 | * log (CRTDLL.421)
|
|---|
| 1526 | */
|
|---|
| 1527 | double CDECL CRTDLL_log( double x )
|
|---|
| 1528 | {
|
|---|
| 1529 | dprintf2(("CRTDLL: log(%08xh)\n", x));
|
|---|
| 1530 | return (log(x));
|
|---|
| 1531 | }
|
|---|
| 1532 |
|
|---|
| 1533 |
|
|---|
| 1534 | /*********************************************************************
|
|---|
| 1535 | * log10 (CRTDLL.422)
|
|---|
| 1536 | */
|
|---|
| 1537 | double CDECL CRTDLL_log10( double x )
|
|---|
| 1538 | {
|
|---|
| 1539 | dprintf2(("CRTDLL: log10\n"));
|
|---|
| 1540 | return (log10(x));
|
|---|
| 1541 | }
|
|---|
| 1542 |
|
|---|
| 1543 |
|
|---|
| 1544 | /*********************************************************************
|
|---|
| 1545 | * mktime (CRTDLL.433)
|
|---|
| 1546 | */
|
|---|
| 1547 | time_t CDECL CRTDLL_mktime( struct tm *timeptr )
|
|---|
| 1548 | {
|
|---|
| 1549 | dprintf2(("CRTDLL: mktime\n"));
|
|---|
| 1550 | return mktime( timeptr );
|
|---|
| 1551 | }
|
|---|
| 1552 |
|
|---|
| 1553 |
|
|---|
| 1554 | /*********************************************************************
|
|---|
| 1555 | * modf (CRTDLL.434)
|
|---|
| 1556 | */
|
|---|
| 1557 | double CDECL CRTDLL_modf( double value, double *iptr )
|
|---|
| 1558 | {
|
|---|
| 1559 | dprintf2(("CRTDLL: modf\n"));
|
|---|
| 1560 | return modf( value, iptr );
|
|---|
| 1561 | }
|
|---|
| 1562 |
|
|---|
| 1563 |
|
|---|
| 1564 | /*********************************************************************
|
|---|
| 1565 | * pow (CRTDLL.436)
|
|---|
| 1566 | */
|
|---|
| 1567 | double CDECL CRTDLL_pow( double x, double y )
|
|---|
| 1568 | {
|
|---|
| 1569 | dprintf2(("CRTDLL: pow(%08xh, %08xh)\n",x, y));
|
|---|
| 1570 | return pow( x, y );
|
|---|
| 1571 | }
|
|---|
| 1572 |
|
|---|
| 1573 |
|
|---|
| 1574 | /*********************************************************************
|
|---|
| 1575 | * printf (CRTDLL.437)
|
|---|
| 1576 | */
|
|---|
| 1577 | int CDECL CRTDLL_printf( const char *format, va_list arg )
|
|---|
| 1578 | {
|
|---|
| 1579 | dprintf2(("CRTDLL: printf\n"));
|
|---|
| 1580 | return (printf(format, arg));
|
|---|
| 1581 | }
|
|---|
| 1582 |
|
|---|
| 1583 |
|
|---|
| 1584 | /*********************************************************************
|
|---|
| 1585 | * qsort (CRTDLL.441)
|
|---|
| 1586 | */
|
|---|
| 1587 | void CDECL CRTDLL_qsort (void *base, size_t num, size_t width,
|
|---|
| 1588 | int (*CDECL compare)(const void *x1, const void *x2))
|
|---|
| 1589 | {
|
|---|
| 1590 | dprintf2(("CRTDLL: qsort\n"));
|
|---|
| 1591 | if (width > 0 && num > 1 && base != 0)
|
|---|
| 1592 | qsort1 ((char *)base, (char *)base+(num-1)*width, width, compare);
|
|---|
| 1593 | }
|
|---|
| 1594 |
|
|---|
| 1595 |
|
|---|
| 1596 | /*********************************************************************
|
|---|
| 1597 | * raise (CRTDLL.442)
|
|---|
| 1598 | */
|
|---|
| 1599 | int CDECL CRTDLL_raise( int sig )
|
|---|
| 1600 | {
|
|---|
| 1601 | dprintf2(("CRTDLL: raise\n"));
|
|---|
| 1602 | return raise( sig );
|
|---|
| 1603 | }
|
|---|
| 1604 |
|
|---|
| 1605 |
|
|---|
| 1606 | /*********************************************************************
|
|---|
| 1607 | * scanf (CRTDLL.448)
|
|---|
| 1608 | */
|
|---|
| 1609 | int CDECL CRTDLL_scanf( const char *format, va_list arg )
|
|---|
| 1610 | {
|
|---|
| 1611 | dprintf(("CRTDLL: scanf\n"));
|
|---|
| 1612 | return (scanf(format, arg));
|
|---|
| 1613 | }
|
|---|
| 1614 |
|
|---|
| 1615 |
|
|---|
| 1616 | /*********************************************************************
|
|---|
| 1617 | * setvbuf (CRTDLL.451)
|
|---|
| 1618 | */
|
|---|
| 1619 | int CDECL CRTDLL_setvbuf( FILE *fp, char *buf, int mode, size_t size )
|
|---|
| 1620 | {
|
|---|
| 1621 | dprintf2(("CRTDLL: setvbuf\n"));
|
|---|
| 1622 | return (setvbuf(fp, buf, mode, size));
|
|---|
| 1623 | }
|
|---|
| 1624 |
|
|---|
| 1625 |
|
|---|
| 1626 | /*********************************************************************
|
|---|
| 1627 | * sin (CRTDLL.453)
|
|---|
| 1628 | */
|
|---|
| 1629 | double CDECL CRTDLL_sin( double x )
|
|---|
| 1630 | {
|
|---|
| 1631 | dprintf2(("CRTDLL: sin(%08xh)\n", x));
|
|---|
| 1632 | return (sin(x));
|
|---|
| 1633 | }
|
|---|
| 1634 |
|
|---|
| 1635 |
|
|---|
| 1636 | /*********************************************************************
|
|---|
| 1637 | * sinh (CRTDLL.454)
|
|---|
| 1638 | */
|
|---|
| 1639 | double CDECL CRTDLL_sinh( double x )
|
|---|
| 1640 | {
|
|---|
| 1641 | dprintf2(("CRTDLL: sinh\n"));
|
|---|
| 1642 | return (sinh(x));
|
|---|
| 1643 | }
|
|---|
| 1644 |
|
|---|
| 1645 |
|
|---|
| 1646 | /*********************************************************************
|
|---|
| 1647 | * sprintf (CRTDLL.455)
|
|---|
| 1648 | */
|
|---|
| 1649 | LPSTR CDECL CRTDLL_sprintf(LPSTR lpstrBuffer,
|
|---|
| 1650 | LPSTR lpstrFormat,
|
|---|
| 1651 | ...)
|
|---|
| 1652 | {
|
|---|
| 1653 | va_list argptr; /* -> variable argument list */
|
|---|
| 1654 |
|
|---|
| 1655 | dprintf2(("CRTDLL: sprintf(%08xh,%s)\n",
|
|---|
| 1656 | lpstrBuffer,
|
|---|
| 1657 | lpstrFormat));
|
|---|
| 1658 |
|
|---|
| 1659 | va_start(argptr,
|
|---|
| 1660 | lpstrFormat); /* get pointer to argument list */
|
|---|
| 1661 | vsprintf(lpstrBuffer,
|
|---|
| 1662 | lpstrFormat,
|
|---|
| 1663 | argptr);
|
|---|
| 1664 | va_end(argptr); /* done with variable arguments */
|
|---|
| 1665 |
|
|---|
| 1666 | return (lpstrBuffer);
|
|---|
| 1667 | }
|
|---|
| 1668 |
|
|---|
| 1669 |
|
|---|
| 1670 | /*********************************************************************
|
|---|
| 1671 | * sqrt (CRTDLL.456)
|
|---|
| 1672 | */
|
|---|
| 1673 | double CDECL CRTDLL_sqrt( double x )
|
|---|
| 1674 | {
|
|---|
| 1675 | dprintf2(("CRTDLL: sqrt(%08xh)\n", x));
|
|---|
| 1676 | return (sqrt(x));
|
|---|
| 1677 | }
|
|---|
| 1678 |
|
|---|
| 1679 |
|
|---|
| 1680 | /*********************************************************************
|
|---|
| 1681 | * srand (CRTDLL.457)
|
|---|
| 1682 | */
|
|---|
| 1683 | void CDECL CRTDLL_srand( unsigned int seed )
|
|---|
| 1684 | {
|
|---|
| 1685 | dprintf2(("CRTDLL: srand\n"));
|
|---|
| 1686 | srand(seed);
|
|---|
| 1687 | }
|
|---|
| 1688 |
|
|---|
| 1689 |
|
|---|
| 1690 | /*********************************************************************
|
|---|
| 1691 | * sscanf (CRTDLL.458)
|
|---|
| 1692 | */
|
|---|
| 1693 | int CDECL CRTDLL_sscanf( const char *s, const char *format, va_list arg )
|
|---|
| 1694 | {
|
|---|
| 1695 | dprintf(("CRTDLL: sscanf\n"));
|
|---|
| 1696 | return (sscanf(s, format, arg));
|
|---|
| 1697 | }
|
|---|
| 1698 |
|
|---|
| 1699 |
|
|---|
| 1700 | /*********************************************************************
|
|---|
| 1701 | * tan (CRTDLL.483)
|
|---|
| 1702 | */
|
|---|
| 1703 | double CDECL CRTDLL_tan(double d)
|
|---|
| 1704 | {
|
|---|
| 1705 | dprintf2(("CRTDLL: tan(%f)\n",
|
|---|
| 1706 | d));
|
|---|
| 1707 |
|
|---|
| 1708 | return (tan(d));
|
|---|
| 1709 | }
|
|---|
| 1710 |
|
|---|
| 1711 |
|
|---|
| 1712 | /*********************************************************************
|
|---|
| 1713 | * tanh (CRTDLL.484)
|
|---|
| 1714 | */
|
|---|
| 1715 | double CDECL CRTDLL_tanh( double x )
|
|---|
| 1716 | {
|
|---|
| 1717 | dprintf2(("CRTDLL: tanh\n"));
|
|---|
| 1718 | return tanh(x);
|
|---|
| 1719 | }
|
|---|
| 1720 |
|
|---|
| 1721 |
|
|---|
| 1722 | /*********************************************************************
|
|---|
| 1723 | * time (CRTDLL.485)
|
|---|
| 1724 | */
|
|---|
| 1725 | time_t CDECL CRTDLL_time( time_t *timer )
|
|---|
| 1726 | {
|
|---|
| 1727 | dprintf2(("CRTDLL: time\n"));
|
|---|
| 1728 |
|
|---|
| 1729 | return time(timer);
|
|---|
| 1730 | }
|
|---|
| 1731 |
|
|---|
| 1732 |
|
|---|
| 1733 | /*********************************************************************
|
|---|
| 1734 | * tmpfile (CRTDLL.486)
|
|---|
| 1735 | */
|
|---|
| 1736 | FILE * CDECL CRTDLL_tmpfile( void )
|
|---|
| 1737 | {
|
|---|
| 1738 | dprintf2(("CRTDLL: tmpfile\n"));
|
|---|
| 1739 | return (tmpfile());
|
|---|
| 1740 | }
|
|---|
| 1741 |
|
|---|
| 1742 |
|
|---|
| 1743 | /*********************************************************************
|
|---|
| 1744 | * tolower (CRTDLL.488)
|
|---|
| 1745 | */
|
|---|
| 1746 | int CDECL CRTDLL_tolower(int c)
|
|---|
| 1747 | {
|
|---|
| 1748 | dprintf2(("CRTDLL: tolower(%c)\n",
|
|---|
| 1749 | c));
|
|---|
| 1750 |
|
|---|
| 1751 | return (tolower(c));
|
|---|
| 1752 | }
|
|---|
| 1753 |
|
|---|
| 1754 |
|
|---|
| 1755 | /*********************************************************************
|
|---|
| 1756 | * toupper (CRTDLL.489)
|
|---|
| 1757 | */
|
|---|
| 1758 | int CDECL CRTDLL_toupper(int c)
|
|---|
| 1759 | {
|
|---|
| 1760 | dprintf2(("CRTDLL: toupper(%c)\n",
|
|---|
| 1761 | c));
|
|---|
| 1762 |
|
|---|
| 1763 | return (toupper(c));
|
|---|
| 1764 | }
|
|---|
| 1765 |
|
|---|
| 1766 |
|
|---|
| 1767 | /*********************************************************************
|
|---|
| 1768 | * ungetc (CRTDLL.492)
|
|---|
| 1769 | */
|
|---|
| 1770 | INT CDECL CRTDLL_ungetc(int c, FILE *f)
|
|---|
| 1771 | {
|
|---|
| 1772 | dprintf(("CRTDLL: ungetc\n"));
|
|---|
| 1773 | return (ungetc(c, f));
|
|---|
| 1774 | }
|
|---|
| 1775 |
|
|---|
| 1776 |
|
|---|
| 1777 | /*********************************************************************
|
|---|
| 1778 | * vprintf (CRTDLL.496)
|
|---|
| 1779 | */
|
|---|
| 1780 | int CDECL CRTDLL_vprintf( const char *format, __va_list arg )
|
|---|
| 1781 | {
|
|---|
| 1782 | dprintf2(("CRTDLL: vprintf\n"));
|
|---|
| 1783 | return (vprintf(format, arg));
|
|---|
| 1784 | }
|
|---|
| 1785 |
|
|---|
| 1786 |
|
|---|
| 1787 | /*********************************************************************
|
|---|
| 1788 | * vsprintf (CRTDLL.497)
|
|---|
| 1789 | */
|
|---|
| 1790 | int CDECL CRTDLL_vsprintf( char *s, const char *format, va_list arg )
|
|---|
| 1791 | {
|
|---|
| 1792 | dprintf2(("CRTDLL: vsprintf(%08xh, %08xh)\n", s, format));
|
|---|
| 1793 | return (vsprintf(s, format, arg));
|
|---|
| 1794 | }
|
|---|
| 1795 |
|
|---|
| 1796 |
|
|---|
| 1797 | /*********************************************************************
|
|---|
| 1798 | * CRTDLL__setjmp3 (CRTDLL.600)
|
|---|
| 1799 | */
|
|---|
| 1800 | int CDECL CRTDLL__setjmp3( jmp_buf env )
|
|---|
| 1801 | {
|
|---|
| 1802 | //TODO:
|
|---|
| 1803 | dprintf2(("CRTDLL: _setjmp3 -> setjmp (NOT IDENTICAL!!!)\n"));
|
|---|
| 1804 | return(setjmp( env));
|
|---|
| 1805 | }
|
|---|