Source code of Windows XP (NT5)
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.

51 lines
1022 B

  1. /* Copyright (C) Boris Nikolaus, Germany, 1996-1997. All rights reserved. */
  2. /* Copyright (C) Microsoft Corporation, 1997-1998. All rights reserved. */
  3. #include "precomp.h"
  4. /* check if a 16 bit character is a space */
  5. int ASN1is16space(ASN1char16_t c)
  6. {
  7. return c == ' ' || c == '\t' || c == '\b' || c == '\f' || c == '\r' ||
  8. c == '\n' || c == '\v';
  9. }
  10. /* get length of a 16 bit string */
  11. // lonchanc: lstrlenW()
  12. int ASN1str16len(ASN1char16_t *p)
  13. {
  14. int len;
  15. for (len = 0; *p; p++)
  16. len++;
  17. return len;
  18. }
  19. int My_lstrlenA(char *p)
  20. {
  21. return (NULL != p) ? lstrlenA(p) : 0;
  22. }
  23. int My_lstrlenW(WCHAR *p)
  24. {
  25. return (NULL != p) ? lstrlenW(p) : 0;
  26. }
  27. /* check if a 32 bit character is a space */
  28. int ASN1is32space(ASN1char32_t c)
  29. {
  30. return c == ' ' || c == '\t' || c == '\b' || c == '\f' || c == '\r' ||
  31. c == '\n' || c == '\v';
  32. }
  33. /* get length of a 32 bit string */
  34. int ASN1str32len(ASN1char32_t *p)
  35. {
  36. int len;
  37. for (len = 0; *p; p++)
  38. len++;
  39. return len;
  40. }