Using function odr_nullval() instead of global ODR_NULLVAL when
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 24 Nov 1997 11:33:56 +0000 (11:33 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 24 Nov 1997 11:33:56 +0000 (11:33 +0000)
appropriate.

12 files changed:
CHANGELOG
include/odr.h
odr/odr.c
odr/odr_null.c
odr/odr_seq.c
retrieval/d1_espec.c
retrieval/d1_expout.c
retrieval/d1_grs.c
tab/explain.abs
tab/explain.tag
util/pquery.c
util/yaz-ccl.c

index 2cd2920..5e3121c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
 Possible compatibility problems with earlier versions marked with '*'.
 
+Implemented function odr_nullval() that returns the value of
+ODR_NULLVAL.
+
 * Removed member num_children from data1_node (in data1.h).
 
 Made NT service interface part of the server library. The
index f74c276..24a5780 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
- * Revision 1.23  1997-09-01 08:49:49  adam
+ * Revision 1.24  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.23  1997/09/01 08:49:49  adam
  * New windows NT/95 port using MSV5.0. To export DLL functions the
  * YAZ_EXPORT modifier was added. Defined in yconfig.h.
  *
@@ -327,6 +331,7 @@ YAZ_EXPORT void odr_setbuf(ODR o, char *buf, int len, int can_grow);
 YAZ_EXPORT char *odr_getbuf(ODR o, int *len, int *size);
 YAZ_EXPORT void *odr_malloc(ODR o, int size);
 YAZ_EXPORT NMEM odr_extract_mem(ODR o);
+YAZ_EXPORT Odr_null *odr_nullval(void);
 #define odr_release_mem(m) nmem_destroy(m)
 #define ODR_MEM NMEM
 
index efded18..c249c93 100644 (file)
--- a/odr/odr.c
+++ b/odr/odr.c
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr.c,v $
- * Revision 1.25  1997-10-31 12:20:08  adam
+ * Revision 1.26  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.25  1997/10/31 12:20:08  adam
  * Improved memory debugging for xmalloc/nmem.c. References to NMEM
  * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
  * Bug fix: missing fclose in data1_read_espec1.
 
 Odr_null *ODR_NULLVAL = "NULL";  /* the presence of a null value */
 
+Odr_null *odr_nullval (void)
+{
+    return ODR_NULLVAL;
+}
+
 char *odr_errlist[] =
 {
     "No (unknown) error",
index 6525e27..af15eba 100644 (file)
@@ -1,10 +1,14 @@
 /*
- * Copyright (c) 1995, Index Data
+ * Copyright (c) 1995-1997, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_null.c,v $
- * Revision 1.9  1995-10-18 16:12:56  quinn
+ * Revision 1.10  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.9  1995/10/18 16:12:56  quinn
  * Better diagnostics. Added special case in NULL to handle WAIS server.
  *
  * Revision 1.8  1995/09/29  17:12:24  quinn
@@ -69,6 +73,6 @@ int odr_null(ODR o, Odr_null **p, int opt)
 #endif
     }
     if (o->direction == ODR_DECODE)
-       *p = ODR_NULLVAL;
+       *p = odr_nullval();
     return ber_null(o);
 }
index 3ea4d2b..b5edb90 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_seq.c,v $
- * Revision 1.20  1997-09-29 07:17:31  adam
+ * Revision 1.21  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.20  1997/09/29 07:17:31  adam
  * Added typecast to avoid warnings on MSVC.
  *
  * Revision 1.19  1997/06/23 10:31:11  adam
@@ -121,7 +125,7 @@ int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num)
     {
        case ODR_DECODE:
            *num = 0;
-           *pp = ODR_NULLVAL;
+           *pp = odr_nullval();
            while (odr_sequence_more(o))
            {
                /* outgrown array? */
index 0a02536..5fffb64 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_espec.c,v $
- * Revision 1.12  1997-10-31 12:20:09  adam
+ * Revision 1.13  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.12  1997/10/31 12:20:09  adam
  * Improved memory debugging for xmalloc/nmem.c. References to NMEM
  * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
  * Bug fix: missing fclose in data1_read_espec1.
@@ -100,7 +104,7 @@ static Z_Variant *read_variant(int argc, char **argv, NMEM nmem)
        if (*value == '@')
        {
            t->which = Z_Triple_null;
-           t->value.null = ODR_NULLVAL;
+           t->value.null = odr_nullval();
        }
        else if (isdigit(*value))
        {
@@ -134,12 +138,12 @@ static Z_Occurrences *read_occurrences(char *occ, NMEM nmem)
     else if (!strcmp(occ, "all"))
     {
        op->which = Z_Occurrences_all;
-       op->u.all = ODR_NULLVAL;
+       op->u.all = odr_nullval();
     }
     else if (!strcmp(occ, "last"))
     {
        op->which = Z_Occurrences_last;
-       op->u.all = ODR_NULLVAL;
+       op->u.all = odr_nullval();
     }
     else
     {
@@ -176,7 +180,7 @@ static Z_ETagUnit *read_tagunit(char *buf, NMEM nmem)
     if (*buf == '*')
     {
        u->which = Z_ETagUnit_wildPath;
-       u->u.wildPath = ODR_NULLVAL;
+       u->u.wildPath = odr_nullval();
     }
     else if (*buf == '?')
     {
index 2c31e9e..1e6d587 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_expout.c,v $
- * Revision 1.5  1997-11-19 10:30:06  adam
+ * Revision 1.6  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.5  1997/11/19 10:30:06  adam
  * More explain work.
  *
  * Revision 1.4  1997/11/18 09:51:08  adam
@@ -108,6 +112,7 @@ static bool_t *f_bool(ExpHandle *eh, data1_node *c)
 
 static Z_IntUnit *f_intunit(ExpHandle *eh, data1_node *c)
 {
+    /* fix */
     return 0;
 }
 
@@ -160,6 +165,46 @@ static Z_CommonInfo *f_commonInfo(ExpHandle *eh, data1_node *n)
     return res;
 }
 
+Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n)
+{
+    /* fix */
+    return NULL;
+}
+
+Odr_oid **f_oid_seq (ExpHandle *eh, data1_node *n, int *num)
+{
+    /* fix */
+    return NULL;
+}
+
+char **f_string_seq (ExpHandle *eh, data1_node *n, int *num)
+{
+    char **res;
+    data1_node *c;
+    int i;
+
+    *num = 0;
+    for (c = n->child ; c; c = c->next)
+    {
+       if (!is_numeric_tag (eh, c))
+           break;
+       if (n->u.tag.element->tag->value.numeric != 1001)
+           break;
+       ++(*num);
+    }
+    if (*num)
+       res = odr_malloc (eh->o, sizeof(*res) * (*num));
+    for (c = n->child, i = 0 ; i < *num; c = c->next, i++)
+       res[i] = f_string (eh, c);
+    return res;
+}
+
+char **f_humstring_seq (ExpHandle *eh, data1_node *n, int *num)
+{
+    /* fix */
+    return NULL;
+}
+
 static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n)
 {
     Z_AccessInfo *res = odr_malloc(eh->o, sizeof(*res));
@@ -188,14 +233,60 @@ static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n)
 
     for (c = n->child; c; c = c->next)
     {
-       if (c->which != DATA1N_tag || !c->u.tag.element)
+       int i;
+       if (!is_numeric_tag (eh, c))
+           continue;
+       switch (c->u.tag.element->tag->value.numeric)
        {
-           logf(LOG_WARN, "Malformed explain record");
+       case 501:
+           res->num_queryTypesSupported = 0;
+           for (n = c->child; n; n = n->next)
+           {
+               if (!is_numeric_tag(eh, n))
+                   break;
+               (res->num_queryTypesSupported)++;
+           }
+           if (res->num_queryTypesSupported)
+               res->queryTypesSupported =
+                   odr_malloc (eh->o, res->num_queryTypesSupported
+                               * sizeof(*res->queryTypesSupported));
+           i = 0;
+           for (n = c->child; i < res->num_queryTypesSupported; n = n->next)
+               res->queryTypesSupported[i++] = f_queryTypeDetails (eh, n);
+           break;
+       case 503:
+           res->diagnosticsSets = f_oid_seq(eh, c, &res->num_diagnosticsSets);
+           break;
+       case 505:
+           res->attributeSetIds = f_oid_seq(eh, c, &res->num_attributeSetIds);
+           break;
+       case 507:
+           res->schemas = f_oid_seq(eh, c, &res->num_schemas);
+           break;
+       case 509:
+           res->recordSyntaxes = f_oid_seq (eh, c, &res->num_recordSyntaxes);
+           break;
+       case 511:
+           res->resourceChallenges = f_oid_seq (eh, c,
+                                                &res->num_resourceChallenges);
+           break;
+       case 513: res->restrictedAccess = NULL; break; /* fix */
+       case 514: res->costInfo = NULL; break; /* fix */
+       case 515:
+           res->variantSets = f_oid_seq (eh, c, 
+                                         &res->num_variantSets);
+           break;
+       case 516:
+           res->elementSetNames =
+               f_string_seq (eh, c, &res->num_elementSetNames);
+           break;
+       case 517:
+           res->unitSystems = f_string_seq (eh, c, &res->num_unitSystems);
+           break;
+       default:
+           logf(LOG_WARN, "Bad child in accessInfo");
            return 0;
        }
-       if (eh->select && !c->u.tag.node_selected)
-           continue;
-       /* switch-statement here */
     }
     return res;
 }
@@ -224,14 +315,40 @@ static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
 
 static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n)
 {
+    /* fix */
     return 0;
 }
 
