1 #ifndef SN_COMPARATOR_H
2 #define SN_COMPARATOR_H 1
9 typedef struct sn_comparator_s sn_comparator_t;
11 #define SN_COMP_LEFT(c) (((c)->min < (c)->max) ? (c)->min : (c)->max)
12 #define SN_COMP_RIGHT(c) (((c)->min > (c)->max) ? (c)->min : (c)->max)
13 #define SN_COMP_MIN(c) (c)->min
14 #define SN_COMP_MAX(c) (c)->max
16 sn_comparator_t *sn_comparator_create (int min, int max);
17 void sn_comparator_destroy (sn_comparator_t *c);
18 void sn_comparator_invert (sn_comparator_t *c);
19 void sn_comparator_swap (sn_comparator_t *c, int con0, int con1);
21 int sn_comparator_compare (const void *, const void *);
23 #endif /* SN_COMPARATOR_H */
25 /* vim: set shiftwidth=2 softtabstop=2 : */