- {
- wrbuf_putc(b, '"');
- for (i = 0; i<len; i++)
- {
- if (term[i] == '"')
- wrbuf_putc(b, '\\');
- wrbuf_putc(b, term[i]);
- }
- wrbuf_printf(b, "\" ");
- }
-}
-
-static void wrbuf_attr(WRBUF b, Z_AttributeElement *element)
-{
- int i;
- char *setname="";
- char *sep = ""; /* optional space after attrset name */
- if (element->attributeSet)
- {
- oident *attrset;
- attrset = oid_getentbyoid (element->attributeSet);
- setname = attrset->desc;
- sep = " ";
- }
- switch (element->which)
- {
- case Z_AttributeValue_numeric:
- wrbuf_printf(b,"@attr %s%s%d=%d ", setname, sep,
- *element->attributeType, *element->value.numeric);
- break;
- case Z_AttributeValue_complex:
- wrbuf_printf(b,"@attr %s%s\"%d=", setname, sep,
- *element->attributeType);
- for (i = 0; i<element->value.complex->num_list; i++)
- {
- if (i)
- wrbuf_printf(b,",");
- if (element->value.complex->list[i]->which ==
- Z_StringOrNumeric_string)
- wrbuf_printf (b, "%s",
- element->value.complex->list[i]->u.string);
- else if (element->value.complex->list[i]->which ==
- Z_StringOrNumeric_numeric)
- wrbuf_printf (b, "%d",
- *element->value.complex->list[i]->u.numeric);
- }
- wrbuf_printf(b, "\" ");
- break;
- default:
- wrbuf_printf (b, "@attr 1=unknown ");
- }