libcfe  0.12.1
some useful C-functions
xstrcoll.h File Reference
#include <sys/types.h>
Include dependency graph for xstrcoll.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define stringcompare(a, alen, b, blen)   xstrcoll((const char *)a, alen, (const char *)b, blen)
 

Functions

int xstrcoll (const char *a, size_t alen, const char *b, size_t blen)
 
int str_compare (void *a, void *b)
 

Macro Definition Documentation

◆ stringcompare

#define stringcompare (   a,
  alen,
  b,
  blen 
)    xstrcoll((const char *)a, alen, (const char *)b, blen)

Definition at line 34 of file xstrcoll.h.

Function Documentation

◆ str_compare()

int str_compare ( void *  a,
void *  b 
)

xstrcoll Compares two '\0' terminated string, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B.

Note
This function can be used to compare elements of a string table.
Parameters
[in]aVoid pointer to string A.
[in]bVoid pointer to string B.
Returns
return value
  • negative A is less than B
  • positive A is greater than B
  • zero A is equal to B

Definition at line 22 of file xstrcoll.c.

Here is the call graph for this function:

◆ xstrcoll()

int xstrcoll ( const char *  a,
size_t  alen,
const char *  b,
size_t  blen 
)

Compare two strings A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B.

Parameters
[in]aPointer to string A.
[in]alenLength of string A (without terminating character).
[in]bPointer to string B.
[in]blenLength of string B (without terminating character).
Returns
return value
  • negative A is less than B
  • positive A is greater than B
  • zero A is equal to B

Definition at line 27 of file xstrcoll.c.

Here is the caller graph for this function: