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.

61 lines
2.3 KiB

  1. /*** strlib.h - String functions Definitions
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 08/14/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _STRLIB_H
  10. #define _STRLIB_H
  11. /*** Macros
  12. */
  13. #ifndef EXPORT
  14. #define EXPORT __cdecl
  15. #endif
  16. #define STRLEN(s) StrLen(s, (ULONG)(-1))
  17. #define STRCPY(s1,s2) StrCpy(s1, s2, (ULONG)(-1))
  18. #define STRCPYN(s1,s2,n) StrCpy(s1, s2, (ULONG)(n))
  19. #define STRCAT(s1,s2) StrCat(s1, s2, (ULONG)(-1))
  20. #define STRCATN(s1,s2,n) StrCat(s1, s2, (ULONG)(n))
  21. #define STRCMP(s1,s2) StrCmp(s1, s2, (ULONG)(-1), TRUE)
  22. #define STRCMPI(s1,s2) StrCmp(s1, s2, (ULONG)(-1), FALSE)
  23. #define STRCMPN(s1,s2,n) StrCmp(s1, s2, (ULONG)(n), TRUE)
  24. #define STRCMPNI(s1,s2,n) StrCmp(s1, s2, (ULONG)(n), FALSE)
  25. #define STRCHR(s,c) StrChr(s, c)
  26. #define STRRCHR(s,c) StrRChr(s, c)
  27. #define STRTOK(s1,s2) StrTok(s1, s2)
  28. #define STRTOUL(s,pe,b) StrToUL(s, pe, b)
  29. #define STRTOL(s,pe,b) StrToL(s, pe, b)
  30. #define STRSTR(s1,s2) StrStr(s1, s2)
  31. #define STRUPR(s) StrUpr(s)
  32. #define STRLWR(s) StrLwr(s)
  33. #define ULTOA(d,s,r) UlToA(d, s, r)
  34. #define ISUPPER(c) (((c) >= 'A') && ((c) <= 'Z'))
  35. #define ISLOWER(c) (((c) >= 'a') && ((c) <= 'z'))
  36. #define ISALPHA(c) (ISUPPER(c) || ISLOWER(c))
  37. #define TOUPPER(c) ((CHAR)(ISLOWER(c)? ((c) & 0xdf): (c)))
  38. #define TOLOWER(c) ((CHAR)(ISUPPER(c)? ((c) | 0x20): (c)))
  39. /*** Exported function prototypes
  40. */
  41. ULONG EXPORT StrLen(PSZ psz, ULONG n);
  42. PSZ EXPORT StrCpy(PSZ pszDst, PSZ pszSrc, ULONG n);
  43. PSZ EXPORT StrCat(PSZ pszDst, PSZ pszSrc, ULONG n);
  44. LONG EXPORT StrCmp(PSZ psz1, PSZ psz2, ULONG n, BOOLEAN fMatchCase);
  45. PSZ EXPORT StrChr(PSZ pszStr, CHAR c);
  46. PSZ EXPORT StrRChr(PSZ pszStr, CHAR c);
  47. PSZ EXPORT StrTok(PSZ pszStr, PSZ pszSep);
  48. ULONG EXPORT StrToUL(PSZ psz, PSZ *ppszEnd, ULONG dwBase);
  49. LONG EXPORT StrToL(PSZ psz, PSZ *ppszEnd, ULONG dwBase);
  50. PSZ EXPORT StrStr(PSZ psz1, PSZ psz2);
  51. PSZ EXPORT StrUpr(PSZ pszStr);
  52. PSZ EXPORT StrLwr(PSZ pszStr);
  53. PSZ EXPORT UlToA(ULONG dwValue, PSZ pszStr, ULONG dwRadix);
  54. #endif //ifndef _STRLIB_H