string.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2016 Jeremiah Orians
  2. * This file is part of M2-Planet.
  3. *
  4. * M2-Planet is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * M2-Planet is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _STRING_H
  18. #define _STRING_H
  19. #ifdef __M2__
  20. #include <string.c>
  21. #else
  22. #include <stddef.h>
  23. /* String manipulation */
  24. char* strcpy(char* dest, char const* src);
  25. char* strncpy(char* dest, char const* src, size_t count);
  26. char* strcat(char* dest, char const* src);
  27. char* strncat(char* dest, char const* src, size_t count);
  28. /* String examination */
  29. size_t strlen(char const* str );
  30. size_t strnlen_s(char const* str, size_t strsz );
  31. int strcmp(char const* lhs, char const* rhs );
  32. int strncmp(char const* lhs, char const* rhs, size_t count);
  33. char* strchr(char const* str, int ch);
  34. char* strrchr(char const* str, int ch);
  35. size_t strspn(char const* dest, char const* src);
  36. size_t strcspn(char const* dest, char const* src);
  37. char* strpbrk(char const* dest, char const* breakset);
  38. /* Memory manipulation */
  39. void* memset(void* dest, int ch, size_t count);
  40. void* memcpy(void* dest, void const* src, size_t count);
  41. void* memmove(void* dest, void const* src, size_t count);
  42. int memcmp(void const* lhs, void const* rhs, size_t count);
  43. void* memchr(void const* ptr, int ch, size_t count);
  44. char* strstr(const char* haystack, const char* needle);
  45. #endif
  46. #endif