avr_pgmspace(3avr) | avr-libc | avr_pgmspace(3avr) |
NAME¶
avr_pgmspace - <avr/pgmspace.h>: Program Space Utilities
SYNOPSIS¶
Macros¶
#define PROGMEM __ATTR_PROGMEM__
#define PGM_P const char *
#define PGM_VOID_P const void *
#define PSTR(s) ((const PROGMEM char *)(s))
#define pgm_read_byte_near(address_short)
__LPM((uint16_t)(address_short))
#define pgm_read_word_near(address_short)
__LPM_word((uint16_t)(address_short))
#define pgm_read_dword_near(address_short)
__LPM_dword((uint16_t)(address_short))
#define pgm_read_float_near(address_short)
__LPM_float((uint16_t)(address_short))
#define pgm_read_ptr_near(address_short)
(void*)__LPM_word((uint16_t)(address_short))
#define pgm_read_byte_far(address_long)
__ELPM((uint32_t)(address_long))
#define pgm_read_word_far(address_long)
__ELPM_word((uint32_t)(address_long))
#define pgm_read_dword_far(address_long)
__ELPM_dword((uint32_t)(address_long))
#define pgm_read_float_far(address_long)
__ELPM_float((uint32_t)(address_long))
#define pgm_read_ptr_far(address_long)
(void*)__ELPM_word((uint32_t)(address_long))
#define pgm_read_byte(address_short)
pgm_read_byte_near(address_short)
#define pgm_read_word(address_short)
pgm_read_word_near(address_short)
#define pgm_read_dword(address_short)
pgm_read_dword_near(address_short)
#define pgm_read_float(address_short)
pgm_read_float_near(address_short)
#define pgm_read_ptr(address_short)
pgm_read_ptr_near(address_short)
#define pgm_get_far_address(var)
Typedefs¶
typedef void PROGMEM prog_void
typedef char PROGMEM prog_char
typedef unsigned char PROGMEM prog_uchar
typedef int8_t PROGMEM prog_int8_t
typedef uint8_t PROGMEM prog_uint8_t
typedef int16_t PROGMEM prog_int16_t
typedef uint16_t PROGMEM prog_uint16_t
typedef int32_t PROGMEM prog_int32_t
typedef uint32_t PROGMEM prog_uint32_t
typedef int64_t PROGMEM prog_int64_t
typedef uint64_t PROGMEM prog_uint64_t
Functions¶
const void * memchr_P (const void *, int __val, size_t
__len)
int memcmp_P (const void *, const void *, size_t) __ATTR_PURE__
void * memccpy_P (void *, const void *, int __val, size_t)
void * memcpy_P (void *, const void *, size_t)
void * memmem_P (const void *, size_t, const void *, size_t)
__ATTR_PURE__
const void * memrchr_P (const void *, int __val, size_t __len)
char * strcat_P (char *, const char *)
const char * strchr_P (const char *, int __val)
const char * strchrnul_P (const char *, int __val)
int strcmp_P (const char *, const char *) __ATTR_PURE__
char * strcpy_P (char *, const char *)
int strcasecmp_P (const char *, const char *) __ATTR_PURE__
char * strcasestr_P (const char *, const char *) __ATTR_PURE__
size_t strcspn_P (const char *__s, const char *__reject) __ATTR_PURE__
size_t strlcat_P (char *, const char *, size_t)
size_t strlcpy_P (char *, const char *, size_t)
size_t strnlen_P (const char *, size_t)
int strncmp_P (const char *, const char *, size_t) __ATTR_PURE__
int strncasecmp_P (const char *, const char *, size_t) __ATTR_PURE__
char * strncat_P (char *, const char *, size_t)
char * strncpy_P (char *, const char *, size_t)
char * strpbrk_P (const char *__s, const char *__accept) __ATTR_PURE__
const char * strrchr_P (const char *, int __val)
char * strsep_P (char **__sp, const char *__delim)
size_t strspn_P (const char *__s, const char *__accept) __ATTR_PURE__
char * strstr_P (const char *, const char *) __ATTR_PURE__
char * strtok_P (char *__s, const char *__delim)
char * strtok_rP (char *__s, const char *__delim, char **__last)
size_t strlen_PF (uint_farptr_t src)
size_t strnlen_PF (uint_farptr_t src, size_t len)
void * memcpy_PF (void *dest, uint_farptr_t src, size_t len)
char * strcpy_PF (char *dest, uint_farptr_t src)
char * strncpy_PF (char *dest, uint_farptr_t src, size_t len)
char * strcat_PF (char *dest, uint_farptr_t src)
size_t strlcat_PF (char *dst, uint_farptr_t src, size_t siz)
char * strncat_PF (char *dest, uint_farptr_t src, size_t len)
int strcmp_PF (const char *s1, uint_farptr_t s2) __ATTR_PURE__
int strncmp_PF (const char *s1, uint_farptr_t s2, size_t n)
__ATTR_PURE__
int strcasecmp_PF (const char *s1, uint_farptr_t s2)
__ATTR_PURE__
int strncasecmp_PF (const char *s1, uint_farptr_t s2, size_t n)
__ATTR_PURE__
char * strstr_PF (const char *s1, uint_farptr_t s2)
size_t strlcpy_PF (char *dst, uint_farptr_t src, size_t siz)
int memcmp_PF (const void *, uint_farptr_t, size_t)
__ATTR_PURE__
static size_t strlen_P (const char *s)
Detailed Description¶
#include <avr/io.h> #include <avr/pgmspace.h>
The functions in this module provide interfaces for a program to access data stored in program space (flash memory) of the device. In order to use these functions, the target device must support either the LPM or ELPM instructions.
Note
If you are working with strings which are completely based in ram, use the standard string functions described in <string.h>: Strings.
If possible, put your constant tables in the lower 64 KB and use pgm_read_byte_near() or pgm_read_word_near() instead of pgm_read_byte_far() or pgm_read_word_far() since it is more efficient that way, and you can still use the upper 64K for executable code. All functions that are suffixed with a _P require their arguments to be in the lower 64 KB of the flash ROM, as they do not use ELPM instructions. This is normally not a big concern as the linker setup arranges any program space constants declared using the macros from this header file so they are placed right after the interrupt vectors, and in front of any executable code. However, it can become a problem if there are too many of these constants, or for bootloaders on devices with more than 64 KB of ROM. All these functions will not work in that situation.
For Xmega devices, make sure the NVM controller command register (NVM.CMD or NVM_CMD) is set to 0x00 (NOP) before using any of these functions.
Macro Definition Documentation¶
#define pgm_get_far_address(var)¶
Value:
({ uint_farptr_t tmp; __asm__ __volatile__( "ldi %A0, lo8(%1)" "0t" "ldi %B0, hi8(%1)" "0t" "ldi %C0, hh8(%1)" "0t" "clr %D0" "0t" : "=d" (tmp) : "p" (&(var)) ); tmp; })This macro facilitates the obtention of a 32 bit 'far' pointer (only 24 bits used) to data even passed the 64KB limit for the 16 bit ordinary pointer. It is similar to the '&' operator, with some limitations.
Comments:
- The overhead is minimal and it's mainly due to the 32 bit size operation.
- 24 bit sizes guarantees the code compatibility for use in future devices.
- hh8() is an undocumented feature but seems to give the third significant byte of a 32 bit data and accepts symbols, complementing the functionality of hi8() and lo8(). There is not an equivalent assembler function to get the high significant byte.
- The returned value is the identifier's VMA (virtual memory address) determined by the linker and falls in the corresponding memory region. The AVR Harvard architecture requires non overlapping VMA areas for the multiple address spaces in the processor: Flash ROM, RAM, and EEPROM. Typical offset for this are 0x00000000, 0x00800xx0, and 0x00810000 respectively, derived from the linker script used and linker options. The value returned can be seen then as a universal pointer.
#define PGM_P const char *¶
Used to declare a variable that is a pointer to a string in program space.
#define pgm_read_byte(address_short) pgm_read_byte_near(address_short)¶
Read a byte from the program space with a 16-bit (near) address.
Note
#define pgm_read_byte_far(address_long) __ELPM((uint32_t)(address_long))¶
Read a byte from the program space with a 32-bit (far) address.
Note
#define pgm_read_byte_near(address_short) __LPM((uint16_t)(address_short))¶
Read a byte from the program space with a 16-bit (near) address.
Note
#define pgm_read_dword(address_short) pgm_read_dword_near(address_short)¶
Read a double word from the program space with a 16-bit (near) address.
Note
#define pgm_read_dword_far(address_long) __ELPM_dword((uint32_t)(address_long))¶
Read a double word from the program space with a 32-bit (far) address.
Note
#define pgm_read_dword_near(address_short) __LPM_dword((uint16_t)(address_short))¶
Read a double word from the program space with a 16-bit (near) address.
Note
#define pgm_read_float(address_short) pgm_read_float_near(address_short)¶
Read a float from the program space with a 16-bit (near) address.
Note
#define pgm_read_float_far(address_long) __ELPM_float((uint32_t)(address_long))¶
Read a float from the program space with a 32-bit (far) address.
Note
#define pgm_read_float_near(address_short) __LPM_float((uint16_t)(address_short))¶
Read a float from the program space with a 16-bit (near) address.
Note
#define pgm_read_ptr(address_short) pgm_read_ptr_near(address_short)¶
Read a pointer from the program space with a 16-bit (near) address.
Note
#define pgm_read_ptr_far(address_long) (void*)__ELPM_word((uint32_t)(address_long))¶
Read a pointer from the program space with a 32-bit (far) address.
Note
#define pgm_read_ptr_near(address_short) (void*)__LPM_word((uint16_t)(address_short))¶
Read a pointer from the program space with a 16-bit (near) address.
Note
#define pgm_read_word(address_short) pgm_read_word_near(address_short)¶
Read a word from the program space with a 16-bit (near) address.
Note
#define pgm_read_word_far(address_long) __ELPM_word((uint32_t)(address_long))¶
Read a word from the program space with a 32-bit (far) address.
Note
#define pgm_read_word_near(address_short) __LPM_word((uint16_t)(address_short))¶
Read a word from the program space with a 16-bit (near) address.
Note
#define PGM_VOID_P const void *¶
Used to declare a generic pointer to an object in program space.
#define PROGMEM __ATTR_PROGMEM__¶
Attribute to use in order to declare an object being located in flash ROM.
#define PSTR(s) ((const PROGMEM char *)(s))¶
Used to declare a static pointer to a string in program space.
Typedef Documentation¶
prog_char¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of a 'char' object located in flash ROM.
prog_int16_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'int16_t' object located in flash ROM.
prog_int32_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'int32_t' object located in flash ROM.
prog_int64_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'int64_t' object located in flash ROM.
Note
prog_int8_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'int8_t' object located in flash ROM.
prog_uchar¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'unsigned char' object located in flash ROM.
prog_uint16_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'uint16_t' object located in flash ROM.
prog_uint32_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'uint32_t' object located in flash ROM.
prog_uint64_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'uint64_t' object located in flash ROM.
Note
prog_uint8_t¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of an 'uint8_t' object located in flash ROM.
prog_void¶
Note
This typedef is now deprecated because the usage of the __progmem__ attribute on a type is not supported in GCC. However, the use of the __progmem__ attribute on a variable declaration is supported, and this is now the recommended usage.
The typedef is only visible if the macro __PROG_TYPES_COMPAT__ has been defined before including <avr/pgmspace.h> (either by a #define directive, or by a -D compiler option.)
Type of a 'void' object located in flash ROM. Does not make much sense by itself, but can be used to declare a 'void *' object in flash ROM.
Function Documentation¶
void * memccpy_P (void * dest, const void * src, int val, size_t len)¶
This function is similar to memccpy() except that src is pointer to a string in program space.
const void * memchr_P (const void * s, int val, size_t len)¶
Scan flash memory for a character. The memchr_P() function scans the first len bytes of the flash memory area pointed to by s for the character val. The first byte to match val (interpreted as an unsigned character) stops the operation.
Returns
int memcmp_P (const void * s1, const void * s2, size_t len)¶
Compare memory areas. The memcmp_P() function compares the first len bytes of the memory areas s1 and flash s2. The comparision is performed using unsigned char operations.
Returns
int memcmp_PF (const void * s1, uint_farptr_t s2, size_t len)¶
Compare memory areas. The memcmp_PF() function compares the first len bytes of the memory areas s1 and flash s2. The comparision is performed using unsigned char operations. It is an equivalent of memcmp_P() function, except that it is capable working on all FLASH including the exteded area above 64kB.
Returns
void * memcpy_P (void * dest, const void * src, size_t n)¶
The memcpy_P() function is similar to memcpy(), except the src string resides in program space.
Returns
void * memcpy_PF (void * dest, uint_farptr_t src, size_t n)¶
Copy a memory block from flash to SRAM. The memcpy_PF() function is similar to memcpy(), except the data is copied from the program space and is addressed using a far pointer.
Parameters
src A far pointer to the origin of data in flash memory
n The number of bytes to be copied
Returns
void * memmem_P (const void * s1, size_t len1, const void * s2, size_t len2)¶
The memmem_P() function is similar to memmem() except that s2 is pointer to a string in program space.
const void memrchr_P (const void * src, int val, size_t len)¶
The memrchr_P() function is like the memchr_P() function, except that it searches backwards from the end of the len bytes pointed to by src instead of forwards from the front. (Glibc, GNU extension.)
Returns
int strcasecmp_P (const char * s1, const char * s2)¶
Compare two strings ignoring case. The strcasecmp_P() function compares the two strings s1 and s2, ignoring the case of the characters.
Parameters
s2 A pointer to a string in the devices Flash.
Returns
int strcasecmp_PF (const char * s1, uint_farptr_t s2)¶
Compare two strings ignoring case. The strcasecmp_PF() function compares the two strings s1 and s2, ignoring the case of the characters.
Parameters
s2 A far pointer to the second string in Flash
Returns
char * strcasestr_P (const char * s1, const char * s2)¶
This funtion is similar to strcasestr() except that s2 is pointer to a string in program space.
char * strcat_P (char * dest, const char * src)¶
The strcat_P() function is similar to strcat() except that the src string must be located in program space (flash).
Returns
char * strcat_PF (char * dst, uint_farptr_t src)¶
Concatenates two strings. The strcat_PF() function is similar to strcat() except that the src string must be located in program space (flash) and is addressed using a far pointer
Parameters
src A far pointer to the string to be appended in Flash
Returns
const char * strchr_P (const char * s, int val)¶
Locate character in program space string. The strchr_P() function locates the first occurrence of val (converted to a char) in the string pointed to by s in program space. The terminating null character is considered to be part of the string.
The strchr_P() function is similar to strchr() except that s is pointer to a string in program space.
Returns
const char * strchrnul_P (const char * s, int c)¶
The strchrnul_P() function is like strchr_P() except that if c is not found in s, then it returns a pointer to the null byte at the end of s, rather than NULL. (Glibc, GNU extension.)
Returns
int strcmp_P (const char * s1, const char * s2)¶
The strcmp_P() function is similar to strcmp() except that s2 is pointer to a string in program space.
Returns
int strcmp_PF (const char * s1, uint_farptr_t s2)¶
Compares two strings. The strcmp_PF() function is similar to strcmp() except that s2 is a far pointer to a string in program space.
Parameters
s2 A far pointer to the second string in Flash
Returns
char * strcpy_P (char * dest, const char * src)¶
The strcpy_P() function is similar to strcpy() except that src is a pointer to a string in program space.
Returns
char * strcpy_PF (char * dst, uint_farptr_t src)¶
Duplicate a string. The strcpy_PF() function is similar to strcpy() except that src is a far pointer to a string in program space.
Parameters
src A far pointer to the source string in Flash
Returns
size_t strcspn_P (const char * s, const char * reject)¶
The strcspn_P() function calculates the length of the initial segment of s which consists entirely of characters not in reject. This function is similar to strcspn() except that reject is a pointer to a string in program space.
Returns
size_t strlcat_P (char * dst, const char * src, size_t siz)¶
Concatenate two strings. The strlcat_P() function is similar to strlcat(), except that the src string must be located in program space (flash).
Appends src to string dst of size siz (unlike strncat(), siz is the full size of dst, not space left). At most siz-1 characters will be copied. Always NULL terminates (unless siz <= strlen(dst)).
Returns
size_t strlcat_PF (char * dst, uint_farptr_t src, size_t n)¶
Concatenate two strings. The strlcat_PF() function is similar to strlcat(), except that the src string must be located in program space (flash) and is addressed using a far pointer.
Appends src to string dst of size n (unlike strncat(), n is the full size of dst, not space left). At most n-1 characters will be copied. Always NULL terminates (unless n <= strlen(dst)).
Parameters
src A far pointer to the source string in Flash
n The total number of bytes allocated to the destination string
Returns
size_t strlcpy_P (char * dst, const char * src, size_t siz)¶
Copy a string from progmem to RAM. Copy src to string dst of size siz. At most siz-1 characters will be copied. Always NULL terminates (unless siz == 0). The strlcpy_P() function is similar to strlcpy() except that the src is pointer to a string in memory space.
Returns
size_t strlcpy_PF (char * dst, uint_farptr_t src, size_t siz)¶
Copy a string from progmem to RAM. Copy src to string dst of size siz. At most siz-1 characters will be copied. Always NULL terminates (unless siz == 0).
Returns
size_t strlen_P (const char * src) [static]¶
The strlen_P() function is similar to strlen(), except that src is a pointer to a string in program space.
Returns
Note
size_t strlen_PF (uint_farptr_t s)¶
Obtain the length of a string. The strlen_PF() function is similar to strlen(), except that s is a far pointer to a string in program space.
Parameters
Returns
int strncasecmp_P (const char * s1, const char * s2, size_t n)¶
Compare two strings ignoring case. The strncasecmp_P() function is similar to strcasecmp_P(), except it only compares the first n characters of s1.
Parameters
s2 A pointer to a string in the devices Flash.
n The maximum number of bytes to compare.
Returns
int strncasecmp_PF (const char * s1, uint_farptr_t s2, size_t n)¶
Compare two strings ignoring case. The strncasecmp_PF() function is similar to strcasecmp_PF(), except it only compares the first n characters of s1 and the string in flash is addressed using a far pointer.
Parameters
s2 A far pointer to a string in Flash
n The maximum number of bytes to compare
Returns
char * strncat_P (char * dest, const char * src, size_t len)¶
Concatenate two strings. The strncat_P() function is similar to strncat(), except that the src string must be located in program space (flash).
Returns
char * strncat_PF (char * dst, uint_farptr_t src, size_t n)¶
Concatenate two strings. The strncat_PF() function is similar to strncat(), except that the src string must be located in program space (flash) and is addressed using a far pointer.
Parameters
src A far pointer to the source string in Flash
n The maximum number of bytes to append
Returns
int strncmp_P (const char * s1, const char * s2, size_t n)¶
The strncmp_P() function is similar to strcmp_P() except it only compares the first (at most) n characters of s1 and s2.
Returns
int strncmp_PF (const char * s1, uint_farptr_t s2, size_t n)¶
Compare two strings with limited length. The strncmp_PF() function is similar to strcmp_PF() except it only compares the first (at most) n characters of s1 and s2.
Parameters
s2 A far pointer to the second string in Flash
n The maximum number of bytes to compare
Returns
char * strncpy_P (char * dest, const char * src, size_t n)¶
The strncpy_P() function is similar to strcpy_P() except that not more than n bytes of src are copied. Thus, if there is no null byte among the first n bytes of src, the result will not be null-terminated.
In the case where the length of src is less than that of n, the remainder of dest will be padded with nulls.
Returns
char * strncpy_PF (char * dst, uint_farptr_t src, size_t n)¶
Duplicate a string until a limited length. The strncpy_PF() function is similar to strcpy_PF() except that not more than n bytes of src are copied. Thus, if there is no null byte among the first n bytes of src, the result will not be null-terminated.
In the case where the length of src is less than that of n, the remainder of dst will be padded with nulls.
Parameters
src A far pointer to the source string in Flash
n The maximum number of bytes to copy
Returns
size_t strnlen_P (const char * src, size_t len)¶
Determine the length of a fixed-size string. The strnlen_P() function is similar to strnlen(), except that src is a pointer to a string in program space.
Returns
size_t strnlen_PF (uint_farptr_t s, size_t len)¶
Determine the length of a fixed-size string. The strnlen_PF() function is similar to strnlen(), except that s is a far pointer to a string in program space.
Parameters
len The maximum number of length to return
Returns
char * strpbrk_P (const char * s, const char * accept)¶
The strpbrk_P() function locates the first occurrence in the string s of any of the characters in the flash string accept. This function is similar to strpbrk() except that accept is a pointer to a string in program space.
Returns
const char * strrchr_P (const char * s, int val)¶
Locate character in string. The strrchr_P() function returns a pointer to the last occurrence of the character val in the flash string s.
Returns
char * strsep_P (char ** sp, const char * delim)¶
Parse a string into tokens. The strsep_P() function locates, in the string referenced by *sp, the first occurrence of any character in the string delim (or the terminating '\0' character) and replaces it with a '\0'. The location of the next character after the delimiter character (or NULL, if the end of the string was reached) is stored in *sp. An ``empty'' field, i.e. one caused by two adjacent delimiter characters, can be detected by comparing the location referenced by the pointer returned in *sp to '\0'. This function is similar to strsep() except that delim is a pointer to a string in program space.
Returns
size_t strspn_P (const char * s, const char * accept)¶
The strspn_P() function calculates the length of the initial segment of s which consists entirely of characters in accept. This function is similar to strspn() except that accept is a pointer to a string in program space.
Returns
char * strstr_P (const char * s1, const char * s2)¶
Locate a substring. The strstr_P() function finds the first occurrence of the substring s2 in the string s1. The terminating '\0' characters are not compared. The strstr_P() function is similar to strstr() except that s2 is pointer to a string in program space.
Returns
char * strstr_PF (const char * s1, uint_farptr_t s2)¶
Locate a substring. The strstr_PF() function finds the first occurrence of the substring s2 in the string s1. The terminating '\0' characters are not compared. The strstr_PF() function is similar to strstr() except that s2 is a far pointer to a string in program space.
Returns
char * strtok_P (char * s, const char * delim)¶
Parses the string into tokens. strtok_P() parses the string s into tokens. The first call to strtok_P() should have s as its first argument. Subsequent calls should have the first argument set to NULL. If a token ends with a delimiter, this delimiting character is overwritten with a '\0' and a pointer to the next character is saved for the next call to strtok_P(). The delimiter string delim may be different for each call.
The strtok_P() function is similar to strtok() except that delim is pointer to a string in program space.
Returns
Note
char * strtok_rP (char * string, const char * delim, char ** last)¶
Parses string into tokens. The strtok_rP() function parses string into tokens. The first call to strtok_rP() should have string as its first argument. Subsequent calls should have the first argument set to NULL. If a token ends with a delimiter, this delimiting character is overwritten with a '\0' and a pointer to the next character is saved for the next call to strtok_rP(). The delimiter string delim may be different for each call. last is a user allocated char* pointer. It must be the same while parsing the same string. strtok_rP() is a reentrant version of strtok_P().
The strtok_rP() function is similar to strtok_r() except that delim is pointer to a string in program space.
Returns
Author¶
Generated automatically by Doxygen for avr-libc from the source code.
Fri Jan 1 2021 | Version 2.0.0 |