ustring.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* sd2snes - SD card based universal cartridge for the SNES
  2. Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
  3. This file was adapted from sd2iec, written by Ingo Korb.
  4. Original copyright header follows:
  5. */
  6. /* sd2iec - SD/MMC to Commodore serial bus interface/controller
  7. Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
  8. Inspiration and low-level SD/MMC access based on code from MMC2IEC
  9. by Lars Pontoppidan et al., see sdcard.c|h and config.h.
  10. FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
  11. This program is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; version 2 of the License only.
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. GNU General Public License for more details.
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. ustring.h: uint8_t wrappers for string.h-functions
  22. */
  23. #ifndef USTRING_H
  24. #define USTRING_H
  25. #include <string.h>
  26. #define ustrcasecmp_P(s1,s2) (strcasecmp_P((char *)(s1), (s2)))
  27. #define ustrchr(s,c) ((uint8_t *)strchr((char *)(s), (c)))
  28. #define ustrcmp(s1,s2) (strcmp((char *)(s1), (char *)(s2)))
  29. #define ustrcmp_P(s1,s2) (strcmp_P((char *)(s1), (s2)))
  30. #define ustrcpy(s1,s2) (strcpy((char *)(s1), (char *)(s2)))
  31. #define ustrcpy_P(s1,s2) (strcpy_P((char *)(s1), (s2)))
  32. #define ustrncpy(s1,s2,n) (strncpy((char *)(s1), (char *)(s2),(n)))
  33. #define ustrlen(s) (strlen((char *)(s)))
  34. #define ustrrchr(s,c) ((uint8_t *)strrchr((char *)(s), (c)))
  35. #endif