X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=index%2Fextract.c;h=dac98203ea3585586398548eef70d88e7966f579;hb=aebdede4bcc1dfe05728dac36b51a1cda85cc70e;hp=4808868b1f07a5fbfb7a8522ee6d2ff36a674fde;hpb=ce20a8a823a2df86ace4862008684c71a4f06cd2;p=idzebra-moved-to-github.git diff --git a/index/extract.c b/index/extract.c index 4808868..dac9820 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,11 @@ * 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 @@ -38,7 +42,7 @@ #include #include -#include +#include #include "index.h" static Dict file_idx; @@ -129,6 +133,7 @@ static void wordAdd (const RecWord *p) struct it_key key; char x; size_t i; + char wordPrefix[8]; if (key_offset + 1000 > key_buf_size) { @@ -140,6 +145,9 @@ static void wordAdd (const RecWord *p) 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: @@ -155,8 +163,6 @@ static void wordAdd (const RecWord *p) 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); @@ -206,9 +212,7 @@ void file_extract (int cmd, const char *fname, const char *kname) 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 = "";