Changeset 10005 for trunk/src/msvcrt/dir.c
- Timestamp:
- Apr 10, 2003, 12:28:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvcrt/dir.c
r9633 r10005 23 23 #ifdef __WIN32OS2__ 24 24 #include <emxheader.h> 25 #include <stdlib.h> 26 #include <string.h> 27 #include <ctype.h> 25 28 #include <winbase.h> 26 29 #else … … 90 93 * _chdir (MSVCRT.@) 91 94 */ 92 int _chdir(const char * newdir)95 int MSVCRT__chdir(const char * newdir) 93 96 { 94 97 if (!SetCurrentDirectoryA(newdir)) … … 116 119 * _chdrive (MSVCRT.@) 117 120 */ 118 int _chdrive(int newdrive)121 int MSVCRT__chdrive(int newdrive) 119 122 { 120 123 char buffer[3] = "A:"; … … 219 222 * _getcwd (MSVCRT.@) 220 223 */ 221 char* _getcwd(char * buf, int size)224 char* MSVCRT__getcwd(char * buf, int size) 222 225 { 223 226 char dir[MAX_PATH]; … … 230 233 { 231 234 if (size < 0) 232 return _strdup(dir);235 return MSVCRT__strdup(dir); 233 236 return msvcrt_strndup(dir,size); 234 237 } … … 271 274 * _getdrive (MSVCRT.@) 272 275 */ 273 int _getdrive(void)276 int MSVCRT__getdrive(void) 274 277 { 275 278 char buffer[MAX_PATH]; … … 282 285 * _getdcwd (MSVCRT.@) 283 286 */ 284 char* _getdcwd(int drive, char * buf, int size)287 char* MSVCRT__getdcwd(int drive, char * buf, int size) 285 288 { 286 289 static char* dummy; … … 288 291 TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size); 289 292 290 if (!drive || drive == _getdrive())291 return _getcwd(buf,size); /* current */293 if (!drive || drive == MSVCRT__getdrive()) 294 return MSVCRT__getcwd(buf,size); /* current */ 292 295 else 293 296 { … … 312 315 TRACE(":returning '%s'\n", dir); 313 316 if (!buf) 314 return _strdup(dir); /* allocate */317 return MSVCRT__strdup(dir); /* allocate */ 315 318 316 319 strcpy(buf,dir); … … 328 331 TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size); 329 332 330 if (!drive || drive == _getdrive())333 if (!drive || drive == MSVCRT__getdrive()) 331 334 return _wgetcwd(buf,size); /* current */ 332 335 else … … 388 391 * _mkdir (MSVCRT.@) 389 392 */ 390 int _mkdir(const char * newdir)393 int MSVCRT__mkdir(const char * newdir) 391 394 { 392 395 if (CreateDirectoryA(newdir,NULL)) … … 410 413 * _rmdir (MSVCRT.@) 411 414 */ 412 int _rmdir(const char * dir)415 int MSVCRT__rmdir(const char * dir) 413 416 { 414 417 if (RemoveDirectoryA(dir)) … … 439 442 MSVCRT_wchar_t pathbuff[MAX_PATH],*path=pathbuff; 440 443 441 TRACE(" :splittingpath %s\n",debugstr_w(path));444 TRACE("MSVCRT: _wsplitpath %s\n",debugstr_w(path)); 442 445 /* FIXME: Should be an strncpyW or something */ 443 446 strcpyW(pathbuff, inpath); … … 586 589 if (q > r) 587 590 { 588 591 strcpy(q, p + 3); 589 592 s = q; 590 593 } … … 622 625 * _fullpath (MSVCRT.@) 623 626 */ 624 char * _fullpath(char * absPath, const char* relPath, unsigned int size)627 char *MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size) 625 628 { 626 629 char drive[5],dir[MAX_PATH],file[MAX_PATH],ext[MAX_PATH]; … … 631 634 632 635 if (!relPath || !*relPath) 633 return _getcwd(absPath, size);636 return MSVCRT__getcwd(absPath, size); 634 637 635 638 if (size < 4) … … 639 642 } 640 643 641 TRACE(" :resolving relativepath '%s'\n",relPath);644 TRACE("MSVCRT: _fullpath '%s'\n",relPath); 642 645 643 646 _splitpath(relPath, drive, dir, file, ext); … … 670 673 671 674 if (!absPath) 672 return _strdup(res);675 return MSVCRT__strdup(res); 673 676 strcpy(absPath,res); 674 677 return absPath; … … 678 681 * _makepath (MSVCRT.@) 679 682 */ 680 VOID _makepath(char * path, const char * drive,683 VOID MSVCRT__makepath(char * path, const char * drive, 681 684 const char *directory, const char * filename, 682 685 const char * extension ) … … 767 770 * _searchenv (MSVCRT.@) 768 771 */ 769 void _searchenv(const char* file, const char* env, char *buf)772 void MSVCRT__searchenv(const char* file, const char* env, char *buf) 770 773 { 771 774 char*envVal, *penv; … … 824 827 } while(1); 825 828 } 829 830 MSVCRT_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.