- Timestamp:
- Jul 28, 2010, 8:14:30 PM (15 years ago)
- Location:
- trunk/src/msvcrt
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvcrt/dir.c
r10005 r21398 31 31 #endif 32 32 33 #ifndef __MINIVCRT__ 34 33 35 #include "wine/port.h" 34 36 … … 49 51 50 52 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); 53 54 #else /* !__MINIVCRT__ */ 55 56 #include "minivcrt.h" 57 #include "minivcrt_internal.h" 58 59 #include "winternl.h" 60 #include "wine/unicode.h" 61 62 #include <errno.h> 63 #include <stdlib.h> 64 65 #endif /* !__MINIVCRT__ */ 66 67 #ifndef __MINIVCRT__ 51 68 52 69 /* INTERNAL: Translate finddata_t to PWIN32_FIND_DATAA */ … … 70 87 } 71 88 89 #endif /* !__MINIVCRT__ */ 90 72 91 /* INTERNAL: Translate wfinddata_t to PWIN32_FIND_DATAA */ 73 92 static void msvcrt_wfttofd(LPWIN32_FIND_DATAW fd, struct _wfinddata_t* ft) … … 90 109 } 91 110 111 #ifndef __MINIVCRT__ 112 92 113 /********************************************************************* 93 114 * _chdir (MSVCRT.@) … … 103 124 } 104 125 126 #endif /* !__MINIVCRT__ */ 127 105 128 /********************************************************************* 106 129 * _wchdir (MSVCRT.@) … … 115 138 return 0; 116 139 } 140 141 #ifndef __MINIVCRT__ 117 142 118 143 /********************************************************************* … … 166 191 } 167 192 193 #endif /* !__MINIVCRT__ */ 194 168 195 /********************************************************************* 169 196 * _wfindfirst (MSVCRT.@) … … 185 212 } 186 213 214 #ifndef __MINIVCRT__ 215 187 216 /********************************************************************* 188 217 * _findnext (MSVCRT.@) … … 194 223 if (!FindNextFileA((HANDLE)hand, &find_data)) 195 224 { 196 *MSVCRT__errno() = MSVCRT _ENOENT;225 *MSVCRT__errno() = MSVCRT(ENOENT); 197 226 return -1; 198 227 } … … 202 231 } 203 232 233 #endif /* !__MINIVCRT__ */ 234 204 235 /********************************************************************* 205 236 * _wfindnext (MSVCRT.@) … … 211 242 if (!FindNextFileW((HANDLE)hand, &find_data)) 212 243 { 213 *MSVCRT__errno() = MSVCRT _ENOENT;244 *MSVCRT__errno() = MSVCRT(ENOENT); 214 245 return -1; 215 246 } … … 218 249 return 0; 219 250 } 251 252 #ifndef __MINIVCRT__ 220 253 221 254 /********************************************************************* … … 245 278 } 246 279 280 #endif /* !__MINIVCRT__ */ 281 247 282 /********************************************************************* 248 283 * _wgetcwd (MSVCRT.@) … … 264 299 if (dir_len >= size) 265 300 { 266 *MSVCRT__errno() = MSVCRT _ERANGE;301 *MSVCRT__errno() = MSVCRT(ERANGE); 267 302 return NULL; /* buf too small */ 268 303 } … … 270 305 return buf; 271 306 } 307 308 #ifndef __MINIVCRT__ 272 309 273 310 /********************************************************************* … … 322 359 } 323 360 361 #endif /* !__MINIVCRT__ */ 362 324 363 /********************************************************************* 325 364 * _wgetdcwd (MSVCRT.@) … … 342 381 if (GetDriveTypeW(drivespec) < DRIVE_REMOVABLE) 343 382 { 344 *MSVCRT__errno() = MSVCRT _EACCES;383 *MSVCRT__errno() = MSVCRT(EACCES); 345 384 return NULL; 346 385 } … … 349 388 if (dir_len >= size || dir_len < 1) 350 389 { 351 *MSVCRT__errno() = MSVCRT _ERANGE;390 *MSVCRT__errno() = MSVCRT(ERANGE); 352 391 return NULL; /* buf too small */ 353 392 } … … 360 399 return buf; 361 400 } 401 402 #ifndef __MINIVCRT__ 362 403 363 404 /********************************************************************* … … 399 440 } 400 441 442 #endif /* !__MINIVCRT__ */ 443 401 444 /********************************************************************* 402 445 * _wmkdir (MSVCRT.@) … … 410 453 } 411 454 455 #ifndef __MINIVCRT__ 456 412 457 /********************************************************************* 413 458 * _rmdir (MSVCRT.@) … … 420 465 return -1; 421 466 } 467 468 #endif /* !__MINIVCRT__ */ 422 469 423 470 /********************************************************************* … … 519 566 } 520 567 } 568 569 #ifndef __MINIVCRT__ 521 570 522 571 /* INTERNAL: Helper for _fullpath. Modified PD code from 'snippets'. */ … … 720 769 } 721 770 771 #endif /* !__MINIVCRT__ */ 772 722 773 /********************************************************************* 723 774 * _wmakepath (MSVCRT.@) … … 767 818 } 768 819 820 #ifndef __MINIVCRT__ 821 769 822 /********************************************************************* 770 823 * _searchenv (MSVCRT.@) … … 828 881 } 829 882 883 #endif /* !__MINIVCRT__ */ 884 830 885 MSVCRT_wchar_t* _wfullpath(MSVCRT_wchar_t* absPath,const MSVCRT_wchar_t* relPath,MSVCRT(size_t) size) 831 886 { … … 836 891 837 892 WideCharToMultiByte(CP_ACP, 0, relPath, -1, (LPSTR)asciirelPath, 280, NULL, NULL); 838 893 839 894 MSVCRT__fullpath(asciiabsPath, asciirelPath, size); 840 895 841 896 MultiByteToWideChar(CP_ACP, 0, asciiabsPath, -1, absPath, size); 842 897 843 return absPath; 844 } 898 return absPath; 899 } -
trunk/src/msvcrt/environ.c
r21395 r21398 26 26 #endif 27 27 28 #ifndef __MINIVCRT__ 29 28 30 #include "wine/unicode.h" 29 31 #include "msvcrt.h" … … 32 34 #include "msvcrt/stdlib.h" 33 35 34 35 36 #include "wine/debug.h" 36 37 37 38 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); 39 40 #else /* !__MINIVCRT__ */ 41 42 #include "minivcrt.h" 43 #include "minivcrt_internal.h" 44 45 #include "winternl.h" 46 #include "wine/unicode.h" 47 48 #endif /* !__MINIVCRT__ */ 49 50 #ifndef __MINIVCRT__ 38 51 39 52 /********************************************************************* … … 67 80 } 68 81 82 #endif /* !__MINIVCRT__ */ 83 69 84 /********************************************************************* 70 85 * _wgetenv (MSVCRT.@) … … 97 112 return NULL; 98 113 } 114 115 #ifndef __MINIVCRT__ 99 116 100 117 /********************************************************************* … … 130 147 } 131 148 149 #endif /* !__MINIVCRT__ */ 150 132 151 /********************************************************************* 133 152 * _wputenv (MSVCRT.@) … … 154 173 155 174 ret = !SetEnvironmentVariableW(name, value[0] ? value : NULL); 175 #ifndef __MINIVCRT__ 156 176 /* Update the __p__environ array only when already initialized */ 157 177 if (MSVCRT__environ) … … 159 179 if (MSVCRT__wenviron) 160 180 MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron); 181 #endif /* !__MINIVCRT__ */ 161 182 return ret; 162 183 } -
trunk/src/msvcrt/errno.c
r10005 r21398 19 19 */ 20 20 21 #ifndef __MINIVCRT__ 22 21 23 #include "msvcrt.h" 22 24 #include "msvcrt/errno.h" … … 29 31 #include "msvcrt/string.h" 30 32 31 32 33 #include "wine/debug.h" 33 34 34 35 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); 35 36 37 #else /* !__MINIVCRT__ */ 38 39 #include <winbase.h> 40 #include <winerror.h> 41 42 #include "minivcrt.h" 43 #include "minivcrt_internal.h" 44 45 #include <errno.h> 46 47 #endif /* !__MINIVCRT__ */ 36 48 37 49 /* INTERNAL: Set the crt and dos errno's from the OS error given. */ 38 50 void MSVCRT__set_errno(int err) 39 51 { 40 int *msv_errno = MSVCRT__errno(); 52 #ifndef __MINIVCRT__ 53 54 int *__errno = MSVCRT__errno(); 41 55 unsigned long *doserrno = MSVCRT_doserrno(); 42 56 43 57 *doserrno = err; 58 59 #define ERR_CASE(oserr) case oserr: 60 #define ERR_MAPS(oserr,crterr) case oserr:*__errno = MSVCRT_##crterr;break; 61 62 #else /* !__MINIVCRT__ */ 63 64 int *__errno = _errno(); 65 66 #define ERR_CASE(oserr) case oserr: 67 #define ERR_MAPS(oserr,crterr) case oserr:*__errno = crterr;break; 68 69 #endif /* !__MINIVCRT__ */ 44 70 45 71 switch(err) 46 72 { 47 #define ERR_CASE(oserr) case oserr:48 #define ERR_MAPS(oserr,crterr) case oserr:*msv_errno = crterr;break;49 73 ERR_CASE(ERROR_ACCESS_DENIED) 50 74 ERR_CASE(ERROR_NETWORK_ACCESS_DENIED) … … 57 81 ERR_CASE(ERROR_NOT_LOCKED) 58 82 ERR_CASE(ERROR_INVALID_ACCESS) 59 ERR_MAPS(ERROR_LOCK_VIOLATION, MSVCRT_EACCES);83 ERR_MAPS(ERROR_LOCK_VIOLATION, EACCES); 60 84 ERR_CASE(ERROR_FILE_NOT_FOUND) 61 85 ERR_CASE(ERROR_NO_MORE_FILES) … … 65 89 ERR_CASE(ERROR_BAD_NET_NAME) 66 90 ERR_CASE(ERROR_FILENAME_EXCED_RANGE) 67 ERR_MAPS(ERROR_PATH_NOT_FOUND, MSVCRT_ENOENT);68 ERR_MAPS(ERROR_IO_DEVICE, MSVCRT_EIO);69 ERR_MAPS(ERROR_BAD_FORMAT, MSVCRT_ENOEXEC);70 ERR_MAPS(ERROR_INVALID_HANDLE, MSVCRT_EBADF);91 ERR_MAPS(ERROR_PATH_NOT_FOUND, ENOENT); 92 ERR_MAPS(ERROR_IO_DEVICE, EIO); 93 ERR_MAPS(ERROR_BAD_FORMAT, ENOEXEC); 94 ERR_MAPS(ERROR_INVALID_HANDLE, EBADF); 71 95 ERR_CASE(ERROR_OUTOFMEMORY) 72 96 ERR_CASE(ERROR_INVALID_BLOCK) 73 97 ERR_CASE(ERROR_NOT_ENOUGH_QUOTA); 74 ERR_MAPS(ERROR_ARENA_TRASHED, MSVCRT_ENOMEM);75 ERR_MAPS(ERROR_BUSY, MSVCRT_EBUSY);98 ERR_MAPS(ERROR_ARENA_TRASHED, ENOMEM); 99 ERR_MAPS(ERROR_BUSY, EBUSY); 76 100 ERR_CASE(ERROR_ALREADY_EXISTS) 77 ERR_MAPS(ERROR_FILE_EXISTS, MSVCRT_EEXIST);78 ERR_MAPS(ERROR_BAD_DEVICE, MSVCRT_ENODEV);79 ERR_MAPS(ERROR_TOO_MANY_OPEN_FILES, MSVCRT_EMFILE);80 ERR_MAPS(ERROR_DISK_FULL, MSVCRT_ENOSPC);81 ERR_MAPS(ERROR_BROKEN_PIPE, MSVCRT_EPIPE);82 ERR_MAPS(ERROR_POSSIBLE_DEADLOCK, MSVCRT_EDEADLK);83 ERR_MAPS(ERROR_DIR_NOT_EMPTY, MSVCRT_ENOTEMPTY);84 ERR_MAPS(ERROR_BAD_ENVIRONMENT, MSVCRT_E2BIG);101 ERR_MAPS(ERROR_FILE_EXISTS, EEXIST); 102 ERR_MAPS(ERROR_BAD_DEVICE, ENODEV); 103 ERR_MAPS(ERROR_TOO_MANY_OPEN_FILES, EMFILE); 104 ERR_MAPS(ERROR_DISK_FULL, ENOSPC); 105 ERR_MAPS(ERROR_BROKEN_PIPE, EPIPE); 106 ERR_MAPS(ERROR_POSSIBLE_DEADLOCK, EDEADLK); 107 ERR_MAPS(ERROR_DIR_NOT_EMPTY, ENOTEMPTY); 108 ERR_MAPS(ERROR_BAD_ENVIRONMENT, E2BIG); 85 109 ERR_CASE(ERROR_WAIT_NO_CHILDREN) 86 ERR_MAPS(ERROR_CHILD_NOT_COMPLETE, MSVCRT_ECHILD);110 ERR_MAPS(ERROR_CHILD_NOT_COMPLETE, ECHILD); 87 111 ERR_CASE(ERROR_NO_PROC_SLOTS) 88 112 ERR_CASE(ERROR_MAX_THRDS_REACHED) 89 ERR_MAPS(ERROR_NESTING_NOT_ALLOWED, MSVCRT_EAGAIN);113 ERR_MAPS(ERROR_NESTING_NOT_ALLOWED, EAGAIN); 90 114 default: 91 115 /* Remaining cases map to EINVAL */ 92 116 /* FIXME: may be missing some errors above */ 93 * msv_errno = MSVCRT_EINVAL;117 *__errno = MSVCRT(EINVAL); 94 118 } 95 119 } 120 121 #ifndef __MINIVCRT__ 96 122 97 123 /********************************************************************* … … 100 126 int* MSVCRT__errno(void) 101 127 { 102 dprintf(("MSVCRT: __errno %d",msvcrt_get_thread_data()->msv_errno)); 128 dprintf(("MSVCRT: __errno %d",msvcrt_get_thread_data()->msv_errno)); 103 129 return &msvcrt_get_thread_data()->msv_errno; 104 130 } … … 109 135 unsigned long* MSVCRT_doserrno(void) 110 136 { 111 dprintf(("MSVCRT: _doserrno %d",msvcrt_get_thread_data()->doserrno)); 137 dprintf(("MSVCRT: _doserrno %d",msvcrt_get_thread_data()->doserrno)); 112 138 return &msvcrt_get_thread_data()->doserrno; 113 139 } … … 138 164 MSVCRT__cprintf("%s: %s\n",str,MSVCRT_strerror(msvcrt_get_thread_data()->msv_errno)); 139 165 } 166 167 #endif /* !__MINIVCRT__ */ -
trunk/src/msvcrt/makefile
r9655 r21398 23 23 24 24 all clean lib: # add all common rules here 25 !ifdef BUILD_MSVCRT 25 26 $(MAKE_CMD) -f msvcrt.mak $@ 26 27 $(MAKE_CMD) -f msvcrt20.mak $@ 27 28 $(MAKE_CMD) -f msvcrt40.mak $@ 29 !endif 30 $(MAKE_CMD) -f minivcrt.mak $@ 28 31 29 32 # don't have to make deps more than once. -
trunk/src/msvcrt/wcs.c
r10005 r21398 19 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 */ 21 22 #ifndef __MINIVCRT__ 23 21 24 #include <limits.h> 22 25 #include <stdlib.h> … … 38 41 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); 39 42 43 #else /* !__MINIVCRT__ */ 44 45 #include <string.h> 46 #include <sys/limits.h> 47 48 #include <winbase.h> 49 50 #include "minivcrt.h" 51 #include "minivcrt_internal.h" 52 53 #include "winternl.h" 54 #include "wine/unicode.h" 55 56 #endif /* !__MINIVCRT__ */ 40 57 41 58 /* INTERNAL: MSVCRT_malloc() based wstrndup */
Note:
See TracChangeset
for help on using the changeset viewer.