-/* $Id: zebrash.c,v 1.17 2003-07-04 14:00:22 heikki Exp $
+/* $Id: zebrash.c,v 1.20 2003-07-07 14:56:04 heikki Exp $
Copyright (C) 2002,2003
Index Data Aps
int cmd_quit( char *args[], WRBUF outbuff)
{
+ if (zs)
+ {
+ onecommand("zebra_close",outbuff,"");
+ zs=0;
+ }
+ if (zh)
+ {
+ onecommand("zebra_stop",outbuff,"");
+ zh=0;
+ }
wrbuf_puts(outbuff, "bye");
return -99; /* special stop signal */
}
int nrecs=defargint(args[2],1);
char *setname=defarg(args[3],DEFAULTRESULTSET);
int rc=0;
+ ZebraRetrievalRecord *recs;
ODR odr;
Z_RecordComposition *pcomp=0;
int i;
oid_value format;
odr=odr_createmem(ODR_ENCODE);
- ZebraRetrievalRecord *recs=
- odr_malloc(odr,sizeof(ZebraRetrievalRecord)*nrecs);
+ recs= odr_malloc(odr,sizeof(ZebraRetrievalRecord)*nrecs);
rc =z_RecordComposition(odr, &pcomp, 0,"recordComposition");
format=oid_getvalbyname ("xml"); /*FIXME - let the user specify*/
for (i=0;i<nrecs;i++)
rc = zebra_records_retrieve (zh, odr, setname,
pcomp, format, nrecs,recs);
- printf("rc=%d\n",rc);
if (0==rc)
{
for (i=0;i<nrecs;i++)
}
nextrecno=start+nrecs+1;
}
+ odr_destroy(odr);
return rc;
}
/**************************************)
Zerrors(outbuff);
printf("%s\n", wrbuf_buf(outbuff));
} /* while */
+ wrbuf_free(outbuff,1);
} /* shell() */