sbi_string.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2019 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Atish Patra <atish.patra@wdc.com>
  8. */
  9. #ifndef __STRING_H__
  10. #define __STRING_H__
  11. #include <sbi/sbi_types.h>
  12. /*
  13. Provides sbi_strcmp for the completeness of supporting string functions.
  14. it is not recommended to use sbi_strcmp() but use sbi_strncmp instead.
  15. */
  16. int sbi_strcmp(const char *a, const char *b);
  17. int sbi_strncmp(const char *a, const char *b, size_t count);
  18. size_t sbi_strlen(const char *str);
  19. size_t sbi_strnlen(const char *str, size_t count);
  20. char *sbi_strcpy(char *dest, const char *src);
  21. char *sbi_strncpy(char *dest, const char *src, size_t count);
  22. char *sbi_strchr(const char *s, int c);
  23. char *sbi_strrchr(const char *s, int c);
  24. void *sbi_memset(void *s, int c, size_t count);
  25. void *sbi_memcpy(void *dest, const void *src, size_t count);
  26. void *sbi_memmove(void *dest, const void *src, size_t count);
  27. int sbi_memcmp(const void *s1, const void *s2, size_t count);
  28. void *sbi_memchr(const void *s, int c, size_t count);
  29. #endif