X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_espec.c;h=83fe26fdf8801ac936e00213e2cff6a4c21c8d45;hb=14136ccc562d5d894fb2ba59304ae64d3516f518;hp=3fdbca67b880f620ec0d64323456f80b9c4557d7;hpb=22539de88437f4812d17f8ab1d71db52f1da4c0e;p=yaz-moved-to-github.git diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index 3fdbca6..83fe26f 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_espec.c,v $ - * Revision 1.4 1995-12-05 11:16:10 quinn + * Revision 1.7 1997-05-14 06:54:02 adam + * C++ support. + * + * Revision 1.6 1996/07/06 19:58:34 quinn + * System headerfiles gathered in yconfig + * + * Revision 1.5 1996/01/02 08:57:44 quinn + * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass + * + * Revision 1.4 1995/12/05 11:16:10 quinn * Fixed malloc of 0. * * Revision 1.3 1995/11/13 09:27:34 quinn @@ -39,7 +48,7 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) int i; var1.proto = PROTO_Z3950; - var1.class = CLASS_VARSET; + var1.oclass = CLASS_VARSET; var1.value = VAL_VAR1; r->globalVariantSetId = odr_oiddup(o, oid_getoidbyent(&var1)); @@ -50,11 +59,11 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) r->num_triples = argc; for (i = 0; i < argc; i++) { - int class, type; + int zclass, type; char value[512]; Z_Triple *t; - if (sscanf(argv[i], "(%d,%d,%[^)])", &class, &type, value) < 3) + if (sscanf(argv[i], "(%d,%d,%[^)])", &zclass, &type, value) < 3) { logf(LOG_WARN, "Syntax error in variant component '%s'", argv[i]); @@ -62,8 +71,8 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) } t = r->triples[i] = odr_malloc(o, sizeof(Z_Triple)); t->variantSetId = 0; - t->class = odr_malloc(o, sizeof(int)); - *t->class = class; + t->zclass = odr_malloc(o, sizeof(int)); + *t->zclass = zclass; t->type = odr_malloc(o, sizeof(int)); *t->type = type; /* @@ -75,6 +84,12 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) t->which = Z_Triple_null; t->value.null = ODR_NULLVAL; } + else if (isdigit(*value)) + { + t->which = Z_Triple_integer; + t->value.integer = odr_malloc(o, sizeof(*t->value.integer)); + *t->value.integer = atoi(value); + } else { t->which = Z_Triple_internationalString;