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