#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <stdarg.h>
#include <uapi/linux/string.h>
#include <asm/string.h>
Go to the source code of this file.
|
char * | strndup_user (const char __user *, long) |
|
void * | memdup_user (const void __user *, size_t) |
|
char * | strcpy (char *, const char *) |
|
char * | strncpy (char *, const char *, __kernel_size_t) |
|
size_t | strlcpy (char *, const char *, size_t) |
|
char * | strcat (char *, const char *) |
|
char * | strncat (char *, const char *, __kernel_size_t) |
|
size_t | strlcat (char *, const char *, __kernel_size_t) |
|
int | strcmp (const char *, const char *) |
|
int | strncmp (const char *, const char *, __kernel_size_t) |
|
int | strnicmp (const char *, const char *, __kernel_size_t) |
|
int | strcasecmp (const char *s1, const char *s2) |
|
int | strncasecmp (const char *s1, const char *s2, size_t n) |
|
char * | strchr (const char *, int) |
|
char * | strnchr (const char *, size_t, int) |
|
char * | strrchr (const char *, int) |
|
char *__must_check | skip_spaces (const char *) |
|
char * | strim (char *) |
|
char * | strstr (const char *, const char *) |
|
char * | strnstr (const char *, const char *, size_t) |
|
__kernel_size_t | strlen (const char *) |
|
__kernel_size_t | strnlen (const char *, __kernel_size_t) |
|
char * | strpbrk (const char *, const char *) |
|
char * | strsep (char **, const char *) |
|
__kernel_size_t | strspn (const char *, const char *) |
|
__kernel_size_t | strcspn (const char *, const char *) |
|
void * | memset (void *, int, __kernel_size_t) |
|
void * | memcpy (void *, const void *, __kernel_size_t) |
|
void * | memmove (void *, const void *, __kernel_size_t) |
|
void * | memscan (void *, int, __kernel_size_t) |
|
int | memcmp (const void *, const void *, __kernel_size_t) |
|
void * | memchr (const void *, int, __kernel_size_t) |
|
void * | memchr_inv (const void *s, int c, size_t n) |
|
char * | kstrdup (const char *s, gfp_t gfp) |
|
char * | kstrndup (const char *s, size_t len, gfp_t gfp) |
|
void * | kmemdup (const void *src, size_t len, gfp_t gfp) |
|
char ** | argv_split (gfp_t gfp, const char *str, int *argcp) |
|
void | argv_free (char **argv) |
|
bool | sysfs_streq (const char *s1, const char *s2) |
|
int | strtobool (const char *s, bool *res) |
|
ssize_t | memory_read_from_buffer (void *to, size_t count, loff_t *ppos, const void *from, size_t available) |
|
size_t | memweight (const void *ptr, size_t bytes) |
|
argv_free - free an argv - the argument vector to be freed
Frees an argv and the strings it points to.
Definition at line 40 of file argv_split.c.
argv_split - split a string at whitespace, returning an argv : the GFP mask used to allocate memory : the string to be split : returned argument count
Returns an array of pointers to strings which are split out from . This is performed by strictly splitting on white-space; no quote processing is performed. Multiple whitespace characters are considered to be a single argument separator. The returned array is always NULL-terminated. Returns NULL on memory allocation failure.
Definition at line 63 of file argv_split.c.
kmemdup - duplicate region of memory
: memory region to duplicate : memory region length : GFP mask to use
Definition at line 67 of file util.c.
kstrdup - allocate space for and copy an existing string : the string to duplicate : the GFP mask used in the kmalloc() call when allocating memory
Definition at line 20 of file util.c.
kstrndup - allocate space for and copy an existing string : the string to duplicate : read at most chars from : the GFP mask used in the kmalloc() call when allocating memory
Definition at line 42 of file util.c.
memchr - Find a character in an area of memory. : The memory area
: The byte to search for
: The size of the area.
returns the address of the first occurrence of
, or NULL if is
not found
Definition at line 96 of file string.c.
memchr_inv - Find an unmatching character in an area of memory. : The memory area
: Find a character other than c : The size of the area.
returns the address of the first character other than
, or NULL if the whole buffer contains just
.
Definition at line 782 of file string.c.
memcmp - Compare two areas of memory : One area of memory : Another area of memory : The size of the area.
Definition at line 68 of file string.c.
memcpy - Copy one area of memory to another : Where to copy to : Where to copy from : The size of the area.
You should not use this function to access IO space, use memcpy_toio() or memcpy_fromio() instead.
Definition at line 151 of file memcpy.c.
memdup_user - duplicate memory region from user space
: source address in user space : number of bytes to copy
Returns an ERR_PTR() on failure.
Definition at line 86 of file util.c.
memmove - Copy one area of memory to another : Where to copy to : Where to copy from : The size of the area.
Unlike memcpy(), memmove() copes with overlapping areas.
Definition at line 10 of file memmove.c.
memory_read_from_buffer - copy data from the buffer : the kernel space buffer to read to : the maximum number of bytes to read : the current position in the buffer : the buffer to read from : the size of the buffer
The memory_read_from_buffer() function reads up to bytes from the buffer at offset into the kernel space address starting at .
On success, the number of bytes read is returned and the offset is advanced by this number, or negative value is returned on error.
Definition at line 652 of file libfs.c.
memscan - Find a character in an area of memory. : The memory area
: The byte to search for
: The size of the area.
returns the address of the first occurrence of
, or 1 byte past the area if is
not found
memscan - Find a character in an area of memory. : The memory area
: The byte to search for : The size of the area.
returns the address of the first occurrence of
, or 1 byte past the area if is
not found
Definition at line 332 of file string.c.
skip_spaces - Removes leading whitespace from . : The string to be stripped.
Returns a pointer to the first non-whitespace character in .
Definition at line 345 of file string.c.
strcat - Append one NUL-terminated string to another : The string to be appended to : The string to append to it
returns a pointer to
strcat - Append one NUL-terminated string to another : The string to be appended to : The string to append to it
Definition at line 18 of file string.c.
strchr - Find the first occurrence of a character in a string : The string to be searched
: The character to search for
Definition at line 106 of file string.c.
strcmp - Compare two strings : One string : Another string
returns 0 if and are equal, < 0 if is less than > 0 if is greater than
strcmp - Compare two strings : One string : Another string
Definition at line 81 of file string.c.
strcpy - Copy a NUL terminated string : Where to copy the string to : Where to copy the string from
returns a pointer to
strcpy - Copy a NUL terminated string : Where to copy the string to : Where to copy the string from
Definition at line 12 of file string.c.
strcspn - Calculate the length of the initial substring of which does not contain letters in : The string to be searched : The string to avoid
Definition at line 445 of file string.c.
strim - Removes leading and trailing whitespace from . : The string to be stripped.
Note that the first trailing whitespace is replaced with a NUL-terminator in the given string . Returns a pointer to the first non-whitespace character in .
Definition at line 361 of file string.c.
strlcat - Append a length-limited, NUL-terminated string to another : The string to be appended to : The string to append to it
: The size of the destination buffer.
strlcat - Append a length-limited, NUL-terminated string to another : The string to be appended to : The string to append to it : The size of the destination buffer.
Definition at line 154 of file string.c.
strlcpy - Copy a NUL terminated string into a sized buffer : Where to copy the string to : Where to copy the string from : size of destination buffer
Compatible with *BSD: the result is always a valid NUL-terminated string that fits in the buffer (unless, of course, the buffer size is zero). It does not pad out the result like strncpy() does.
Definition at line 94 of file string.c.
strlen - Find the length of a string : The string to be sized
returns the length of
strlen - Find the length of a string : The string to be sized
Definition at line 59 of file string.c.
strncat - Append a length-limited, NUL-terminated string to another : The string to be appended to : The string to append to it
: The maximum numbers of bytes to copy
returns a pointer to
Note that in contrast to strncpy, strncat ensures the result is terminated.
strncat - Append a length-limited, NUL-terminated string to another : The string to be appended to : The string to append to it : The maximum numbers of bytes to copy
Note that in contrast to strncpy(), strncat() ensures the result is terminated.
Definition at line 183 of file string.c.
strnchr - Find a character in a length limited string : The string to be searched : The number of characters to be searched
: The character to search for
Definition at line 329 of file string.c.
strncmp - Compare two length-limited strings : One string : Another string : The maximum number of bytes to compare
Definition at line 33 of file string.c.
strncpy - Copy a length-limited, NUL-terminated string : Where to copy the string to : Where to copy the string from
: The maximum number of bytes to copy
The result is not NUL-terminated if the source exceeds
bytes.
strncpy - Copy a length-limited, NUL-terminated string : Where to copy the string to : Where to copy the string from : The maximum number of bytes to copy
The result is not NUL-terminated if the source exceeds bytes.
In the case where the length of is less than that of count, the remainder of will be padded with NUL.
Definition at line 116 of file string.c.
strnicmp - Case insensitive, length-limited string comparison : One string : The other string : the maximum number of characters to compare
Definition at line 37 of file string.c.
strnlen - Find the length of a length-limited string : The string to be sized
: The maximum number of bytes to search
returns the minimum of the length of and
strnlen - Find the length of a length-limited string : The string to be sized : The maximum number of bytes to search
Definition at line 15 of file stdio.c.
strnstr - Find the first substring in a length-limited string : The string to be searched : The string to search for : the maximum number of characters to search
Definition at line 721 of file string.c.
strpbrk - Find the first occurrence of a set of characters : The string to be searched : The characters to search for
Definition at line 469 of file string.c.
strrchr - Find the last occurrence of a character in a string : The string to be searched
: The character to search for
Definition at line 226 of file string.c.
strsep - Split a string into tokens : The string to be searched : The characters to search for
strsep() updates to point after the token, ready for the next call.
It returns empty tokens, too, behaving exactly like the libc function of that name. In fact, it was stolen from glibc2 and de-fancy-fied. Same semantics, slimmer shape. ;)
Definition at line 496 of file string.c.
strspn - Calculate the length of the initial substring of which only contain letters in : The string to be searched : The string to search for
Definition at line 418 of file string.c.
strstr - Find the first substring in a NUL terminated string : The string to be searched : The string to search for
Definition at line 244 of file string.c.
strtobool - convert common user inputs into boolean values : input string : result
This routine returns 0 iff the first character is one of 'Yy1Nn0'. Otherwise it will return -EINVAL. Value pointed to by res is updated upon finding a match.
Definition at line 549 of file string.c.
sysfs_streq - return true if strings are equal, modulo trailing newline : one string : another string
This routine returns true iff two strings are equal, treating both NUL and newline-then-NUL as equivalent string terminations. It's geared for use with sysfs input strings, which generally terminate with newlines but are compared against values without newlines.
Definition at line 523 of file string.c.