X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=index%2Fzebraapi.c;h=676846fd93bc56b7ef58ad1866ea47ad46446c5e;hb=a479e3c7f966848a6fc71ac2c2c7f5db7068351b;hp=6fefbb20c66fd84498f65179763cb63d5a5f062c;hpb=3fcc65de3bb8ac7af03900dccf23a5b1219b2e8e;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 6fefbb2..676846f 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.258 2007-08-27 17:22:22 adam Exp $ +/* $Id: zebraapi.c,v 1.264 2007-11-06 10:29:59 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -419,7 +419,6 @@ struct zebra_register *zebra_register_open(ZebraService zs, const char *name, if (!strcmp (recordCompression, "bzip2")) record_compression = REC_COMPRESS_BZIP2; - if (1) { const char *index_fname = res_get_def(res, "index", "default.idx"); if (index_fname && *index_fname) @@ -1226,7 +1225,6 @@ ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, const char *setname) { ZEBRA_RES res; - RSET limit_rset = 0; ZEBRA_CHECK_HANDLE(zh); @@ -1244,21 +1242,10 @@ ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, *num_entries = 0; return ZEBRA_FAIL; } - if (setname) - { - limit_rset = resultSetRef(zh, setname); - if (!limit_rset) - { - zebra_setError(zh, - YAZ_BIB1_SPECIFIED_RESULT_SET_DOES_NOT_EXIST, - setname); - zebra_end_read (zh); - return ZEBRA_FAIL; - } - } + res = rpn_scan(zh, stream, zapt, attributeset, zh->num_basenames, zh->basenames, position, - num_entries, entries, is_partial, limit_rset); + num_entries, entries, is_partial, setname); zebra_end_read(zh); return res; } @@ -1292,8 +1279,7 @@ int zebra_deleteResultSet(ZebraHandle zh, int function, { int i, status; ASSERTZH; - assert(statuses); - yaz_log(log_level, "zebra_deleteResultSet n=%d",num_setnames); + yaz_log(log_level, "zebra_deleteResultSet n=%d", num_setnames); if (zebra_begin_read(zh)) return Z_DeleteStatus_systemProblemAtTarget; @@ -1527,11 +1513,12 @@ ZEBRA_RES zebra_create_database (ZebraHandle zh, const char *db) return zebra_end_trans (zh); } -int zebra_string_norm(ZebraHandle zh, unsigned reg_id, +int zebra_string_norm(ZebraHandle zh, const char *index_type, const char *input_str, int input_len, char *output_str, int output_len) { WRBUF wrbuf; + zebra_map_t zm = zebra_map_get(zh->reg->zebra_maps, index_type); ASSERTZH; assert(input_str); assert(output_str); @@ -1539,8 +1526,7 @@ int zebra_string_norm(ZebraHandle zh, unsigned reg_id, if (!zh->reg->zebra_maps) return -1; - wrbuf = zebra_replace(zh->reg->zebra_maps, reg_id, "", - input_str, input_len); + wrbuf = zebra_replace(zm, "", input_str, input_len); if (!wrbuf) return -2; if (wrbuf_len(wrbuf) >= output_len)