#include <string.h>
void *memcmp
(void * s1 , void *
s2 , size_t n
);
The memcmp function compares the first n characters of the object pointed to by s1 to the first n characters of the object pointed to by s2.
The memcmp function returns an integer greater than, equal to, or less than zero, accordingly as the object pointed to by s1 is greater than, equal to, or less than the object pointed to by s2.
None.
#include <string.h>
void *strcmp
(char * s1 , char *
s2 );
The strcmp function compares the string pointed to by s1 to the string pointed to by s2.
The strcmp function returns an integer greater than, equal to, or less than zero, accordingly as the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2.
#include <string.h>
void *strncmp
(char * s1 , char *
s2 , size_t n
);
The strncmp function compares not more than n characters (characters that follow a null character are not compared) from the array pointed to by s1 to the array pointed to by s2.
The strncmp function returns an integer greater than, equal to, or less than zero, accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal to, or less than the possibly null-terminated array pointed to by s2.
None.
#include <string.h>
void *strcoll
(char * s1 , char *
s2 );
The strcoll function compares the string pointed to by s1 to the string pointed to by s2, both interpreted as appropriate to the LC_COLLATE category of the current locale.
The strcoll function returns an integer greater than, equal to, or less than zero, accordingly as the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2, when they are both interpreted as appropriate to the current locale.
The XGC library supports the "C" locale only.
#include <string.h>
size_t
strxfrm
(char *
s1 , char * s2 ,
size_t n );
The strxfrm function transforms the string pointed to by s2 and places the resulting string into the array pointed to by s1. The transformation is such that if the strcmpfunction is applied to two transformed strings, it returns a value greater than, equal to, or less than zero, corresponding to the result of the strcoll function applied to the same two original strings. No more than n characters are placed into the resulting array pointed to by s1, including the terminating null character. If n is zero, s1 is permitted to be a null pointer. If copying takes place between objects that overlap, the behavior is undefined.
The strxfrm function returns the length of the transformed string (not including the terminating null character). If the value returned is n or more, then the contents of the array pointed to be s1 are indeterminate.
In the XGC library, the strxfrm function copies the characters with no transformation.