Minor change to make C++ happy.
[yaz-moved-to-github.git] / include / prt-exd.h
index a25feb2..fa3c875 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1998, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
 
 #include <yconfig.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct Z_TaskPackage
 {
     Odr_oid *packageType;                 
@@ -94,16 +98,14 @@ typedef struct Z_IOCreditCardInfo
 
 typedef struct Z_IOBilling
 {
-    enum
-    {
-       Z_IOBilling_billInvoice,
-       Z_IOBilling_prepay,
-       Z_IOBilling_depositAccount,
-       Z_IOBilling_creditCard,
-       Z_IOBilling_cardInfoPreviouslySupplied,
-       Z_IOBilling_privateKnown,
-       Z_IOBilling_privateNotKnown
-    } which;
+    int which;
+#define Z_IOBilling_billInvoice 0
+#define Z_IOBilling_prepay 1
+#define Z_IOBilling_depositAccount 2
+#define Z_IOBilling_creditCard 3
+#define Z_IOBilling_cardInfoPreviouslySupplied 4
+#define Z_IOBilling_privateKnown 5
+#define Z_IOBilling_privateNotKnown 6
     union
     {
        Odr_null *noinfo;
@@ -135,11 +137,9 @@ typedef struct Z_IOTaskPackage
 
 typedef struct Z_ItemOrder
 {
-    enum
-    {
-       Z_ItemOrder_esRequest,
-       Z_ItemOrder_taskPackage
-    } which;
+    int which;
+#define Z_ItemOrder_esRequest 0
+#define Z_ItemOrder_taskPackage 1
     union
     {
        Z_IORequest *esRequest;
@@ -149,4 +149,120 @@ typedef struct Z_ItemOrder
 
 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
+#define Z_IUOriginPartToKeep_specialUpdate 5
+    char *databaseName;
+    Odr_oid *schema;               /* OPTIONAL */
+    char *elementSetName;          /* OPTIONAL */
+    Odr_external *actionQualifier; /* OPTIONAL */
+} Z_IUOriginPartToKeep;
+
+typedef struct Z_IUTaskPackageRecordStructure
+{
+    int which;
+#define Z_IUTaskPackageRecordStructure_record 1
+#define Z_IUTaskPackageRecordStructure_surrogateDiagnostics 2
+    union {
+        Odr_external *record;
+        Z_DiagRecs *surrogateDiagnostics;
+    } 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_DiagRecs *supplementalDiagnostics;  /* OPTIONAL */
+} 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;
+
+YAZ_EXPORT int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif