* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recctrl.h,v $
- * Revision 1.24 1998-03-05 08:38:46 adam
+ * Revision 1.25 1998-03-11 11:19:04 adam
+ * Changed the way sequence numbers are generated.
+ *
+ * Revision 1.24 1998/03/05 08:38:46 adam
* New member recordSize in recRetrieveCtrl.
*
* Revision 1.23 1998/02/10 12:03:05 adam
unsigned reg_type;
char *string;
int length;
- int seqno;
+ int *seqnos;
ZebraMaps zebra_maps;
} RecWord;
void (*add)(RecWord *p);
ZebraMaps zebra_maps;
int flagShowRecords;
+ int seqno[256];
data1_handle dh;
};
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.80 1998-03-05 08:45:11 adam
+ * Revision 1.81 1998-03-11 11:19:04 adam
+ * Changed the way sequence numbers are generated.
+ *
+ * Revision 1.80 1998/03/05 08:45:11 adam
* New result set model and modular ranking system. Moved towards
* descent server API. System information stored as "SGML" records.
*
static void wordInit (struct recExtractCtrl *p, RecWord *w)
{
w->zebra_maps = p->zebra_maps;
+ w->seqnos = p->seqno;
w->attrSet = 1;
w->attrUse = 1016;
w->reg_type = 'w';
short attrUse;
int lead = 0;
int diff = 0;
+ int *pseqno = &p->seqnos[p->reg_type];
if (reckeys.buf_used+1024 > reckeys.buf_max)
{
else
reckeys.prevAttrUse = attrUse;
#if 1
- diff = 1 + p->seqno - reckeys.prevSeqNo;
+ diff = 1 + *pseqno - reckeys.prevSeqNo;
if (diff >= 1 && diff <= 15)
lead |= (diff << 2);
else
diff = 0;
#endif
- reckeys.prevSeqNo = p->seqno;
-
+ reckeys.prevSeqNo = *pseqno;
+
*dst++ = lead;
if (!(lead & 1))
if (!diff)
{
- memcpy (dst, &p->seqno, sizeof(p->seqno));
- dst += sizeof(p->seqno);
+ memcpy (dst, pseqno, sizeof(*pseqno));
+ dst += sizeof(*pseqno);
}
reckeys.buf_used = dst - reckeys.buf;
- (p->seqno)++;
+ (*pseqno)++;
}
static void addSortString (RecWord *p, const char *string, int length)
if (fi->fd != -1)
{
+ int i;
/* we are going to read from a file, so prepare the extraction */
extractCtrl.fh = fi;
extractCtrl.subType = subType;
reckeys.prevAttrSet = -1;
reckeys.prevSeqNo = 0;
+ for (i = 0; i<256; i++)
+ extractCtrl.seqno[i] = 0;
recordOffset = fi->file_moffset;
extractCtrl.offset = recordOffset;
extractCtrl.readf = file_read;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recgrs.c,v $
- * Revision 1.18 1998-03-05 08:41:31 adam
+ * Revision 1.19 1998-03-11 11:19:05 adam
+ * Changed the way sequence numbers are generated.
+ *
+ * Revision 1.18 1998/03/05 08:41:31 adam
* Minor changes.
*
* Revision 1.17 1998/02/10 12:03:06 adam
#define GRS_MAX_WORD 512
-static int seqno = 0;
-
static data1_node *read_grs_type (struct grs_read_info *p, const char *type)
{
static struct {
else
{
wrd.reg_type = *tlist->structure;
- wrd.seqno = seqno;
wrd.string = n->u.data.data;
wrd.length = n->u.data.len;
wrd.attrSet = tlist->att->parent->ordinal;
wrd.attrUse = tlist->att->locals->local;
(*p->add)(&wrd);
- seqno = wrd.seqno;
}
}
}
data1_node *n;
NMEM mem;
struct grs_read_info gri;
- seqno = 0;
mem = nmem_create ();
gri.readf = p->readf;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rectext.c,v $
- * Revision 1.6 1998-02-10 12:03:06 adam
+ * Revision 1.7 1998-03-11 11:19:05 adam
+ * Changed the way sequence numbers are generated.
+ *
+ * Revision 1.6 1998/02/10 12:03:06 adam
* Implemented Sort.
*
* Revision 1.5 1997/10/27 14:33:06 adam
{
char w[512];
RecWord recWord;
- int r, seqno = 1;
+ int r;
struct buf_info *fi = buf_open (p);
(*p->init)(p, &recWord);
}
if (i)
{
- recWord.seqno = seqno++;
recWord.string = w;
recWord.length = i;
(*p->add)(&recWord);