Linux Perf
string2.h File Reference
#include <linux/types.h>
#include <stddef.h>
#include <string.h>
Include dependency graph for string2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 

Function Documentation

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ asprintf_expr_in_ints()

static char* asprintf_expr_in_ints ( const char *  var,
size_t  nints,
int *  ints 
)
inlinestatic

Definition at line 32 of file string2.h.

Here is the call graph for this function:

◆ asprintf_expr_inout_ints()

char* asprintf_expr_inout_ints ( const char *  var,
bool  in,
size_t  nints,
int *  ints 
)

Definition at line 361 of file string.c.

Here is the call graph for this function:

◆ asprintf_expr_not_in_ints()

static char* asprintf_expr_not_in_ints ( const char *  var,
size_t  nints,
int *  ints 
)
inlinestatic

Definition at line 37 of file string2.h.

Here is the call graph for this function:

◆ ltrim()

char* ltrim ( char *  s)

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)

Definition at line 15 of file string.c.

◆ rtrim()

char* rtrim ( char *  s)

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)

Definition at line 417 of file string.c.

◆ 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.

Here is the call graph for this function:

◆ strglobmatch_nocase()

bool strglobmatch_nocase ( const char *  str,
const char *  pat 
)

Definition at line 270 of file string.c.

Here is the call graph for this function:

◆ strisglob()

static bool strisglob ( const char *  str)
inlinestatic

Definition at line 15 of file string2.h.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ strpbrk_esc()

char* strpbrk_esc ( char *  str,
const char *  stopset 
)

Definition at line 401 of file string.c.

◆ 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

Definition at line 25 of file string2.h.

Here is the call graph for this function: