X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Ffacet.c;h=40b5e1c29dd4fe5a14f5fe789f3eda406bfdeba9;hp=a9d1ef993da4a9415a1cc16960e4033aaaec5e5f;hb=d2ed898832ae354c17254ff52c70c92278518efe;hpb=b51665819b5685aeeac61d30aee5e66f1af7a4cc diff --git a/src/facet.c b/src/facet.c index a9d1ef9..40b5e1c 100644 --- a/src/facet.c +++ b/src/facet.c @@ -43,17 +43,21 @@ void yaz_oi_set_facetlist( Z_FacetList *yaz_oi_get_facetlist(Z_OtherInformation **otherInformation) { - int categoryValue = 1; - Z_External *z_external = 0; - Z_OtherInformationUnit *oi = - yaz_oi_update(otherInformation, 0, yaz_oid_userinfo_facet_1, - categoryValue, 0); - if (!oi) - return 0; - z_external = oi->information.externallyDefinedInfo; - - if (z_external && z_external->which == Z_External_userFacets) - return z_external->u.facetList; + Z_OtherInformation *oi = *otherInformation; + if (oi) + { + int i; + for (i = 0; i < oi->num_elements; i++) + { + Z_OtherInformationUnit *oiu = oi->list[i]; + if (oiu->which == Z_OtherInfo_externallyDefinedInfo + && oiu->information.externallyDefinedInfo->which == + Z_External_userFacets) + { + return oiu->information.externallyDefinedInfo->u.facetList; + } + } + } return 0; }