Changeset 4667 for trunk/src


Ignore:
Timestamp:
Nov 22, 2000, 12:49:04 AM (25 years ago)
Author:
phaller
Message:

Major move towards WINE CRTDLL, mixture between both code branches

Location:
trunk/src/crtdll
Files:
24 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crtdll/crt_string.cpp

    r2844 r4667  
    1 /* $Id: crt_string.cpp,v 1.2 2000-02-21 10:34:01 sandervl Exp $ */
     1/* $Id: crt_string.cpp,v 1.3 2000-11-21 23:48:49 phaller Exp $ */
    22
    33/*
     
    1313 * Copyright 1999-2000 Jens Wiessner
    1414 *
    15  * CRTDLL - string functions
    16  *
     15 * Implementation Notes:
     16 * MT Safe.
    1717 */
    1818
     
    2424
    2525
     26#include "crtdll.h"
     27
     28
     29DEFAULT_DEBUG_CHANNEL(crtdll);
     30
    2631/*********************************************************************
    2732 *           _strcmpi            (CRTDLL.280)
     
    4853
    4954/*********************************************************************
    50  *           CRTDLL__strdec      (CRTDLL.282)
    51  */
    52 char * CDECL CRTDLL__strdec( const char *, const char *p )
    53 {
    54   dprintf2(("CRTDLL: _strdec\n"));
    55   return( (char *)(p-1) );
    56 }
    57 
    58 
    59 /*********************************************************************
    60  *           CRTDLL__strdup      (CRTDLL.283)
    61  */
    62 LPSTR CDECL CRTDLL__strdup(LPCSTR ptr)
    63 {
    64   dprintf2(("CRTDLL: _strdup\n"));
    65   return HEAP_strdupA(GetProcessHeap(),0,ptr);
    66 }
    67 
    68 
    69 /*********************************************************************
    70  *           _strerror           (CRTDLL.284)
    71  */
    72 char * CDECL CRTDLL__strerror(const char *s)
    73 {
    74   dprintf(("CRTDLL: _strerror\n"));
    75   return (_strerror((char*)s));
    76 }
    77 
    78 
    79 /*********************************************************************
    8055 *           _stricmp    (CRTDLL.285)
    8156 */
     
    9974  dprintf2(("CRTDLL: _stricoll\n"));
    10075  return stricmp(s1,s2);
    101 }
    102 
    103 
    104 /*********************************************************************
    105  *           CRTDLL__strinc      (CRTDLL.287)
    106  */
    107 char * CDECL CRTDLL__strinc( const char *p )
    108 {
    109     dprintf2(("CRTDLL: _strinc\n"));
    110     return( (char *)(p+1) );
    11176}
    11277
     
    13297
    13398/*********************************************************************
    134  *           CRTDLL__strncnt     (CRTDLL.289)
    135  */
    136 size_t CDECL CRTDLL__strncnt( const char *p, size_t l )
    137 {
    138     dprintf2(("CRTDLL: _strncnt\n"));
    139     size_t i;
    140     i = strlen(p);
    141     return( (i>l) ? l : i );
    142 }
    143 
    144 
    145 /*********************************************************************
    146  *           CRTDLL__strnextc    (CRTDLL.290)
    147  */
    148 unsigned int CDECL CRTDLL__strnextc( const char *p )
    149 {
    150     dprintf2(("CRTDLL: _strnextc\n"));
    151     return( (unsigned int)*p );
    152 }
    153 
    154 
    155 /*********************************************************************
    15699 *           CRTDLL__strnicmp    (CRTDLL.291)
    157100 */
     
    167110}
    168111
    169 
    170 /*********************************************************************
    171  *           CRTDLL__strninc     (CRTDLL.292)
    172  */
    173 char * CDECL CRTDLL__strninc( const char *p, size_t l )
    174 {
    175     dprintf2(("CRTDLL: _strninc\n"));
    176     return( (char *)(p+l) );
    177 }
    178 
    179 
    180 /*********************************************************************
    181  *           CRTDLL__strnset     (CRTDLL.293)
    182  */
    183 char * CDECL CRTDLL__strnset(char *string, int c, size_t count)
    184 {
    185   dprintf2(("CRTDLL: _strnset\n"));
    186   char *dst;
    187 
    188   dst = string;
    189   while (count > 0 && *dst != 0)
    190     {
    191       *dst++ = (char)c;
    192       --count;
    193     }
    194   return string;
    195 }
    196 
    197 
    198 /*********************************************************************
    199  *           CRTDLL__strrev      (CRTDLL.294)
    200  */
    201 char * CDECL CRTDLL__strrev( char *string )
    202 {
    203   dprintf2(("CRTDLL: _strrev\n"));
    204   char *p, *q, c;
    205 
    206   p = q = string;
    207   while (*q != 0)
    208     ++q;
    209   --q;                                  /* Benign, as string must be != 0 */
    210   while ((size_t)q > (size_t)p)
    211     {
    212       c = *p; *p = *q; *q = c;
    213       ++p; --q;
    214     }
    215   return string;
    216 }
    217 
    218 
    219 /*********************************************************************
    220  *           CRTDLL__strset      (CRTDLL.295)
    221  */
    222 char * CDECL CRTDLL__strset(char *string, int c)
    223 {
    224   dprintf2(("CRTDLL: _strset\n"));
    225   char *dst;
    226 
    227   dst = string;
    228   while (*dst != 0)
    229     *dst++ = (char)c;
    230   return string;
    231 }
    232 
    233 
    234 /*********************************************************************
    235  *           CRTDLL__strspnp     (CRTDLL.296)
    236  */
    237 char * CDECL CRTDLL__strspnp( const char *p1, const char *p2 )
    238 {
    239     dprintf2(("CRTDLL: _strspnp\n"));
    240     return( (*(p1 += strspn(p1,p2))!='\0') ? (char*)p1 : NULL );
    241 }
    242112
    243113
     
    348218
    349219/*********************************************************************
    350  *                  strerror        (CRTDLL.465)
    351  */
    352 char * CDECL CRTDLL_strerror( int errnum )
    353 {
    354   dprintf2(("CRTDLL: strerror\n"));
    355   return strerror(errnum);
    356 }
    357 
    358 
    359 /*********************************************************************
    360220 *                  strftime        (CRTDLL.466)
    361221 */
     
    531391  return strxfrm(s1, s2, n);
    532392}
     393
     394
     395/* INTERNAL: CRTDLL_malloc() based strndup */
     396LPSTR __CRTDLL__strndup(LPSTR buf, INT size);
     397LPSTR __CRTDLL__strndup(LPSTR buf, INT size)
     398{
     399  char* ret;
     400  int len = strlen(buf);
     401  int max_len;
     402
     403  max_len = size <= len? size : len + 1;
     404
     405  ret = (char*)CRTDLL_malloc(max_len);
     406  if (ret)
     407  {
     408    memcpy(ret,buf,max_len);
     409    ret[max_len] = 0;
     410  }
     411  return ret;
     412}
     413
     414
     415/*********************************************************************
     416 *                  _strdec           (CRTDLL.282)
     417 *
     418 * Return the byte before str2 while it is >= to str1.
     419 *
     420 * PARAMS
     421 *   str1 [in]  Terminating string
     422 *
     423 *   sre2 [in]  string to start searching from
     424 *
     425 * RETURNS
     426 *   The byte before str2, or str1, whichever is greater
     427 *
     428 * NOTES
     429 * This function is implemented as tested with windows, which means
     430 * it does not have a terminating condition. It always returns
     431 * the byte before str2. Use with extreme caution!
     432 */
     433LPSTR CDECL CRTDLL__strdec(LPSTR str1, LPSTR str2)
     434{
     435  /* Hmm. While the docs suggest that the following should work... */
     436  /*  return (str2<=str1?0:str2-1); */
     437  /* ...Version 2.50.4170 (NT) from win98 constantly decrements! */
     438  return str2-1;
     439}
     440
     441
     442/*********************************************************************
     443 *                  _strdup          (CRTDLL.285)
     444 *
     445 * Duplicate a string.
     446 */
     447LPSTR CDECL CRTDLL__strdup(LPCSTR ptr)
     448{
     449    LPSTR ret = (LPSTR)CRTDLL_malloc(strlen(ptr)+1);
     450    if (ret) strcpy( ret, ptr );
     451    return ret;
     452}
     453
     454
     455/*********************************************************************
     456 *                  _strinc           (CRTDLL.287)
     457 *
     458 * Return a pointer to the next character in a string
     459 */
     460LPSTR CDECL CRTDLL__strinc(LPSTR str)
     461{
     462  return str+1;
     463}
     464
     465
     466/*********************************************************************
     467 *                   _strnextc         (CRTDLL.290)
     468 *
     469 * Return an unsigned int from a string.
     470 */
     471UINT CDECL CRTDLL__strnextc(LPCSTR str)
     472{
     473  return (UINT)*str;
     474}
     475
     476
     477/*********************************************************************
     478 *                  _strninc           (CRTDLL.292)
     479 *
     480 * Return a pointer to the 'n'th character in a string
     481 */
     482LPSTR CDECL CRTDLL__strninc(LPSTR str, INT n)
     483{
     484  return str+n;
     485}
     486
     487
     488/*********************************************************************
     489 *                  _strnset           (CRTDLL.293)
     490 *
     491 * Fill a string with a character up to a certain length
     492 */
     493LPSTR CDECL CRTDLL__strnset(LPSTR str, INT c, INT len)
     494{
     495  if (len > 0 && str)
     496    while (*str && len--)
     497      *str++ = c;
     498  return str;
     499}
     500
     501
     502/*********************************************************************
     503 *                  _strrev              (CRTDLL.294)
     504 *
     505 * Reverse a string in place
     506 */
     507LPSTR CDECL CRTDLL__strrev (LPSTR str)
     508{
     509  LPSTR p1;
     510  LPSTR p2;
     511 
     512  if (str && *str)
     513    for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
     514    {
     515      *p1 ^= *p2;
     516      *p2 ^= *p1;
     517      *p1 ^= *p2;
     518    }
     519
     520  return str;
     521}
     522
     523/*********************************************************************
     524 *                  _strset          (CRTDLL.295)
     525 *
     526 * Fill a string with a value.
     527 */
     528LPSTR  CDECL CRTDLL__strset (LPSTR str, INT set)
     529{
     530  char *ptr = str;
     531
     532  while (*ptr)
     533    *ptr++ = set;
     534
     535  return str;
     536}
     537
     538
     539/*********************************************************************
     540 *                  _strncnt           (CRTDLL.289)
     541 *
     542 * Return the length of a string or the maximum given length.
     543 */
     544LONG CDECL CRTDLL__strncnt(LPSTR str, LONG max)
     545{
     546  LONG len = strlen(str);
     547  return (len > max? max : len);
     548}
     549
     550
     551/*********************************************************************
     552 *                  _strspnp           (CRTDLL.296)
     553 *
     554 */
     555LPSTR CDECL CRTDLL__strspnp(LPSTR str1, LPSTR str2)
     556{
     557  str1 += strspn(str1,str2);
     558  return *str1? str1 : 0;
     559}
     560
     561
     562/*********************************************************************
     563 *                  _swab           (CRTDLL.299)
     564 *
     565 * Copy from source to dest alternating bytes (i.e 16 bit big-to-little
     566 * endian or vice versa).
     567 */
     568void CDECL CRTDLL__swab(LPSTR src, LPSTR dst, INT len)
     569{
     570  //_swab(s1, s2, i);
     571 
     572  if (len > 1)
     573  {
     574    len = (unsigned)len >> 1;
     575
     576    while (len--) {
     577      *dst++ = src[1];
     578      *dst++ = *src++;
     579      src++;
     580    }
     581  }
     582}
  • trunk/src/crtdll/crt_wc.cpp

    r2855 r4667  
    1 /* $Id: crt_wc.cpp,v 1.2 2000-02-21 23:11:30 sandervl Exp $ */
     1/* $Id: crt_wc.cpp,v 1.3 2000-11-21 23:48:49 phaller Exp $ */
    22
    33/*
     
    253253{
    254254  dprintf2(("CRTDLL: iswalnum(%08xh)\n", i));
     255  //return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
    255256  return (iswalnum(i));
    256257}
     
    264265  dprintf2(("CRTDLL: iswalpha(%08xh)\n", i));
    265266  return (iswalpha(i));
    266 }
    267 
    268 
    269 /*********************************************************************
    270  *                  iswascii    (CRTDLL.404)
    271  */
    272 int CDECL CRTDLL_iswascii(wint_t c)
    273 {
    274   dprintf2(("CRTDLL: iswascii\n", c));
    275   return  (!((c)&(~0x7f)));
     267  //return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
    276268}
    277269
     
    283275{
    284276  dprintf2(("CRTDLL: iswcntrl(%08xh)\n", i));
     277  //return get_char_typeW(wc) & C1_CNTRL;
    285278  return (iswcntrl(i));
    286279}
     
    303296{
    304297  dprintf2(("CRTDLL: iswdigit(%08xh)\n", i));
     298  //return get_char_typeW(wc) & C1_DIGIT;
    305299  return (iswdigit(i));
    306300}
     
    313307{
    314308  dprintf2(("CRTDLL: iswgraph(%08xh)\n", i));
     309  //return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
    315310  return (iswgraph(i));
    316311}
     
    323318{
    324319  dprintf2(("CRTDLL: iswlower(%08xh)\n", i));
     320  //return get_char_typeW(wc) & C1_LOWER;
    325321  return (iswlower(i));
    326322}
     
    333329{
    334330  dprintf2(("CRTDLL: iswprint(%08xh)\n", i));
     331  //return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
    335332  return (iswprint(i));
    336333}
     
    343340{
    344341  dprintf2(("CRTDLL: iswpunct(%08xh)\n", i));
     342  //return get_char_typeW(wc) & C1_PUNCT;
    345343  return (iswpunct(i));
    346344}
     
    353351{
    354352  dprintf2(("CRTDLL: iswspace(%08xh)\n", i));
     353  //return get_char_typeW(wc) & C1_SPACE;
    355354  return (iswspace(i));
    356355}
     
    363362{
    364363  dprintf2(("CRTDLL: iswupper(%08xh)\n", i));
     364  //return get_char_typeW(wc) & C1_UPPER;
    365365  return (iswupper(i));
    366366}
     
    373373{
    374374  dprintf2(("CRTDLL: iswxdigit(%08xh)\n", i));
     375  //return get_char_typeW(wc) & C1_XDIGIT;
    375376  return (iswxdigit(i));
    376377}
     
    448449
    449450/*********************************************************************
    450  *                  vswprintf       (CRTDLL.498)
    451  */
    452 int CDECL CRTDLL_vswprintf( wchar_t *s , size_t t, const wchar_t *format, va_list arg )
    453 {
    454   dprintf2(("CRTDLL: vswprintf\n"));
    455   return (vswprintf(s, t, format, arg));
    456 }
    457 
    458 
    459 /*********************************************************************
    460451 *                  wcscat            (CRTDLL.500)
    461452 */
     
    731722{
    732723  dprintf2(("CRTDLL: wctomb\n"));
     724  //return WideCharToMultiByte( CP_ACP, 0, &ch, 1, dst, 6, NULL, NULL );
    733725  return (wctomb((char*)dst,ch));
    734726}
  • trunk/src/crtdll/crtdll.cpp

    r3737 r4667  
    1 /* $Id: crtdll.cpp,v 1.26 2000-06-21 18:39:32 phaller Exp $ */
     1/* $Id: crtdll.cpp,v 1.27 2000-11-21 23:48:49 phaller Exp $ */
    22
    33/*
     
    6767
    6868
    69 
    70 #define FS_OS2   unsigned short sel = RestoreOS2FS();
    71 #define FS_WIN32 SetFS(sel);
    72 
    7369#define dprintf2 dprintf
    74 
    75 
    76 /*********************************************************************
    77  *                  CRTDLL_MainInit  (CRTDLL.init)
    78  */
    79 BOOL WINAPI CRTDLL_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
    80 {
    81   FS_OS2
    82    
    83     if (fdwReason == DLL_PROCESS_ATTACH) {
    84       _fdopen(0,"r");
    85       _fdopen(1,"w");
    86       _fdopen(2,"w");
    87       CRTDLL_hHeap = HeapCreate(0, 0x10000, 0);
    88     }
    89     else
    90       if (fdwReason == DLL_PROCESS_DETACH) {
    91         HeapDestroy(CRTDLL_hHeap);
    92         CRTDLL_hHeap = 0;
    93       }
    94  
    95   FS_WIN32
    96   return TRUE;
    97 }
    98 
    99 
    100 /*********************************************************************
    101  *                  new           (CRTDLL.001)
    102  */
    103 VOID* CDECL CRTDLL_new(DWORD size)
    104 {
    105     dprintf2(("CRTDLL: ??2@YAPAXI@Z\n"));
    106     VOID* result;
    107     if(!(result = Heap_Alloc(size)) && new_handler)
    108         (*new_handler)();
    109     return result;
    110 }
    111 
    112 
    113 /*********************************************************************
    114  *                  delete       (CRTDLL.002)
    115  */
    116 VOID CDECL CRTDLL_delete(VOID* ptr)
    117 {
    118     dprintf2(("CRTDLL: ??3@YAXPAX@Z\n"));
    119     Heap_Free(ptr);
    120 }
    121 
    122 
    123 /*********************************************************************
    124  *                  set_new_handler(CRTDLL.003)
    125  */
    126 new_handler_type CDECL CRTDLL_set_new_handler(new_handler_type func)
    127 {
    128     dprintf2(("CRTDLL: ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z\n"));
    129     new_handler_type old_handler = new_handler;
    130     new_handler = func;
    131     return old_handler;
    132 }
    13370
    13471
     
    341278
    342279/*********************************************************************
    343  *                  _GetMainArgs  (CRTDLL.22)
    344  */
    345 DWORD CDECL CRTDLL__GetMainArgs(LPDWORD argc,LPSTR **argv,
    346                                 LPSTR *environ,DWORD flag)
    347 {
    348         char *cmdline;
    349         char  **xargv;
    350         int     xargc,i,afterlastspace;
    351         DWORD   version;
    352 
    353         dprintf2(("CRTDLL: GetMainArgs\n"));
    354 
    355         CRTDLL_acmdln_dll = cmdline = HEAP_strdupA( GetProcessHeap(), 0,
    356                                                     GetCommandLineA() );
    357 
    358         version = GetVersion();
    359         CRTDLL_osver_dll       = version >> 16;
    360         CRTDLL_winminor_dll    = version & 0xFF;
    361         CRTDLL_winmajor_dll    = (version>>8) & 0xFF;
    362         CRTDLL_baseversion_dll = version >> 16;
    363         CRTDLL_winver_dll      = ((version >> 8) & 0xFF) + ((version & 0xFF) << 8);
    364         CRTDLL_baseminor_dll   = (version >> 16) & 0xFF;
    365         CRTDLL_basemajor_dll   = (version >> 24) & 0xFF;
    366         CRTDLL_osversion_dll   = version & 0xFFFF;
    367         CRTDLL_osminor_dll     = version & 0xFF;
    368         CRTDLL_osmajor_dll     = (version>>8) & 0xFF;
    369 
    370         /* missing threading init */
    371 
    372         i=0;xargv=NULL;xargc=0;afterlastspace=0;
    373 /*
    374         while (cmdline[i]) {
    375                 if (cmdline[i]==' ') {
    376                         xargv=(char**)HeapReAlloc( GetProcessHeap(), 0, xargv,
    377                                                    sizeof(char*)*(++xargc));
    378                         cmdline[i]='\0';
    379                         xargv[xargc-1] = HEAP_strdupA( GetProcessHeap(), 0,
    380                                                        cmdline+afterlastspace);
    381                         i++;
    382                         while (cmdline[i]==' ')
    383                                 i++;
    384                         if (cmdline[i])
    385                                 afterlastspace=i;
    386 
    387                 } else
    388                         i++;
    389 
    390         }
    391 
    392         xargv=(char**)HeapReAlloc( GetProcessHeap(), 0, xargv,
    393                                    sizeof(char*)*(++xargc));
    394         cmdline[i]='\0';
    395         xargv[xargc-1] = HEAP_strdupA( GetProcessHeap(), 0,
    396                                        cmdline+afterlastspace);
    397 */
    398         CRTDLL_argc_dll = xargc;
    399         *argc           = xargc;
    400         CRTDLL_argv_dll = xargv;
    401         *argv           = xargv;
    402         CRTDLL_environ_dll = *environ = GetEnvironmentStringsA();
    403         dprintf2(("CRTDLL: GetMainArgs end\n"));
    404         return 0;
    405 }
    406 
    407 
    408 /*********************************************************************
    409  *                  __doserrno            (CRTDLL.26)
    410  */
    411 int * CDECL CRTDLL___doserrno()
    412 {       
    413         dprintf2(("CRTDLL: __doserrno\n"));
    414         return (__doserrno());
    415 }
    416 
    417 
    418 /*********************************************************************
    419  *           CRTDLL___isascii   (CRTDLL.28)
    420  */
    421 int CDECL CRTDLL___isascii(int i)
    422 {
    423   //TODO: Check if really ok.
    424   dprintf(("CRTDLL: __isascii -> _isascii\n"));
    425   return (_isascii(i));
    426 }
    427 
    428 
    429 /*********************************************************************
    430  *           CRTDLL___iscsym   (CRTDLL.29)
    431  */
    432 int CDECL CRTDLL___iscsym(int c)
    433 {
    434   //TODO: Check if really ok.
    435   dprintf(("CRTDLL: __iscsym -> _iscsym\n"));
    436   return (_iscsym(c));
    437 }
    438 
    439 
    440 /*********************************************************************
    441  *           CRTDLL___iscsymf   (CRTDLL.30)
    442  */
    443 int CDECL CRTDLL___iscsymf(int c)
    444 {
    445   //TODO: Check if really ok.
    446   dprintf(("CRTDLL: __iscsymf -> _iscsymf\n"));
    447   return (_iscsymf(c));
    448 }
    449 
    450 
    451 /*********************************************************************
    452280 *           CRTDLL___threadhandle   (CRTDLL.33)
    453281 */
     
    466294  dprintf2(("CRTDLL: __threadid\n"));
    467295  return GetCurrentThreadId();
    468 }
    469 
    470 
    471 /*********************************************************************
    472  *           CRTDLL__access   (CRTDLL.37)
    473  */
    474 int CDECL CRTDLL__access(const char *path,int mode)
    475 {
    476   dprintf2(("CRTDLL: _access\n"));
    477   return (_access(path, mode));
    478 }
    479 
    480 
    481 /*********************************************************************
    482  *           CRTDLL___toascii   (CRTDLL.38)
    483  */
    484 int CDECL CRTDLL___toascii(int c)
    485 {
    486   //TODO: Check if really ok.
    487   dprintf(("CRTDLL: __toascii -> _toascii\n"));
    488   return (_toascii(c));
    489 }
    490 
    491 
    492 /*********************************************************************
    493  *                  _aexit_rtn_dll    (CRTDLL.39)
    494  */
    495 VOID CDECL CRTDLL__aexit_rtn_dll(int exitcode)
    496 {
    497   dprintf2(("CRTDLL: _aexit_rtn_dll\n"));
    498   ExitProcess(exitcode);
    499 }
    500 
    501 
    502 /*********************************************************************
    503  *                  _amsg_exit    (CRTDLL.40)
    504  */
    505 VOID CDECL CRTDLL__amsg_exit(int errnum)
    506 {
    507   dprintf2(("CRTDLL: _amsg_exit\n"));
    508   fprintf(stderr,strerror(errnum));
    509   ExitProcess(-1);
    510 }
    511 
    512 
    513 /*********************************************************************
    514  *           CRTDLL__assert   (CRTDLL.41)
    515  */
    516 void CDECL CRTDLL__assert( char *s1, char *s2, int i)
    517 {
    518   dprintf2(("CRTDLL: _assert\n"));
    519   _assert(s1, s2, i);
    520 }
    521 
    522 
    523 /*********************************************************************
    524  *                  CRTDLL__beep                    (CRTDLL.45)
    525  */
    526 void CDECL CRTDLL__beep(unsigned nFreq, unsigned nDur)
    527 {       
    528   dprintf2(("_beep\n"));
    529   Beep(nFreq,nDur);
    530296}
    531297
     
    591357
    592358/*********************************************************************
    593  *                  _c_exit          (CRTDLL.47)
    594  *
    595  */
    596 void CDECL CRTDLL__c_exit(INT ret)
    597 {
    598         dprintf2(("_c_exit(%d)\n",ret));
    599         ExitProcess(ret);
    600 }
    601 
    602 
    603 /*********************************************************************
    604  *           _cabs   (CRTDLL.48)
    605  */
    606 double CDECL CRTDLL__cabs(struct complex z)
    607 {
    608   dprintf2(("CRTDLL: _cabs\n"));
    609   return (_cabs(z));
    610 }
    611 
    612 
    613 /*********************************************************************
    614  *                  _cexit          (CRTDLL.49)
    615  */
    616 void CDECL CRTDLL__cexit(INT ret)
    617 {
    618   dprintf2(("_cexit(%d)\n",ret));
    619   ExitProcess(ret);
    620 }
    621 
    622 
    623 /*********************************************************************
    624359 *           CRTDLL__cgets  (CRTDLL.50)
    625360 */
     
    632367
    633368/*********************************************************************
    634  *                  _chdir           (CRTDLL.51)
    635  */
    636 INT CDECL CRTDLL__chdir(LPCSTR newdir)
    637 {
    638         dprintf2(("CRTDLL: _chdir\n"));
    639         if (!SetCurrentDirectoryA(newdir))
    640                 return 1;
    641         return 0;
    642 }
    643 
    644 
    645 /*********************************************************************
    646  *                  _chdrive           (CRTDLL.52)
    647  *
    648  *  newdir      [I] drive to change to, A=1
    649  *
    650  */
    651 BOOL CDECL CRTDLL__chdrive(INT newdrive)
    652 {
    653         /* FIXME: generates errnos */
    654         dprintf2(("CRTDLL: _chdrive\n"));
    655         return DRIVE_SetCurrentDrive(newdrive-1);
    656 }
    657 
    658 
    659 /*********************************************************************
    660369 *           CRTDLL__chmod   (CRTDLL.54)
    661370 */
     
    688397
    689398/*********************************************************************
    690  *           CRTDLL__close   (CRTDLL.57)
    691  */
    692 int CDECL CRTDLL__close(int handle)
    693 {
    694   dprintf2(("CRTDLL: _close\n"));
    695  
    696   return CloseHandle(handle);
    697 }
    698 
    699 
    700 /*********************************************************************
    701399 *           CRTDLL__control87   (CRTDLL.60)
    702400 */
     
    739437
    740438/*********************************************************************
    741  *                  CRTDLL__creat      (CRTDLL.66)
    742  */
    743 INT CDECL CRTDLL__creat( const char *s, int i )
    744 {
    745   dprintf2(("CRTDLL: _creat\n"));
    746   return (_creat(s, i));
    747 }
    748 
    749 
    750 /*********************************************************************
    751439 *      _cscanf                                 (CRTDLL.67)
    752440 */
     
    809497
    810498/*********************************************************************
    811  *           _eof   (CRTDLL.76)
    812  */
    813 int CDECL CRTDLL__eof( int _fd )
    814 {
    815   dprintf2(("CRTDLL: _eof\n"));
    816   return (__eof(_fd));
    817 }
    818 
    819 
    820 /*********************************************************************
    821  *           CRTDLL__errno  (CRTDLL.77)
    822  */
    823 int * CDECL CRTDLL__errno(void)
    824 {
    825   dprintf2(("CRTDLL: _errno\n"));
    826   return (_errno());
    827 }
    828 
    829 
    830 /*********************************************************************
    831  *                  _except_handler2  (CRTDLL.78)
    832  */
    833 INT CDECL CRTDLL__except_handler2 ( PEXCEPTION_RECORD rec,
    834         PEXCEPTION_FRAME frame, PCONTEXT context,
    835         PEXCEPTION_FRAME  *dispatcher)
    836 {
    837         dprintf (("exception %lx flags=%lx at %p handler=%p %p %p stub\n",
    838         rec->ExceptionCode, rec->ExceptionFlags, rec->ExceptionAddress,
    839         frame->Handler, context, dispatcher));
    840         return ExceptionContinueSearch;
    841 }
    842 
    843 
    844 /*********************************************************************
    845499 *           _execl   (CRTDLL.79)
    846500 */
     
    923577
    924578/*********************************************************************
    925  *                  _exit          (CRTDLL.87)
    926  */
    927 VOID CDECL CRTDLL__exit(DWORD ret)
    928 {
    929         dprintf2(("CRTDLL: _exit\n"));
    930         ExitProcess(ret);
    931 }
    932 
    933 
    934 /*********************************************************************
    935  *           _fcloseall   (CRTDLL.89)
    936  */
    937 int CDECL CRTDLL__fcloseall( void )
    938 {
    939   dprintf2(("CRTDLL: _fcloseall\n"));
    940   return (_fcloseall());
    941 }
    942 
    943 
    944 /*********************************************************************
    945579 *           _fcvt  (CRTDLL.90)
    946580 */
     
    953587
    954588/*********************************************************************
    955  *                  _fdopen     (CRTDLL.91)
    956  */
    957 FILE * CDECL CRTDLL__fdopen(INT handle, LPCSTR mode)
    958 {
    959     dprintf2(("CRTDLL: _fdopen\n"));
    960     return (_fdopen(handle, mode));
    961 }
    962 
    963 
    964 /*********************************************************************
    965  *           _fgetchar  (CRTDLL.92)
    966  */
    967 int CDECL CRTDLL__fgetchar( void )
    968 {
    969   dprintf2(("CRTDLL: _fgetchar\n"));
    970   return (_fgetchar());
    971 }
    972 
    973 
    974 /*********************************************************************
    975589 *           CRTDLL__filelength     (CRTDLL.96)
    976590 */
     
    979593  dprintf2(("CRTDLL: _filelength\n"));
    980594  return (_filelength(i));
    981 }
    982 
    983 
    984 /*********************************************************************
    985  *           _fileno     (CRTDLL.97)
    986  */
    987 int CDECL CRTDLL__fileno(FILE * f)
    988 {
    989   dprintf2(("CRTDLL: _fileno\n"));
    990   return (_fileno(f));
    991 }
    992 
    993 
    994 /*********************************************************************
    995  *                  _flushall     (CRTDLL.103)
    996  */
    997 INT CDECL CRTDLL__flushall(void)
    998 {
    999   dprintf2(("CRTDLL: _flushall\n"));
    1000   return (_flushall());
    1001 }
    1002 
    1003 
    1004 /*********************************************************************
    1005  *      _fpreset                                (CRTDLL.107)
    1006  */
    1007 void CDECL CRTDLL__fpreset(void)
    1008 {
    1009   dprintf(("CRTDLL: _fpreset\n"));
    1010   _fpreset();
    1011 }
    1012 
    1013 
    1014 /*********************************************************************
    1015  *                  _fputchar     (CRTDLL.108)
    1016  */
    1017 INT CDECL CRTDLL__fputchar( int c )
    1018 {
    1019   dprintf2(("CRTDLL: _fputchar\n"));
    1020   return(_fputchar(c));
    1021 }
    1022 
    1023 
    1024 /*********************************************************************
    1025  *      _fstat                                  (CRTDLL.111)
    1026  */
    1027 int CDECL CRTDLL__fstat(int file, struct stat* buf)
    1028 {
    1029   dprintf(("CRTDLL: _fstat\n"));
    1030   return (_fstat(file, buf));
    1031595}
    1032596
     
    1056620
    1057621/*********************************************************************
    1058  *                  _fullpath     (CRTDLL.114)
    1059  */
    1060 char * CDECL CRTDLL__fullpath( char *buf, char *path, size_t size )
    1061 {
    1062   dprintf2(("CRTDLL: _fullpath\n"));
    1063   return (_fullpath(buf, path, size));
    1064 }
    1065 
    1066 
    1067 /*********************************************************************
    1068622 *                  _gcvt     (CRTDLL.116)
    1069623 */
     
    1092646  dprintf2(("CRTDLL: _getche\n"));
    1093647  return (_getche());
    1094 }
    1095 
    1096 
    1097 /*********************************************************************
    1098  *                  _getcwd     (CRTDLL.120)
    1099  */
    1100 char * CDECL CRTDLL__getcwd( char *buf, size_t size )
    1101 {
    1102   dprintf2(("CRTDLL: _getcwd\n"));
    1103   return (_getcwd(buf, size));
    1104 }
    1105 
    1106 
    1107 /*********************************************************************
    1108  *                  _getdcwd     (CRTDLL.121)
    1109  */
    1110 char * CDECL CRTDLL__getdcwd( int drive, char *buffer, size_t maxlen )
    1111 {
    1112   dprintf2(("CRTDLL: _getdcwd\n"));
    1113   return (_getdcwd(drive, buffer, maxlen));
    1114 }
    1115 
    1116 
    1117 /*********************************************************************
    1118  *                  _getdrive    (CRTDLL.124)
    1119  */
    1120 unsigned CDECL CRTDLL__getdrive( void )
    1121 {
    1122   dprintf2(("CRTDLL: _getdrive\n"));
    1123   return DRIVE_GetCurrentDrive() + 1;
    1124648}
    1125649
     
    1181705
    1182706
    1183 /*******************************************************************
    1184  *         _global_unwind2  (CRTDLL.129)
    1185  */
    1186 void CDECL CRTDLL__global_unwind2( PEXCEPTION_FRAME frame )
    1187 {
    1188     dprintf2(("CRTDLL: _global_unwind2\n"));
    1189     RtlUnwind( frame, 0, NULL, 0 );
    1190 }
    1191 
    1192 
    1193 /*********************************************************************
    1194  *                  _heapchk    (CRTDLL.130)
    1195  */
    1196 int CDECL CRTDLL__heapchk( void )
    1197 {
    1198   dprintf2(("CRTDLL: _heapchk\n"));
    1199   return (_heapchk());
    1200 }
    1201 
    1202 
    1203 /*********************************************************************
    1204  *                  _heapmin    (CRTDLL.131)
    1205  */
    1206 int CDECL CRTDLL__heapmin( void )
    1207 {
    1208   dprintf2(("CRTDLL: _heapmin\n"));
    1209   return (_heapmin());
    1210 }
    1211 
    1212 
    1213 /*********************************************************************
    1214  *                  _heapset    (CRTDLL.132)
    1215  */
    1216 int CDECL CRTDLL__heapset( unsigned int fill )
    1217 {
    1218   dprintf2(("CRTDLL: _heapset\n"));
    1219   return (_heapset(fill));
    1220 }
    1221 
    1222 
    1223707/*********************************************************************
    1224708 *                  _hypot     (CRTDLL.134)
     
    1228712  dprintf2(("CRTDLL: _hypot\n"));
    1229713  return (_hypot(x1, x2));
    1230 }
    1231 
    1232 
    1233 /*********************************************************************
    1234  *                  _initterm     (CRTDLL.135)
    1235  */
    1236 DWORD CDECL CRTDLL__initterm(_INITTERMFUN *start,_INITTERMFUN *end)
    1237 {
    1238         dprintf2(("CRTDLL: initterm\n"));
    1239         _INITTERMFUN    *current;
    1240 
    1241         current=start;
    1242         while (current<end) {
    1243                 if (*current) (*current)();
    1244                 current++;
    1245         }
    1246         return 0;
    1247 }
    1248 
    1249 
    1250 /*********************************************************************
    1251  *                  _isctype           (CRTDLL.138)
    1252  */
    1253 BOOL CDECL CRTDLL__isctype(CHAR x,CHAR type)
    1254 {
    1255         dprintf2(("CRTDLL: isctype\n"));
    1256         if ((type & CRTDLL_SPACE) && isspace(x))
    1257                 return TRUE;
    1258         if ((type & CRTDLL_PUNCT) && ispunct(x))
    1259                 return TRUE;
    1260         if ((type & CRTDLL_LOWER) && islower(x))
    1261                 return TRUE;
    1262         if ((type & CRTDLL_UPPER) && isupper(x))
    1263                 return TRUE;
    1264         if ((type & CRTDLL_ALPHA) && isalpha(x))
    1265                 return TRUE;
    1266         if ((type & CRTDLL_DIGIT) && isdigit(x))
    1267                 return TRUE;
    1268         if ((type & CRTDLL_CONTROL) && iscntrl(x))
    1269                 return TRUE;
    1270         /* check CRTDLL_LEADBYTE */
    1271         return FALSE;
    1272714}
    1273715
     
    1326768
    1327769/*********************************************************************
    1328  *                  _loaddll    (CRTDLL.171)
    1329  */
    1330 void * CDECL CRTDLL__loaddll (char *name)
    1331 {
    1332   dprintf2(("CRTDLL: _loaddll\n"));
    1333   return (void*)LoadLibraryA(name);
    1334 }
    1335 
    1336 
    1337 /*******************************************************************
    1338  *         _local_unwind2  (CRTDLL.172)
    1339  */
    1340 void CDECL CRTDLL__local_unwind2( PEXCEPTION_FRAME endframe, DWORD nr )
    1341 {
    1342         dprintf2(("CRTDLL: _local_unwind2\n"));
    1343 }
    1344 
    1345 
    1346 /*********************************************************************
    1347  *                  _lrotl      (CRTDLL.175)
    1348  */
    1349 unsigned long CDECL CRTDLL__lrotl( unsigned long value, unsigned int shift )
    1350 {
    1351   dprintf2(("CRTDLL: _lrotl\n"));
    1352   return (_lrotl(value, shift));
    1353 }
    1354 
    1355 
    1356 /*********************************************************************
    1357  *                  _lrotr      (CRTDLL.176)
    1358  */
    1359 unsigned long CDECL CRTDLL__lrotr( unsigned long value, unsigned int shift )
    1360 {
    1361   dprintf2(("CRTDLL: _lrotr\n"));
    1362   return (_lrotr(value, shift));
    1363 }
    1364 
    1365 
    1366 /*********************************************************************
    1367  *                  _lseek      (CRTDLL.178)
    1368  */
    1369 long CDECL CRTDLL__lseek(int handle,long offset,int origin)
    1370 {
    1371   dprintf2(("CRTDLL: _lssek\n"));
    1372   return (_lseek(handle, offset, origin));
    1373 }
    1374 
    1375 
    1376 /*********************************************************************
    1377770 *                  _ltoa       (CRTDLL.179)
    1378771 */
     
    1380773{
    1381774    return ltoa(x,buf,radix);
    1382 }
    1383 
    1384 
    1385 /*********************************************************************
    1386  *                  _makepath   (CRTDLL.180)
    1387  */
    1388 void CDECL CRTDLL__makepath( char *path, char *drive,
    1389                     char *dir, char *fname, char *ext )
    1390 {
    1391   dprintf2(("CRTDLL: _makepath\n"));
    1392   _makepath(path, drive, dir, fname, ext);
    1393775}
    1394776
     
    1401783  dprintf2(("CRTDLL: _matherr\n"));
    1402784  return (_matherr(excep));
    1403 }
    1404 
    1405 
    1406 /*********************************************************************
    1407  *                  _mkdir           (CRTDLL.232)
    1408  */
    1409 INT CDECL CRTDLL__mkdir(LPCSTR newdir)
    1410 {
    1411         dprintf2(("CRTDLL: _mkdir\n"));
    1412         if (!CreateDirectoryA(newdir,NULL))
    1413                 return -1;
    1414         return 0;
    1415785}
    1416786
     
    1456826
    1457827/*********************************************************************
    1458  *                  _msize        (CRTDLL.234)
    1459  */
    1460 size_t CDECL CRTDLL__msize( void *ptr )
    1461 {
    1462   dprintf2(("CRTDLL: _msize\n"));
    1463   return (_msize(ptr));
    1464 }
    1465 
    1466 
    1467 /*********************************************************************
    1468  *                  _onexit        (CRTDLL.236)
    1469  */
    1470 onexit_t CDECL CRTDLL__onexit(onexit_t t)
    1471 {
    1472   dprintf2(("CRTDLL: _onexit\n"));
    1473   return (_onexit(t));
    1474 }
    1475 
    1476 
    1477 /*********************************************************************
    1478  *                  _open        (CRTDLL.237)
    1479  */
    1480 HFILE CDECL CRTDLL__open(LPCSTR path,INT flags)
    1481 {
    1482     dprintf2(("CRTDLL: _open\n"));
    1483     DWORD access = 0, creation = 0;
    1484     HFILE ret;
    1485    
    1486     switch(flags & 3)
    1487     {
    1488     case O_RDONLY: access |= GENERIC_READ; break;
    1489     case O_WRONLY: access |= GENERIC_WRITE; break;
    1490     case O_RDWR:   access |= GENERIC_WRITE | GENERIC_READ; break;
    1491     }
    1492 
    1493     if (flags & 0x0100) /* O_CREAT */
    1494     {
    1495         if (flags & 0x0400) /* O_EXCL */
    1496             creation = CREATE_NEW;
    1497         else if (flags & 0x0200) /* O_TRUNC */
    1498             creation = CREATE_ALWAYS;
    1499         else
    1500             creation = OPEN_ALWAYS;
    1501     }
    1502     else  /* no O_CREAT */
    1503     {
    1504         if (flags & 0x0200) /* O_TRUNC */
    1505             creation = TRUNCATE_EXISTING;
    1506         else
    1507             creation = OPEN_EXISTING;
    1508     }
    1509     if (flags & 0x0008) /* O_APPEND */
    1510         dprintf2(("O_APPEND not supported\n" ));
    1511     if (flags & 0xf0f4)
    1512       dprintf2(("CRTDLL_open file unsupported flags 0x%04x\n",flags));
    1513     /* End Fixme */
    1514 
    1515     ret = CreateFileA( path, access, FILE_SHARE_READ | FILE_SHARE_WRITE,
    1516                          NULL, creation, FILE_ATTRIBUTE_NORMAL, -1 );
    1517     dprintf2(("CRTDLL_open file %s mode 0x%04x got handle %d\n", path,flags,ret));
    1518     return ret;
    1519 }
    1520 
    1521 
    1522 /*********************************************************************
    1523  *                  _open_osfhandle  (CRTDLL.238)
    1524  */
    1525 INT CDECL CRTDLL__open_osfhandle( long osfhandle, int flags )
    1526 {
    1527   dprintf2(("CRTDLL: _open_osfhandle\n"));
    1528 HFILE handle;
    1529  
    1530         switch (osfhandle) {
    1531         case STD_INPUT_HANDLE :
    1532         case 0 :
    1533           handle=0;
    1534           break;
    1535         case STD_OUTPUT_HANDLE:
    1536         case 1:
    1537           handle=1;
    1538           break;
    1539         case STD_ERROR_HANDLE:
    1540         case 2:
    1541           handle=2;
    1542           break;
    1543         default:
    1544           return (-1);
    1545         }
    1546         dprintf2(("(handle %08lx,flags %d) return %d\n",
    1547                      osfhandle,flags,handle));
    1548         return handle;
    1549 }
    1550 
    1551 
    1552 /*********************************************************************
    1553828 *                  _purecall     (CRTDLL.249)
    1554829 */
     
    1556831{
    1557832  dprintf2(("CRTDLL: _purecall\n"));
    1558 }
    1559 
    1560 
    1561 /*********************************************************************
    1562  *                  _putch     (CRTDLL.250)
    1563  */
    1564 INT CDECL CRTDLL__putch( int i )
    1565 {
    1566   dprintf2(("CRTDLL: _putch\n"));
    1567   return (_putch(i));
    1568833}
    1569834
     
    1590855
    1591856/*********************************************************************
    1592  *                  _read     (CRTDLL.254)
    1593  */
    1594 INT CDECL CRTDLL__read(int handle, void *buf, size_t nbyte)
    1595 {
    1596   dprintf(("CRTDLL: _read\n"));
    1597 /*
    1598   int n, *pflags, *pla;
    1599   size_t j, k;
    1600   char *dst, c;
    1601 
    1602   if ((pflags = _fd_flags (handle)) == NULL
    1603       || (pla = _fd_lookahead (handle)) == NULL)
    1604     {
    1605       errno = EBADF;
    1606       return -1;
    1607     }
    1608 
    1609   *pflags &= ~F_CRLF;
    1610   if (nbyte > 0 && (*pflags & F_EOF))
    1611     return 0;
    1612   dst = buf;
    1613   n = read_lookahead (handle, dst, nbyte, pla);
    1614   if (n == -1)
    1615     return -1;
    1616   if ((*pflags & O_TEXT) && !(*pflags & F_TERMIO) && n > 0)
    1617     {
    1618       if (!(*pflags & (F_PIPE|F_SOCKET|F_DEV)) && dst[n-1] == 0x1a &&
    1619           _eof (handle))
    1620         {
    1621           --n;
    1622           *pflags |= F_EOF;
    1623           if (n == 0)
    1624             return 0;
    1625         }
    1626       if (n == 1 && dst[0] == '\r')
    1627         {
    1628           int saved_errno = errno;
    1629           j = read_lookahead (handle, &c, 1, pla);
    1630           if (j == -1 && errno == EAGAIN)
    1631             {
    1632               *pla = dst[0];
    1633               return -1;
    1634             }
    1635           errno = saved_errno;               
    1636           if (j == 1 && c == '\n')           
    1637             {
    1638               dst[0] = '\n';
    1639               *pflags |= F_CRLF;
    1640             }
    1641           else
    1642             *pla = c;
    1643         }
    1644       else
    1645         {
    1646 
    1647           if (_crlf (dst, n, &k))
    1648             {
    1649 
    1650               *pla = '\r';
    1651               --n;
    1652             }
    1653           if (k != n)
    1654             *pflags |= F_CRLF;
    1655           n = k;
    1656         }
    1657     }
    1658   return n;
    1659 */
    1660   return 0;
    1661 }
    1662 
    1663 
    1664 /*********************************************************************
    1665  *                  _rmdir     (CRTDLL.255)
    1666  */
    1667 INT CDECL CRTDLL__rmdir(const char *path)
    1668 {
    1669   dprintf2(("CRTDLL: _rmdir\n"));
    1670   if (!RemoveDirectoryA(path))
    1671         return -1;
    1672   return 0;
    1673 }
    1674 
    1675 
    1676 /*********************************************************************
    1677857 *                  _rmtmp     (CRTDLL.256)
    1678858 */
     
    1681861  dprintf2(("CRTDLL: _rmtmp\n"));
    1682862  return(_rmtmp());
    1683 }
    1684 
    1685 
    1686 /*********************************************************************
    1687  *           CRTDLL__rotl        (CRTDLL.257)
    1688  */
    1689 unsigned int CDECL CRTDLL__rotl( unsigned int value, unsigned int shift )
    1690 {
    1691   dprintf2(("CRTDLL: _rotl\n"));
    1692   return (_rotl(value, shift));
    1693 }
    1694 
    1695 
    1696 /*********************************************************************
    1697  *           CRTDLL__rotr        (CRTDLL.258)
    1698  */
    1699 unsigned int CDECL CRTDLL__rotr( unsigned int value, unsigned int shift )
    1700 {
    1701   dprintf2(("CRTDLL: _rotr\n"));
    1702   return (_rotr(value, shift));
    1703863}
    1704864
     
    1733893  dprintf2(("CRTDLL: _setjmp -> setjmp (NOT IDENTICAL!!!)\n"));
    1734894  return(setjmp( env));
    1735 }
    1736 
    1737 
    1738 /*********************************************************************
    1739  *                  _setmode           (CRTDLL.263)
    1740  */
    1741 INT CDECL CRTDLL__setmode( INT fh,INT mode)
    1742 {
    1743         dprintf2(("CRTDLL: _setmode\n"));
    1744         return (_setmode(fh, mode));
    1745895}
    1746896
     
    1771921
    1772922/*********************************************************************
    1773  *                  _sleep           (CRTDLL.265)
    1774  */
    1775 VOID CDECL CRTDLL__sleep(unsigned long timeout)
    1776 {
    1777   dprintf2(("_sleep for %ld milliseconds\n",timeout));
    1778   Sleep((timeout)?timeout:1);
    1779 }
    1780 
    1781 
    1782 /*********************************************************************
    1783923 *      _sopen                                  (CRTDLL.268)
    1784924 */
     
    1841981
    1842982/*********************************************************************
    1843  *           CRTDLL__spawnve     (CRTDLL.274)
    1844  */
    1845 int CDECL CRTDLL__spawnve( int i, char *s1, char ** s2, char ** s3 )
    1846 {
    1847   dprintf2(("CRTDLL: _spawnve\n"));
    1848   return (_spawnve(i, s1, s2, s3));
    1849 }
    1850 
    1851 
    1852 /*********************************************************************
    1853983 *           CRTDLL__spawnvp     (CRTDLL.275)
    1854984 */
     
    18701000
    18711001/*********************************************************************
    1872  *           _splitpath          (CRTDLL.277)
    1873  */
    1874 void CDECL CRTDLL__splitpath( char *path, char *drive, char *dir, char *fname, char *ext )
    1875 {
    1876   dprintf2(("CRTDLL: _splitpath"));
    1877   _splitpath( path, drive, dir, fname, ext);
    1878 }
    1879 
    1880 
    1881 /*********************************************************************
    1882  *           CRTDLL__stat        (CRTDLL.278)
    1883  */
    1884 int CDECL CRTDLL__stat( const char *s1, struct stat * n )
    1885 {
    1886   dprintf2(("CRTDLL: _stat\n"));
    1887   return(_stat(s1, n));
    1888 }
    1889 
    1890 
    1891 /*********************************************************************
    18921002 *           CRTDLL__statusfp    (CRTDLL.279)
    18931003 */
     
    18971007  return (_status87());
    18981008}
    1899 
    1900 
    1901 /*********************************************************************
    1902  *           CRTDLL__swab        (CRTDLL.299)
    1903  */
    1904 void CDECL CRTDLL__swab(char *s1, char *s2, int i)
    1905 {
    1906   dprintf2(("CRTDLL: _swab\n"));
    1907   _swab(s1, s2, i);
    1908 }
    1909 
    1910 
    1911 /*********************************************************************
    1912  *           CRTDLL__tell        (CRTDLL.302)
    1913  */
    1914 long CDECL CRTDLL__tell( int i )
    1915 {
    1916   dprintf2(("CRTDLL: _tell\n"));
    1917   return (_tell(i));
    1918 }
    1919 
    1920 
    1921 /*********************************************************************
    1922  *           CRTDLL__tempnam     (CRTDLL.303)
    1923  */
    1924 char * CDECL CRTDLL__tempnam( char *dir, char *prefix )
    1925 {
    1926   dprintf2(("CRTDLL: _tempnam\n"));
    1927   return (_tempnam(dir, prefix));
    1928 }
    19291009       
    1930 
    1931 /*********************************************************************
    1932  *           CRTDLL__tolower     (CRTDLL.305)
    1933  */
    1934 int CDECL CRTDLL__tolower(int n)
    1935 {
    1936   dprintf2(("CRTDLL: _tolower\n"));
    1937   return (_tolower(n));
    1938 }
    1939 
    1940 
    1941 /*********************************************************************
    1942  *           CRTDLL__toupper     (CRTDLL.306)
    1943  */
    1944 int CDECL CRTDLL__toupper(int n)
    1945 {
    1946   dprintf2(("CRTDLL: _toupper\n"));
    1947   return (_toupper(n));
    1948 }
    1949 
    19501010
    19511011/*********************************************************************
     
    19601020
    19611021/*********************************************************************
    1962  *           CRTDLL__umask       (CRTDLL.310)
    1963  */
    1964 int CDECL CRTDLL__umask( int i )
    1965 {
    1966   dprintf2(("CRTDLL: _umask\n"));
    1967   return (_umask(i));
    1968 }
    1969 
    1970 
    1971 /*********************************************************************
    19721022 *           CRTDLL__ungetch     (CRTDLL.311)
    19731023 */
     
    19761026  dprintf2(("CRTDLL: _ungetch\n"));
    19771027  return (_ungetch(i));
    1978 }
    1979 
    1980 
    1981 /*********************************************************************
    1982  *                  _unlink           (CRTDLL.312)
    1983  */
    1984 INT CDECL CRTDLL__unlink(LPCSTR pathname)
    1985 {
    1986     dprintf2(("CRTDLL: _unlink\n"));
    1987     int ret=0;
    1988     DOS_FULL_NAME full_name;
    1989 
    1990     if (!DOSFS_GetFullName( pathname, FALSE, (CHAR*)&full_name )) {
    1991       dprintf2(("CRTDLL_unlink file %s bad name\n",pathname));
    1992       return EOF;
    1993     }
    1994  
    1995     ret=unlink(full_name.long_name);
    1996     dprintf2(("(%s unix %s)\n",
    1997                    pathname,full_name.long_name));
    1998     if(ret)
    1999       dprintf2((" Failed!\n"));
    2000 
    2001     return ret;
    2002 }
    2003 
    2004 
    2005 /*********************************************************************
    2006  *           _unloaddll  (CRTDLL.313)
    2007  */
    2008 int CDECL CRTDLL__unloaddll(void *handle)
    2009 {
    2010   dprintf2(("CRTDLL: _unloaddll\n"));
    2011   return FreeLibrary((HMODULE)handle);
    20121028}
    20131029
     
    20381054
    20391055/*********************************************************************
    2040  *                  _write        (CRTDLL.329)
    2041  */
    2042 INT CDECL CRTDLL__write(INT fd,LPCVOID buf,UINT count)
    2043 {
    2044         dprintf2(("CRTDLL: _write\n"));
    2045         INT len=0;
    2046 
    2047         if (fd == -1)
    2048           len = -1;
    2049         else if (fd<=2)
    2050           len = (UINT)write(fd,buf,(LONG)count);
    2051         else
    2052           len = _lwrite(fd,(LPCSTR)buf,count);
    2053         dprintf2(("%d/%d byte to dfh %d from %p,\n",
    2054                        len,count,fd,buf));
    2055         return len;
    2056 }
    2057 
    2058 
    2059 /*********************************************************************
    20601056 *                  _y0     (CRTDLL.332)
    20611057 */
     
    20881084
    20891085/*********************************************************************
    2090  *                  abort       (CRTDLL.335)
    2091  */
    2092 void CDECL CRTDLL_abort( void )
    2093 {
    2094   dprintf2(("CRTDLL: abort\n"));
    2095   abort();
    2096 }
    2097 
    2098 
    2099 /*********************************************************************
    21001086 *                  abs         (CRTDLL.336)
    21011087 */
     
    21581144  dprintf2(("CRTDLL: atan2\n"));
    21591145  return (atan2(y, x));
    2160 }
    2161 
    2162 
    2163 /*********************************************************************
    2164  *                  atexit      (CRTDLL.342)
    2165  */
    2166 int CDECL CRTDLL_atexit(void (*func)(void))
    2167 {
    2168   dprintf(("CRTDLL: atexit\n"));
    2169   if (_atexit_n >= sizeof (_atexit_v) / sizeof (_atexit_v[0]))
    2170     return -1;
    2171   _atexit_v[_atexit_n++] = func;
    2172   return 0;
    21731146}
    21741147
     
    22371210
    22381211/*********************************************************************
    2239  *                  calloc      (CRTDLL.347)
    2240  */
    2241 void * CDECL CRTDLL_calloc( size_t n, size_t size )
    2242 {
    2243 //  dprintf2(("CRTDLL: calloc\n"));
    2244   return Heap_Alloc(size*n);
    2245 }
    2246 
    2247 
    2248 /*********************************************************************
    22491212 *                  ceil        (CRTDLL.348)
    22501213 */
     
    22541217           d));
    22551218  return (ceil(d));
    2256 }
    2257 
    2258 
    2259 /*********************************************************************
    2260  *                  clearerr    (CRTDLL.349)
    2261  */
    2262 void CDECL CRTDLL_clearerr( FILE *fp )
    2263 {
    2264   dprintf2(("CRTDLL: clearerr\n"));
    2265   clearerr(fp);
    22661219}
    22671220
     
    23341287
    23351288/*********************************************************************
    2336  *                  exit          (CRTDLL.356)
    2337  */
    2338 void CDECL CRTDLL_exit(DWORD ret)
    2339 {
    2340         dprintf2(("CRTDLL: exit\n"));
    2341         ExitProcess(ret);
    2342 }
    2343 
    2344 
    2345 /*********************************************************************
    23461289 *                  exp         (CRTDLL.357)
    23471290 */
     
    23661309
    23671310/*********************************************************************
    2368  *                  fclose      (CRTDLL.359)
    2369  */
    2370 int CDECL CRTDLL_fclose( FILE *fp )
    2371 {
    2372   dprintf2(("CRTDLL: fclose\n"));
    2373   return (fclose(fp));
    2374 }
    2375 
    2376 
    2377 /*********************************************************************
    2378  *                  feof        (CRTDLL.360)
    2379  */
    2380 int CDECL CRTDLL_feof( FILE *fp )
    2381 {
    2382   dprintf2(("CRTDLL: feof\n"));
    2383   return (feof(fp));
    2384 }
    2385 
    2386 
    2387 /*********************************************************************
    2388  *                  ferror      (CRTDLL.361)
    2389  */
    2390 int CDECL CRTDLL_ferror( FILE *fp )
    2391 {
    2392   dprintf2(("CRTDLL: ferror\n"));
    2393   return (ferror(fp));
    2394 }
    2395 
    2396 
    2397 /*********************************************************************
    2398  *                  fflush      (CRTDLL.362)
    2399  */
    2400 int CDECL CRTDLL_fflush( FILE *fp )
    2401 {
    2402   dprintf2(("CRTDLL: fflush\n"));
    2403   return (fflush(fp));
    2404 }
    2405 
    2406 
    2407 /*********************************************************************
    2408  *                  fgetc       (CRTDLL.363)
    2409  */
    2410 int CDECL CRTDLL_fgetc( FILE *fp )
    2411 {
    2412   dprintf2(("CRTDLL: fgetc\n"));
    2413   return (fgetc(fp));
    2414 }
    2415 
    2416 
    2417 /*********************************************************************
    2418  *                  fgetpos     (CRTDLL.364)
    2419  */
    2420 int CDECL CRTDLL_fgetpos( FILE *fp, fpos_t *pos )
    2421 {
    2422   dprintf2(("CRTDLL: fgetpos\n"));
    2423   return (fgetpos(fp, pos));
    2424 }
    2425 
    2426 
    2427 /*********************************************************************
    2428  *                  fgets       (CRTDLL.365)
    2429  */
    2430 char * CDECL CRTDLL_fgets( char *s, int n, FILE *fp )
    2431 {
    2432   dprintf2(("CRTDLL: fgets\n"));
    2433   return (fgets(s, n, fp));
    2434 }
    2435 
    2436 
    2437 /*********************************************************************
    24381311 *                  floor               (CRTDLL.367)
    24391312 */
     
    24581331
    24591332/*********************************************************************
    2460  *                  fopen       (CRTDLL.369)
    2461  */
    2462 FILE * CDECL CRTDLL_fopen( const char *filename, const char *mode )
    2463 {
    2464   dprintf2(("CRTDLL: fopen\n"));
    2465   return (fopen( filename, mode));
    2466 }
    2467 
    2468 
    2469 /*********************************************************************
    2470  *                  fprintf       (CRTDLL.370)
    2471  */
    2472 INT CDECL CRTDLL_fprintf( FILE *file, LPSTR format, va_list arg )
    2473 {
    2474     dprintf2(("CRTDLL: fprintf\n"));
    2475     return (fprintf(file, format, arg));
    2476 }
    2477 
    2478 
    2479 /*********************************************************************
    2480  *                  fputc   (CRTDLL.371)
    2481  */
    2482 int CDECL CRTDLL_fputc( int c, FILE *fp )
    2483 {
    2484   dprintf2(("CRTDLL: fputc\n"));
    2485   return (fputc(c, fp));
    2486 }
    2487 
    2488 
    2489 /*********************************************************************
    2490  *                  fputs   (CRTDLL.372)
    2491  */
    2492 int CDECL CRTDLL_fputs( const char *s, FILE *fp )
    2493 {
    2494   dprintf2(("CRTDLL: fputs\n"));
    2495   return (fputs(s, fp));
    2496 }
    2497 
    2498 
    2499 
    2500 /*********************************************************************
    2501  *                  fread  (CRTDLL.374)
    2502  */
    2503 size_t CDECL CRTDLL_fread( void *ptr, size_t size, size_t n, FILE *fp )
    2504 {
    2505 //  dprintf2(("CRTDLL: fread\n"));
    2506   return (fread(ptr, size, n, fp));
    2507 }
    2508 
    2509  
    2510 /*********************************************************************
    2511  *                  free          (CRTDLL.375)
    2512  */
    2513 VOID CDECL CRTDLL_free(LPVOID ptr)
    2514 {
    2515 //    dprintf2(("CRTDLL: free\n"));
    2516     Heap_Free(ptr);
    2517 }
    2518 
    2519 
    2520 /*********************************************************************
    2521  *                  freopen       (CRTDLL.376)
    2522  */
    2523 FILE * CDECL CRTDLL_freopen( const char *filename, const char *mode, FILE *fp )
    2524 {
    2525   dprintf2(("CRTDLL: freopen\n"));
    2526   return (freopen(filename, mode, fp));
    2527 }
    2528 
    2529 
    2530 /*********************************************************************
    25311333 *                  frexp         (CRTDLL.377)
    25321334 */
     
    25391341
    25401342/*********************************************************************
    2541  *                  fscanf        (CRTDLL.378)
    2542  */
    2543 int CDECL CRTDLL_fscanf( FILE*fp, const char *format, va_list arg )
    2544 {
    2545   dprintf2(("CRTDLL: fscanf\n"));
    2546   return (fscanf(fp, format, arg));
    2547 }
    2548 
    2549 
    2550 /*********************************************************************
    2551  *                  fseek         (CRTDLL.379)
    2552  */
    2553 int CDECL CRTDLL_fseek( FILE *file, long int offset, int whence )
    2554 {
    2555   dprintf2(("CRTDLL: fseek\n"));
    2556   return (fseek(file, offset, whence));
    2557 }
    2558 
    2559 
    2560 /*********************************************************************
    2561  *                  fsetpos       (CRTDLL.380)
    2562  */
    2563 int CDECL CRTDLL_fsetpos( FILE *fp, const fpos_t *pos )
    2564 {
    2565   dprintf2(("CRTDLL: fsetpos\n"));
    2566   return (fsetpos(fp, pos));
    2567 }
    2568 
    2569 
    2570 /*********************************************************************
    2571  *                  ftell         (CRTDLL.381)
    2572  */
    2573 long int CDECL CRTDLL_ftell( FILE *fp )
    2574 {
    2575   dprintf2(("CRTDLL: ftell\n"));
    2576   return (ftell(fp));
    2577 }
    2578 
    2579 
    2580 /*********************************************************************
    2581  *                  fwrite     (CRTDLL.383)
    2582  */
    2583 DWORD CDECL CRTDLL_fwrite( LPVOID ptr, INT size, INT nmemb, FILE *file )
    2584 {
    2585     dprintf2(("CRTDLL: fwrite\n"));
    2586     return (fwrite( ptr, size, nmemb, file));
    2587 }
    2588 
    2589 
    2590 /*********************************************************************
    2591  *                  getc    (CRTDLL.385)
    2592  */
    2593 int CDECL CRTDLL_getc( FILE *fp )
    2594 {
    2595   dprintf2(("CRTDLL: getc\n"));
    2596   return (getc(fp));
    2597 }
    2598 
    2599 
    2600 /*********************************************************************
    2601  *                  getchar    (CRTDLL.386)
    2602  */
    2603 int CDECL CRTDLL_getchar( void )
    2604 {
    2605   dprintf2(("CRTDLL: getchar\n"));
    2606   return (getchar());
    2607 }
    2608 
    2609 
    2610 /*********************************************************************
    2611  *                  getenv    (CRTDLL.387)
    2612  */
    2613 char * CDECL CRTDLL_getenv( const char *name )
    2614 {
    2615   dprintf2(("CRTDLL: getenv\n"));
    2616   return (getenv(name));
    2617 }
    2618 
    2619 
    2620 /*********************************************************************
    2621  *                  gets    (CRTDLL.388)
    2622  */
    2623 char * CDECL CRTDLL_gets( char *s )
    2624 {
    2625   dprintf2(("CRTDLL: gets\n"));
    2626   return (gets(s));
    2627 }
    2628 
    2629 
    2630 /*********************************************************************
    26311343 *                  gmtime    (CRTDLL.389)
    26321344 */
     
    28311543
    28321544/*********************************************************************
    2833  *                  longjmp        (CRTDLL.423)
    2834  */
    2835 VOID CDECL CRTDLL_longjmp(jmp_buf env, int val)
    2836 {
    2837     dprintf2(("CRTDLL: longjmp\n"));
    2838     longjmp(env, val);
    2839 }
    2840 
    2841 
    2842 /*********************************************************************
    2843  *                  malloc        (CRTDLL.424)
    2844  */
    2845 VOID* CDECL CRTDLL_malloc(DWORD size)
    2846 {
    2847 //      dprintf2(("CRTDLL: malloc\n"));
    2848       return Heap_Alloc(size);
    2849 }
    2850 
    2851 
    2852 /*********************************************************************
    28531545 *                  mktime   (CRTDLL.433)
    28541546 */
     
    28711563
    28721564/*********************************************************************
    2873  *                  perror   (CRTDLL.435)
    2874  */
    2875 void CDECL CRTDLL_perror( const char *s )
    2876 {
    2877     dprintf2(("CRTDLL: perror\n"));
    2878     perror( s );
    2879 }
    2880 
    2881 
    2882 /*********************************************************************
    28831565 *                  pow      (CRTDLL.436)
    28841566 */
     
    28971579  dprintf2(("CRTDLL: printf\n"));
    28981580  return (printf(format, arg));
    2899 }
    2900 
    2901 
    2902 /*********************************************************************
    2903  *                  putc      (CRTDLL.438)
    2904  */
    2905 int CDECL CRTDLL_putc( int c, FILE *fp )
    2906 {
    2907     dprintf2(("CRTDLL: putc\n"));
    2908     return putc( c, fp );
    2909 }
    2910 
    2911 
    2912 /*********************************************************************
    2913  *                  putchar      (CRTDLL.439)
    2914  */
    2915 int CDECL CRTDLL_putchar( int c )
    2916 {
    2917     dprintf2(("CRTDLL: putchar\n"));
    2918     return putchar( c );
    2919 }
    2920 
    2921 
    2922 /*********************************************************************
    2923  *                  puts         (CRTDLL.440)
    2924  */
    2925 int CDECL CRTDLL_puts( const char *s )
    2926 {
    2927     dprintf2(("CRTDLL: puts\n"));
    2928     return puts( s );
    29291581}
    29301582
     
    29531605
    29541606/*********************************************************************
    2955  *                  rand   (CRTDLL.443)
    2956  */
    2957 int CDECL CRTDLL_rand( void )
    2958 {
    2959 //    dprintf2(("CRTDLL: rand\n"));
    2960     return (rand());
    2961 }
    2962 
    2963 
    2964 /*********************************************************************
    2965  *                  realloc   (CRTDLL.444)
    2966  */
    2967 void * CDECL CRTDLL_realloc( void *ptr, size_t size )
    2968 {
    2969     dprintf2(("CRTDLL: realloc\n"));
    2970     return HeapReAlloc( GetProcessHeap(), 0, ptr, size );
    2971 }
    2972 
    2973 
    2974 /*********************************************************************
    2975  *                  remove           (CRTDLL.445)
    2976  */
    2977 INT CDECL CRTDLL_remove(const char* file)
    2978 {
    2979   dprintf2(("CRTDLL: remove\n"));
    2980   return (remove(file));
    2981 }
    2982 
    2983 
    2984 /*********************************************************************
    2985  *                  rename      (CRTDLL.446)
    2986  */
    2987 int CDECL CRTDLL_rename (const char *old, const char *new2)
    2988 {
    2989   dprintf2(("CRTDLL: rename\n"));
    2990   return (rename(old, new2));
    2991 }
    2992 
    2993 
    2994 /*********************************************************************
    2995  *                  rewind      (CRTDLL.447)
    2996  */
    2997 void CDECL CRTDLL_rewind( FILE *fp )
    2998 {
    2999   dprintf2(("CRTDLL: rewind\n"));
    3000   rewind(fp);
    3001 }
    3002 
    3003 
    3004 /*********************************************************************
    30051607 *      scanf                                   (CRTDLL.448)
    30061608 */
     
    30131615
    30141616/*********************************************************************
    3015  *                  setbuf      (CRTDLL.449)
    3016  */
    3017 void CDECL CRTDLL_setbuf( FILE *fp, char *buf )
    3018 {
    3019   dprintf2(("CRTDLL: setbuf\n"));
    3020   setbuf(fp, buf);
    3021 }
    3022 
    3023 
    3024 /*********************************************************************
    3025  *                  setlocale      (CRTDLL.450)
    3026  */
    3027 char * CDECL CRTDLL_setlocale(int category,const char *locale)
    3028 {
    3029   dprintf2(("CRTDLL: setlocale\n"));
    3030   return (setlocale(category, locale));
    3031 }
    3032 
    3033 
    3034 /*********************************************************************
    30351617 *                  setvbuf      (CRTDLL.451)
    30361618 */
     
    30391621  dprintf2(("CRTDLL: setvbuf\n"));
    30401622  return (setvbuf(fp, buf, mode, size));
    3041 }
    3042 
    3043 
    3044 /*********************************************************************
    3045  *                  signal       (CRTDLL.452)
    3046  */
    3047 _SigFunc CDECL CRTDLL_signal(int sig, _SigFunc func)
    3048 {
    3049   dprintf(("CRTDLL: signal\n"));
    3050   return (signal(sig, func));
    30511623}
    30521624
     
    31271699
    31281700/*********************************************************************
    3129  *                  system         (CRTDLL.482)
    3130  */
    3131 int CDECL CRTDLL_system( const char *string )
    3132 {
    3133   dprintf2(("CRTDLL: system\n"));
    3134   return system(string);
    3135 }
    3136 
    3137 
    3138 /*********************************************************************
    31391701 *                  tan           (CRTDLL.483)
    31401702 */
     
    31781740}
    31791741
    3180        
    3181 /*********************************************************************
    3182  *                  tmpnam           (CRTDLL.487)
    3183  */
    3184 char * CDECL CRTDLL_tmpnam( char *s )
    3185 {
    3186   dprintf2(("CRTDLL: tmpnam\n"));
    3187   return (tmpnam(s));
    3188 }
    3189 
    31901742
    31911743/*********************************************************************
     
    32241776
    32251777/*********************************************************************
    3226  *                  vfprintf       (CRTDLL.494)
    3227  */
    3228 INT CDECL CRTDLL_vfprintf( FILE *file, LPSTR format, va_list args )
    3229 {
    3230     dprintf2(("CRTDLL: vfprintf\n"));
    3231     return (vfprintf(file, format, args));
    3232 }
    3233 
    3234 
    3235 /*********************************************************************
    32361778 *                  vprintf       (CRTDLL.496)
    32371779 */
     
    32501792  dprintf2(("CRTDLL: vsprintf(%08xh, %08xh)\n", s, format));
    32511793  return (vsprintf(s, format, arg));
    3252 }
    3253 
    3254 
    3255 /*********************************************************************
    3256  *           CRTDLL__itow        (CRTDLL.600)
    3257  */
    3258 char * CDECL CRTDLL__itow(int i, char *s, int r)
    3259 {
    3260   dprintf(("CRTDLL: _itow(%08xh, %08xh, %08xh) no unicode support !\n",
    3261            i,
    3262            s,
    3263            r));
    3264 
    3265   return (itoa(i,s,r));
    32661794}
    32671795
  • trunk/src/crtdll/makefile

    r4624 r4667  
    1 # $Id: makefile,v 1.12 2000-11-19 09:22:35 bird Exp $
     1# $Id: makefile,v 1.13 2000-11-21 23:48:52 phaller Exp $
    22
    33#
     
    1818#
    1919OBJS = \
     20$(OBJDIR)\crtdll_main.obj \
     21$(OBJDIR)\dir.obj \
     22$(OBJDIR)\exit.obj \
     23$(OBJDIR)\file.obj \
     24$(OBJDIR)\mbstring.obj \
     25$(OBJDIR)\memory.obj \
     26$(OBJDIR)\spawn.obj \
     27                     \
    2028$(OBJDIR)\crtdll.obj \
    2129$(OBJDIR)\asmhlp.obj \
     
    2432$(OBJDIR)\crt_string.obj \
    2533$(OBJDIR)\crt_memory.obj \
    26 $(OBJDIR)\crt_mb.obj \
    2734$(OBJDIR)\crt_wc.obj \
    2835$(OBJDIR)\initterm.obj \
     
    5259#
    5360!include $(PDWIN32_INCLUDE)/pdwin32.post
    54 
  • trunk/src/crtdll/stubs.cpp

    r2855 r4667  
    1 /* $Id: stubs.cpp,v 1.3 2000-02-21 23:11:31 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.4 2000-11-21 23:48:53 phaller Exp $ */
    22
    33/*
     
    2626
    2727/*********************************************************************
    28  *      __dllonexit                             (CRTDLL.25)
    29  */
    30 VOID CDECL CRTDLL___dllonexit ()
    31 {       
    32   dprintf(("__dllonexit not implemented.\n"));
    33   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    34 }
    35 
    36 
    37 /*********************************************************************
    3828 *                  __fpecode            (CRTDLL.27)
    3929 */
     
    5848
    5949/*********************************************************************
    60  *      _abnormal_termination                   (CRTDLL.36)
    61  */
    62 int CDECL CRTDLL__abnormal_termination(void)
    63 {
    64   dprintf(("CRTDLL: _abnormal_termination  not implemented.\n"));
    65   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    66   return FALSE;
    67 }
    68 
    69 
    70 /*********************************************************************
    71  *           _chgsign    (CRTDLL.53)
    72  */
    73 double CDECL CRTDLL__chgsign(double x)
    74 {
    75   dprintf(("CRTDLL: _chgsign not implemented.\n"));
    76   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    77   return FALSE;
    78 }
    79 
    80 
    81 /*********************************************************************
    82  *                  _commit    (CRTDLL.58)
    83  */
    84 int CDECL CRTDLL__commit( int fd )
    85 {
    86   dprintf(("CRTDLL: _commit not implemented.\n"));
    87   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    88   return FALSE;
    89 }
    90 
    91 
    92 /*********************************************************************
    93  *                  _copysign    (CRTDLL.62)
    94  */
    95 double CDECL CRTDLL__copysign( double d, double s )
    96 {
    97   dprintf(("CRTDLL: _copysign not implemented\n"));
    98   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    99   return FALSE;
    100 }
    101 
    102 
    103 /*********************************************************************
    104  *      _expand                                 (CRTDLL.88)
    105  */
    106 void * CDECL CRTDLL__expand( void *ptr, size_t size )
    107 {
    108   dprintf(("CRTDLL: _expand not implemented.\n"));
    109   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    110   return FALSE;
    111 }
    112 
    113 
    114 /*********************************************************************
    115  *      _filbuf                                 (CRTDLL.94)
    116  */
    117 int CDECL CRTDLL__filbuf(FILE * f)
    118 {
    119   dprintf(("CRTDLL: _filbuf not implemented.\n"));
    120   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    121   return FALSE;
    122 }
    123 
    124 
    125 /*********************************************************************
    126 *                  _findclose    (CRTDLL.098)
    127 */
    128 int CDECL CRTDLL__findclose( long handle )
    129 {
    130   dprintf(("CRTDLL: _findclose not implemented.\n"));
    131   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    132   return FALSE;
    133 }
    134 
    135 
    136 /*********************************************************************
    137  *      _findfirst                              (CRTDLL.099)
    138  */
    139 DWORD CDECL CRTDLL__findfirst(const char *_name, struct _finddata_t *result)
    140 {
    141   dprintf(("CRTDLL: _findfirst not implemented.\n"));
    142   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    143   return FALSE;
    144 }
    145 
    146 
    147 /*********************************************************************
    148  *      _findnext                               (CRTDLL.100)
    149  */
    150 INT CDECL CRTDLL__findnext(DWORD hand, struct find_t * x2)
    151 {
    152   dprintf(("CRTDLL: _findnext not implemented.\n"));
    153   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    154   return FALSE;
    155 }
    156 
    157 
    158 /*********************************************************************
    159  *                  _finite     (CRTDLL.101)
    160  */
    161 INT CDECL CRTDLL__finite(double x)
    162 {
    163   dprintf(("CRTDLL: _finite not implemented.\n"));
    164   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    165   return FALSE;
    166 }
    167 
    168 
    169 /*********************************************************************
    170  *      _flsbuf                                 (CRTDLL.102)
    171  */
    172 INT CDECL CRTDLL__flsbuf(int i, FILE * f)
    173 {
    174   dprintf(("CRTDLL: _flsbuf not implemented.\n"));
    175   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    176   return FALSE;
    177 }
    178 
    179 
    180 /*********************************************************************
    18150 *                  _fpclass     (CRTDLL.105)
    18251 */
     
    21281
    21382/*********************************************************************
    214  *      _fsopen                                 (CRTDLL.110)
    215  */
    216 FILE * CDECL CRTDLL__fsopen( const char *file, const char *mode, int shflag )
    217 {
    218   dprintf(("CRTDLL: _fsopen not implemented.\n"));
    219   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    220   return FALSE;
    221 }
    222 
    223 
    224 /*********************************************************************
    22583 *      _futime                                 (CRTDLL.115)
    22684 */
     
    23492
    23593/*********************************************************************
    236  *                  _get_osfhandle     (CRTDLL.117)
    237  */
    238 void* CDECL CRTDLL__get_osfhandle( int fileno )
    239 {
    240   dprintf(("CRTDLL: _get_osfhandle not implemented.\n"));
    241   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    242   return 0;
    243 }
    244 
    245 
    246 /*********************************************************************
    247  *                  _getdiskfree     (CRTDLL.122)
    248  */
    249 unsigned int CDECL CRTDLL__getdiskfree( unsigned int drive, struct _diskfree_t *diskspace)
    250 {
    251   dprintf(("CRTDLL: _getdiskfree not implemented\n"));
    252   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    253   return 0;
    254 }
    255 
    256 
    257 /*********************************************************************
    25894 *                  _getdllprocaddr     (CRTDLL.123)
    25995 */
     
    267103
    268104/*********************************************************************
    269  *      _heapwalk                               (CRTDLL.133)
    270  */
    271 int CDECL CRTDLL__heapwalk( struct _heapinfo *entry )
    272 {
    273   dprintf(("CRTDLL: _heapwalk not implemented.\n"));
    274   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    275   return 0;
    276 }
    277 
    278 
    279 /*********************************************************************
    280  *                  _isatty       (CRTDLL.137)
    281  */
    282 BOOL CDECL CRTDLL__isatty(DWORD x)
    283 {
    284    dprintf(("CRTDLL: _isatty(%ld) not implemented.\n",x));
    285    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    286    return TRUE;
    287 }
    288 
    289 
    290 /*********************************************************************
    291105 *                  _ismbbalnum     (CRTDLL.139)
    292106 */
     
    560374  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    561375  return 0;
    562 }
    563 
    564 
    565 /*********************************************************************
    566  *                  _isnan     (CRTDLL.164)
    567  */
    568 int CDECL CRTDLL__isnan( double x )
    569 {
    570   dprintf(("CRTDLL: _isnan not implemented.\n"));
    571   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    572   return FALSE;
    573376}
    574377
     
    609412
    610413/*********************************************************************
    611  *      _lsearch                                (CRTDLL.177)
    612  */
    613 void * CDECL CRTDLL__lsearch(const void *key, void *base, size_t *nelp, size_t width,
    614          int (*compar)(const void *, const void *))
    615 {
    616   dprintf(("CRTDLL: _lsearch not implemented.\n"));
    617   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    618   return FALSE;
    619 }
    620 
    621 
    622 /*********************************************************************
    623414 *                  _mbbtombc        (CRTDLL.182)
    624415 */
     
    639430  SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    640431  return FALSE;
    641 }
    642 
    643 
    644 /*********************************************************************
    645  *                  _mbccpy        (CRTDLL.184)
    646  */
    647 void CDECL CRTDLL__mbccpy( unsigned char *dst, const unsigned char *src )
    648 {
    649   dprintf(("CRTDLL: _mbccpy not implemented.\n"));
    650   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    651432}
    652433
Note: See TracChangeset for help on using the changeset viewer.