X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;h=14aa73752a41608fe491f5ea42136b63aa46f65a;hp=86caf06d536f5ebcd184ebb39e3cce79df49b4a3;hb=2ba3d1d3bf2b57c7ac462b347cb18f06820ac73a;hpb=58e7306c9f23189e136c52b21e39692392824ea7 diff --git a/client/client.c b/client/client.c index 86caf06..14aa737 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: client.c,v 1.288 2005-06-21 07:33:09 adam Exp $ + * $Id: client.c,v 1.291 2005-06-24 19:56:52 adam Exp $ */ #include @@ -2313,23 +2313,40 @@ static int cmd_update_common(const char *arg, int version) static int cmd_xmles(const char *arg) { + int noread = 0; + char oid_str[51]; + int oid_value_xmles = VAL_XMLES; Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest); Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest; Z_External *ext = (Z_External *) odr_malloc(out, sizeof(*ext)); req->taskSpecificParameters = ext; - req->packageType = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV, - VAL_XMLES); - ext->direct_reference = req->packageType; ext->descriptor = 0; - ext->indirect_reference = 0; - ext->which = Z_External_octet; ext->u.single_ASN1_type = (Odr_oct *) odr_malloc (out, sizeof(Odr_oct)); + sscanf(arg, "%50s%n", oid_str, &noread); + if (noread == 0) + { + printf("Missing OID for xmles\n"); + return 0; + } + arg += noread; + oid_value_xmles = oid_getvalbyname(oid_str); + if (oid_value_xmles == VAL_NONE) + { + printf("Bad OID: %s\n", oid_str); + return 0; + } + if (parse_cmd_doc(&arg, out, (char **) &ext->u.single_ASN1_type->buf, &ext->u.single_ASN1_type->len, 0) == 0) return 0; + req->packageType = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV, + oid_value_xmles); + + ext->direct_reference = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV, + oid_value_xmles); send_apdu(apdu); return 2; @@ -4256,7 +4273,7 @@ static struct { {"itemorder", cmd_itemorder, "ill|item ",NULL,0,NULL}, {"update", cmd_update, " []",NULL,0,NULL}, {"update0", cmd_update0, " []",NULL,0,NULL}, - {"xmles", cmd_xmles, "",NULL,0,NULL}, + {"xmles", cmd_xmles, " ",NULL,0,NULL}, {"packagename", cmd_packagename, "",NULL,0,NULL}, {"proxy", cmd_proxy, "[('tcp'|'ssl')][':']",NULL,0,NULL}, {"charset", cmd_charset, " ",NULL,0,NULL}, @@ -4740,12 +4757,3 @@ int main(int argc, char **argv) client (); exit (0); } - -/* - * Local variables: - * tab-width: 8 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=8 fdm=marker - * vim<600: sw=4 ts=8 - */