From: Adam Dickmeiss Date: Thu, 20 Apr 1995 16:10:45 +0000 (+0000) Subject: Modified to work with non-blocking zass-api. Not using non-blocking X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=f01040fd4a2fe0d6171984cbb6aed09bd172faa5;p=egate.git Modified to work with non-blocking zass-api. Not using non-blocking facility yet. --- diff --git a/kernel/Makefile b/kernel/Makefile index 3b07766..5686bc5 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -2,7 +2,11 @@ # Europagate, 1995 # # $Log: Makefile,v $ -# Revision 1.20 1995/04/20 15:24:59 quinn +# Revision 1.21 1995/04/20 16:10:45 adam +# Modified to work with non-blocking zass-api. Not using non-blocking +# facility yet. +# +# Revision 1.20 1995/04/20 15:24:59 quinn # *** empty log message *** # # Revision 1.19 1995/04/19 16:08:20 adam @@ -69,21 +73,11 @@ # SHELL=/bin/sh -<<<<<<< 1.19 -ZPRE=/home/proj/zdist/zdist102b1-1/libz3950 -ZINC=-I$(ZPRE) -ZLIB=$(ZPRE)/libz3950.a -======= #ZPRE=/home/proj/zdist/zdist102b1-1/libz3950 #ZINC=-I$(ZPRE) #ZLIB=$(ZPRE)/libz3950.a ->>>>>>> /tmp/T4a18061 -<<<<<<< 1.19 -#ZLIB=../../yaz/lib/libyaz.a -======= ZLIB=../../yaz/lib/libyaz.a ->>>>>>> /tmp/T4a18061 INCLUDE=-I../include #CFLAGS=-g -Wall diff --git a/kernel/persist.c b/kernel/persist.c index 34263b1..9158d40 100644 --- a/kernel/persist.c +++ b/kernel/persist.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: persist.c,v $ - * Revision 1.3 1995/04/19 13:19:09 adam + * Revision 1.4 1995/04/20 16:10:46 adam + * Modified to work with non-blocking zass-api. Not using non-blocking + * facility yet. + * + * Revision 1.3 1995/04/19 13:19:09 adam * New command: account - for authentication. * * Revision 1.2 1995/04/19 10:46:19 adam @@ -40,7 +44,7 @@ static int obtain_set (ZASS zass, struct gw_user_set *set) { const struct zass_searchent *p; - p = zass_search (zass, set->rpn, set->name, set->database); + p = zass_search (zass, set->rpn, set->name, set->database, NULL); if (!p) return 2; if (p->errcode != -1) @@ -100,7 +104,7 @@ const struct zass_searchent *zass_p_search (ZASS zass, r = obtain_sets (zass, rpn, sets); if (r) return NULL; - return zass_search (zass, rpn, (char*) result_set, (char*) database); + return zass_search (zass, rpn, (char*) result_set, (char*) database, NULL); } const struct zass_presentent *zass_p_present (ZASS zass, @@ -120,7 +124,7 @@ const struct zass_presentent *zass_p_present (ZASS zass, if (!p) return NULL; } - return zass_present (zass, (char*) result_set, offset, number); + return zass_present (zass, (char*) result_set, offset, number, NULL); } struct ccl_rpn_node *load_rpn (char *buf, FILE *inf) @@ -132,44 +136,32 @@ struct ccl_rpn_node *load_rpn (char *buf, FILE *inf) if (!fgetsx (buf, 1024, inf)) return NULL; + rpn = malloc (sizeof (*rpn)); + if (!rpn) + return NULL; switch (*buf) { case 'A': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_AND; rpn->u.p[0] = load_rpn (buf, inf); rpn->u.p[1] = load_rpn (buf, inf); break; case 'O': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_OR; rpn->u.p[0] = load_rpn (buf, inf); rpn->u.p[1] = load_rpn (buf, inf); break; case 'N': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_NOT; rpn->u.p[0] = load_rpn (buf, inf); rpn->u.p[1] = load_rpn (buf, inf); break; case 'P': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_PROX; rpn->u.p[0] = load_rpn (buf, inf); rpn->u.p[1] = load_rpn (buf, inf); break; case 'T': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_TERM; rpn->u.t.term = gw_strdup (buf+2); @@ -188,11 +180,12 @@ struct ccl_rpn_node *load_rpn (char *buf, FILE *inf) *attrp = NULL; break; case 'S': - rpn = malloc (sizeof (*rpn)); - if (!rpn) - return NULL; rpn->kind = CCL_RPN_SET; rpn->u.setname = gw_strdup (buf+2); + break; + default: + free (rpn); + return NULL; } return rpn; } diff --git a/kernel/urp.c b/kernel/urp.c index a5a5c68..ed79aca 100644 --- a/kernel/urp.c +++ b/kernel/urp.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: urp.c,v $ - * Revision 1.29 1995/04/19 16:01:58 adam + * Revision 1.30 1995/04/20 16:10:47 adam + * Modified to work with non-blocking zass-api. Not using non-blocking + * facility yet. + * + * Revision 1.29 1995/04/19 16:01:58 adam * Some hacks to get the FIFO communication work!! Isn't reliable. * Resource gw.account added - default account info. * @@ -150,8 +154,8 @@ int reopen_target (void) if (info.zass) gw_log (GW_LOG_WARN, KERNEL_LOG, "Zass free..."); gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reopen_target"); - info.zass = zass_open (info.hostname, info.port, *info.account ? - info.account : NULL); + info.zass = zass_open (info.hostname, info.port, NULL, /* complete */ + *info.account ? info.account : NULL); if (!info.zass) { gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Cannot connect to target %s:%d",