Fix crash in record conv rule select YAZ-812
[yaz-moved-to-github.git] / src / logrpn.c
index 56dc01a..379dad0 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -187,7 +187,7 @@ static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
     int of, i;
     char str[80];
     int num_attributes = t->attributes->num_attributes;
-    
+
     for (of = 0; of < num_attributes; of++)
     {
         char attset_name_buf[OID_STR_MAX];
@@ -201,7 +201,7 @@ static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
         }
         if (!attset_name)
             attset_name = "";
-        switch (element->which) 
+        switch (element->which)
         {
         case Z_AttributeValue_numeric:
             attrStr(*element->attributeType,
@@ -249,7 +249,7 @@ static char *complex_op_name(Z_Operator *op)
     }
 }
 
-static char *prox_unit_name(Z_ProximityOperator *op)
+char *yaz_prox_unit_name(Z_ProximityOperator *op)
 {
     if (op->which!=Z_ProximityOperator_known)
          return "private";
@@ -270,7 +270,7 @@ static char *prox_unit_name(Z_ProximityOperator *op)
     }
 }
 
-static void zlog_structure(Z_RPNStructure *zs, int depth, 
+static void zlog_structure(Z_RPNStructure *zs, int depth,
                            const Odr_oid *ast, int loglevel)
 {
     if (zs->which == Z_RPNStructure_complex)
@@ -288,11 +288,11 @@ static void zlog_structure(Z_RPNStructure *zs, int depth,
                      " order=%s "
                      "rel=%s unit=%s",
                      depth, "", op->u.prox->exclusion ?
-                     (*op->u.prox->exclusion ? "T" : "F") : "N", 
+                     (*op->u.prox->exclusion ? "T" : "F") : "N",
                      *op->u.prox->distance,
                      *op->u.prox->ordered ? "T" : "F",
                      relToStr(*op->u.prox->relationType),
-                     prox_unit_name(op->u.prox) );
+                     yaz_prox_unit_name(op->u.prox) );
             break;
         default:
             yaz_log(loglevel, "%*.0s unknown complex", depth, "");
@@ -300,7 +300,7 @@ static void zlog_structure(Z_RPNStructure *zs, int depth,
         }
         zlog_structure(zs->u.complex->s1, depth+2, ast, loglevel);
         zlog_structure(zs->u.complex->s2, depth+2, ast, loglevel);
-    } 
+    }
     else if (zs->which == Z_RPNStructure_simple)
     {
         if (zs->u.simple->which == Z_Operand_APT)
@@ -353,13 +353,13 @@ void log_rpn_query(Z_RPNQuery *rpn)
     log_rpn_query_level(YLOG_LOG, rpn);
 }
 
-void log_scan_term_level(int loglevel, 
+void log_scan_term_level(int loglevel,
                          Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
 {
     int depth = 0;
     if (!loglevel)
         return;
-    if (zapt->term->which == Z_Term_general) 
+    if (zapt->term->which == Z_Term_general)
     {
         yaz_log(loglevel, "%*.0s term '%.*s' (general)", depth, "",
                  zapt->term->u.general->len, zapt->term->u.general->buf);
@@ -377,7 +377,7 @@ void log_scan_term(Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
 void yaz_log_zquery_level(int loglevel, Z_Query *q)
 {
     if (!loglevel)
-        return; 
+        return;
     switch (q->which)
     {
     case Z_Query_type_1: case Z_Query_type_101: