Changeset 1868 for trunk/src/crtdll/crtdll.cpp
- Timestamp:
- Nov 28, 1999, 6:22:27 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crtdll/crtdll.cpp
r1220 r1868 1 /* $Id: crtdll.cpp,v 1.1 0 1999-10-09 13:32:25sandervl Exp $ */1 /* $Id: crtdll.cpp,v 1.11 1999-11-28 17:22:26 sandervl Exp $ */ 2 2 3 3 /* … … 548 548 * CRTDLL__cabs (CRTDLL.48) 549 549 */ 550 double CDECL CRTDLL__cabs(struct complex * z) 551 { 552 dprintf(("CRTDLL: _cabs not implemented\n")); 553 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 554 return FALSE; 550 double CDECL CRTDLL__cabs(struct _complex z) 551 { 552 dprintf(("CRTDLL: _cabs\n")); 553 return sqrt( z.x*z.x + z.y*z.y ); 555 554 } 556 555 … … 710 709 * _cprintf (CRTDLL.63) 711 710 */ 712 INT CDECL CRTDLL__cprintf( char *s, ... ) 713 { 714 dprintf(("CRTDLL: _cprintf not implemented.\n")); 715 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 716 return FALSE; 711 INT CDECL CRTDLL__cprintf( char *fmt, ... ) 712 { 713 dprintf(("CRTDLL: _cprintf.\n")); 714 715 int cnt; 716 char buf[ 2048 ]; /* this is buggy, because buffer might be too small. */ 717 va_list ap; 718 719 va_start(ap, fmt); 720 cnt = vsprintf(buf, fmt, ap); 721 va_end(ap); 722 723 _cputs(buf); 724 return cnt; 717 725 } 718 726 … … 844 852 int CDECL CRTDLL__execl(const char* szPath, const char* szArgv0, ...) 845 853 { 846 dprintf(("CRTDLL: _execl not implemented.\n")); 847 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 848 return FALSE; 854 dprintf(("CRTDLL: _execl\n")); 855 856 char *szArg[100]; 857 const char *a; 858 int i = 0; 859 va_list l = 0; 860 va_start(l,szArgv0); 861 do { 862 a = va_arg(l,const char *); 863 szArg[i++] = (char *)a; 864 } while ( a != NULL && i < 100 ); 865 866 return _spawnve(P_OVERLAY, (char*)szPath, szArg, _environ); 849 867 } 850 868 … … 864 882 * CRTDLL__execlp (CRTDLL.81) 865 883 */ 866 int CDECL CRTDLL__execlp( char *s1, char *s2, ...) 867 { 868 dprintf(("CRTDLL: _execlp not implemented.\n")); 869 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 870 return FALSE; 884 int CDECL CRTDLL__execlp( char *szPath, char *szArgv0, ...) 885 { 886 dprintf(("CRTDLL: _execlp\n")); 887 char *szArg[100]; 888 const char *a; 889 int i = 0; 890 va_list l = 0; 891 va_start(l,szArgv0); 892 do { 893 a = (const char *)va_arg(l,const char *); 894 szArg[i++] = (char *)a; 895 } while ( a != NULL && i < 100 ); 896 return _spawnvpe(P_OVERLAY, szPath,szArg, _environ); 871 897 } 872 898 … … 1168 1194 * _fpreset (CRTDLL.107) 1169 1195 */ 1170 INTCDECL CRTDLL__fpreset(void)1196 void CDECL CRTDLL__fpreset(void) 1171 1197 { 1172 1198 dprintf(("CRTDLL: _fpreset not implemented.\n")); 1173 1199 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1174 return FALSE;1175 1200 } 1176 1201 … … 1775 1800 int CDECL CRTDLL__ismbcsymbol( unsigned int c ) 1776 1801 { 1777 dprintf(("CRTDLL: _ismbcsymbol \n"));1802 dprintf(("CRTDLL: _ismbcsymbol not implemented.\n")); 1778 1803 if ((c & 0xFF00) != 0) { 1779 1804 // true multibyte character … … 1888 1913 * _lfind (CRTDLL.170) 1889 1914 */ 1890 void * CDECL CRTDLL__lfind(const void *v1, const void *v2, unsigned int *i1, unsigned int i2, 1891 int (CDECL *i3)(const void *v3, const void *v4)) 1892 { 1893 dprintf(("CRTDLL: _lfind not implemented.\n")); 1894 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1895 return FALSE; 1896 // return (_lfind(v1,v2,i1,i2,i3(v3,v4))); 1915 void * CDECL CRTDLL__lfind(const void *key, const void *base, size_t *nelp, 1916 size_t width, int (*compar)(const void *, const void *)) 1917 { 1918 dprintf(("CRTDLL: _lfind\n")); 1919 char *char_base = (char *)base; 1920 int i; 1921 for(i=0;i<*nelp;i++) { 1922 if ( compar(key,char_base) == 0) 1923 return char_base; 1924 char_base += width; 1925 } 1926 return NULL; 1897 1927 } 1898 1928 … … 1962 1992 * _lsearch (CRTDLL.177) 1963 1993 */ 1964 void * CDECL CRTDLL__lsearch(const void * v1, void *v2, unsigned int *i1, unsigned int i2,1965 int (CDECL *i3)(const void *v3, const void *v4))1994 void * CDECL CRTDLL__lsearch(const void *key, void *base, size_t *nelp, size_t width, 1995 int (*compar)(const void *, const void *)) 1966 1996 { 1967 1997 dprintf(("CRTDLL: _lsearch not implemented.\n")); 1968 1998 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1969 1999 return FALSE; 1970 // return (_lsearch(v1,v2,i1,i2,i3(v3,v4)));1971 2000 } 1972 2001 … … 3148 3177 double CDECL CRTDLL__nextafter( double x, double y ) 3149 3178 { 3150 dprintf(("CRTDLL: _nextafter not implemented.\n")); 3151 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3152 return FALSE; 3179 dprintf(("CRTDLL: _nextafter\n")); 3180 if ( x == y) 3181 return x; 3182 if ( CRTDLL__isnan(x) || CRTDLL__isnan(y) ) 3183 return x; 3184 3185 return x; 3153 3186 } 3154 3187 … … 3475 3508 * CRTDLL__spawnl (CRTDLL.269) 3476 3509 */ 3477 int CDECL CRTDLL__spawnl( int i, char *s1, char *s2, ... ) 3478 { 3479 dprintf(("CRTDLL: _spawnl not implemented.\n")); 3480 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3481 return FALSE; 3510 int CDECL CRTDLL__spawnl(int nMode, const char* szPath, const char* szArgv0,...) 3511 { 3512 dprintf(("CRTDLL: _spawnl\n")); 3513 char *szArg[100]; 3514 const char *a; 3515 int i = 0; 3516 va_list l = 0; 3517 va_start(l,szArgv0); 3518 do { 3519 a = va_arg(l,const char *); 3520 szArg[i++] = (char *)a; 3521 } while ( a != NULL && i < 100 ); 3522 3523 return _spawnve(nMode, (char*)szPath, szArg, _environ); 3482 3524 } 3483 3525 … … 3497 3539 * CRTDLL__spawnlp (CRTDLL.271) 3498 3540 */ 3499 int CDECL CRTDLL__spawnlp( int i, char *s1, char *s2, ... ) 3500 { 3501 dprintf(("CRTDLL: _spawnlp not implemented.\n")); 3502 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3503 return FALSE; 3541 int CDECL CRTDLL__spawnlp(int nMode, const char* szPath, const char* szArgv0, ...) 3542 { 3543 dprintf(("CRTDLL: _spawnlp\n")); 3544 char *szArg[100]; 3545 const char *a; 3546 int i = 0; 3547 va_list l = 0; 3548 va_start(l,szArgv0); 3549 do { 3550 a = (const char *)va_arg(l,const char *); 3551 szArg[i++] = (char *)a; 3552 } while ( a != NULL && i < 100 ); 3553 return _spawnvpe(nMode, (char*)szPath,szArg, _environ); 3504 3554 } 3505 3555 … … 3889 3939 { 3890 3940 int size = (wcslen((const wchar_t*)str) + 1) * sizeof(WCHAR); 3891 // FIXME ret = CRTDLL_malloc( size );3941 // FIXME ret = CRTDLL_malloc( size ); 3892 3942 if (ret) memcpy( ret, str, size ); 3893 3943 } … … 4434 4484 * fwprintf (CRTDLL.382) 4435 4485 */ 4436 int CDECL CRTDLL_fwprintf( FILE * strm, const wchar_t *format, ... )4486 int CDECL CRTDLL_fwprintf( FILE *iop, const wchar_t *fmt, ... ) 4437 4487 { 4438 4488 dprintf(("CRTDLL: fwprintf not implemented.\n")); … … 4523 4573 INT CDECL CRTDLL_is_wctype(wint_t wc, wctype_t wctypeFlags) 4524 4574 { 4525 dprintf(("CRTDLL: is_wctype not implemented.\n"));4526 return 0;4575 dprintf(("CRTDLL: is_wctype\n")); 4576 return ((CRTDLL_pwctype_dll[(unsigned char)(wc & 0xFF)]&wctypeFlags) == wctypeFlags ); 4527 4577 } 4528 4578 … … 4817 4867 int CDECL CRTDLL_printf( const char *format, ... ) 4818 4868 { 4819 dprintf(("CRTDLL: printf not implemented.\n")); 4820 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 4821 return FALSE; 4869 dprintf(("CRTDLL: printf not implemented.\n")); 4870 va_list arg; 4871 int done; 4872 4873 va_start (arg, format); 4874 done = vprintf (format, arg); 4875 va_end (arg); 4876 return done; 4822 4877 } 4823 4878
Note:
See TracChangeset
for help on using the changeset viewer.