stringutil.h File Reference
#include "stddef.h"
Include dependency graph for stringutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARRAY_SIZE(a)   (sizeof(a) / sizeof((a)[0]))
 

Functions

const char * strstri (const char *pString, const char *pToken)
 Return pointer to occurrence of substring in string. Case insensitive. More...
 
int strcasecmp (const char *s1, const char *s2)
 A case-insensitive strcmp(). More...
 
void * memmem (const void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
 
void * memrchr (const void *s, int c, size_t n)
 
int memicmp (const void *buf1, const void *buf2, size_t len)
 Compare block of memory without case sensitivity. More...
 
char hexchar (unsigned char c)
 Return hex character corresponding to given value. More...
 
signed char unhex (char c)
 Return numeric value corresponding to given hex character. More...
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   a)    (sizeof(a) / sizeof((a)[0]))

Function Documentation

◆ hexchar()

char hexchar ( unsigned char  c)

Return hex character corresponding to given value.

Parameters
cValue from 0-15, others are invalid
Return values
charHex character '0'-'9', 'a'-'f' or '\0' if invalid

◆ memicmp()

int memicmp ( const void *  buf1,
const void *  buf2,
size_t  len 
)

Compare block of memory without case sensitivity.

◆ memmem()

void* memmem ( const void *  haystack,
size_t  haystacklen,
const void *  needle,
size_t  needlelen 
)

◆ memrchr()

void* memrchr ( const void *  s,
int  c,
size_t  n 
)

◆ strcasecmp()

int strcasecmp ( const char *  s1,
const char *  s2 
)

A case-insensitive strcmp().

Note
non-ANSI GNU C library extension

◆ strstri()

const char* strstri ( const char *  pString,
const char *  pToken 
)

Return pointer to occurrence of substring in string. Case insensitive.

Parameters
[in]pStringstring to work with
[in]pTokenstring to locate
Return values
constchar* pointer to first occurrence in of pToken in pString or NULL if not found

◆ unhex()

signed char unhex ( char  c)

Return numeric value corresponding to given hex character.

Parameters
cCharacter '0'-'9', 'a'-'f' or 'A'-'F'
Return values
int8_tNumeric value or -1 if character invalid