Changeset 3687 for trunk/src/shlwapi/string.cpp
- Timestamp:
- Jun 12, 2000, 10:09:48 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/string.cpp
r3684 r3687 1 /* $Id: string.cpp,v 1.3 2000-06-11 08:44:55phaller Exp $ */1 /* $Id: string.cpp,v 1.4 2000-06-12 08:09:46 phaller Exp $ */ 2 2 3 3 /* … … 68 68 ODINDEBUGCHANNEL(SHLWAPI-STRING) 69 69 70 71 /***************************************************************************** 72 * Name : ChrCmpIA 73 * Purpose : 74 * Parameters: 75 * Variables : 76 * Result : 77 * Remark : 78 * Status : UNTESTED 79 * 80 * Author : Patrick Haller [Wed, 1999/12/29 09:00] 81 *****************************************************************************/ 82 83 ODINFUNCTION2(INT, ChrCmpIA, 84 INT, ch1, 85 INT, ch2) 86 { 87 // Note: IsDBCSLeadByte ignored ! 88 89 if ( (ch1 >= 'A') && (ch1 <= 'Z') ) ch1 |= 0x20; 90 if ( (ch2 >= 'A') && (ch2 <= 'Z') ) ch2 |= 0x20; 91 92 return ch1 - ch2; 93 } 70 94 71 95 … … 516 540 } 517 541 542 543 /************************************************************************* 544 * StrToIntW [SHLWAPI]ú 545 */ 546 int WINAPI StrToIntW(LPCWSTR lpSrc) 547 { 548 int ret; 549 LPSTR lpStr = HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc); 550 551 TRACE("%s\n", debugstr_w(lpSrc)); 552 553 ret = atol(lpStr); 554 HeapFree(GetProcessHeap(),0,lpStr); 555 return ret; 556 } 557 558 518 559 /************************************************************************* 519 560 * StrFormatByteSizeA [SHLWAPI] … … 559 600 return pszBuf; 560 601 } 602 603 604 /***************************************************************************** 605 * Name : StrCpyA 606 * Purpose : copy a string 607 * Parameters: 608 * Variables : 609 * Result : 610 * Remark : not exported ? 611 * Status : UNTESTED 612 * 613 * Author : 614 *****************************************************************************/ 615 616 ODINFUNCTION2(LPSTR, StrCpyA, 617 LPSTR, lpDest, 618 LPCSTR, lpSource) 619 { 620 return lstrcpyA(lpDest, 621 lpSource); 622 } 623 624 625 /***************************************************************************** 626 * Name : StrCpyW 627 * Purpose : copy a wide-character string 628 * Parameters: 629 * Variables : 630 * Result : 631 * Remark : SHLWAPI.642 632 * Status : UNTESTED 633 * 634 * Author : 635 *****************************************************************************/ 636 637 ODINFUNCTION2(LPWSTR, StrCpyW, 638 LPWSTR, lpDest, 639 LPCWSTR, lpSource) 640 { 641 return lstrcpyW(lpDest, 642 lpSource); 643 } 644 645 646 /***************************************************************************** 647 * Name : StrDupA 648 * Purpose : duplicate a string on the local heap 649 * Parameters: 650 * Variables : 651 * Result : 652 * Remark : SHLWAPI.644 653 * Status : UNTESTED 654 * 655 * Author : 656 *****************************************************************************/ 657 658 ODINFUNCTION1(LPSTR, StrDupA, 659 LPCSTR, lpStr) 660 { 661 int iLength = lstrlenA(lpStr) + 1; 662 HLOCAL hLocal = LocalAlloc(LMEM_ZEROINIT, 663 iLength); 664 if (hLocal != NULL) 665 StrCpyA((LPSTR)hLocal, 666 lpStr); 667 668 return (LPSTR)hLocal; 669 } 670 671 672 /***************************************************************************** 673 * Name : StrDupW 674 * Purpose : duplicate a wide-characters string on the local heap 675 * Parameters: 676 * Variables : 677 * Result : 678 * Remark : SHLWAPI.645 679 * Status : UNTESTED 680 * 681 * Author : 682 *****************************************************************************/ 683 684 ODINFUNCTION1(LPWSTR, StrDupW, 685 LPCWSTR, lpStr) 686 { 687 int iLength = lstrlenW(lpStr) << 1 + 2; 688 HLOCAL hLocal = LocalAlloc(LMEM_ZEROINIT, 689 iLength); 690 if (hLocal != NULL) 691 StrCpyW((LPWSTR)hLocal, 692 lpStr); 693 694 return (LPWSTR)hLocal; 695 }
Note:
See TracChangeset
for help on using the changeset viewer.