string.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /****************************************************************************
  2. * include/string.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __INCLUDE_STRING_H
  21. #define __INCLUDE_STRING_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. #include <nuttx/config.h>
  26. #include <stddef.h>
  27. /* Non-standard support for cases where CHAR_BIT != 8 carried in strings.h
  28. * only for convenience. See include/nuttx/b2c.h.
  29. */
  30. #include <nuttx/b2c.h>
  31. /****************************************************************************
  32. * Public Function Prototypes
  33. ****************************************************************************/
  34. #undef EXTERN
  35. #if defined(__cplusplus)
  36. #define EXTERN extern "C"
  37. extern "C"
  38. {
  39. #else
  40. #define EXTERN extern
  41. #endif
  42. FAR char *strdup(FAR const char *s);
  43. FAR char *strndup(FAR const char *s, size_t size);
  44. FAR const char *strerror(int);
  45. int strerror_r(int, FAR char *, size_t);
  46. size_t strlen(FAR const char *);
  47. size_t strnlen(FAR const char *, size_t);
  48. FAR char *strcat(FAR char *, FAR const char *);
  49. FAR char *strncat(FAR char *, FAR const char *, size_t);
  50. int strcmp(FAR const char *, FAR const char *);
  51. int strncmp(FAR const char *, FAR const char *, size_t);
  52. int strcoll(FAR const char *, FAR const char *s2);
  53. FAR char *strcpy(FAR char *dest, FAR const char *src);
  54. FAR char *stpcpy(FAR char *dest, FAR const char *src);
  55. size_t strlcpy(FAR char *dst, FAR const char *src, size_t siz);
  56. FAR char *strncpy(FAR char *, FAR const char *, size_t);
  57. FAR char *stpncpy(FAR char *, FAR const char *, size_t);
  58. FAR char *strpbrk(FAR const char *, FAR const char *);
  59. FAR char *strchr(FAR const char *s, int c);
  60. FAR char *strrchr(FAR const char *s, int c);
  61. size_t strspn(FAR const char *, FAR const char *);
  62. size_t strcspn(FAR const char *, FAR const char *);
  63. FAR char *strstr(FAR const char *, FAR const char *);
  64. FAR char *strcasestr(FAR const char *, FAR const char *);
  65. FAR char *strsep(FAR char **, FAR const char *);
  66. FAR char *strsignal(int signum);
  67. FAR char *strtok(FAR char *, FAR const char *);
  68. FAR char *strtok_r(FAR char *, FAR const char *, FAR char **);
  69. size_t strxfrm(FAR char *, FAR const char *, size_t n);
  70. FAR void *memchr(FAR const void *s, int c, size_t n);
  71. FAR void *memrchr(FAR const void *s, int c, size_t n);
  72. FAR void *memccpy(FAR void *s1, FAR const void *s2, int c, size_t n);
  73. int memcmp(FAR const void *s1, FAR const void *s2, size_t n);
  74. FAR void *memcpy(FAR void *dest, FAR const void *src, size_t n);
  75. FAR void *memmove(FAR void *dest, FAR const void *src, size_t count);
  76. FAR void *memset(FAR void *s, int c, size_t n);
  77. void explicit_bzero(FAR void *s, size_t n);
  78. #undef EXTERN
  79. #if defined(__cplusplus)
  80. }
  81. #endif
  82. #endif /* __INCLUDE_STRING_H */