* Sebastian Hammer, Adam Dickmeiss
*
* $Log: extract.c,v $
- * Revision 1.10 1995-09-28 09:19:41 adam
+ * Revision 1.11 1995-09-28 12:10:31 adam
+ * Bug fixes. Field prefix used in queries.
+ *
+ * Revision 1.10 1995/09/28 09:19:41 adam
* xfree/xmalloc used everywhere.
* Extract/retrieve method seems to work for text records.
*
static void wordInit (RecWord *p)
{
p->attrSet = 1;
- p->attrUse = 1;
+ p->attrUse = 1016;
p->which = Word_String;
}
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);
+ key_offset += index_word_prefix (key_buf + key_offset,
+ p->attrSet, p->attrUse);
switch (p->which)
{
case Word_String:
key_offset++;
key.sysno = key_sysno;
- key.seqno = p->seqno;
+ key.seqno = p->seqno;
memcpy (key_buf + key_offset, &key, sizeof(key));
key_offset += sizeof(key);
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
- * Revision 1.11 1995-09-27 12:22:28 adam
+ * Revision 1.12 1995-09-28 12:10:32 adam
+ * Bug fixes. Field prefix used in queries.
+ *
+ * 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.
*
#define IT_KEY_HAVE_FIELD 0
struct it_key {
- int sysno;
- short seqno;
+ int sysno : 24;
+ int seqno : 16;
};
struct dir_entry {
void (*func)(const char *name, void *info, void *data),
void *data);
int index_char_cvt (int c);
+int index_word_prefix (char *string, int attrSet, int attrUse);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: kcompare.c,v $
- * Revision 1.8 1995-09-28 09:19:42 adam
+ * Revision 1.9 1995-09-28 12:10:32 adam
+ * Bug fixes. Field prefix used in queries.
+ *
+ * Revision 1.8 1995/09/28 09:19:42 adam
* xfree/xmalloc used everywhere.
* Extract/retrieve method seems to work for text records.
*
{
return tolower (c);
}
+
+int index_word_prefix (char *string, int attrSet, int attrUse)
+{
+ sprintf (string, "%c%04d", attrSet + '0', attrUse);
+ return 5;
+}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
- * Revision 1.13 1995-09-18 14:17:50 adam
+ * Revision 1.14 1995-09-28 12:10:32 adam
+ * Bug fixes. Field prefix used in queries.
+ *
+ * Revision 1.13 1995/09/18 14:17:50 adam
* Minor changes.
*
* Revision 1.12 1995/09/15 14:45:21 adam
zi->errCode = 124;
return NULL;
}
- sizez = term->u.general->len;
+ i = index_word_prefix (termz, 1, 1016);
+ sizez = i + term->u.general->len;
if (sizez > IT_MAX_WORD)
sizez = IT_MAX_WORD;
- for (i = 0; i<sizez; i++)
+ for ( ; i < sizez; i++)
termz[i] = index_char_cvt (term->u.general->buf[i]);
termz[i] = '\0';
zi->errCode = 124;
return NULL;
}
- sizez = term->u.general->len;
+ i = index_word_prefix (termz, 1, 1016);
+ sizez = i + term->u.general->len;
if (sizez > IT_MAX_WORD)
sizez = IT_MAX_WORD;
- for (i = 0; i<sizez; i++)
+ for ( ; i < sizez; i++)
termz[i] = index_char_cvt (term->u.general->buf[i]);
termz[i] = '\0';
zi->errCode = 124;
return NULL;
}
- sizez = term->u.general->len;
+ i = index_word_prefix (termz, 1, 1016);
+ sizez = i + term->u.general->len;
if (sizez > IT_MAX_WORD)
sizez = IT_MAX_WORD;
- for (i = 0; i<sizez; i++)
+ for ( ; i < sizez; i++)
termz[i] = index_char_cvt (term->u.general->buf[i]);
termz[i] = '\0';