/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1996, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zserver.c,v $
- * Revision 1.33 1996-01-17 14:57:56 adam
+ * Revision 1.38 1996-05-14 11:34:01 adam
+ * Scan support in multiple registers/databases.
+ *
+ * Revision 1.37 1996/05/14 06:16:48 adam
+ * Compact use/set bytes used in search service.
+ *
+ * Revision 1.36 1996/05/01 13:46:37 adam
+ * First work on multiple records in one file.
+ * New option, -offset, to the "unread" command in the filter module.
+ *
+ * Revision 1.35 1996/03/26 16:01:14 adam
+ * New setting lockPath: directory of various lock files.
+ *
+ * Revision 1.34 1996/03/20 09:36:46 adam
+ * Function dict_lookup_grep got extra parameter, init_pos, which marks
+ * from which position in pattern approximate pattern matching should occur.
+ * Approximate pattern matching is used in relevance=re-2.
+ *
+ * Revision 1.33 1996/01/17 14:57:56 adam
* Prototype changed for reader functions in extract/retrieve. File
* is identified by 'void *' instead of 'int.
*
zi->registerChange = lastChange;
if (zi->records)
{
+ zebTargetInfo_close (zi->zti, 0);
dict_close (zi->wordDict);
is_close (zi->wordIsam);
rec_close (&zi->records);
if (!(zi->wordIsam = is_open (FNAME_WORD_ISAM, key_compare, 0,
sizeof (struct it_key))))
return -1;
+ zi->zti = zebTargetInfo_open (zi->records, 0);
return 0;
}
logf (LOG_FATAL, "Cannot open resource `%s'", sob->configname);
exit (1);
}
+ bf_lockDir (res_get (common_resource, "lockPath"));
+ data1_tabpath = res_get(common_resource, "profilePath");
}
- data1_tabpath = res_get(common_resource, "profilePath");
server_info.sets = NULL;
server_info.registerState = -1; /* trigger open of registers! */
server_info.registerChange = 0;
return &r;
}
+static int record_offset;
+
static int record_ext_read (void *fh, char *buf, size_t count)
{
return read (*((int*) fh), buf, count);
}
+static off_t record_ext_seek (void *fh, off_t offset)
+{
+ return lseek (*((int*) fh), offset + record_offset, SEEK_SET);
+}
+
static int record_int_pos;
static char *record_int_buf;
static int record_int_len;
+static off_t record_int_seek (void *fh, off_t offset)
+{
+ return (off_t) (record_int_pos = offset);
+}
+
static int record_int_read (void *fh, char *buf, size_t count)
{
int l = record_int_len - record_int_pos;
*output_format = VAL_SUTRS;
*rec_bufp = msg;
*rec_lenp = strlen (msg);
+ logf (LOG_DEBUG, "rec_get fail on sysno=%d", sysno);
return 0;
}
file_type = rec->info[recInfo_fileType];
if (rec->size[recInfo_storeData] > 0)
{
retrieveCtrl.readf = record_int_read;
+ retrieveCtrl.seekf = record_int_seek;
record_int_len = rec->size[recInfo_storeData];
record_int_buf = rec->info[recInfo_storeData];
record_int_pos = 0;
rec_rm (&rec);
return 0; /* or 14: System error in presenting records */
}
+
+ memcpy (&record_offset, rec->info[recInfo_offset],
+ sizeof(record_offset));
+
retrieveCtrl.fh = &fd;
retrieveCtrl.readf = record_ext_read;
+ retrieveCtrl.seekf = record_ext_seek;
+
+ record_ext_seek (retrieveCtrl.fh, 0);
}
retrieveCtrl.subType = subType;
retrieveCtrl.localno = sysno;
r.term_position = q->term_position;
r.num_entries = q->num_entries;
r.errcode = rpn_scan (&server_info, q->term,
+ q->attributeset,
q->num_bases, q->basenames,
&r.term_position,
&r.num_entries, &r.entries, &status);