+#ifdef Z_95
+
+int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt)
+{
+ static Odr_arm arm[] =
+ {
+ {-1, -1, -1, Z_DiagForm_v2AddInfo, odr_visiblestring},
+ {-1, -1, -1, Z_DiagForm_v3AddInfo, z_InternationalString},
+ {ODR_IMPLICIT, ODR_CONTEXT, ODR_VISIBLESTRING, Z_DiagForm_v2AddInfo,
+ odr_visiblestring}, /* to match some weird server.. */
+ {-1, -1, -1, -1, 0}
+ };
+ if (!odr_sequence_begin(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ return
+ odr_oid(o, &(*p)->diagnosticSetId, 1) && /* SHOULD NOT BE OPT! */
+ odr_integer(o, &(*p)->condition, 0) &&
+ /*
+ * I no longer recall what server tagged the addinfo.. but it isn't
+ * hurting anyone, so...
+ * We need to turn it into a choice, or something, because of
+ * that damn generalstring in v3.
+ */
+ odr_choice(o, arm, &(*p)->addinfo, &(*p)->which) &&
+ odr_sequence_end(o);
+}
+
+int z_DiagRec(ODR o, Z_DiagRec **p, int opt)
+{
+ static Odr_arm arm[] =
+ {
+ {-1, -1, -1, Z_DiagRec_defaultFormat, z_DefaultDiagFormat},
+ {-1, -1, -1, Z_DiagRec_externallyDefined, odr_external},
+ {-1, -1, -1, -1, 0}
+ };
+
+ 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;
+ return opt && odr_ok(o);
+}
+
+#else
+