X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=2cf67925252bcd75c3bef6eaccbcbd861b097f38;hb=06395306e21cd9e9235e14483a88ba70c3325030;hp=6fa6a4a90a8f4650dd6e3f79d3e93d4ab8cb8803;hpb=76bd6780cebee47ffefa4170fa2daa1f079d9559;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 6fa6a4a..2cf6792 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.226 2004-01-15 10:16:26 adam Exp $ + * $Id: client.c,v 1.230 2004-02-14 15:58:42 adam Exp $ */ #include @@ -296,7 +296,7 @@ static void send_initRequest(const char* type_and_host) req->referenceId = set_refid (out); - if (yazProxy) + if (yazProxy && type_and_host) yaz_oi_set_string_oidval(&req->otherInfo, out, VAL_PROXY, 1, type_and_host); @@ -1208,6 +1208,9 @@ static int send_SRW_searchRequest(const char *arg) sr = yaz_srw_get(out, Z_SRW_searchRetrieve_request); sr->u.request->query_type = Z_SRW_query_type_cql; sr->u.request->query.cql = odr_strdup(out, arg); + + sr->u.request->maximumRecords = odr_intdup(out, 0); + if (record_schema) sr->u.request->recordSchema = record_schema; return send_srw(sr); @@ -2154,7 +2157,15 @@ static int cmd_explain(const char *arg) #endif return 0; } - + +static int cmd_init(const char *arg) +{ + if (!conn || protocol != PROTO_Z3950) + return 0; + send_initRequest(0); + return 2; +} + static int cmd_find(const char *arg) { if (!*arg) @@ -3304,10 +3315,13 @@ static void handle_srw_response(Z_SRW_searchRetrieveResponse *res) for (i = 0; inum_diagnostics; i++) { - printf ("SRW diagnostic %d %s\n", - *res->diagnostics[i].code, - yaz_diag_srw_str(*res->diagnostics[i].code)); - + if (res->diagnostics[i].uri) + printf ("SRW diagnostic %s\n", + res->diagnostics[i].uri); + else + printf ("SRW diagnostic missing or could not be decoded\n"); + if (res->diagnostics[i].message) + printf ("Message: %s\n", res->diagnostics[i].message); if (res->diagnostics[i].details) printf ("Details: %s\n", res->diagnostics[i].details); } @@ -3812,6 +3826,7 @@ static struct { {"options", cmd_options, "", NULL, 0, NULL}, {"zversion", cmd_zversion, "", NULL, 0, NULL}, {"help", cmd_help, "", NULL,0,NULL}, + {"init", cmd_init, "", NULL,0,NULL}, {0,0,0,0,0,0} };