X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=cd973bd3b6a62eaf9bfe3c2bae551ca1116ed69d;hb=4ca818ec201c9dcf5461e419002c95fd2eac620e;hp=639fecae4474bdc4f6765c89d4c44ecdb5fe5b7c;hpb=4d531a1a9131d69c3b6c27fbac42837e22cff61c;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 639feca..cd973bd 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.178 2003-01-06 08:20:26 adam Exp $ + * $Id: client.c,v 1.182 2003-02-17 21:23:31 adam Exp $ */ #include @@ -966,7 +966,7 @@ static int send_searchRequest(char *arg) break; case QueryType_CQL: query.which = Z_Query_type_104; - ext = odr_malloc(out, sizeof(*ext)); + ext = (Z_External *) odr_malloc(out, sizeof(*ext)); ext->direct_reference = odr_getoidbystr(out, "1.2.840.10003.16.2"); ext->indirect_reference = 0; ext->descriptor = 0; @@ -1788,13 +1788,14 @@ static int send_presentRequest(char *arg) compo.u.complex->generic = (Z_Specification *) odr_malloc(out, sizeof(*compo.u.complex->generic)); - compo.u.complex->generic->schema = (Odr_oid *) + compo.u.complex->generic->which = Z_Schema_oid; + compo.u.complex->generic->schema.oid = (Odr_oid *) odr_oiddup(out, oid_ent_to_oid(&prefschema, oid)); - if (!compo.u.complex->generic->schema) + if (!compo.u.complex->generic->schema.oid) { /* OID wasn't a schema! Try record syntax instead. */ prefschema.oclass = CLASS_RECSYN; - compo.u.complex->generic->schema = (Odr_oid *) + compo.u.complex->generic->schema.oid = (Odr_oid *) odr_oiddup(out, oid_ent_to_oid(&prefschema, oid)); } if (!elementSetNames) @@ -2181,17 +2182,19 @@ int cmd_schema(char *arg) int cmd_format(char *arg) { + oid_value nsyntax; if (!arg || !*arg) { printf("Usage: format \n"); return 0; } - recordsyntax = oid_getvalbyname (arg); - if (recordsyntax == VAL_NONE) + nsyntax = oid_getvalbyname (arg); + if (strcmp(arg, "none") && nsyntax == VAL_NONE) { printf ("unknown record syntax\n"); return 0; } + recordsyntax = nsyntax; return 1; }