Separate malloc debug library. Removal of ASN_COMPILED-#ifdefs.
[yaz-moved-to-github.git] / zutil / sortspec.c
index caf5603..3ffee80 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2001, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: sortspec.c,v 1.2 2001-08-10 12:50:40 adam Exp $
+ * $Id: sortspec.c,v 1.4 2001-11-13 23:00:43 adam Exp $
  */
 
 #include <stdio.h>
@@ -15,8 +15,6 @@
 
 Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg)
 {
-    int oid[OID_SIZE];
-    oident bib1;
     char sort_string_buf[32], sort_flags[32];
     Z_SortKeySpecList *sksl = (Z_SortKeySpecList *)
         odr_malloc (out, sizeof(*sksl));
@@ -25,9 +23,6 @@ Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg)
     sksl->num_specs = 0;
     sksl->specs = (Z_SortKeySpec **)odr_malloc (out, sizeof(sksl->specs) * 20);
     
-    bib1.proto = PROTO_Z3950;
-    bib1.oclass = CLASS_ATTSET;
-    bib1.value = VAL_BIB1;
     while ((sscanf (arg, "%31s %31s%n", sort_string_buf,
                    sort_flags, &off)) == 2  && off > 1)
     {
@@ -50,7 +45,8 @@ Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg)
             sk->which = Z_SortKey_sortAttributes;
             sk->u.sortAttributes = (Z_SortAttributes *)
                odr_malloc (out, sizeof(*sk->u.sortAttributes));
-            sk->u.sortAttributes->id = oid_ent_to_oid(&bib1, oid);
+            sk->u.sortAttributes->id = 
+               yaz_oidval_to_z3950oid(out, CLASS_ATTSET, VAL_BIB1);
             sk->u.sortAttributes->list = (Z_AttributeList *)
                odr_malloc (out, sizeof(*sk->u.sortAttributes->list));
             sk->u.sortAttributes->list->attributes = (Z_AttributeElement **)
@@ -84,12 +80,8 @@ Z_SortKeySpecList *yaz_sort_spec (ODR out, const char *arg)
         sks->sortRelation = odr_intdup (out, Z_SortRelation_ascending);
         sks->caseSensitivity = odr_intdup (out, Z_SortCase_caseSensitive);
 
-#ifdef ASN_COMPILED
         sks->which = Z_SortKeySpec_null;
         sks->u.null = odr_nullval ();
-#else
-        sks->missingValueAction = NULL;
-#endif
        
         for (i = 0; sort_flags[i]; i++)
         {