X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=445dc527b5718b45b49e47bc498ccd2da0456ceb;hb=af3b1f509a27cb38ca5c9cb7a22cd384f5ca7c70;hp=f80bb47697324357e65e9b0082ff43a048195563;hpb=2dd448afda333a5db88396d70d539089bf1a572d;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index f80bb47..445dc52 100644 --- a/client/client.c +++ b/client/client.c @@ -5,6 +5,9 @@ /** \file client.c * \brief yaz-client program */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -284,7 +287,7 @@ int send_apdu(Z_APDU *a) do_hex_dump(buf, len); if (cs_put(conn, buf, len) < 0) { - fprintf(stderr, "cs_put: %s", cs_errmsg(cs_errno(conn))); + fprintf(stderr, "cs_put: %s\n", cs_errmsg(cs_errno(conn))); close_session(); return 0; } @@ -2903,6 +2906,8 @@ static int cmd_find(const char *arg) static int cmd_facets(const char *arg) { + /* TODO Wrong odr. Loosing memory */ + ODR odr = odr_createmem(ODR_ENCODE); int size = 0; if (!*arg) { @@ -2911,15 +2916,9 @@ static int cmd_facets(const char *arg) return 0; } size = strlen(arg); -/* - MOVE to non-usage of it? - if (only_z3950() && !yaz_matchstr(sru_method, "solr")) { - // We are not Z39.50 and not SOLR (I think) - printf("WARN: Currently supported for Z39.50 and SOLR.\n"); + if (is_SRW()) { + printf("WARN: No supported for SRW/SRU.\n"); } -º/ - /* TODO Wrong odr. Loosing memory */ - ODR odr = odr_createmem(ODR_ENCODE); facet_list = yaz_pqf_parse_facet_list(odr, arg); if (!facet_list) @@ -4319,6 +4318,9 @@ static void handle_srw_response(Z_SRW_searchRetrieveResponse *res) } if (res->numberOfRecords) printf("Number of hits: " ODR_INT_PRINTF "\n", *res->numberOfRecords); + if (res->facetList) { + display_facets(res->facetList); + } for (i = 0; inum_records; i++) handle_srw_record(res->records + i); }