AVR Libc Home Page | ![]() |
AVR Libc Development Pages | |||
Main Page | User Manual | Library Reference | FAQ | Alphabetical Index | Example Projects |
Macros | |
#define | _FFS(x) |
Functions | |
char * | strdup (const char *s1) |
size_t | strlcat (char *, const char *, size_t) |
size_t | strlcpy (char *, const char *, size_t) |
char * | strtok (char *, const char *) |
The string functions perform string operations on NULL terminated strings.
#define _FFS | ( | x | ) |
This macro finds the first (least significant) bit set in the input value.
This macro is very similar to the function ffs() except that it evaluates its argument at compile-time, so it should only be applied to compile-time constant expressions where it will reduce to a constant itself. Application of this macro to expressions that are not constant at compile-time is not recommended, and might result in a huge amount of code generated.
char * strdup | ( | const char * | s1 | ) |
Duplicate a string.
The strdup() function allocates memory and copies into it the string addressed by s1, including the terminating null character.
size_t strlcat | ( | char * | dst, |
const char * | src, | ||
size_t | siz | ||
) |
Concatenate two strings.
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)).
size_t strlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | siz | ||
) |
Copy a string.
Copy src to string dst of size siz. At most siz-1 characters will be copied. Always NULL terminates (unless siz == 0).
char * strtok | ( | char * | s, |
const char * | delim | ||
) |
Parses the string s into tokens.
strtok parses the string s into tokens. The first call to strtok 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. The delimiter string delim may be different for each call.
strtok_r()
.