From: Adam Dickmeiss Date: Wed, 9 Mar 2005 12:14:42 +0000 (+0000) Subject: Several updates for the changes of hit count datatype from int X-Git-Tag: snippet.version.1~119 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=a9e90f22d2cefbafc9d490a03a3bc7d1b75d57ee Several updates for the changes of hit count datatype from int to zint (long long or long). --- diff --git a/index/apitest.c b/index/apitest.c index b0e3de2..cd88853 100644 --- a/index/apitest.c +++ b/index/apitest.c @@ -1,4 +1,4 @@ -/* $Id: apitest.c,v 1.21 2005-01-16 23:14:57 adam Exp $ +/* $Id: apitest.c,v 1.22 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -161,7 +161,7 @@ int main (int argc, char **argv) char setname[64]; int errCode; int i; - int hits; + zint hits; char *errString; ZebraRetrievalRecord *records; int noOfRecordsToFetch; @@ -209,7 +209,7 @@ int main (int argc, char **argv) continue; } /* ok ... */ - printf ("Zebra Search gave %d hits\n", hits); + printf ("Zebra Search gave " ZINT_FORMAT " hits\n", hits); /* Deterimine number of records to fetch ... */ if (hits > 10) diff --git a/index/extract.c b/index/extract.c index 04acd4b..84d4c4f 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.173 2005-03-08 14:02:09 adam Exp $ +/* $Id: extract.c,v 1.174 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -577,7 +577,8 @@ static int file_extract_record(ZebraHandle zh, if (!force_update && recordAttr->runNumber == zebraExplain_runNumberIncrement (zh->reg->zei, 0)) { - yaz_log (YLOG_LOG, "run number = %d", recordAttr->runNumber); + yaz_log (YLOG_LOG, "run number = " ZINT_FORMAT, + recordAttr->runNumber); yaz_log (YLOG_LOG, "skipped %s %s " PRINTF_OFF_T, zh->m_record_type, fname, recordOffset); extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys); diff --git a/index/invstat.c b/index/invstat.c index 2e5f91e..4f87064 100644 --- a/index/invstat.c +++ b/index/invstat.c @@ -1,4 +1,4 @@ -/* $Id: invstat.c,v 1.44 2005-03-08 14:02:09 adam Exp $ +/* $Id: invstat.c,v 1.45 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -241,11 +241,11 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) break; fprintf (stdout, "Category %d\n", i); fprintf (stdout, "Block size %d\n", bsize); - fprintf (stdout, "Blocks: %d\n", stat_info.isamb_blocks[i]); - fprintf (stdout, "Size: %d\n", stat_info.isamb_sizes[i]); + fprintf (stdout, "Blocks: " ZINT_FORMAT "\n", stat_info.isamb_blocks[i]); + fprintf (stdout, "Size: " ZINT_FORMAT "\n", stat_info.isamb_sizes[i]); fprintf (stdout, "Entries: " ZINT_FORMAT "\n", stat_info.no_isam_entries[i]); - fprintf (stdout, "Total %d\n", stat_info.isamb_blocks[i]* + fprintf (stdout, "Total " ZINT_FORMAT "\n", stat_info.isamb_blocks[i]* bsize); for (j = 0; j<5; j++) if (stat_info.isamb_levels[i][j]) diff --git a/index/zebraapi.c b/index/zebraapi.c index d0f4e79..8c49ad3 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.153 2005-03-08 14:02:12 adam Exp $ +/* $Id: zebraapi.c,v 1.154 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -2112,7 +2112,7 @@ int zebra_search_PQF (ZebraHandle zh, const char *pqf_query, odr_destroy(odr); - yaz_log(log_level, "Hits: %d",hits); + yaz_log(log_level, "Hits: " ZINT_FORMAT, hits); if (numhits) *numhits = hits; diff --git a/index/zebrash.c b/index/zebrash.c index 577f942..928bf95 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -1,4 +1,4 @@ -/* $Id: zebrash.c,v 1.32 2005-01-15 19:38:29 adam Exp $ +/* $Id: zebrash.c,v 1.33 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -390,15 +390,15 @@ static int cmd_exchange_record( char *args[], WRBUF outbuff) * Searching and retrieving */ -static int cmd_search_pqf( char *args[], WRBUF outbuff) +static int cmd_search_pqf(char *args[], WRBUF outbuff) { - int hits=0; - char *set=args[1]; - char *qry=restargs(args,2); + zint hits = 0; + char *set = args[1]; + char *qry = restargs(args,2); int rc; - rc=zebra_search_PQF(zh, qry, set, &hits); + rc = zebra_search_PQF(zh, qry, set, &hits); if (0==rc) - wrbuf_printf(outbuff,"%d hits found\n",hits); + wrbuf_printf(outbuff, ZINT_FORMAT " hits found\n", hits); return rc; } @@ -406,21 +406,21 @@ static int cmd_find( char *args[], WRBUF outbuff) { char *setname=DEFAULTRESULTSET; int rc; - int hits=0; - WRBUF qry=wrbuf_alloc(); + zint hits = 0; + WRBUF qry = wrbuf_alloc(); if (0==strstr(args[0],"@attr")) wrbuf_puts(qry, "@attr 1=/ "); wrbuf_puts(qry,restargs(args,1)); if (!zh) onecommand("quickstart", outbuff, ""); wrbuf_printf(outbuff, "find %s\n",wrbuf_buf(qry)); - rc=zebra_search_PQF(zh, wrbuf_buf(qry), setname, &hits); + rc = zebra_search_PQF(zh, wrbuf_buf(qry), setname, &hits); if (0==rc) { - wrbuf_printf(outbuff,"%d hits found\n",hits); - nextrecno=1; + wrbuf_printf(outbuff, ZINT_FORMAT " hits found\n", hits); + nextrecno = 1; } - wrbuf_free(qry,1); + wrbuf_free(qry, 1); return rc; } diff --git a/test/api/t3.c b/test/api/t3.c index 5887612..57376a2 100644 --- a/test/api/t3.c +++ b/test/api/t3.c @@ -1,4 +1,4 @@ -/* $Id: t3.c,v 1.15 2005-01-22 12:20:35 adam Exp $ +/* $Id: t3.c,v 1.16 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -52,7 +52,7 @@ int main(int argc, char **argv) YAZ_PQF_Parser parser = yaz_pqf_create(); Z_RPNQuery *query = yaz_pqf_parse(parser, odr_input, "@attr 1=4 my"); - int hits; + zint hits; zebra_begin_trans (zh, 1); zebra_begin_trans (zh, 0); diff --git a/test/api/t4.c b/test/api/t4.c index 820ec36..ffc3355 100644 --- a/test/api/t4.c +++ b/test/api/t4.c @@ -1,4 +1,4 @@ -/* $Id: t4.c,v 1.14 2005-01-15 19:38:35 adam Exp $ +/* $Id: t4.c,v 1.15 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -59,7 +59,7 @@ int main(int argc, char **argv) YAZ_PQF_Parser parser = yaz_pqf_create(); Z_RPNQuery *query = yaz_pqf_parse(parser, odr_input, "@attr 1=4 my"); - int hits; + zint hits; sprintf(setname, "s%d", i+1); zebra_search_RPN(zh, odr_input, query, setname, &hits); diff --git a/test/api/t7.c b/test/api/t7.c index 2c048c8..c100a8d 100644 --- a/test/api/t7.c +++ b/test/api/t7.c @@ -1,4 +1,4 @@ -/* $Id: t7.c,v 1.7 2005-01-22 12:20:35 adam Exp $ +/* $Id: t7.c,v 1.8 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -49,7 +49,7 @@ int main(int argc, char **argv) "@attr 1=4 my"); Z_SortKeySpecList *spec = yaz_sort_spec (odr_output, "@attr 1=4 id"); - int hits; + zint hits; init_data(zh, recs); diff --git a/test/api/testlib.c b/test/api/testlib.c index c32fb16..d54c7c1 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.11 2005-01-15 19:38:35 adam Exp $ +/* $Id: testlib.c,v 1.12 2005-03-09 12:14:42 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -145,7 +145,7 @@ int do_query(int lineno, ZebraHandle zh, char *query, int exphits) YAZ_PQF_Parser parser; Z_RPNQuery *rpn; const char *setname="rsetname"; - int hits; + zint hits; int rc; @@ -166,7 +166,7 @@ int do_query(int lineno, ZebraHandle zh, char *query, int exphits) } if (hits != exphits) { - printf("Error: search returned %d hits instead of %d\n", + printf("Error: search returned " ZINT_FORMAT " hits instead of %d\n", hits, exphits); exit (1); }