-/* ------------------------------------ */
-
-typedef struct {
- int type;
- int major;
- int minor;
- Z_AttributeElement **attributeList;
- int num_attributes;
-} AttrType;
-
-static int attr_find (AttrType *src, oid_value *attributeSetP)
-{
- while (src->major < src->num_attributes)
- {
- Z_AttributeElement *element;
-
- element = src->attributeList[src->major];
- if (src->type == *element->attributeType)
- {
- switch (element->which)
- {
- case Z_AttributeValue_numeric:
- ++(src->major);
- if (element->attributeSet && attributeSetP)
- {
- oident *attrset;
-
- attrset = oid_getentbyoid (element->attributeSet);
- *attributeSetP = attrset->value;
- }
- return *element->value.numeric;
- break;
- case Z_AttributeValue_complex:
- if (src->minor >= element->value.complex->num_list ||
- element->value.complex->list[src->minor]->which !=
- Z_StringOrNumeric_numeric)
- break;
- ++(src->minor);
- if (element->attributeSet && attributeSetP)
- {
- oident *attrset;
-
- attrset = oid_getentbyoid (element->attributeSet);
- *attributeSetP = attrset->value;
- }
- return *element->value.complex->list[src->minor-1]->u.numeric;
- default:
- assert (0);
- }
- }
- ++(src->major);
- }
- return -1;
-}
-
-static void attr_init_APT (AttrType *src, Z_AttributesPlusTerm *zapt, int type)
-{
- src->attributeList = zapt->attributes->attributes;
- src->num_attributes = zapt->attributes->num_attributes;
- src->type = type;
- src->major = 0;
- src->minor = 0;
-}
-
-static void attr_init_AttrList (AttrType *src, Z_AttributeList *list, int type)
-{
- src->attributeList = list->attributes;
- src->num_attributes = list->num_attributes;
- src->type = type;
- src->major = 0;
- src->minor = 0;
-}