Fidgeting.
authorSebastian Hammer <quinn@indexdata.com>
Mon, 12 Feb 1996 18:18:07 +0000 (18:18 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Mon, 12 Feb 1996 18:18:07 +0000 (18:18 +0000)
client/Makefile
client/client.c
tab/usmarc.abs
tab/usmarc.tag [new file with mode: 0644]

index 412406d..3630c9a 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright (C) 1994, Index Data I/S 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.6 1995-06-27 13:20:06 quinn Exp $
+# $Id: Makefile,v 1.7 1996-02-12 18:18:07 quinn Exp $
 
 LIBDIR=../lib
 
@@ -11,7 +11,7 @@ SHELL=/bin/sh
 INCLUDE=-I../include -I. -I../../xtimosi/src
 LIBINCLUDE=-L$(LIBDIR)
 #CFLAGS=-Wall -pedantic -g
-DEFS=$(INCLUDE) -DRPN_QUERY -DPREFIX_QUERY
+DEFS=$(INCLUDE) -DRPN_QUERY #-DPREFIX_QUERY
 LIBS=$(LIBDIR)/libasn.a $(LIBDIR)/libodr.a \
   $(LIBDIR)/libcomstack.a ../lib/ccl.a $(LIBMOSI) $(LIBDIR)/libutil.a $(ELIBS)
 CPP=$(CC) -E
index f153700..90438a6 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: client.c,v $
- * Revision 1.29  1996-01-02 08:57:25  quinn
+ * Revision 1.30  1996-02-12 18:18:09  quinn
+ * Fidgeting.
+ *
+ * Revision 1.29  1996/01/02  08:57:25  quinn
  * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
  *
  * Revision 1.28  1995/12/14  11:09:31  quinn
@@ -149,6 +152,8 @@ static Z_InitResponse *session = 0;        /* session parameters */
 static char last_scan[512] = "0";
 static char last_cmd[100] = "?";
 static oid_value attributeset = VAL_BIB1;
+static FILE *marcdump = 0;
+static char marcdump_file[512] = "marc.out";
 
 #ifdef RPN_QUERY
 #ifndef PREFIX_QUERY
@@ -403,7 +408,29 @@ static void display_record(Z_DatabaseRecord *p)
         }
     }
     if (r->which == Z_External_octet && p->u.octet_aligned->len)
+    {
+#if 0
+       if (marcdump)
+           fwrite(p->u.octet_aligned->buf, p->u.octet_aligned->len, 1,
+               marcdump);
+#endif
+        static count = 0;
+        FILE *f;
+        char buf[256];
+
+        sprintf(buf, "marc.%d", count++);
+        if (!(f = fopen(buf, "w")))
+        {
+            perror(buf);
+            exit(1);
+
+        }
+        fwrite(p->u.octet_aligned->buf, p->u.octet_aligned->len, 1, f);
+        fclose(f);
+
+
         marc_display ((char*)p->u.octet_aligned->buf, stdout);
+    }
     else if (ent->value == VAL_SUTRS)
     {
         if (r->which != Z_External_sutrs)
@@ -1147,5 +1174,10 @@ int main(int argc, char **argv)
         cmd_open(argv[1]);
     else
         printf(C_PROMPT);
+    if (*marcdump_file && !(marcdump = fopen(marcdump_file, "a")))
+    {
+       perror(marcdump_file);
+       exit(1);
+    }
     return client();
 }
index bdff1b3..e760256 100644 (file)
@@ -1,5 +1,7 @@
 name usmarc
 reference USmarc
+attset bib1.att
+tagset usmarc.tag
 
 marc usmarc.mar
 
diff --git a/tab/usmarc.tag b/tab/usmarc.tag
new file mode 100644 (file)
index 0000000..0d4f20c
--- /dev/null
@@ -0,0 +1,10 @@
+# Pseudo-tagset for USMARC
+
+name usmarc
+type 4
+include tagsetm.tag
+
+#tag 1         a               string
+#tag 2         b               string
+tag 245                245             string
+tag 100                100             string