#include "string2.h"
#include <linux/kernel.h>
#include <linux/string.h>
#include <stdlib.h>
#include "sane_ctype.h"
Go to the source code of this file.
|
s64 | perf_atoll (const char *str) |
|
static const char * | skip_sep (const char *cp) |
|
static const char * | skip_arg (const char *cp) |
|
static int | count_argc (const char *str) |
|
void | argv_free (char **argv) |
|
char ** | argv_split (const char *str, int *argcp) |
|
static bool | __match_charclass (const char *pat, char c, const char **npat) |
|
static bool | __match_glob (const char *str, const char *pat, bool ignore_space, bool case_ins) |
|
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) |
|
int | strtailcmp (const char *s1, const char *s2) |
|
char * | strxfrchar (char *s, char from, char to) |
|
char * | ltrim (char *s) |
|
char * | rtrim (char *s) |
|
char * | asprintf_expr_inout_ints (const char *var, bool in, size_t nints, int *ints) |
|
char * | strpbrk_esc (char *str, const char *stopset) |
|
char * | strdup_esc (const char *str) |
|
◆ __match_charclass()
static bool __match_charclass |
( |
const char * |
pat, |
|
|
char |
c, |
|
|
const char ** |
npat |
|
) |
| |
|
static |
◆ __match_glob()
static bool __match_glob |
( |
const char * |
str, |
|
|
const char * |
pat, |
|
|
bool |
ignore_space, |
|
|
bool |
case_ins |
|
) |
| |
|
static |
◆ 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_inout_ints()
char* asprintf_expr_inout_ints |
( |
const char * |
var, |
|
|
bool |
in, |
|
|
size_t |
nints, |
|
|
int * |
ints |
|
) |
| |
◆ count_argc()
static int count_argc |
( |
const char * |
str | ) |
|
|
static |
◆ 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.
◆ skip_arg()
static const char* skip_arg |
( |
const char * |
cp | ) |
|
|
static |
◆ skip_sep()
static const char* skip_sep |
( |
const char * |
cp | ) |
|
|
static |
◆ 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 |
|
) |
| |
◆ 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.