Updated WIN32 code specific sections. Changed header.
[idzebra-moved-to-github.git] / recctrl / recgrs.c
index 4ebbe6f..d2beb77 100644 (file)
@@ -1,10 +1,22 @@
 /*
- * Copyright (C) 1994-1998, Index Data I/S 
+ * Copyright (C) 1994-1999, Index Data
  * All rights reserved.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: recgrs.c,v $
- * Revision 1.20  1998-05-20 10:12:26  adam
+ * Revision 1.24  1999-02-02 14:51:28  adam
+ * Updated WIN32 code specific sections. Changed header.
+ *
+ * Revision 1.23  1998/10/18 07:51:10  adam
+ * Changed one logf call.
+ *
+ * Revision 1.22  1998/10/16 08:14:37  adam
+ * Updated record control system.
+ *
+ * Revision 1.21  1998/07/01 09:16:10  adam
+ * Element localno only added when it's greater than 0.
+ *
+ * Revision 1.20  1998/05/20 10:12:26  adam
  * Implemented automatic EXPLAIN database maintenance.
  * Modified Zebra to work with ASN.1 compiled version of YAZ.
  *
 #include <stdio.h>
 #include <assert.h>
 #include <sys/types.h>
-#ifndef WINDOWS
+#ifndef WIN32
 #include <unistd.h>
 #endif
 
@@ -198,7 +210,11 @@ static data1_node *read_grs_type (struct grs_read_info *p, const char *type)
     return NULL;
 }
 
-static void grs_init(void)
+static void grs_init(RecType recType)
+{
+}
+
+static void grs_destroy(RecType recType)
 {
 }
 
@@ -429,7 +445,7 @@ static int process_comp(data1_handle dh, data1_node *n, Z_RecordComposition *c)
     }
     if (espec)
     {
-        logf (LOG_LOG, "Element: Espec-1 match");
+        logf (LOG_DEBUG, "Element: Espec-1 match");
        return data1_doespec1(dh, n, espec);
     }
     else
@@ -489,7 +505,7 @@ static int grs_retrieve(struct recRetrieveCtrl *p)
     }
 
     logf (LOG_DEBUG, "grs_retrieve: localControlNumber");
-    if ((dnew = data1_insert_taggeddata(p->dh, node, node,
+    if (p->localno > 0 && (dnew = data1_insert_taggeddata(p->dh, node, node,
                                       "localControlNumber", mem)))
     {
        dnew->u.data.what = DATA1I_text;
@@ -645,6 +661,7 @@ static struct recType grs_type =
 {
     "grs",
     grs_init,
+    grs_destroy,
     grs_extract,
     grs_retrieve
 };