string.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * U-Boot - string.h String functions
  3. *
  4. * Copyright (c) 2005-2007 Analog Devices Inc.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. /* Changed by Lineo Inc. May 2001 */
  9. #ifndef _BLACKFINNOMMU_STRING_H_
  10. #define _BLACKFINNOMMU_STRING_H_
  11. #ifdef __KERNEL__ /* only set these up for kernel code */
  12. #define __HAVE_ARCH_STRCPY
  13. #define __HAVE_ARCH_STRNCPY
  14. #define __HAVE_ARCH_STRCMP
  15. #define __HAVE_ARCH_STRNCMP
  16. #define __HAVE_ARCH_MEMCPY
  17. #define __HAVE_ARCH_MEMCMP
  18. #define __HAVE_ARCH_MEMSET
  19. #define __HAVE_ARCH_MEMMOVE
  20. extern char *strcpy(char *dest, const char *src);
  21. extern char *strncpy(char *dest, const char *src, size_t n);
  22. extern int strcmp(const char *cs, const char *ct);
  23. extern int strncmp(const char *cs, const char *ct, size_t count);
  24. extern void *memcpy(void *dest, const void *src, size_t count);
  25. extern void *memset(void *s, int c, size_t count);
  26. extern int memcmp(const void *, const void *, size_t);
  27. extern void *memmove(void *dest, const void *src, size_t count);
  28. #else /* KERNEL */
  29. /*
  30. * let user libraries deal with these,
  31. * IMHO the kernel has no place defining these functions for user apps
  32. */
  33. #define __HAVE_ARCH_STRCPY 1
  34. #define __HAVE_ARCH_STRNCPY 1
  35. #define __HAVE_ARCH_STRCAT 1
  36. #define __HAVE_ARCH_STRNCAT 1
  37. #define __HAVE_ARCH_STRCMP 1
  38. #define __HAVE_ARCH_STRNCMP 1
  39. #define __HAVE_ARCH_STRNICMP 1
  40. #define __HAVE_ARCH_STRCHR 1
  41. #define __HAVE_ARCH_STRRCHR 1
  42. #define __HAVE_ARCH_STRSTR 1
  43. #define __HAVE_ARCH_STRLEN 1
  44. #define __HAVE_ARCH_STRNLEN 1
  45. #define __HAVE_ARCH_MEMSET 1
  46. #define __HAVE_ARCH_MEMCPY 1
  47. #define __HAVE_ARCH_MEMMOVE 1
  48. #define __HAVE_ARCH_MEMSCAN 1
  49. #define __HAVE_ARCH_MEMCMP 1
  50. #define __HAVE_ARCH_MEMCHR 1
  51. #define __HAVE_ARCH_STRTOK 1
  52. #endif /* KERNEL */
  53. #endif /* _BLACKFIN_STRING_H_ */