compare-string.h File Reference

Comparison functions for strings. More...


Functions

int string_equal (void *string1, void *string2)
 Compare two strings to determine if they are equal.
int string_compare (void *string1, void *string2)
 Compare two strings.
int string_nocase_equal (void *string1, void *string2)
 Compare two strings to determine if they are equal, ignoring the case of letters.
int string_nocase_compare (void *string1, void *string2)
 Compare two strings, ignoring the case of letters.


Detailed Description

Comparison functions for strings.

To find the difference between two strings, use string_compare.

To find if two strings are equal, use string_equal.

For case insensitive versions, see string_nocase_compare and string_nocase_equal.


Function Documentation

int string_compare ( void *  string1,
void *  string2 
)

Compare two strings.

Parameters:
string1 The first string.
string2 The second string.
Returns:
A negative value if the first string should be sorted before the second, a positive value if the first string should be sorted after the second, zero if the two strings are equal.

int string_equal ( void *  string1,
void *  string2 
)

Compare two strings to determine if they are equal.

Parameters:
string1 The first string.
string2 The second string.
Returns:
Non-zero if the strings are equal, zero if they are not equal.

int string_nocase_compare ( void *  string1,
void *  string2 
)

Compare two strings, ignoring the case of letters.

Parameters:
string1 The first string.
string2 The second string.
Returns:
A negative value if the first string should be sorted before the second, a positive value if the first string should be sorted after the second, zero if the two strings are equal.

int string_nocase_equal ( void *  string1,
void *  string2 
)

Compare two strings to determine if they are equal, ignoring the case of letters.

Parameters:
string1 The first string.
string2 The second string.
Returns:
Non-zero if the strings are equal, zero if they are not equal.


Generated on Sun Sep 14 03:08:02 2008 for C Algorithms by  doxygen 1.5.5