+static Z_DatabaseList *f_databaseList(ExpHandle *eh, data1_node *n)
+{
+    data1_node *c;
+    Z_DatabaseList *res = odr_malloc (eh->o, sizeof(*res));
+    int i;
+
+    res->num_databases = 0;
+    res->databases = NULL;
+    for (c = n->child ; c; c = c->next)
+    {
+       if (!is_numeric_tag (eh, c))
+           break;
+       if (n->u.tag.element->tag->value.numeric != 102)
+           break;
+       ++(res->num_databases);
+    }
+    if (res->num_databases)
+       res->databases =
+           odr_malloc (eh->o, sizeof(*res->databases)*res->num_databases);
+    for (c = n->child, i = 0 ; i < res->num_databases; c = c->next, i++)
+       res->databases[i] = f_string (eh, c);
+    return res;
+}
+
 static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n)
 {
     Z_TargetInfo *res = odr_malloc(eh->o, sizeof(*res));
     data1_node *c;
     bool_t *fl = odr_malloc(eh->o,sizeof(*fl));
+    int i;
 
     *fl = 0;
     res->commonInfo = 0;
@@ -257,35 +374,69 @@ static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n)
     res->num_addresses = 0;
     res->addresses = 0;
     res->commonAccessInfo = 0;
-
+    
     for (c = n->child; c; c = c->next)
     {
        if (!is_numeric_tag (eh, c))
            continue;
        switch (c->u.tag.element->tag->value.numeric)
        {
-           case 600: res->commonInfo = f_commonInfo(eh, c); break;
-           case 102: res->name = f_string(eh, c); break;
-           case 103: res->recentNews = f_humstring(eh, c); break;
-           case 104: break; /* icon */
-           case 105: res->namedResultSets = f_bool(eh, c); break;
-           case 106: res->multipleDbSearch = f_bool(eh, c); break;
-           case 107: res->maxResultSets = f_integer(eh, c); break;
-           case 108: res->maxResultSize = f_integer(eh, c); break;
-           case 109: res->maxTerms = f_integer(eh, c); break;
-           case 110: res->timeoutInterval = f_intunit(eh, c); break;
-           case 111: res->welcomeMessage = f_humstring(eh, c); break;
-           case 112: res->contactInfo = f_contactInfo(eh, c); break;
-           case 113: res->description = f_humstring(eh, c); break;
-           case 114: break; /* nicknames */
-           case 115: res->usageRest = f_humstring(eh, c); break;
-           case 116: res->paymentAddr = f_humstring(eh, c); break;
-           case 117: res->hours = f_humstring(eh, c); break;
-           case 118: break; /* dbcombinations */
-           case 119: break; /* addresses */
-           case 500: res->commonAccessInfo = f_accessInfo(eh, c); break;
-           default:
-               logf(LOG_WARN, "Unknown target-info element");
+       case 600: res->commonInfo = f_commonInfo(eh, c); break;
+       case 102: res->name = f_string(eh, c); break;
+       case 103: res->recentNews = f_humstring(eh, c); break;
+       case 104: res->icon = NULL; break; /* fix */
+       case 105: res->namedResultSets = f_bool(eh, c); break;
+       case 106: res->multipleDbSearch = f_bool(eh, c); break;
+       case 107: res->maxResultSets = f_integer(eh, c); break;
+       case 108: res->maxResultSize = f_integer(eh, c); break;
+       case 109: res->maxTerms = f_integer(eh, c); break;
+       case 110: res->timeoutInterval = f_intunit(eh, c); break;
+       case 111: res->welcomeMessage = f_humstring(eh, c); break;
+       case 112: res->contactInfo = f_contactInfo(eh, c); break;
+       case 113: res->description = f_humstring(eh, c); break;
+       case 114: 
+           res->num_nicknames = 0;
+           for (n = c->child; n; n = n->next)
+           {
+               if (!is_numeric_tag(eh, n))
+                   break;
+               if (n->u.tag.element->tag->value.numeric != 102)
+                   break;
+               (res->num_nicknames)++;
+           }
+           if (res->num_nicknames)
+               res->nicknames =
+                   odr_malloc (eh->o, res->num_nicknames 
+                               * sizeof(*res->nicknames));
+           i = 0;
+           for (n = c->child; i < res->num_nicknames; n = n->next)
+               res->nicknames[i++] = f_string (eh, n);
+           break;
+       case 115: res->usageRest = f_humstring(eh, c); break;
+       case 116: res->paymentAddr = f_humstring(eh, c); break;
+       case 117: res->hours = f_humstring(eh, c); break;
+       case 118:
+           res->num_dbCombinations = 0;
+           for (n = c->child; n; n = n->next)
+           {
+               if (!is_numeric_tag(eh, n))
+                   break;
+               if (n->u.tag.element->tag->value.numeric != 605)
+                   break;
+               (res->num_dbCombinations)++;
+           }
+           if (res->num_dbCombinations)
+               res->dbCombinations =
+                   odr_malloc (eh->o, res->num_dbCombinations
+                               * sizeof(*res->dbCombinations));
+           i = 0;
+           for (n = c->child; i < res->num_dbCombinations; n = n->next)
+               res->dbCombinations[i++] = f_databaseList (eh, n);
+           break;
+       case 119: break; /* addresses */
+       case 500: res->commonAccessInfo = f_accessInfo(eh, c); break;
+       default:
+           logf(LOG_WARN, "Unknown target-info element");
        }
     }
     if (!res->namedResultSets)
