static int enum_compare(const idmef_value_type_t *src, const idmef_value_type_t *dst, size_t size, idmef_criterion_operator_t op) { const char *s1; if ( dst->id == IDMEF_VALUE_TYPE_STRING ) { s1 = idmef_class_enum_to_string(src->data.enum_val.class_id, src->data.enum_val.value); if ( ! s1 ) return requiem_error_verbose(REQUIEM_ERROR_IDMEF_VALUE_TYPE_PARSE, "Enumeration conversion from numeric to string failed"); return charstring_compare(s1, requiem_string_get_string(dst->data.string_val), op); } return generic_compare(src, dst, size, op); }
static int enum_compare(const iodef_value_type_t *src, const iodef_value_type_t *dst, size_t size, iodef_criterion_operator_t op) { const char *s1; if ( (src && ! dst) || (dst && ! src) ) return -1; if ( dst->id == IODEF_VALUE_TYPE_STRING ) { s1 = iodef_class_enum_to_string(src->data.enum_val.class_id, src->data.enum_val.value); if ( ! s1 ) return libiodef_error_verbose(LIBIODEF_ERROR_IODEF_VALUE_TYPE_PARSE, "Enumeration conversion from numeric to string failed"); return charstring_compare(s1, libiodef_string_get_string(dst->data.string_val), op); } return generic_compare(src, dst, size, op); }
int tree_node_cmp(const void *a, const void *b) { return generic_compare(*(tree_node *)a, *(tree_node *)b); }
static inline int avl_node_cmp(const void *a, const void *b) { return generic_compare( ((struct avl_node *)a)->key, ((struct avl_node *)b)->key); }