Extra arg to recType_byName.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Dec 1995 14:22:25 +0000 (14:22 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Dec 1995 14:22:25 +0000 (14:22 +0000)
Started work on new regular expression parsed input to
structured records.

index/Makefile
index/extract.c
index/zserver.c

index 61cb7f1..94d5b5a 100644 (file)
@@ -1,14 +1,16 @@
 # Copyright (C) 1995, Index Data I/S 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.25 1995-11-27 14:21:53 adam Exp $
+# $Id: Makefile,v 1.26 1995-12-04 14:22:25 adam Exp $
 
 SHELL=/bin/sh
 RANLIB=ranlib
 
-YAZLIB=../../yaz/lib/libyaz.a
-YAZINC=-I../../yaz/include
-OSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
+#YAZLIB=../../yaz/lib/libyaz.a
+YAZLIB=-lyaz
+#YAZINC=-I../../yaz/include
+#OSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
+OSILIB=../../xtimosi/src/libmosi.a -lrfc
 #NETLIB=-lnsl -lsocket
 
 INCLUDE=-I../include $(YAZINC)
@@ -17,18 +19,19 @@ TPROG2=kdump
 TPROG3=zebrasrv
 DEFS=$(INCLUDE)
 O1 = main.o dir.o dirs.o trav.o extract.o kinput.o kcompare.o \
- symtab.o text.o recctrl.o structrec.o recindex.o
+ symtab.o text.o recctrl.o structrec.o recindex.o regxread.o
 O2 = kdump.o
 O3 = zserver.o kcompare.o zrpn.o zsets.o text.o recctrl.o structrec.o  \
-       attribute.o recindex.o zlogs.o
+       attribute.o recindex.o zlogs.o regxread.o
 CPP=$(CC) -E
 
 all: $(TPROG1) $(TPROG2) $(TPROG3)
 
-$(TPROG1): $(O1) ../lib/dict.a \
-               ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a 
-       $(CC) $(CFLAGS) -o $(TPROG1) $(O1) ../lib/dict.a \
-               ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a \
+$(TPROG1): $(O1) ../lib/dict.a ../lib/isam.a \
+               ../lib/bfile.a ../lib/dfa.a ../lib/alexutil.a 
+       $(CC) $(CFLAGS) -o $(TPROG1) $(O1) \
+               ../lib/dict.a ../lib/isam.a \
+               ../lib/bfile.a ../lib/dfa.a ../lib/alexutil.a \
                $(YAZLIB)
 
 $(TPROG2): $(O2)
index 23ba68e..6e0e35f 100644 (file)
@@ -4,7 +4,12 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: extract.c,v $
- * Revision 1.36  1995-11-30 08:34:29  adam
+ * Revision 1.37  1995-12-04 14:22:27  adam
+ * Extra arg to recType_byName.
+ * Started work on new regular expression parsed input to
+ * structured records.
+ *
+ * Revision 1.36  1995/11/30  08:34:29  adam
  * Started work on commit facility.
  * Changed a few malloc/free to xmalloc/xfree.
  *
@@ -674,7 +679,8 @@ static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup,
 static int recordExtract (SYSNO *sysno, const char *fname,
                           struct recordGroup *rGroup, int deleteFlag,
                           int fd,
-                          RecType recType)
+                          RecType recType,
+                          const char *subType)
 {
     struct recExtractCtrl extractCtrl;
     int r;
@@ -855,6 +861,7 @@ int fileExtract (SYSNO *sysno, const char *fname,
     char gprefix[128];
     char ext[128];
     char ext_res[128];
+    char subType[128];
     RecType recType;
     struct recordGroup rGroupM;
     struct recordGroup *rGroup = &rGroupM;
@@ -899,7 +906,7 @@ int fileExtract (SYSNO *sysno, const char *fname,
         logf (LOG_LOG, "? record %s", fname);
         return 0;
     }
-    if (!(recType = recType_byName (rGroup->recordType)))
+    if (!(recType = recType_byName (rGroup->recordType, subType)))
     {
         logf (LOG_WARN, "No such record type: %s", rGroup->recordType);
         return 0;
@@ -967,7 +974,7 @@ int fileExtract (SYSNO *sysno, const char *fname,
         }
     }
     file_read_start (fd);
-    recordExtract (sysno, fname, rGroup, deleteFlag, fd, recType);
+    recordExtract (sysno, fname, rGroup, deleteFlag, fd, recType, subType);
     file_read_stop (fd);
     if (fd != -1)
         close (fd);
index 2bfe9c8..7bd26e0 100644 (file)
@@ -4,7 +4,12 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: zserver.c,v $
- * Revision 1.28  1995-11-28 09:09:48  adam
+ * Revision 1.29  1995-12-04 14:22:32  adam
+ * Extra arg to recType_byName.
+ * Started work on new regular expression parsed input to
+ * structured records.
+ *
+ * Revision 1.28  1995/11/28  09:09:48  adam
  * Zebra config renamed.
  * Use setting 'recordId' to identify record now.
  * Bug fix in recindex.c: rec_release_blocks was invokeded even
@@ -216,12 +221,13 @@ static int record_fetch (ZServerInfo *zi, int sysno, int score, ODR stream,
     char *fname, *file_type;
     RecType rt;
     struct recRetrieveCtrl retrieveCtrl;
+    char subType[128];
 
     rec = rec_get (zi->records, sysno);
     file_type = rec->info[recInfo_fileType];
     fname = rec->info[recInfo_filename];
 
-    if (!(rt = recType_byName (file_type)))
+    if (!(rt = recType_byName (file_type, subType)))
     {
         logf (LOG_FATAL|LOG_ERRNO, "Retrieve: Cannot handle type %s", 
               file_type);
@@ -250,6 +256,7 @@ static int record_fetch (ZServerInfo *zi, int sysno, int score, ODR stream,
         }
         retrieveCtrl.readf = record_ext_read;
     }
+    retrieveCtrl.subType = subType;
     retrieveCtrl.localno = sysno;
     retrieveCtrl.score = score;
     retrieveCtrl.odr = stream;