* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.25 1995/04/17 09:34:33 adam
+ * Revision 1.26 1995/04/19 07:31:12 adam
+ * First work on Z39.50 persistence.
+ *
+ * Revision 1.25 1995/04/17 09:34:33 adam
* Timeout (idletime) adjustable. Minor changes in kernel.
*
* Revision 1.24 1995/03/28 11:42:35 adam
return 1;
}
-static int reopen_target (void)
+int reopen_target (void)
{
const char *v;
if (info.zass)
{
const struct zass_searchent *p;
struct gw_user_set *us;
+ char setname[32];
struct ccl_rpn_node *rpn;
int error;
const char *pos;
- us = user_set_add ("Default", -1);
+ if (info.setno == -1)
+ strcpy (setname, "Default");
+ else
+ sprintf (setname, "%d", info.setno);
rpn = ccl_find (info.bibset, list, &error, &pos);
if (!rpn)
{
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Searching in database %s",
info.database );
assert (info.zass);
- p = zass_search (info.zass, rpn, "Default", info.database );
+ fprintf (reply_fd, "Searching in database %s\n", info.database);
+ p = zass_p_search (info.zass, rpn, setname, info.database, info.sets);
if (!p)
+ {
+ fprintf (reply_fd, "Search fail\n");
return -1;
+ }
if (p->errcode != -1)
{
display_diag_error (p->errcode, p->errstring);
}
fprintf (reply_fd, "%d %s\n", p->num,
gw_res_get (info.kernel_res, "gw.msg.hits", "hit(s)"));
- us->hits = p->num;
+ us = user_set_add (setname, p->num, info.database, rpn, 1);
+ fprintf (reply_fd, "Result-set %s created\n", setname);
+ if (info.setno >= 0)
+ info.setno++;
return 0;
}
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "present in set %s", set);
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "present of %d records from offset %d",
number, offset);
- zp = zass_present(info.zass, (char *) set, offset, number);
+ zp = zass_p_present(info.zass, (char *) set, offset, number);
if (zp)
{
int i;