X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebrash.c;h=c9bbda4e547d23c3587f456bdb02de8ae9c8c7b9;hb=3e7372e15b55113d4d29582fc30e7e3a398161fc;hp=63a878266309e51e5118b9bf7330b6933d50a950;hpb=5437b50633032595afe6f87dc0f989bc92a5aea8;p=idzebra-moved-to-github.git diff --git a/index/zebrash.c b/index/zebrash.c index 63a8782..c9bbda4 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -1,6 +1,6 @@ -/* $Id: zebrash.c,v 1.30 2004-11-19 10:27:04 heikki Exp $ - Copyright (C) 2002,2003,2004 - Index Data Aps +/* $Id: zebrash.c,v 1.34 2005-06-14 20:28:54 adam Exp $ + Copyright (C) 1995-2005 + Index Data ApS This file is part of the Zebra server. @@ -28,7 +28,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#include /* for isatty */ +#if HAVE_UNISTD_H +#include +#endif #if HAVE_READLINE_READLINE_H #include @@ -38,7 +40,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #endif #include -#include +#include #include #include #include @@ -390,15 +392,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 +408,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; }