Ignore:
Timestamp:
Apr 10, 2003, 12:28:07 PM (22 years ago)
Author:
sandervl
Message:

PF: MSVCRT update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/msvcrt/dir.c

    r9633 r10005  
    2323#ifdef __WIN32OS2__
    2424#include <emxheader.h>
     25#include <stdlib.h>
     26#include <string.h>
     27#include <ctype.h>
    2528#include <winbase.h>
    2629#else
     
    9093 *              _chdir (MSVCRT.@)
    9194 */
    92 int _chdir(const char * newdir)
     95int MSVCRT__chdir(const char * newdir)
    9396{
    9497  if (!SetCurrentDirectoryA(newdir))
     
    116119 *              _chdrive (MSVCRT.@)
    117120 */
    118 int _chdrive(int newdrive)
     121int MSVCRT__chdrive(int newdrive)
    119122{
    120123  char buffer[3] = "A:";
     
    219222 *              _getcwd (MSVCRT.@)
    220223 */
    221 char* _getcwd(char * buf, int size)
     224char* MSVCRT__getcwd(char * buf, int size)
    222225{
    223226  char dir[MAX_PATH];
     
    230233  {
    231234    if (size < 0)
    232       return _strdup(dir);
     235      return MSVCRT__strdup(dir);
    233236    return msvcrt_strndup(dir,size);
    234237  }
     
    271274 *              _getdrive (MSVCRT.@)
    272275 */
    273 int _getdrive(void)
     276int MSVCRT__getdrive(void)
    274277{
    275278    char buffer[MAX_PATH];
     
    282285 *              _getdcwd (MSVCRT.@)
    283286 */
    284 char* _getdcwd(int drive, char * buf, int size)
     287char* MSVCRT__getdcwd(int drive, char * buf, int size)
    285288{
    286289  static char* dummy;
     
    288291  TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size);
    289292
    290   if (!drive || drive == _getdrive())
    291     return _getcwd(buf,size); /* current */
     293  if (!drive || drive == MSVCRT__getdrive())
     294    return MSVCRT__getcwd(buf,size); /* current */
    292295  else
    293296  {
     
    312315    TRACE(":returning '%s'\n", dir);
    313316    if (!buf)
    314       return _strdup(dir); /* allocate */
     317      return MSVCRT__strdup(dir); /* allocate */
    315318
    316319    strcpy(buf,dir);
     
    328331  TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size);
    329332
    330   if (!drive || drive == _getdrive())
     333  if (!drive || drive == MSVCRT__getdrive())
    331334    return _wgetcwd(buf,size); /* current */
    332335  else
     
    388391 *              _mkdir (MSVCRT.@)
    389392 */
    390 int _mkdir(const char * newdir)
     393int MSVCRT__mkdir(const char * newdir)
    391394{
    392395  if (CreateDirectoryA(newdir,NULL))
     
    410413 *              _rmdir (MSVCRT.@)
    411414 */
    412 int _rmdir(const char * dir)
     415int MSVCRT__rmdir(const char * dir)
    413416{
    414417  if (RemoveDirectoryA(dir))
     
    439442  MSVCRT_wchar_t pathbuff[MAX_PATH],*path=pathbuff;
    440443
    441   TRACE(":splitting path %s\n",debugstr_w(path));
     444  TRACE("MSVCRT: _wsplitpath %s\n",debugstr_w(path));
    442445  /* FIXME: Should be an strncpyW or something */
    443446  strcpyW(pathbuff, inpath);
     
    586589      if (q > r)
    587590      {
    588         strcpy(q, p + 3);
     591        strcpy(q, p + 3);
    589592        s = q;
    590593      }
     
    622625 *              _fullpath (MSVCRT.@)
    623626 */
    624 char *_fullpath(char * absPath, const char* relPath, unsigned int size)
     627char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size)
    625628{
    626629  char drive[5],dir[MAX_PATH],file[MAX_PATH],ext[MAX_PATH];
     
    631634
    632635  if (!relPath || !*relPath)
    633     return _getcwd(absPath, size);
     636    return MSVCRT__getcwd(absPath, size);
    634637
    635638  if (size < 4)
     
    639642  }
    640643
    641   TRACE(":resolving relative path '%s'\n",relPath);
     644  TRACE("MSVCRT: _fullpath '%s'\n",relPath);
    642645
    643646  _splitpath(relPath, drive, dir, file, ext);
     
    670673
    671674  if (!absPath)
    672     return _strdup(res);
     675    return MSVCRT__strdup(res);
    673676  strcpy(absPath,res);
    674677  return absPath;
     
    678681 *              _makepath (MSVCRT.@)
    679682 */
    680 VOID _makepath(char * path, const char * drive,
     683VOID MSVCRT__makepath(char * path, const char * drive,
    681684                              const char *directory, const char * filename,
    682685                              const char * extension )
     
    767770 *              _searchenv (MSVCRT.@)
    768771 */
    769 void _searchenv(const char* file, const char* env, char *buf)
     772void MSVCRT__searchenv(const char* file, const char* env, char *buf)
    770773{
    771774  char*envVal, *penv;
     
    824827  } while(1);
    825828}
     829
     830MSVCRT_wchar_t* _wfullpath(MSVCRT_wchar_t* absPath,const MSVCRT_wchar_t* relPath,MSVCRT(size_t) size)
     831{
     832   MSVCRT_wchar_t ch;
     833   char asciiabsPath[280], asciirelPath[280];
     834
     835   TRACE("MSVCRT: _wfullpath %s %d\n", debugstr_w(relPath),size);
     836
     837   WideCharToMultiByte(CP_ACP, 0, relPath, -1, (LPSTR)asciirelPath, 280, NULL, NULL);
     838   
     839   MSVCRT__fullpath(asciiabsPath, asciirelPath, size);
     840   
     841   MultiByteToWideChar(CP_ACP, 0, asciiabsPath, -1, absPath, size);
     842
     843   return absPath; 
     844}
Note: See TracChangeset for help on using the changeset viewer.