CString.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include "util/CString.h"
  16. #include <string.h>
  17. #ifdef Illumos
  18. #define _XPG4_2
  19. #endif
  20. #include <strings.h>
  21. unsigned long CString_strlen(const char* str)
  22. {
  23. return strlen(str);
  24. }
  25. int CString_strcmp(const char* a, const char* b)
  26. {
  27. return strcmp(a,b);
  28. }
  29. char* CString_strchr(const char* a, int b)
  30. {
  31. return strchr(a,b);
  32. }
  33. char* CString_strrchr(const char* a, int b)
  34. {
  35. return strrchr(a,b);
  36. }
  37. int CString_strcasecmp(const char *a, const char *b)
  38. {
  39. return strcasecmp(a,b);
  40. }
  41. char* CString_strstr(const char* haystack, const char* needle)
  42. {
  43. return strstr(haystack,needle);
  44. }
  45. char* CString_strncpy(char* restrict dest, const char *restrict src, size_t n)
  46. {
  47. return strncpy(dest, src, n);
  48. }