2 * Copyright (c) 1995, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.5 1995-09-27 15:02:42 quinn
8 * Modified function heads & prototypes.
10 * Revision 1.4 1995/08/29 11:17:16 quinn
11 * *** empty log message ***
13 * Revision 1.3 1995/08/21 09:10:18 quinn
14 * Smallish fixes to suppport new formats.
16 * Revision 1.2 1995/08/17 12:45:00 quinn
17 * Fixed minor problems with GRS-1. Added support in c&s.
19 * Revision 1.1 1995/08/15 13:37:41 quinn
27 int MDF z_External(ODR o, Z_External **p, int opt)
31 static Odr_arm arm[] =
33 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_single, odr_any},
34 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_External_octet, odr_octetstring},
35 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_External_arbitrary, odr_bitstring},
37 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_sutrs, z_SUTRS},
38 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_explainRecord,
40 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport1,
42 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_resourceReport2,
44 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_promptObject1,
46 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_grs1, z_GenericRecord},
47 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_extendedService,
49 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_itemOrder, z_ItemOrder},
50 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_diag1, z_DiagnosticFormat},
54 * The table below should be moved to the ODR structure itself and
55 * be an image of the association context: To help
56 * map indirect references when they show up.
61 int what; /* discriminator value for the external CHOICE */
64 {VAL_SUTRS, Z_External_sutrs},
65 {VAL_EXPLAIN, Z_External_explainRecord},
66 {VAL_RESOURCE1, Z_External_resourceReport1},
67 {VAL_RESOURCE2, Z_External_resourceReport2},
68 {VAL_PROMPT1, Z_External_promptObject1},
69 {VAL_GRS1, Z_External_grs1},
70 {VAL_EXTENDED, Z_External_extendedService},
71 {VAL_ITEMORDER, Z_External_itemOrder},
72 {VAL_DIAG1, Z_External_diag1},
76 odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL);
77 if (!odr_sequence_begin(o, p, sizeof(**p)))
78 return opt && odr_ok(o);
79 if (!(odr_oid(o, &(*p)->direct_reference, 1) &&
80 odr_integer(o, &(*p)->indirect_reference, 1) &&
81 odr_graphicstring(o, &(*p)->descriptor, 1)))
84 * Do we know this beast?
86 if (o->direction == ODR_DECODE && (*p)->direct_reference &&
87 (oid = oid_getentbyoid((*p)->direct_reference)))
91 for (i = 0; tab[i].dref != VAL_NONE; i++)
92 if (oid->value == tab[i].dref)
94 odr_choice_bias(o, tab[i].what);
99 odr_choice(o, arm, &(*p)->u, &(*p)->which) &&