1
0

CString.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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)
  29. char* CString_strchr(const char *a, int b);
  30. Gcc_PURE
  31. Gcc_NONNULL(1)
  32. char* CString_strrchr(const char *a, int b);
  33. Gcc_PURE
  34. int CString_strcasecmp(const char *a, const char *b);
  35. /** strstr(haystack, needle); */
  36. Gcc_PURE
  37. Gcc_NONNULL(1,2)
  38. char* CString_strstr(const char* a, const char* b);
  39. Gcc_NONNULL(1,2)
  40. char* CString_strncpy(char* restrict dest, const char *restrict src, size_t n);
  41. #endif