Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2 KiB

  1. //
  2. // cuistr.cpp
  3. // = handling string functions in CUILIB =
  4. //
  5. #include "private.h"
  6. #include "cuistr.h"
  7. /* C U I S T R C M P W */
  8. /*------------------------------------------------------------------------------
  9. ------------------------------------------------------------------------------*/
  10. int CUIStrCmpW( const WCHAR* pwch1, const WCHAR* pwch2 )
  11. {
  12. while (*pwch1 && *pwch2 && (*pwch1 == *pwch2)) {
  13. pwch1++;
  14. pwch2++;
  15. }
  16. return (*pwch1 - *pwch2);
  17. }
  18. /* C U I S T R C P Y W */
  19. /*------------------------------------------------------------------------------
  20. ------------------------------------------------------------------------------*/
  21. WCHAR* CUIStrCpyW( WCHAR *pwchDst, const WCHAR *pwchSrc )
  22. {
  23. WCHAR *pwch = pwchDst;
  24. while (*pwch++ = *pwchSrc++);
  25. return pwchDst;
  26. }
  27. /* C U I S T R L E N W */
  28. /*------------------------------------------------------------------------------
  29. ------------------------------------------------------------------------------*/
  30. int CUIStrLenW( const WCHAR *pwch )
  31. {
  32. const WCHAR *pwchFirst = pwch;
  33. while (*pwch++);
  34. return (int)(UINT_PTR)(pwch - pwchFirst - (UINT_PTR)1);
  35. }