const Odr_oid *input_format, Z_RecordComposition *comp,
const Odr_oid **output_format, char **rec_bufp,
int *rec_lenp, char **basenamep,
- char **addinfo);
+ WRBUF addinfo_w);
void extract_get_fname_tmp(ZebraHandle zh, char *fname, int no);
const Odr_oid *input_format, Z_RecordComposition *comp,
const Odr_oid **output_format,
char **rec_bufp, int *rec_lenp, char **basenamep,
- char **addinfo)
+ WRBUF addinfo_w)
{
Record rec;
char *fname, *file_type, *basename;
sysno = sysnos[0];
*basenamep = 0;
- *addinfo = 0;
elemsetname = yaz_get_esn(comp);
fetch_info.zh = zh;
if (elemsetname && 0 == strncmp(elemsetname, "zebra::", 7))
{
WRBUF result = wrbuf_alloc();
- WRBUF addinfo_w = wrbuf_alloc();
int r = zebra_special_fetch(&fetch_info, elemsetname + 7,
input_format, output_format,
result, addinfo_w);
*rec_bufp = odr_strdup(odr, wrbuf_cstr(result));
*rec_lenp = wrbuf_len(result);
}
- else
- {
- if (wrbuf_len(addinfo_w))
- *addinfo = odr_strdup(odr, wrbuf_cstr(addinfo_w));
- }
wrbuf_destroy(result);
- wrbuf_destroy(addinfo_w);
return r;
}
if (!(rt = recType_byName(zh->reg->recTypes, zh->res,
file_type, &clientData)))
{
- char addinfo_str[100];
-
- sprintf(addinfo_str, "Could not handle record type %.40s",
- file_type);
-
- *addinfo = odr_strdup(odr, addinfo_str);
+ wrbuf_printf(addinfo_w, "Could not handle record type %.40s",
+ file_type);
return_code = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
}
else
*output_format = retrieveCtrl.output_format;
*rec_bufp = (char *) retrieveCtrl.rec_buf;
*rec_lenp = retrieveCtrl.rec_len;
- *addinfo = retrieveCtrl.addinfo;
+ if (retrieveCtrl.addinfo)
+ wrbuf_puts(addinfo_w, retrieveCtrl.addinfo);
}
stream.destroy(&stream);
if (zebra_maps_read_file(reg->zebra_maps, index_fname) != ZEBRA_OK)
ret = ZEBRA_FAIL;
}
+ else
+ {
+ zebra_maps_define_default_sort(reg->zebra_maps);
+ }
}
if (!(reg->records = rec_open(reg->bfs, rw, record_compression)))
recs[i].len = 0;
recs[i].buf = 0;
recs[i].base = 0;
- recs[i].sysno = poset[i].term;
+ recs[i].sysno = poset[i].sysno;
if (poset[i].term)
{
recs[i].format = yaz_oid_recsyn_sutrs;