X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsrwutil.c;h=81e1010f15bd5482544def67872be40688e36188;hp=83665d413ad21c3b98180ffee42fd406e7fface1;hb=b675ebc81ebe1f2cb7d28b4ce43a51ad5cb39598;hpb=5350317640042c3507172d28d14279595eb7a49f diff --git a/src/srwutil.c b/src/srwutil.c index 83665d4..81e1010 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -39,41 +39,6 @@ char *yaz_encode_sru_dbpath_odr(ODR out, const char *db) return dst; } -Z_AttributeElement *yaz_string_element_create(ODR o, int type, - const char *value) -{ - Z_AttributeElement *element = (Z_AttributeElement*) - odr_malloc(o, sizeof(*element)); - element->attributeType = odr_intdup(o, type); - element->attributeSet = odr_nullval(); - element->which = Z_AttributeValue_complex; - element->value.complex = (Z_ComplexAttribute *) - odr_malloc(o, sizeof(Z_ComplexAttribute)); - element->value.complex->num_list = 1; - element->value.complex->list = (Z_StringOrNumeric **) - odr_malloc(o, 1 * sizeof(Z_StringOrNumeric *)); - element->value.complex->list[0] = (Z_StringOrNumeric *) - odr_malloc(o, sizeof(Z_StringOrNumeric)); - element->value.complex->list[0]->which = Z_StringOrNumeric_string; - element->value.complex->list[0]->u.string = odr_strdup(o, value); - element->value.complex->semanticAction = 0; - element->value.complex->num_semanticAction = 0; - return element; -} - -Z_AttributeList *yaz_use_attribute_create(ODR o, const char *name) -{ - Z_AttributeList *attributes = (Z_AttributeList *) - odr_malloc(o, sizeof(*attributes)); - Z_AttributeElement **elements = (Z_AttributeElement**) - odr_malloc(o, attributes->num_attributes * sizeof(*elements)); - - elements[0] = yaz_string_element_create(o, 1, name); - attributes->num_attributes = 1; - attributes->attributes = elements; - return attributes; -} - #if YAZ_HAVE_XML2 const char *yaz_element_attribute_value_get(xmlNodePtr ptr, const char *node_name,