spif_cmp_t spif_tok_comp(spif_tok_t self, spif_tok_t other) { SPIF_OBJ_COMP_CHECK_NULL(self, other); SPIF_OBJ_COMP_CHECK_NULL(self->src, other->src); return spif_str_cmp(self->src, other->src); }
spif_cmp_t spif_str_ncmp_with_ptr(spif_str_t self, spif_charptr_t other, spif_stridx_t cnt) { int c; SPIF_OBJ_COMP_CHECK_NULL(self, other); c = strncmp((char *) SPIF_STR_STR(self), (char *) other, cnt); return SPIF_CMP_FROM_INT(c); }
spif_cmp_t spif_str_cmp(spif_str_t self, spif_str_t other) { int c; SPIF_OBJ_COMP_CHECK_NULL(self, other); c = strcmp((char *) SPIF_STR_STR(self), (char *) SPIF_STR_STR(other)); return SPIF_CMP_FROM_INT(c); }
spif_cmp_t spif_eterm_action_comp(spif_eterm_action_t self, spif_eterm_action_t other) { spif_cmp_t c; SPIF_OBJ_COMP_CHECK_NULL(self, other); c = SPIF_CMP_FROM_INT((int) (self->type) - (int) (other->type)); if (!SPIF_CMP_IS_EQUAL(c)) { return c; } c = SPIF_CMP_FROM_INT((int) (self->button) - (int) (other->button)); if (!SPIF_CMP_IS_EQUAL(c)) { return c; } c = SPIF_CMP_FROM_INT((int) (self->keysym) - (int) (other->keysym)); if (!SPIF_CMP_IS_EQUAL(c)) { return c; } return SPIF_CMP_FROM_INT((int) (self->modifiers) - (int) (other->modifiers)); }
spif_cmp_t spif_url_comp(spif_url_t self, spif_url_t other) { SPIF_OBJ_COMP_CHECK_NULL(self, other); return spif_str_comp(SPIF_STR(self), SPIF_STR(other)); }