X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=asn%2Fprt-acc.c;h=dfc024e195281748aaf6b2755aaad1ffdadfeac6;hb=1f6254e4d56700f2862a549a77daeb6c22d1f8d4;hp=93ca15272f00a14e0600805bc759542e84c82623;hpb=6edc916a5a8d44e1d7708f5018828e0d2020690b;p=yaz-moved-to-github.git diff --git a/asn/prt-acc.c b/asn/prt-acc.c index 93ca152..dfc024e 100644 --- a/asn/prt-acc.c +++ b/asn/prt-acc.c @@ -1,10 +1,25 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-acc.c,v $ - * Revision 1.1 1995-06-02 09:49:15 quinn + * Revision 1.6 1998-01-05 09:04:57 adam + * Fixed bugs in encoders/decoders - Not operator (!) missing. + * + * Revision 1.5 1995/09/29 17:11:53 quinn + * Smallish + * + * Revision 1.4 1995/09/27 15:02:41 quinn + * Modified function heads & prototypes. + * + * Revision 1.3 1995/08/15 11:59:41 quinn + * Updated External + * + * Revision 1.2 1995/06/05 10:52:05 quinn + * Fixed some negligences. + * + * Revision 1.1 1995/06/02 09:49:15 quinn * Adding access control * * @@ -48,6 +63,8 @@ int z_PromptId1(ODR o, Z_PromptId1 **p, int opt) if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) return 1; *p = 0; @@ -67,6 +84,8 @@ int z_PromptInfo1(ODR o, Z_PromptInfo1 **p, int opt) if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) return 1; *p = 0; @@ -89,6 +108,7 @@ int z_ChallengeUnit1(ODR o, Z_ChallengeUnit1 **p, int opt) &(*p)->num_values) || odr_ok(o)) && odr_implicit(o, odr_null, &(*p)->shouldSave, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_integer, &(*p)->dataType, ODR_CONTEXT, 8, 1) && + odr_implicit(o, z_External, &(*p)->diagnostic, ODR_CONTEXT, 9, 1) && odr_sequence_end(o); } @@ -96,6 +116,8 @@ int z_Challenge1(ODR o, Z_Challenge1 **p, int opt) { if (o->direction == ODR_ENCODE) *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; if (odr_sequence_of(o, z_ChallengeUnit1, &(*p)->list, &(*p)->num_challenges)) return 1; @@ -117,7 +139,7 @@ int z_ResponseUnit1(ODR o, Z_ResponseUnit1 **p, int opt) {-1, -1, -1, -1, 0} }; - if (odr_sequence_begin(o, p, sizeof(**p))) + if (!odr_sequence_begin(o, p, sizeof(**p))) return opt && odr_ok(o); return odr_explicit(o, z_PromptId1, &(*p)->promptId, ODR_CONTEXT, 1, 0) && @@ -131,6 +153,8 @@ int z_Response1(ODR o, Z_Response1 **p, int opt) { if (o->direction == ODR_ENCODE) *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; if (odr_sequence_of(o, z_ResponseUnit1, &(*p)->list, &(*p)->num_responses)) return 1; @@ -149,6 +173,8 @@ int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt) if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; if (odr_choice(o, arm, &(*p)->u, &(*p)->which)) return 1; *p = 0;