X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fextract.c;h=1312bfe06408a5d1a1c7842f4401c749fdd94d03;hb=43e4297c07b9c8b29bfc1ea647fc27456198f6ce;hp=68c8b12d63637924f5d383bef76ecc8caa8b887f;hpb=4df7866a571bf540cb320b62e6eec6f7e81b65dd;p=idzebra-moved-to-github.git diff --git a/index/extract.c b/index/extract.c index 68c8b12..1312bfe 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.256 2007-04-25 08:22:01 adam Exp $ +/* $Id: extract.c,v 1.258 2007-05-08 14:27:23 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -553,6 +553,20 @@ ZEBRA_RES zebra_extract_records_stream(ZebraHandle zh, } +static WRBUF wrbuf_hex_str(const char *cstr) +{ + size_t i; + WRBUF w = wrbuf_alloc(); + for (i = 0; cstr[i]; i++) + { + if (cstr[i] < ' ' || cstr[i] > 126) + wrbuf_printf(w, "\\%02X", cstr[i] & 0xff); + else + wrbuf_putc(w, cstr[i]); + } + return w; +} + ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh, struct ZebraRecStream *stream, enum zebra_recctrl_action_t action, @@ -688,12 +702,20 @@ ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh, int db_ord = zebraExplain_get_database_ord(zh->reg->zei); char *rinfo = dict_lookup_ord(zh->reg->matchDict, db_ord, matchStr); + + + if (log_level_extract) + { + WRBUF w = wrbuf_hex_str(matchStr); + yaz_log(log_level_extract, "matchStr: %s", wrbuf_cstr(w)); + wrbuf_destroy(w); + } if (rinfo) { assert(*rinfo == sizeof(*sysno)); memcpy (sysno, rinfo+1, sizeof(*sysno)); } - } + } } if (zebra_rec_keys_empty(zh->reg->keys)) {