X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fretrieve.c;h=650eb82b38158b59854a67ac5ac1f612dc58d699;hb=a20e59c5087fb92c419f2330c786367f9ce8ccd2;hp=9b8baae859f8bb0de14a615a9a5fc78e90342e10;hpb=2b1851bd5565e3d21f9cf9a37661a584c063b75f;p=idzebra-moved-to-github.git diff --git a/index/retrieve.c b/index/retrieve.c index 9b8baae..650eb82 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: retrieve.c,v $ - * Revision 1.15 2002-04-04 14:14:13 adam + * Revision 1.17 2002-05-03 13:49:04 adam + * play with shellsort + * + * Revision 1.16 2002/04/04 20:50:37 adam + * Multi register works with record paths and data1 profile path + * + * Revision 1.15 2002/04/04 14:14:13 adam * Multiple registers (alpha early) * * Revision 1.14 2001/01/22 11:41:41 adam @@ -65,6 +71,7 @@ #endif #include "index.h" +#include int zebra_record_ext_read (void *fh, char *buf, size_t count) { @@ -170,10 +177,22 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, } else { - if ((fc.fd = open (fname, O_BINARY|O_RDONLY)) == -1) + char full_rep[1024]; + + if (zh->path_reg && !yaz_is_abspath (fname)) + { + strcpy (full_rep, zh->path_reg); + strcat (full_rep, "/"); + strcat (full_rep, fname); + } + else + strcpy (full_rep, fname); + + + if ((fc.fd = open (full_rep, O_BINARY|O_RDONLY)) == -1) { logf (LOG_WARN|LOG_ERRNO, "Retrieve fail; missing file: %s", - fname); + full_rep); rec_rm (&rec); return 14; } @@ -195,6 +214,9 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, retrieveCtrl.diagnostic = 0; retrieveCtrl.dh = zh->reg->dh; retrieveCtrl.res = zh->res; + retrieveCtrl.rec_buf = 0; + retrieveCtrl.rec_len = -1; + (*rt->retrieve)(clientData, &retrieveCtrl); *output_format = retrieveCtrl.output_format; *rec_bufp = (char *) retrieveCtrl.rec_buf;