@@ -301,6 +452,7 @@ static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n)
     data1_node *c;
     bool_t *fl = odr_malloc(eh->o,sizeof(*fl));
     bool_t *tr = odr_malloc(eh->o,sizeof(*tr));
+    int i;
 
     *fl = 0;
     *tr = 1;
@@ -339,22 +491,62 @@ static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n)
     
     for (c = n->child; c; c = c->next)
     {
+       Z_DatabaseList *zdb;
+
        if (!is_numeric_tag (eh, c))
            continue;
        switch (c->u.tag.element->tag->value.numeric)
        {
        case 600: res->commonInfo = f_commonInfo(eh, c); break;
        case 102: res->name = f_string(eh, c); break;
-       case 226: res->explainDatabase = ODR_NULLVAL; break;
-       case 114: res->num_nicknames = 0; res->nicknames = 0; break; /* fix */
+       case 226: res->explainDatabase = odr_nullval(); break;
+       case 114:
+           res->num_nicknames = 0;
+           for (n = c->child; n; n = n->next)
+           {
+               if (!is_numeric_tag(eh, n))
+                   break;
+               if (n->u.tag.element->tag->value.numeric != 102)
+                   break;
+               (res->num_nicknames)++;
+           }
+           if (res->num_nicknames)
+               res->nicknames =
+                   odr_malloc (eh->o, res->num_nicknames 
+                               * sizeof(*res->nicknames));
+           i = 0;
+           for (n = c->child; i < res->num_nicknames; n = n->next)
+               res->nicknames[i++] = f_string (eh, n);
+           break;
        case 104: res->icon = 0; break;      /* fix */
        case 201: res->userFee = f_bool(eh, c); break;
        case 202: res->available = f_bool(eh, c); break;
        case 203: res->titleString = f_humstring(eh, c); break;
-       case 227: res->num_keywords = 0; res->keywords = 0; break; /* fix */
+       case 227:
+           res->num_keywords = 0;
+           for (n = c->child; n; n = n->next)
+           {
+               if (!is_numeric_tag(eh, n))
+                   break;
+               if (n->u.tag.element->tag->value.numeric != 1000)
+                   break;
+               (res->num_keywords)++;
+           }
+           if (res->num_keywords)
+               res->keywords =
+                   odr_malloc (eh->o, res->num_keywords 
+                               * sizeof(*res->keywords));
+           i = 0;
+           for (n = c->child; i < res->num_keywords; n = n->next)
+               res->keywords[i++] = f_humstring (eh, n);
+           break;
        case 113: res->description = f_humstring(eh, c); break;
-       case 205: res->associatedDbs = 0; break; /* fix */
-       case 206: res->subDbs = 0; break; /* fix */
+       case 205:
+           res->associatedDbs = f_databaseList (eh, c);
+           break;
+       case 206:
+           res->subDbs = f_databaseList (eh, c);
+           break;
        case 207: res->disclaimers = f_humstring(eh, c); break;
        case 103: res->news = f_humstring(eh, c); break;
        case 209: res->recordCount =
index 30397c9..d488949 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_grs.c,v $
- * Revision 1.11  1997-11-18 09:51:09  adam
+ * Revision 1.12  1997-11-24 11:33:56  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.11  1997/11/18 09:51:09  adam
  * Removed element num_children from data1_node. Minor changes in
  * data1 to Explain.
  *
@@ -159,7 +163,7 @@ static Z_ElementData *nodetoelementdata(data1_handle dh, data1_node *n,
     if (!n)
     {
        res->which = Z_ElementData_elementNotThere;
-       res->u.elementNotThere = ODR_NULLVAL;
+       res->u.elementNotThere = odr_nullval();
     }
     else if (n->which == DATA1N_data && (leaf || n->next == NULL))
     {
@@ -292,7 +296,7 @@ static Z_TaggedElement *nodetotaggedelement(data1_handle dh, data1_node *n,
     {
        res->content = odr_malloc(o, sizeof(*res->content));
        res->content->which = Z_ElementData_noDataRequested;
-       res->content->u.noDataRequested = ODR_NULLVAL;
+       res->content->u.noDataRequested = odr_nullval();
     }
     else if (!(res->content = nodetoelementdata (dh, data, select, leaf,
                                                 o, len)))
index cf604df..3036445 100644 (file)
@@ -37,6 +37,8 @@ elm (4,0)/(4,115)             usageRestrictions                       -
 elm (4,0)/(4,116)              paymentAddr                             -
 elm (4,0)/(4,117)              hours                                   -
 elm (4,0)/(4,118)              dbCombinations                          -
+elm (4,0)/(4,118)/(4,605)      databaseList                            -
+elm (4,0)/(4,118)/(4,605)/(4,102)      databaseName                    -
 elm (4,0)/(4,119)              addresses                               -
 
 elm (4,0)/(4,500)              commonAccessInfo                        -
@@ -81,7 +83,11 @@ elm (4,1)/(4,227)            keywords                                -
 elm (4,1)/(4,227)/(4,1000)     keyword                                 -
 elm (4,1)/(4,113)              description                             -
 elm (4,1)/(4,205)              associatedDbs                           -
+elm (4,1)/(4,205)/(4,605)      databaseList                            -
+elm (4,1)/(4,205)/(4,605)/(4,102)      databaseName                    -
 elm (4,1)/(4,206)              subDbs                                  -
+elm (4,1)/(4,206)/(4,605)      databaseList                            -
+elm (4,1)/(4,206)/(4,605)/(4,102)      databaseName                    -
 elm (4,1)/(4,207)              disclaimers                             -
 elm (4,1)/(4,103)              recentNews                              -
 elm (4,1)/(4,209)              recordCount                             -
index a9f98b9..6c781a0 100644 (file)
@@ -91,6 +91,7 @@ tag 601               dateAdded                                       generalizedtime
 tag 602                dateChanged                                     generalizedtime
 tag 603                expiry                                          generalizedtime
 tag 604                languageCode                                    string
+tag 605        databaseList                                    structured
 
 #
 # General tags for list members, etc.
index 7977ed6..7b33757 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: pquery.c,v $
- * Revision 1.16  1997-09-29 13:19:00  adam
+ * Revision 1.17  1997-11-24 11:33:57  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.16  1997/09/29 13:19:00  adam
  * Added function, oid_ent_to_oid, to replace the function
  * oid_getoidbyent, which is not thread safe.
  *
@@ -216,7 +220,7 @@ static Z_AttributesPlusTerm *rpn_term (struct lex_info *li, ODR o,
         }
     }
     else
-        zapt->attributeList = ODR_NULLVAL;
+        zapt->attributeList = odr_nullval();
     zapt->term = term;
     term->which = Z_Term_general;
     term->u.general = term_octet;
@@ -323,15 +327,15 @@ static Z_Complex *rpn_complex (struct lex_info *li, ODR o, oid_proto proto,
     {
     case 'a':
         zo->which = Z_Operator_and;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     case 'o':
         zo->which = Z_Operator_or;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     case 'n':
         zo->which = Z_Operator_and_not;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     case 'p':
         zo->which = Z_Operator_prox;
index 5bf8006..6c85642 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: yaz-ccl.c,v $
- * Revision 1.10  1997-09-29 08:58:25  adam
+ * Revision 1.11  1997-11-24 11:33:57  adam
+ * Using function odr_nullval() instead of global ODR_NULLVAL when
+ * appropriate.
+ *
+ * Revision 1.10  1997/09/29 08:58:25  adam
  * Fixed conversion of trees so that true copy is made.
  *
  * Revision 1.9  1997/06/23 10:31:25  adam
@@ -65,7 +69,7 @@ static Z_AttributesPlusTerm *ccl_rpn_term (ODR o, struct ccl_rpn_node *p)
         }
     }
     else
-        zapt->attributeList = ODR_NULLVAL;
+        zapt->attributeList = odr_nullval();
     
     zapt->term = term;
     term->which = Z_Term_general;
@@ -114,15 +118,15 @@ static Z_Complex *ccl_rpn_complex (ODR o, struct ccl_rpn_node *p)
     {
     case CCL_RPN_AND:
         zo->which = Z_Operator_and;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     case CCL_RPN_OR:
         zo->which = Z_Operator_or;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     case CCL_RPN_NOT:
         zo->which = Z_Operator_and_not;
-        zo->u.and = ODR_NULLVAL;
+        zo->u.and = odr_nullval();
         break;
     default:
         assert (0);