universe@89: #ifndef COMPARATOR_H universe@89: #define COMPARATOR_H universe@89: universe@89: #ifdef __cplusplus universe@89: extern "C" { universe@89: #endif universe@89: universe@89: #include "ucx.h" universe@89: #include universe@89: universe@89: /** universe@89: * Wraps the strcmp function. universe@89: * @param s1 string one universe@89: * @param s2 string two universe@89: * @param data omitted universe@89: * @return the result of strcmp(s1, s2) universe@89: */ universe@89: int ucx_strcmp(void *s1, void *s2, void *data); universe@89: universe@89: /** universe@89: * Wraps the strncmp function. universe@89: * @param s1 string one universe@89: * @param s2 string two universe@89: * @param n a pointer to the size_t containing the third strncmp parameter universe@89: * @return the result of strncmp(s1, s2, *n) universe@89: */ universe@89: int ucx_strncmp(void *s1, void *s2, void *n); universe@89: universe@89: /** universe@89: * Compares two integers of type int. universe@89: * @param i1 pointer to integer one universe@89: * @param i2 pointer to integer two universe@89: * @param data omitted universe@89: * @return -1, if *i1 is less than *i2, 0 if both are equal, universe@89: * 1 if *i1 is greater than *i2 universe@89: */ universe@89: universe@89: int ucx_intcmp(void *i1, void *i2, void *data); universe@89: universe@89: /** universe@89: * Compares two pointers. universe@89: * @param ptr1 pointer one universe@89: * @param ptr2 pointer two universe@89: * @param data omitted universe@89: * @return -1 if ptr1 is less than ptr2, 0 if both are equal, universe@89: * 1 if ptr1 is greater than ptr2 universe@89: */ universe@89: int ucx_ptrcmp(void *ptr1, void *ptr2, void *data); universe@89: universe@91: /** universe@91: * Compares two memory areas. universe@91: * @param ptr1 pointer one universe@91: * @param ptr2 pointer two universe@91: * @param n a pointer to the size_t containing the third parameter for memcmp universe@91: * @return the result of memcmp(ptr1, ptr2, *n) universe@91: */ universe@91: int ucx_memcmp(void *ptr1, void *ptr2, void *n); universe@91: universe@89: #ifdef __cplusplus universe@89: } universe@89: #endif universe@89: universe@89: #endif /* COMPARATOR_H */ universe@89: