Field name is not in isam keys but in prefix in dictionary words.
# Copyright (C) 1995, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.10 1995-09-14 11:53:27 adam Exp $
+# $Id: Makefile,v 1.11 1995-09-27 12:22:27 adam Exp $
SHELL=/bin/sh
RANLIB=ranlib
TPROG2=kdump
TPROG3=zserver
DEFS=$(INCLUDE)
-O1 = main.o dir.o trav.o extract.o kinput.o kcompare.o ksort.o symtab.o text.o
+O1 = main.o dir.o trav.o extract.o kinput.o kcompare.o ksort.o\
+ symtab.o text.o recctrl.o
O2 = kdump.o
-O3 = zserver.o kcompare.o zrpn.o zsets.o text.o
+O3 = zserver.o kcompare.o zrpn.o zsets.o text.o recctrl.o
CPP=cc -E
all: $(TPROG1) $(TPROG2) $(TPROG3)
$(TPROG1): $(O1) ../lib/dict.a \
- ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a $(YAZLIB)
+ ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a ../lib/data1.a \
+ $(YAZLIB)
$(CC) $(CFLAGS) -o $(TPROG1) $(O1) ../lib/dict.a \
- ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a $(YAZLIB) $(OSILIB)
+ ../lib/isam.a ../lib/bfile.a ../lib/alexutil.a ../lib/data1.a \
+ $(YAZLIB) $(OSILIB)
$(TPROG2): $(O2) $(YAZLIB)
$(CC) $(CFLAGS) -o $(TPROG2) $(O2) $(YAZLIB)
$(TPROG3): $(O3) \
../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/bfile.a \
- ../lib/dfa.a ../lib/alexutil.a $(YAZLIB)
+ ../lib/dfa.a ../lib/alexutil.a ../lib/data1.a \
+ $(YAZLIB)
$(CC) $(CFLAGS) -o $(TPROG3) $(O3) \
../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/bfile.a \
- ../lib/dfa.a ../lib/alexutil.a $(YAZLIB) $(OSILIB) -lm
+ ../lib/dfa.a ../lib/alexutil.a ../lib/data1.a \
+ $(YAZLIB) $(OSILIB) -lm
.c.o:
$(CC) -c $(DEFS) $(CFLAGS) $<
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.8 1995-09-14 07:48:22 adam
+ * Revision 1.9 1995-09-27 12:22:28 adam
+ * More work on extract in record control.
+ * Field name is not in isam keys but in prefix in dictionary words.
+ *
+ * Revision 1.8 1995/09/14 07:48:22 adam
* Record control management.
*
* Revision 1.7 1995/09/11 13:09:32 adam
#include <ctype.h>
#include <alexutil.h>
-#include <rectext.h>
+#include <recctrl.h>
#include "index.h"
static Dict file_idx;
struct it_key key;
char x;
size_t i;
+ char wordPrefix[8];
if (key_offset + 1000 > key_buf_size)
{
xfree (key_buf);
key_buf = new_key_buf;
}
+ sprintf (wordPrefix, "%c%04d", p->attrSet + '0', p->attrUse);
+ strcpy (key_buf + key_offset, wordPrefix);
+ key_offset += strlen (wordPrefix);
switch (p->which)
{
case Word_String:
key_offset++;
key.sysno = key_sysno;
- key.attrSet = p->attrSet;
- key.attrUse = p->attrUse;
key.seqno = p->seqno;
memcpy (key_buf + key_offset, &key, sizeof(key));
key_offset += sizeof(key);
logf (LOG_WARN|LOG_ERRNO, "open %s", fname);
return;
}
- if (!strcmp (file_type, "text"))
- rt = recTypeText;
- else
+ if (!(rt = recType_byName (file_type)))
return;
extractCtrl.inf = inf;
extractCtrl.subType = "";
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
- * Revision 1.10 1995-09-14 07:48:23 adam
+ * Revision 1.11 1995-09-27 12:22:28 adam
+ * More work on extract in record control.
+ * Field name is not in isam keys but in prefix in dictionary words.
+ *
+ * Revision 1.10 1995/09/14 07:48:23 adam
* Record control management.
*
* Revision 1.9 1995/09/11 13:09:33 adam
#define IT_KEY_HAVE_FIELD 0
struct it_key {
- int sysno;
- int seqno;
- unsigned attrSet : 3;
- unsigned attrUse : 13;
+ int sysno;
+ short seqno;
};
struct dir_entry {
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kcompare.c,v $
- * Revision 1.6 1995-09-14 07:48:23 adam
+ * Revision 1.7 1995-09-27 12:22:28 adam
+ * More work on extract in record control.
+ * Field name is not in isam keys but in prefix in dictionary words.
+ *
+ * Revision 1.6 1995/09/14 07:48:23 adam
* Record control management.
*
* Revision 1.5 1995/09/11 13:09:34 adam
struct it_key key;
memcpy (&key, p, sizeof(key));
- logf (logmask, "%7d s=%-4d f=%d,%d", key.sysno, key.seqno,
- key.attrSet, key.attrUse);
+ logf (logmask, "%7d s=%-4d", key.sysno, key.seqno);
}
int key_compare (const void *p1, const void *p2)
return -1;
}
#endif
- if (i1.attrSet != i2.attrSet)
- {
- if (i1.attrSet > i2.attrSet)
- return 1;
- else
- return -1;
- }
- if (i1.attrUse != i2.attrUse)
- {
- if (i1.attrUse > i2.attrUse)
- return 1;
- else
- return -1;
- }
return 0;
}