static Boolean _compareProperties(WsmProperty& prop1, WsmProperty& prop2) { if (prop1.getName() != prop2.getName()) return false; return _compareValues(prop1.getValue(), prop2.getValue()); }
int _matchesQuery(ZdbRecordset* recordset) { void* value1 = NULL; void* value2 = NULL; ZdbType* type; if (recordset->query->condition.type == ZDB_QUERY_CONDITION_NONE) { /* No condition, always match */ return 1; } value1 = recordset->query->condition.value; type = recordset->query->table->columns[recordset->query->condition.columnIndex]->type; ZdbQueryGetValue(recordset, recordset->query->condition.columnIndex, type, &value2); int result = _compareValues(type, value1, value2, recordset->query->condition.type); printf("RESULT!! %d %d %d\n", *(int*)value1, *(int*)value2, result); switch(recordset->query->condition.type) { case ZDB_QUERY_CONDITION_EQ: return result == 0; case ZDB_QUERY_CONDITION_NE: return result != 0; case ZDB_QUERY_CONDITION_LT: return result > 0; case ZDB_QUERY_CONDITION_GT: return result < 0; case ZDB_QUERY_CONDITION_LTE: return result >= 0; case ZDB_QUERY_CONDITION_GTE: return result <= 0; } return result; }