desktop: more progmem string functions

This commit is contained in:
Andrew Tridgell 2012-02-12 20:17:58 +11:00
parent f22988163e
commit d658bc6f9d
2 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,7 @@ extern "C" {
typedef char PROGMEM prog_char; typedef char PROGMEM prog_char;
extern int strcasecmp_P(const char *, PGM_P) __ATTR_PURE__; extern int strcasecmp_P(const char *, PGM_P) __ATTR_PURE__;
extern int strcmp_P(const char *, PGM_P) __ATTR_PURE__; extern int strcmp_P(const char *, PGM_P) __ATTR_PURE__;
extern int strncmp_P(const char *, PGM_P, size_t n) __ATTR_PURE__;
extern size_t strlcat_P (char *, PGM_P, size_t ); extern size_t strlcat_P (char *, PGM_P, size_t );
extern size_t strnlen_P (PGM_P, size_t ); extern size_t strnlen_P (PGM_P, size_t );
extern size_t strlen_P (PGM_P); extern size_t strlen_P (PGM_P);

View File

@ -87,6 +87,16 @@ int strcmp_P(PGM_P str1, PGM_P str2)
return strcmp(str1, str2); return strcmp(str1, str2);
} }
int strncmp_P(PGM_P str1, PGM_P str2, size_t n)
{
return strncmp(str1, str2, n);
}
char *strncpy_P(char *dest, PGM_P src, size_t n)
{
return strncpy(dest, src, n);
}
void *memcpy_P(void *dest, PGM_P src, size_t n) void *memcpy_P(void *dest, PGM_P src, size_t n)
{ {
return memcpy(dest, src, n); return memcpy(dest, src, n);