#include <linux/types.h>
#include <stddef.h>
#include <string.h>
Go to the source code of this file.
|
s64 | perf_atoll (const char *str) |
|
char ** | argv_split (const char *str, int *argcp) |
|
void | argv_free (char **argv) |
|
bool | strglobmatch (const char *str, const char *pat) |
|
bool | strglobmatch_nocase (const char *str, const char *pat) |
|
bool | strlazymatch (const char *str, const char *pat) |
|
static bool | strisglob (const char *str) |
|
int | strtailcmp (const char *s1, const char *s2) |
|
char * | strxfrchar (char *s, char from, char to) |
|
char * | ltrim (char *s) |
|
char * | rtrim (char *s) |
|
static char * | trim (char *s) |
|
char * | asprintf_expr_inout_ints (const char *var, bool in, size_t nints, int *ints) |
|
static char * | asprintf_expr_in_ints (const char *var, size_t nints, int *ints) |
|
static char * | asprintf_expr_not_in_ints (const char *var, size_t nints, int *ints) |
|
char * | strpbrk_esc (char *str, const char *stopset) |
|
char * | strdup_esc (const char *str) |
|
◆ argv_free()
void argv_free |
( |
char ** |
argv | ) |
|
argv_free - free an argv - the argument vector to be freed
Frees an argv and the strings it points to.
Definition at line 104 of file string.c.
◆ argv_split()
char** argv_split |
( |
const char * |
str, |
|
|
int * |
argcp |
|
) |
| |
argv_split - split a string at whitespace, returning an argv : 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 127 of file string.c.
◆ asprintf_expr_in_ints()
static char* asprintf_expr_in_ints |
( |
const char * |
var, |
|
|
size_t |
nints, |
|
|
int * |
ints |
|
) |
| |
|
inlinestatic |
◆ asprintf_expr_inout_ints()
char* asprintf_expr_inout_ints |
( |
const char * |
var, |
|
|
bool |
in, |
|
|
size_t |
nints, |
|
|
int * |
ints |
|
) |
| |
◆ asprintf_expr_not_in_ints()
static char* asprintf_expr_not_in_ints |
( |
const char * |
var, |
|
|
size_t |
nints, |
|
|
int * |
ints |
|
) |
| |
|
inlinestatic |
◆ ltrim()
ltrim - Removes leading whitespace from . : The string to be stripped.
Return pointer to the first non-whitespace character in .
Definition at line 330 of file string.c.
◆ perf_atoll()
s64 perf_atoll |
( |
const char * |
str | ) |
|
◆ rtrim()
rtrim - Removes 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 .
Definition at line 345 of file string.c.
◆ strdup_esc()
char* strdup_esc |
( |
const char * |
str | ) |
|
◆ strglobmatch()
bool strglobmatch |
( |
const char * |
str, |
|
|
const char * |
pat |
|
) |
| |
strglobmatch - glob expression pattern matching : the target string to match : the pattern string to match
This returns true if the matches . can includes wildcards ('*','?') and character classes ([CHARS], complementation and ranges are also supported). Also, this supports escape character ('\') to use special characters as normal character.
Note: if syntax is broken, this always returns false.
Definition at line 265 of file string.c.
◆ strglobmatch_nocase()
bool strglobmatch_nocase |
( |
const char * |
str, |
|
|
const char * |
pat |
|
) |
| |
◆ strisglob()
static bool strisglob |
( |
const char * |
str | ) |
|
|
inlinestatic |
◆ strlazymatch()
bool strlazymatch |
( |
const char * |
str, |
|
|
const char * |
pat |
|
) |
| |
strlazymatch - matching pattern strings lazily with glob pattern : the target string to match : the pattern string to match
This is similar to strglobmatch, except this ignores spaces in the target string.
Definition at line 283 of file string.c.
◆ strpbrk_esc()
char* strpbrk_esc |
( |
char * |
str, |
|
|
const char * |
stopset |
|
) |
| |
◆ strtailcmp()
int strtailcmp |
( |
const char * |
s1, |
|
|
const char * |
s2 |
|
) |
| |
strtailcmp - Compare the tail of two strings : 1st string to be compared : 2nd string to be compared
Return 0 if whole of either string is same as another's tail part.
Definition at line 295 of file string.c.
◆ strxfrchar()
char* strxfrchar |
( |
char * |
s, |
|
|
char |
from, |
|
|
char |
to |
|
) |
| |
strxfrchar - Locate and replace character in : The string to be searched/changed. : Source character to be replaced. : Destination character.
Return pointer to the changed string.
Definition at line 314 of file string.c.
◆ trim()
static char* trim |
( |
char * |
s | ) |
|
|
inlinestatic |