-static const char *cql_lookup_reverse(cql_transform_t ct,
- const char *category,
- const char **attr_list,
- int *matches)
+#if 0
+struct Z_AttributeElement {
+ Z_AttributeSetId *attributeSet; /* OPT */
+ int *attributeType;
+ int which;
+ union {
+ int *numeric;
+ Z_ComplexAttribute *complex;
+#define Z_AttributeValue_numeric 1
+#define Z_AttributeValue_complex 2
+ } value;
+};
+#endif
+
+static int compare_attr(Z_AttributeElement *a, Z_AttributeElement *b)
+{
+ ODR odr_a = odr_createmem(ODR_ENCODE);
+ ODR odr_b = odr_createmem(ODR_ENCODE);
+ int len_a, len_b;
+ char *buf_a, *buf_b;
+ int ret;
+
+ z_AttributeElement(odr_a, &a, 0, 0);
+ z_AttributeElement(odr_b, &b, 0, 0);
+
+ buf_a = odr_getbuf(odr_a, &len_a, 0);
+ buf_b = odr_getbuf(odr_b, &len_b, 0);
+
+ ret = yaz_memcmp(buf_a, buf_b, len_a, len_b);
+
+ odr_destroy(odr_a);
+ odr_destroy(odr_b);
+ return ret;
+}
+
+const char *cql_lookup_reverse(cql_transform_t ct,
+ const char *category,
+ Z_AttributeList *attributes)