+ else
+ {
+ /* we have a use attribute and attribute set */
+ int r;
+
+ r = att_getentbyatt(zh, curAttributeSet, use_value, &use_string);
+ if (r == -2)
+ {
+ zebra_setError_zint(zh, YAZ_BIB1_UNSUPP_ATTRIBUTE_SET, 0);
+ return ZEBRA_FAIL;
+ }
+ if (r == -1)
+ {
+ zebra_setError_zint(zh, YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, use_value);
+ return ZEBRA_FAIL;
+ }
+ }
+ if (!use_string)
+ {
+ zebra_setError(zh, YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, 0);
+ return ZEBRA_FAIL;
+ }
+ *ord = zebraExplain_lookup_attr_str(zh->reg->zei, cat,
+ index_type, use_string);
+ if (*ord == -1)
+ {
+ /* attribute 14=1 does not issue a diagnostic even
+ 1) the attribute is numeric but listed in .att
+ 2) the use attribute is string
+ */
+ AttrType unsup;
+ int unsup_value = 0;
+ attr_init_AttrList(&unsup, attr_list, 14);
+ unsup_value = attr_find(&unsup, 0);
+
+ if (unsup_value != 1)
+ {
+ if (use_value < 0)
+ zebra_setError(zh, YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, use_string);
+ else
+ zebra_setError_zint(zh, YAZ_BIB1_UNSUPP_USE_ATTRIBUTE, use_value);
+ return ZEBRA_FAIL;
+ }
+ }
+ return ZEBRA_OK;