Changeset 5618 for trunk/src/shlwapi/string.c
- Timestamp:
- Apr 28, 2001, 3:33:49 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/string.c
r4081 r5618 14 14 #include <winnls.h> 15 15 #endif 16 17 16 #include <ctype.h> 18 17 #include <stdlib.h> … … 21 20 22 21 #include "winerror.h" 23 #include "wine/undocshell.h" 22 #include "windef.h" 23 #include "winbase.h" 24 #include "wingdi.h" 25 #include "winuser.h" 26 #include "shlwapi.h" 27 #include "shlobj.h" 24 28 #include "wine/unicode.h" 25 #include "heap.h"26 29 #include "debugtools.h" 27 30 … … 46 49 return strchrW(str, x); 47 50 } 51 #ifndef __WIN32OS2__ 52 /************************************************************************* 53 * StrCmpIW [SHLWAPI] 54 */ 55 int WINAPI StrCmpIW ( LPCWSTR wstr1, LPCWSTR wstr2 ) 56 { 57 TRACE("%s %s\n", debugstr_w(wstr1),debugstr_w(wstr2)); 58 return strcmpiW( wstr1, wstr2 ); 59 } 60 #endif 48 61 49 62 /************************************************************************* … … 84 97 85 98 /************************************************************************* 99 * StrCmpW [SHLWAPI] 100 */ 101 int WINAPI StrCmpW ( LPCWSTR wstr1, LPCWSTR wstr2 ) 102 { 103 TRACE("%s %s\n", debugstr_w(wstr1),debugstr_w(wstr2)); 104 return strcmpW( wstr1, wstr2 ); 105 } 106 107 /************************************************************************* 86 108 * StrCatW [SHLWAPI] 87 109 */ … … 98 120 { 99 121 return strcpyW( wstr1, wstr2 ); 122 } 123 124 125 /************************************************************************* 126 * StrCpyNW [SHLWAPI] 127 */ 128 LPWSTR WINAPI StrCpyNW( LPWSTR wstr1, LPCWSTR wstr2, int n ) 129 { 130 return lstrcpynW( wstr1, wstr2, n ); 100 131 } 101 132 … … 131 162 } 132 163 133 #ifndef __WIN32OS2__134 164 /************************************************************************* 135 165 * StrStrIA [SHLWAPI] … … 161 191 return NULL; 162 192 } 163 #endif164 193 165 194 /************************************************************************* … … 177 206 int WINAPI StrToIntW(LPCWSTR lpSrc) 178 207 { 179 int ret; 180 LPSTR lpStr = HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc); 181 182 TRACE("%s\n", debugstr_w(lpSrc)); 183 184 ret = atol(lpStr); 185 HeapFree(GetProcessHeap(),0,lpStr); 186 return ret; 208 char buffer[32]; 209 210 TRACE("%s\n", debugstr_w(lpSrc)); 211 WideCharToMultiByte( CP_ACP, 0, lpSrc, -1, buffer, sizeof(buffer), NULL, NULL ); 212 buffer[sizeof(buffer)-1] = 0; 213 return atol(buffer); 214 } 215 216 /************************************************************************* 217 * StrToIntExA [SHLWAPI] 218 */ 219 BOOL WINAPI StrToIntExA( LPCSTR pszString, DWORD dwFlags, LPINT piRet) 220 { 221 TRACE("%s %ld stub !\n", debugstr_a(pszString), dwFlags); 222 piRet = (LPINT) StrToIntA(pszString); 223 return TRUE; 224 } 225 226 /************************************************************************* 227 * StrToIntExW [SHLWAPI] 228 */ 229 BOOL WINAPI StrToIntExW( LPCWSTR pszString, DWORD dwFlags, LPINT piRet) 230 { 231 TRACE("%s %ld stub !\n", debugstr_w(pszString), dwFlags); 232 piRet = (LPINT) StrToIntW(pszString); 233 return TRUE; 187 234 } 188 235 … … 348 395 * the pidl is for STRRET OFFSET 349 396 */ 350 HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLISTpidl, LPSTR dest, DWORD len)397 HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, DWORD len) 351 398 { 352 399 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl); … … 386 433 * the pidl is for STRRET OFFSET 387 434 */ 388 HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLISTpidl, LPWSTR dest, DWORD len)435 HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, DWORD len) 389 436 { 390 437 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl); … … 398 445 399 446 case STRRET_CSTRA: 400 lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len); 447 if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ) && len) 448 dest[len-1] = 0; 401 449 break; 402 450 … … 404 452 if (pidl) 405 453 { 406 lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len); 454 if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1, 455 dest, len ) && len) 456 dest[len-1] = 0; 407 457 } 408 458 break; … … 425 475 TRACE("%lx %p %i\n", dw, pszBuf, cchBuf); 426 476 if ( dw<1024L ) 427 { sprintf (buf,"% 3.1f bytes", (FLOAT)dw);477 { sprintf (buf,"%ld bytes", dw); 428 478 } 429 479 else if ( dw<1048576L) … … 444 494 */ 445 495 LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf ) 446 { char buf[64]; 447 TRACE("%lx %p %i\n", dw, pszBuf, cchBuf); 448 if ( dw<1024L ) 449 { sprintf (buf,"%3.1f bytes", (FLOAT)dw); 450 } 451 else if ( dw<1048576L) 452 { sprintf (buf,"%3.1f KB", (FLOAT)dw/1024); 453 } 454 else if ( dw < 1073741824L) 455 { sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L); 456 } 457 else 458 { sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L); 459 } 460 lstrcpynAtoW (pszBuf, buf, cchBuf); 461 return pszBuf; 496 { 497 char buf[64]; 498 StrFormatByteSizeA( dw, buf, sizeof(buf) ); 499 if (!MultiByteToWideChar( CP_ACP, 0, buf, -1, pszBuf, cchBuf ) && cchBuf) 500 pszBuf[cchBuf-1] = 0; 501 return pszBuf; 502 } 503 504 /************************************************************************* 505 * StrNCatA [SHLWAPI] 506 */ 507 LPSTR WINAPI StrNCatA(LPSTR front, LPCSTR back, INT cchMax) 508 { 509 TRACE("%s %s %i stub\n", debugstr_a(front),debugstr_a(back),cchMax); 510 return (front); 511 } 512 513 /************************************************************************* 514 * StrNCatW [SHLWAPI] 515 */ 516 LPWSTR WINAPI StrNCatW(LPWSTR front, LPCWSTR back, INT cchMax) 517 { 518 TRACE("%s %s %i stub\n", debugstr_w(front),debugstr_w(back),cchMax); 519 return (front); 462 520 } 463 521
Note:
See TracChangeset
for help on using the changeset viewer.