* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zserver.c,v $
- * Revision 1.13 1995-10-06 14:38:00 adam
+ * Revision 1.17 1995-10-16 09:32:40 adam
+ * More work on relational op.
+ *
+ * Revision 1.16 1995/10/13 12:26:44 adam
+ * Optimization of truncation.
+ *
+ * Revision 1.15 1995/10/12 12:40:55 adam
+ * Bug fixes in rpn_prox.
+ *
+ * Revision 1.14 1995/10/09 16:18:37 adam
+ * Function dict_lookup_grep got extra client data parameter.
+ *
+ * Revision 1.13 1995/10/06 14:38:00 adam
* New result set method: r_score.
* Local no (sysno) and score is transferred to retrieveCtrl.
*
r.errstring = 0;
r.handle = name;
+ logf (LOG_DEBUG, "bend_init");
server_info.sets = NULL;
if (!(server_info.sys_idx_fd = open (FNAME_SYS_IDX, O_RDONLY)))
{
+ logf (LOG_WARN|LOG_ERRNO, "sys_idx open fail");
r.errcode = 1;
- r.errstring = "dict_open fail: filedict";
+ r.errstring = "sys_idx open fail";
return &r;
}
if (!(server_info.fileDict = dict_open (FNAME_FILE_DICT, 10, 0)))
{
+ logf (LOG_WARN, "dict_open fail: fname dict");
r.errcode = 1;
- r.errstring = "dict_open fail: filedict";
+ r.errstring = "dict_open fail: fname dict";
return &r;
}
if (!(server_info.wordDict = dict_open (FNAME_WORD_DICT, 40, 0)))
{
+ logf (LOG_WARN, "dict_open fail: word dict");
dict_close (server_info.fileDict);
r.errcode = 1;
- r.errstring = "dict_open fail: worddict";
+ r.errstring = "dict_open fail: word dict";
return &r;
}
if (!(server_info.wordIsam = is_open (FNAME_WORD_ISAM, key_compare, 0,
sizeof (struct it_key))))
{
+ logf (LOG_WARN, "is_open fail: word isam");
dict_close (server_info.wordDict);
dict_close (server_info.fileDict);
r.errcode = 1;
- r.errstring = "is_open fail: wordisam";
+ r.errstring = "is_open fail: word isam";
return &r;
}
server_info.odr = odr_createmem (ODR_ENCODE);
file_type);
exit (1);
}
+ logf (LOG_DEBUG, "retrieve localno=%d score=%d", sysno, score);
if ((retrieveCtrl.fd = open (fname, O_RDONLY)) == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "Retrieve: Open record file %s", fname);
- exit (1);
+ char *msg = "Record doesn't exist";
+ logf (LOG_WARN|LOG_ERRNO, "Retrieve: Open record file %s", fname);
+ *output_format = VAL_SUTRS;
+ *rec_bufp = msg;
+ *rec_lenp = strlen (msg);
+ return 0; /* or 14: System error in presenting records */
}
- logf (LOG_DEBUG, "retrieve localno=%d score=%d", sysno, score);
retrieveCtrl.localno = sysno;
retrieveCtrl.score = score;
retrieveCtrl.odr = stream;
bend_scanresult *bend_scan (void *handle, bend_scanrequest *q, int *num)
{
static bend_scanresult r;
+ int status;
odr_reset (server_info.odr);
server_info.errCode = 0;
r.num_entries = q->num_entries;
r.errcode = rpn_scan (&server_info, server_info.odr, q->term,
&r.term_position,
- &r.num_entries, &r.entries);
+ &r.num_entries, &r.entries, &status);
+ r.status = status;
return &r;
}