* Sebastian Hammer, Adam Dickmeiss
*
* $Log: prt-exd.c,v $
- * Revision 1.3 1995-09-29 17:11:54 quinn
+ * Revision 1.4 1996-10-10 12:35:12 quinn
+ * Added Update extended service.
+ *
+ * Revision 1.3 1995/09/29 17:11:54 quinn
* Smallish
*
* Revision 1.2 1995/09/27 15:02:41 quinn
*p = 0;
return opt && odr_ok(o);
}
+
+/* ----------------------- ITEM UPDATE -------------------- */
+
+int z_IUSuppliedRecordsId (ODR o, Z_IUSuppliedRecordsId **p, int opt)
+{
+ static Odr_arm arm[] = {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecordsId_timeStamp,
+ odr_generalizedtime},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecordsId_versionNumber,
+ z_InternationalString},
+ {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecordsId_previousVersion,
+ odr_external},
+ {-1, -1, -1, -1, 0}
+ };
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_IUCorrelationInfo (ODR o, Z_IUCorrelationInfo **p, int opt)
+{
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ odr_implicit (o, z_InternationalString,
+ &(*p)->note, ODR_CONTEXT, 1, 1) &&
+ odr_implicit (o, odr_integer,
+ &(*p)->id, ODR_CONTEXT, 2, 1) &&
+ odr_sequence_end (o);
+}
+
+int z_IUSuppliedRecords_elem (ODR o, Z_IUSuppliedRecords_elem **p, int opt)
+{
+ static Odr_arm arm[] = {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUSuppliedRecords_number,
+ odr_integer},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUSuppliedRecords_string,
+ z_InternationalString},
+ {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_IUSuppliedRecords_opaque,
+ odr_octetstring},
+ {-1, -1, -1, -1, 0}
+ };
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) &&
+ odr_choice (o, arm, &(*p)->u, &(*p)->which) &&
+ odr_constructed_end (o)) || odr_ok(o)) &&
+ odr_explicit (o, z_IUSuppliedRecordsId,
+ &(*p)->supplementalId, ODR_CONTEXT, 2, 1) &&
+ odr_implicit (o, z_IUCorrelationInfo,
+ &(*p)->correlationInfo, ODR_CONTEXT, 3, 1) &&
+ odr_implicit (o, odr_external,
+ &(*p)->record, ODR_CONTEXT, 4, 0) &&
+ odr_sequence_end (o);
+}
+
+int z_IUSuppliedRecords (ODR o, Z_IUSuppliedRecords **p, int opt)
+{
+ if (odr_initmember (o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_sequence_of (o, z_IUSuppliedRecords_elem, &(*p)->elements,
+ &(*p)->num))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
+
+int z_IUTaskPackageRecordStructure (ODR o, Z_IUTaskPackageRecordStructure **p,
+ int opt)
+{
+ static Odr_arm arm[] = {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUTaskPackageRecordStructure_record,
+ odr_external},
+ {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_IUTaskPackageRecordStructure_diagnostic,
+ z_DiagRec},
+ {-1, -1, -1, -1, 0}
+ };
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ ((odr_constructed_begin (o, &(*p)->u, ODR_CONTEXT, 1) &&
+ odr_choice (o, arm, &(*p)->u, &(*p)->which) &&
+ odr_constructed_end (o)) || odr_ok(o)) &&
+ odr_implicit (o, z_IUCorrelationInfo,
+ &(*p)->correlationInfo, ODR_CONTEXT, 2, 1) &&
+ odr_implicit (o, odr_integer,
+ &(*p)->recordStatus, ODR_CONTEXT, 3, 0) &&
+ odr_sequence_end (o);
+}
+
+int z_IUOriginPartToKeep (ODR o, Z_IUOriginPartToKeep **p, int opt)
+{
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ odr_implicit (o, odr_integer,
+ &(*p)->action, ODR_CONTEXT, 1, 0) &&
+ odr_implicit (o, z_InternationalString,
+ &(*p)->databaseName, ODR_CONTEXT, 2, 0) &&
+ odr_implicit (o, odr_oid,
+ &(*p)->schema, ODR_CONTEXT, 3, 1) &&
+ odr_implicit (o, z_InternationalString,
+ &(*p)->elementSetName, ODR_CONTEXT, 4, 1) &&
+ odr_sequence_end (o);
+}
+
+int z_IUTargetPart (ODR o, Z_IUTargetPart **p, int opt)
+{
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ odr_implicit (o, odr_integer,
+ &(*p)->updateStatus, ODR_CONTEXT, 1, 0) &&
+ odr_implicit_settag (o, ODR_CONTEXT, 2) &&
+ (odr_sequence_of(o, z_DiagRec, &(*p)->globalDiagnostics,
+ &(*p)->num_globalDiagnostics) || odr_ok(o)) &&
+ odr_implicit_settag (o, ODR_CONTEXT, 3) &&
+ odr_sequence_of(o, z_IUTaskPackageRecordStructure, &(*p)->taskPackageRecords,
+ &(*p)->num_taskPackageRecords) &&
+ odr_sequence_end (o);
+}
+
+int z_IUUpdateEsRequest (ODR o, Z_IUUpdateEsRequest **p, int opt)
+{
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ odr_explicit (o, z_IUOriginPartToKeep,
+ &(*p)->toKeep, ODR_CONTEXT, 1, 0) &&
+ odr_explicit (o, z_IUSuppliedRecords,
+ &(*p)->notToKeep, ODR_CONTEXT, 2, 0) &&
+ odr_sequence_end (o);
+}
+
+int z_IUUpdateTaskPackage (ODR o, Z_IUUpdateTaskPackage **p, int opt)
+{
+ if (!odr_sequence_begin (o, p, sizeof(**p)))
+ return opt && odr_ok (o);
+ return
+ odr_explicit (o, z_IUOriginPartToKeep,
+ &(*p)->originPart, ODR_CONTEXT, 1, 0) &&
+ odr_explicit (o, z_IUTargetPart,
+ &(*p)->targetPart, ODR_CONTEXT, 2, 0) &&
+ odr_sequence_end (o);
+}
+
+int z_IUUpdate (ODR o, Z_IUUpdate **p, int opt)
+{
+ static Odr_arm arm[] = {
+ {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_IUUpdate_esRequest,
+ z_IUUpdateEsRequest},
+ {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_IUUpdate_taskPackage,
+ z_IUUpdateTaskPackage},
+ {-1, -1, -1, -1, 0}
+ };
+ if (!odr_initmember(o, p, sizeof(**p)))
+ return opt && odr_ok(o);
+ if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
+ return 1;
+ *p = 0;
+ return opt && odr_ok(o);
+}
int z_ItemOrder(ODR o, Z_ItemOrder **p, int opt);
+/* ----------------------- ITEM UPDATE ------------------------ */
+
+typedef struct Z_IUSuppliedRecordsId
+{
+ int which;
+#define Z_IUSuppliedRecordsId_timeStamp 1
+#define Z_IUSuppliedRecordsId_versionNumber 2
+#define Z_IUSuppliedRecordsId_previousVersion 3
+ union {
+ char *timeStamp;
+ char *versionNumber;
+ Odr_external *previousVersion;
+ } u;
+} Z_IUSuppliedRecordsId;
+
+typedef struct Z_IUCorrelationInfo
+{
+ char *note; /* OPTIONAL */
+ int *id; /* OPTIONAL */
+} Z_IUCorrelationInfo;
+
+typedef struct Z_IUSuppliedRecords_elem
+{
+ int which;
+#define Z_IUSuppliedRecords_number 1
+#define Z_IUSuppliedRecords_string 2
+#define Z_IUSuppliedRecords_opaque 3
+ union {
+ int *number;
+ char *string;
+ Odr_oct *opaque;
+ } u; /* OPTIONAL */
+ Z_IUSuppliedRecordsId *supplementalId; /* OPTIONAL */
+ Z_IUCorrelationInfo *correlationInfo; /* OPTIONAL */
+ Odr_external *record;
+} Z_IUSuppliedRecords_elem;
+
+typedef struct Z_IUSuppliedRecords
+{
+ int num;
+ Z_IUSuppliedRecords_elem **elements;
+} Z_IUSuppliedRecords;
+
+typedef struct Z_IUOriginPartToKeep
+{
+ int *action;
+#define Z_IUOriginPartToKeep_recordInsert 1
+#define Z_IUOriginPartToKeep_recordReplace 2
+#define Z_IUOriginPartToKeep_recordDelete 3
+#define Z_IUOriginPartToKeep_elementUpdate 4
+ char *databaseName;
+ Odr_oid *schema; /* OPTIONAL */
+ char *elementSetName; /* OPTIONAL */
+} Z_IUOriginPartToKeep;
+
+typedef struct Z_IUTaskPackageRecordStructure
+{
+ int which;
+#define Z_IUTaskPackageRecordStructure_record 1
+#define Z_IUTaskPackageRecordStructure_diagnostic 2
+ union {
+ Odr_external *record;
+ Z_DiagRec *diagnostic;
+ } u; /* OPTIONAL */
+ Z_IUCorrelationInfo *correlationInfo; /* OPTIONAL */
+ int *recordStatus;
+#define Z_IUTaskPackageRecordStructureS_success 1
+#define Z_IUTaskPackageRecordStructureS_queued 2
+#define Z_IUTaskPackageRecordStructureS_inProcess 3
+#define Z_IUTaskPackageRecordStructureS_failure 4
+} Z_IUTaskPackageRecordStructure;
+
+typedef struct Z_IUTargetPart
+{
+ int *updateStatus;
+#define Z_IUTargetPart_success 1
+#define Z_IUTargetPart_partial 2
+#define Z_IUTargetPart_failure 3
+ int num_globalDiagnostics;
+ Z_DiagRec **globalDiagnostics; /* OPTIONAL */
+ int num_taskPackageRecords;
+ Z_IUTaskPackageRecordStructure **taskPackageRecords;
+} Z_IUTargetPart;
+
+typedef struct Z_IUUpdateEsRequest
+{
+ Z_IUOriginPartToKeep *toKeep;
+ Z_IUSuppliedRecords *notToKeep;
+} Z_IUUpdateEsRequest;
+
+typedef struct Z_IUUpdateTaskPackage
+{
+ Z_IUOriginPartToKeep *originPart;
+ Z_IUTargetPart *targetPart;
+} Z_IUUpdateTaskPackage;
+
+typedef struct Z_IUUpdate
+{
+ int which;
+#define Z_IUUpdate_esRequest 1
+#define Z_IUUpdate_taskPackage 2
+ union {
+ Z_IUUpdateEsRequest *esRequest;
+ Z_IUUpdateTaskPackage *taskPackage;
+ } u;
+} Z_IUUpdate;
+
+int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt);
+
#endif