From: Sebastian Hammer Date: Thu, 15 Jun 1995 15:42:01 +0000 (+0000) Subject: Fixed some v3 bugs X-Git-Tag: YAZ.1.8~973 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=78f86cdd3cc8d44fb8c4329e408a3aa679bd8b9e;p=yaz-moved-to-github.git Fixed some v3 bugs --- diff --git a/asn/proto.c b/asn/proto.c index 45735b6..a69d49b 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.29 1995-06-15 07:44:49 quinn + * Revision 1.30 1995-06-15 15:42:01 quinn + * Fixed some v3 bugs + * + * Revision 1.29 1995/06/15 07:44:49 quinn * Moving to v3. * * Revision 1.28 1995/06/14 15:26:35 quinn @@ -780,6 +783,20 @@ int z_DiagRec(ODR o, Z_DiagRec **p, int opt) #endif +int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt) +{ + if (o->direction == ODR_DECODE) + *p = odr_malloc(o, sizeof(**p)); + else if (!*p) + return opt; + + if (odr_sequence_of(o, z_DiagRec, &(*p)->diagRecs, + &(*p)->num_diagRecs)) + return 1; + *p = 0; + return 0; +} + int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt) { static Odr_arm arm[] = @@ -817,10 +834,12 @@ int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt) int z_Records(ODR o, Z_Records **p, int opt) { - Odr_arm arm[] = + static Odr_arm arm[] = { {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD, z_NamePlusRecordList}, {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, z_DiagRec}, + {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD, + z_DiagRecs}, {-1, -1, -1, -1, 0} }; @@ -1012,20 +1031,6 @@ int z_Entries(ODR o, Z_Entries **p, int opt) return 0; } -int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt) -{ - if (o->direction == ODR_DECODE) - *p = odr_malloc(o, sizeof(**p)); - else if (!*p) - return opt; - - if (odr_sequence_of(o, z_DiagRec, &(*p)->diagRecs, - &(*p)->num_diagRecs)) - return 1; - *p = 0; - return 0; -} - int z_ListEntries(ODR o, Z_ListEntries **p, int opt) { static Odr_arm arm[] = diff --git a/include/proto.h b/include/proto.h index 3d05a57..95e2277 100644 --- a/include/proto.h +++ b/include/proto.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.16 1995-06-15 07:45:06 quinn + * Revision 1.17 1995-06-15 15:42:05 quinn + * Fixed some v3 bugs + * + * Revision 1.16 1995/06/15 07:45:06 quinn * Moving to v3. * * Revision 1.15 1995/06/14 15:26:43 quinn @@ -549,11 +552,11 @@ typedef struct Z_DiagRec #endif -typedef struct Z_DiagRecList +typedef struct Z_DiagRecs { - int num; - Z_DiagRec **list; -} Z_DiagRecList; + int num_diagRecs; + Z_DiagRec **diagRecs; +} Z_DiagRecs; typedef struct Z_NamePlusRecord { @@ -561,15 +564,13 @@ typedef struct Z_NamePlusRecord enum { Z_NamePlusRecord_databaseRecord, - Z_NamePlusRecord_surrogateDiagnostic, - Z_NamePlusRecord_multipleNonSurDiagnostics + Z_NamePlusRecord_surrogateDiagnostic } which; union { Z_DatabaseRecord *databaseRecord; Z_DiagRec *surrogateDiagnostic; - Z_DiagRecList *multipleNonSurDiagnostics; } u; } Z_NamePlusRecord; @@ -591,7 +592,7 @@ typedef struct Z_Records { Z_NamePlusRecordList *databaseOrSurDiagnostics; Z_DiagRec *nonSurrogateDiagnostic; - Z_DiagRecList *multipleNonSurDiagnostics; + Z_DiagRecs *multipleNonSurDiagnostics; } u; } Z_Records; @@ -858,12 +859,6 @@ typedef struct Z_Entries Z_Entry **entries; } Z_Entries; -typedef struct Z_DiagRecs -{ - int num_diagRecs; - Z_DiagRec **diagRecs; -} Z_DiagRecs; - typedef struct Z_ListEntries { enum