Changeset 7820 for trunk/src/shlwapi/string.c
- Timestamp:
- Feb 6, 2002, 9:18:30 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/string.c
r7508 r7820 1 //Note: Odin changes marked by #ifdef __WIN32OS2__!2 #ifdef __WIN32OS2__3 #include <odin.h>4 #include <odinwrap.h>5 #include <os2sel.h>6 7 #include <string.h>8 #include <wctype.h>9 #include <wcstr.h>10 #define HAVE_WCTYPE_H11 #include <win\shlwapi.h>12 13 #include <heapstring.h>14 #include <winnls.h>15 #endif16 1 #include <ctype.h> 17 2 #include <stdlib.h> … … 24 9 #include "wingdi.h" 25 10 #include "winuser.h" 11 #include "winreg.h" 12 #ifdef __WIN32OS2__ 13 #include "shlobj.h" 14 #define NO_SHLWAPI_STREAM 15 #include "shlwapi.h" 16 #else 17 #define NO_SHLWAPI_STREAM 26 18 #include "shlwapi.h" 27 19 #include "shlobj.h" 20 #endif 28 21 #include "wine/unicode.h" 29 22 #include "debugtools.h" … … 32 25 33 26 /************************************************************************* 34 * StrChrA [SHLWAPI] 27 * ChrCmpIA [SHLWAPI.385] 28 * 29 * Note: Returns 0 (FALSE) if characters are equal (insensitive). 30 */ 31 BOOL WINAPI ChrCmpIA (WORD w1, WORD w2) 32 { 33 TRACE("%c ? %c\n", w1, w2); 34 return (toupper(w1) != toupper(w2)); 35 } 36 37 /************************************************************************* 38 * ChrCmpIW [SHLWAPI.386] 39 * 40 * Note: Returns 0 (FALSE) if characters are equal (insensitive). 41 */ 42 BOOL WINAPI ChrCmpIW (WCHAR w1, WCHAR w2) 43 { 44 TRACE("%c ? %c\n", w1, w2); 45 return (toupperW(w1) != toupperW(w2)); 46 } 47 48 /************************************************************************* 49 * StrChrA [SHLWAPI.@] 35 50 */ 36 51 LPSTR WINAPI StrChrA (LPCSTR str, WORD c) … … 41 56 42 57 /************************************************************************* 43 * StrChrW [SHLWAPI ]58 * StrChrW [SHLWAPI.@] 44 59 * 45 60 */ … … 49 64 return strchrW(str, x); 50 65 } 51 #ifndef __WIN32OS2__ 52 /************************************************************************* 53 * StrCmpIW [SHLWAPI ]66 67 /************************************************************************* 68 * StrCmpIW [SHLWAPI.@] 54 69 */ 55 70 int WINAPI StrCmpIW ( LPCWSTR wstr1, LPCWSTR wstr2 ) … … 58 73 return strcmpiW( wstr1, wstr2 ); 59 74 } 60 #endif 61 62 /************************************************************************* 63 * StrCmpNA [SHLWAPI] 75 76 /************************************************************************* 77 * StrCmpNA [SHLWAPI.@] 64 78 */ 65 79 INT WINAPI StrCmpNA ( LPCSTR str1, LPCSTR str2, INT len) … … 70 84 71 85 /************************************************************************* 72 * StrCmpNW [SHLWAPI ]86 * StrCmpNW [SHLWAPI.@] 73 87 */ 74 88 INT WINAPI StrCmpNW ( LPCWSTR wstr1, LPCWSTR wstr2, INT len) … … 79 93 80 94 /************************************************************************* 81 * StrCmpNIA [SHLWAPI ]95 * StrCmpNIA [SHLWAPI.@] 82 96 */ 83 97 int WINAPI StrCmpNIA ( LPCSTR str1, LPCSTR str2, int len) … … 88 102 89 103 /************************************************************************* 90 * StrCmpNIW [SHLWAPI ]104 * StrCmpNIW [SHLWAPI.@] 91 105 */ 92 106 int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len) … … 97 111 98 112 /************************************************************************* 99 * StrCmpW [SHLWAPI ]113 * StrCmpW [SHLWAPI.@] 100 114 */ 101 115 int WINAPI StrCmpW ( LPCWSTR wstr1, LPCWSTR wstr2 ) … … 106 120 107 121 /************************************************************************* 108 * StrCatW [SHLWAPI ]122 * StrCatW [SHLWAPI.@] 109 123 */ 110 124 LPWSTR WINAPI StrCatW( LPWSTR wstr1, LPCWSTR wstr2 ) … … 115 129 116 130 /************************************************************************* 117 * StrCpyW [SHLWAPI ]131 * StrCpyW [SHLWAPI.@] 118 132 */ 119 133 LPWSTR WINAPI StrCpyW( LPWSTR wstr1, LPCWSTR wstr2 ) … … 124 138 125 139 /************************************************************************* 126 * StrCpyNW [SHLWAPI ]140 * StrCpyNW [SHLWAPI.@] 127 141 */ 128 142 LPWSTR WINAPI StrCpyNW( LPWSTR wstr1, LPCWSTR wstr2, int n ) … … 133 147 134 148 /************************************************************************* 135 * StrStrA [SHLWAPI ]149 * StrStrA [SHLWAPI.@] 136 150 */ 137 151 LPSTR WINAPI StrStrA(LPCSTR lpFirst, LPCSTR lpSrch) … … 148 162 149 163 /************************************************************************* 150 * StrStrW [SHLWAPI ]164 * StrStrW [SHLWAPI.@] 151 165 */ 152 166 LPWSTR WINAPI StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch) … … 163 177 164 178 /************************************************************************* 165 * StrStrIA [SHLWAPI ]179 * StrStrIA [SHLWAPI.@] 166 180 */ 167 181 LPSTR WINAPI StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch) … … 178 192 179 193 /************************************************************************* 180 * StrStrIW [SHLWAPI ]194 * StrStrIW [SHLWAPI.@] 181 195 */ 182 196 LPWSTR WINAPI StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch) … … 193 207 194 208 /************************************************************************* 195 * StrToIntA [SHLWAPI ]209 * StrToIntA [SHLWAPI.@] 196 210 */ 197 211 int WINAPI StrToIntA(LPCSTR lpSrc) … … 202 216 203 217 /************************************************************************* 204 * StrToIntW [SHLWAPI ]218 * StrToIntW [SHLWAPI.@] 205 219 */ 206 220 int WINAPI StrToIntW(LPCWSTR lpSrc) … … 215 229 216 230 /************************************************************************* 217 * StrToIntExA [SHLWAPI ]231 * StrToIntExA [SHLWAPI.@] 218 232 */ 219 233 BOOL WINAPI StrToIntExA( LPCSTR pszString, DWORD dwFlags, LPINT piRet) … … 225 239 226 240 /************************************************************************* 227 * StrToIntExW [SHLWAPI ]241 * StrToIntExW [SHLWAPI.@] 228 242 */ 229 243 BOOL WINAPI StrToIntExW( LPCWSTR pszString, DWORD dwFlags, LPINT piRet) … … 235 249 236 250 /************************************************************************* 237 * StrDupA [SHLWAPI ]251 * StrDupA [SHLWAPI.@] 238 252 */ 239 253 LPSTR WINAPI StrDupA (LPCSTR lpSrc) … … 249 263 250 264 /************************************************************************* 251 * StrDupW [SHLWAPI ]265 * StrDupW [SHLWAPI.@] 252 266 */ 253 267 LPWSTR WINAPI StrDupW (LPCWSTR lpSrc) … … 263 277 264 278 /************************************************************************* 265 * StrCSpnA [SHLWAPI ]279 * StrCSpnA [SHLWAPI.@] 266 280 */ 267 281 int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet) … … 287 301 288 302 /************************************************************************* 289 * StrCSpnW [SHLWAPI ]303 * StrCSpnW [SHLWAPI.@] 290 304 */ 291 305 int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet) … … 320 334 321 335 TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch); 322 336 if (!lpStart && !lpEnd) return NULL; 323 337 if (!lpEnd) lpEnd = lpStart + strlen(lpStart); 324 338 … … 342 356 343 357 TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch); 358 if (!lpStart && !lpEnd) return NULL; 344 359 if (!lpEnd) lpEnd = lpStart + strlenW(lpStart); 345 360 … … 351 366 352 367 353 /************************************************************************* 354 * StrCatBuffA [SHLWAPI] 368 /************************************************************************** 369 * StrRChrIA [SHLWAPI.@] 370 * 371 */ 372 LPSTR WINAPI StrRChrIA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch ) 373 { 374 LPCSTR lpGotIt = NULL; 375 BOOL dbcs = IsDBCSLeadByte( LOBYTE(wMatch) ); 376 377 TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch); 378 if (!lpStart && !lpEnd) return NULL; 379 if (!lpEnd) lpEnd = lpStart + strlen(lpStart); 380 381 for(; lpStart < lpEnd; lpStart = CharNextA(lpStart)) 382 { 383 if (dbcs) { 384 /* 385 if (_mbctoupper(*lpStart) == _mbctoupper(wMatch)) 386 lpGotIt = lpStart; 387 */ 388 if (toupper(*lpStart) == toupper(wMatch)) lpGotIt = lpStart; 389 } else { 390 if (toupper(*lpStart) == toupper(wMatch)) lpGotIt = lpStart; 391 } 392 } 393 return (LPSTR)lpGotIt; 394 } 395 396 397 /************************************************************************** 398 * StrRChrIW [SHLWAPI.@] 399 * 400 */ 401 LPWSTR WINAPI StrRChrIW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch) 402 { 403 LPCWSTR lpGotIt = NULL; 404 405 TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch); 406 if (!lpStart && !lpEnd) return NULL; 407 if (!lpEnd) lpEnd = lpStart + strlenW(lpStart); 408 409 for(; lpStart < lpEnd; lpStart = CharNextW(lpStart)) 410 if (toupperW(*lpStart) == toupperW(wMatch)) lpGotIt = lpStart; 411 412 return (LPWSTR)lpGotIt; 413 } 414 415 416 /************************************************************************* 417 * StrCatBuffA [SHLWAPI.@] 355 418 * 356 419 * Appends back onto front, stopping when front is size-1 characters long. … … 370 433 371 434 /************************************************************************* 372 * StrCatBuffW [SHLWAPI ]435 * StrCatBuffW [SHLWAPI.@] 373 436 * 374 437 * Appends back onto front, stopping when front is size-1 characters long. … … 394 457 * NOTES 395 458 * the pidl is for STRRET OFFSET 459 * 460 * ***** NOTE ***** 461 * This routine is identical to StrRetToStrNA in dlls/shell32/shellstring.c. 462 * It was duplicated there because not every version of Shlwapi.dll exports 463 * StrRetToBufA. If you change one routine, change them both. YOU HAVE BEEN 464 * WARNED. 465 * ***** NOTE ***** 396 466 */ 397 467 HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, DWORD len) 398 468 { 399 TRACE("dest= 0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);469 TRACE("dest=%p len=0x%lx strret=%p pidl=%p stub\n",dest,len,src,pidl); 400 470 401 471 switch (src->uType) … … 432 502 * NOTES 433 503 * the pidl is for STRRET OFFSET 504 * 505 * ***** NOTE ***** 506 * This routine is identical to StrRetToStrNW in dlls/shell32/shellstring.c. 507 * It was duplicated there because not every version of Shlwapi.dll exports 508 * StrRetToBufW. If you change one routine, change them both. YOU HAVE BEEN 509 * WARNED. 510 * ***** NOTE ***** 434 511 */ 435 512 HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, DWORD len) 436 513 { 437 TRACE("dest= 0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);514 TRACE("dest=%p len=0x%lx strret=%p pidl=%p stub\n",dest,len,src,pidl); 438 515 439 516 switch (src->uType) … … 469 546 470 547 /************************************************************************* 471 * StrFormatByteSizeA [SHLWAPI ]548 * StrFormatByteSizeA [SHLWAPI.@] 472 549 */ 473 550 LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf ) … … 491 568 492 569 /************************************************************************* 493 * StrFormatByteSizeW [SHLWAPI ]570 * StrFormatByteSizeW [SHLWAPI.@] 494 571 */ 495 572 LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf ) … … 503 580 504 581 /************************************************************************* 505 * StrNCatA [SHLWAPI ]582 * StrNCatA [SHLWAPI.@] 506 583 */ 507 584 LPSTR WINAPI StrNCatA(LPSTR front, LPCSTR back, INT cchMax) … … 512 589 513 590 /************************************************************************* 514 * StrNCatW [SHLWAPI ]591 * StrNCatW [SHLWAPI.@] 515 592 */ 516 593 LPWSTR WINAPI StrNCatW(LPWSTR front, LPCWSTR back, INT cchMax) … … 546 623 547 624 /************************************************************************* 548 * wnsprintfA [SHLWAPI ]625 * wnsprintfA [SHLWAPI.@] 549 626 */ 550 627 int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...) … … 560 637 561 638 /************************************************************************* 562 * wnsprintfW [SHLWAPI ]639 * wnsprintfW [SHLWAPI.@] 563 640 */ 564 641 int WINAPIV wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...)
Note:
See TracChangeset
for help on using the changeset viewer.