CString.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef CString_H
  16. #define CString_H
  17. #include "util/Gcc.h"
  18. #include "util/Linker.h"
  19. Linker_require("util/CString.c")
  20. #include <stddef.h> // size_t
  21. Gcc_PURE
  22. Gcc_NONNULL(1)
  23. unsigned long CString_strlen(const char* str);
  24. Gcc_PURE
  25. Gcc_NONNULL(1,2)
  26. int CString_strcmp(const char* a, const char* b);
  27. Gcc_PURE
  28. Gcc_NONNULL(1,2)
  29. int CString_strncmp(const char* a, const char *b, size_t n);
  30. Gcc_PURE
  31. Gcc_NONNULL(1)
  32. char* CString_strchr(const char *a, int b);
  33. Gcc_PURE
  34. Gcc_NONNULL(1)
  35. char* CString_strrchr(const char *a, int b);
  36. Gcc_PURE
  37. int CString_strcasecmp(const char *a, const char *b);
  38. /** strstr(haystack, needle); */
  39. Gcc_PURE
  40. Gcc_NONNULL(1,2)
  41. char* CString_strstr(const char* a, const char* b);
  42. Gcc_NONNULL(1,2)
  43. char* CString_strcpy(char* restrict dest, const char* restrict src);
  44. Gcc_NONNULL(1,2)
  45. char* CString_strncpy(char* restrict dest, const char *restrict src, size_t n);
  46. #endif