00001
00007 #include <yaz/zes-exps.h>
00008
00009 int z_ESExportSpecificationEsRequest (ODR o, Z_ESExportSpecificationEsRequest **p, int opt, const char *name)
00010 {
00011 if (!odr_sequence_begin (o, p, sizeof(**p), name))
00012 return odr_missing(o, opt, name) && odr_ok (o);
00013 return
00014 odr_explicit_tag (o, z_ESOriginPartToKeep,
00015 &(*p)->toKeep, ODR_CONTEXT, 1, 0, "toKeep") &&
00016 odr_implicit_tag (o, odr_null,
00017 &(*p)->notToKeep, ODR_CONTEXT, 2, 0, "notToKeep") &&
00018 odr_sequence_end (o);
00019 }
00020
00021 int z_ESExportSpecificationTaskPackage (ODR o, Z_ESExportSpecificationTaskPackage **p, int opt, const char *name)
00022 {
00023 if (!odr_sequence_begin (o, p, sizeof(**p), name))
00024 return odr_missing(o, opt, name) && odr_ok (o);
00025 return
00026 odr_explicit_tag (o, z_ESOriginPartToKeep,
00027 &(*p)->originPart, ODR_CONTEXT, 1, 0, "originPart") &&
00028 odr_implicit_tag (o, odr_null,
00029 &(*p)->targetPart, ODR_CONTEXT, 2, 0, "targetPart") &&
00030 odr_sequence_end (o);
00031 }
00032
00033 int z_ESExportSpecification (ODR o, Z_ESExportSpecification **p, int opt, const char *name)
00034 {
00035 static Odr_arm arm[] = {
00036 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ESExportSpecification_esRequest,
00037 (Odr_fun) z_ESExportSpecificationEsRequest, "esRequest"},
00038 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ESExportSpecification_taskPackage,
00039 (Odr_fun) z_ESExportSpecificationTaskPackage, "taskPackage"},
00040 {-1, -1, -1, -1, (Odr_fun) 0, 0}
00041 };
00042 if (!odr_initmember(o, p, sizeof(**p)))
00043 return odr_missing(o, opt, name);
00044 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
00045 return 1;
00046 if(o->direction == ODR_DECODE)
00047 *p = 0;
00048 return odr_missing(o, opt, name);
00049 }
00050
00051 int z_ESOriginPartToKeep (ODR o, Z_ESOriginPartToKeep **p, int opt, const char *name)
00052 {
00053 if (!odr_sequence_begin (o, p, sizeof(**p), name))
00054 return odr_missing(o, opt, name) && odr_ok (o);
00055 return
00056 odr_implicit_tag (o, z_CompSpec,
00057 &(*p)->composition, ODR_CONTEXT, 1, 0, "composition") &&
00058 odr_explicit_tag (o, z_ESDestination,
00059 &(*p)->exportDestination, ODR_CONTEXT, 2, 0, "exportDestination") &&
00060 odr_sequence_end (o);
00061 }
00062
00063 int z_ESDestinationOther (ODR o, Z_ESDestinationOther **p, int opt, const char *name)
00064 {
00065 if (!odr_sequence_begin (o, p, sizeof(**p), name))
00066 return odr_missing(o, opt, name) && odr_ok (o);
00067 return
00068 odr_implicit_tag (o, z_InternationalString,
00069 &(*p)->vehicle, ODR_CONTEXT, 1, 1, "vehicle") &&
00070 odr_implicit_tag (o, z_InternationalString,
00071 &(*p)->destination, ODR_CONTEXT, 2, 0, "destination") &&
00072 odr_sequence_end (o);
00073 }
00074
00075 int z_ESDestination (ODR o, Z_ESDestination **p, int opt, const char *name)
00076 {
00077 static Odr_arm arm[] = {
00078 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ESDestination_phoneNumber,
00079 (Odr_fun) z_InternationalString, "phoneNumber"},
00080 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ESDestination_faxNumber,
00081 (Odr_fun) z_InternationalString, "faxNumber"},
00082 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_ESDestination_x400address,
00083 (Odr_fun) z_InternationalString, "x400address"},
00084 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_ESDestination_emailAddress,
00085 (Odr_fun) z_InternationalString, "emailAddress"},
00086 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_ESDestination_pagerNumber,
00087 (Odr_fun) z_InternationalString, "pagerNumber"},
00088 {ODR_IMPLICIT, ODR_CONTEXT, 6, Z_ESDestination_ftpAddress,
00089 (Odr_fun) z_InternationalString, "ftpAddress"},
00090 {ODR_IMPLICIT, ODR_CONTEXT, 7, Z_ESDestination_ftamAddress,
00091 (Odr_fun) z_InternationalString, "ftamAddress"},
00092 {ODR_IMPLICIT, ODR_CONTEXT, 8, Z_ESDestination_printerAddress,
00093 (Odr_fun) z_InternationalString, "printerAddress"},
00094 {ODR_IMPLICIT, ODR_CONTEXT, 100, Z_ESDestination_other,
00095 (Odr_fun) z_ESDestinationOther, "other"},
00096 {-1, -1, -1, -1, (Odr_fun) 0, 0}
00097 };
00098 if (!odr_initmember(o, p, sizeof(**p)))
00099 return odr_missing(o, opt, name);
00100 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
00101 return 1;
00102 if(o->direction == ODR_DECODE)
00103 *p = 0;
00104 return odr_missing(o, opt, name);
00105 }