Smallish
[yaz-moved-to-github.git] / asn / zget.c
index 63c4b95..aeed16d 100644 (file)
@@ -4,7 +4,28 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: zget.c,v $
- * Revision 1.2  1995-05-30 10:15:49  quinn
+ * Revision 1.9  1995-09-29 17:11:55  quinn
+ * Smallish
+ *
+ * Revision 1.8  1995/09/27  15:02:43  quinn
+ * Modified function heads & prototypes.
+ *
+ * Revision 1.7  1995/06/15  07:44:52  quinn
+ * Moving to v3.
+ *
+ * Revision 1.6  1995/06/14  15:26:37  quinn
+ * *** empty log message ***
+ *
+ * Revision 1.5  1995/06/07  14:42:30  quinn
+ * Fixed CLOSE
+ *
+ * Revision 1.4  1995/06/07  14:36:25  quinn
+ * Added CLOSE
+ *
+ * Revision 1.3  1995/06/05  10:52:06  quinn
+ * Fixed some negligences.
+ *
+ * Revision 1.2  1995/05/30  10:15:49  quinn
  * Added our implementor's ID
  *
  * Revision 1.1  1995/05/22  11:30:20  quinn
@@ -14,7 +35,6 @@
  */
 
 #include <proto.h>
-#include "../version.h"
 
 Z_InitRequest *zget_InitRequest(ODR o)
 {
@@ -34,6 +54,9 @@ Z_InitRequest *zget_InitRequest(ODR o)
     r->implementationName = "Index Data/YAZ";
     r->implementationVersion = YAZ_VERSION;
     r->userInformationField = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -50,10 +73,15 @@ Z_InitResponse *zget_InitResponse(ODR o)
     *r->preferredMessageSize = 30*1024;
     r->maximumRecordSize = odr_malloc(o, sizeof(int));
     *r->maximumRecordSize = 30*1024;
-    r->implementationId = "YAZ";
-    r->implementationName = "Index Data YAZ Z39.50/SR implementation";
+    r->result = odr_malloc(o, sizeof(bool_t));
+    *r->result = 1;
+    r->implementationId = "YAZ (id=81)";
+    r->implementationName = "Index Data/YAZ";
     r->implementationVersion = YAZ_VERSION;
     r->userInformationField = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -77,6 +105,10 @@ Z_SearchRequest *zget_SearchRequest(ODR o)
     r->mediumSetElementSetNames = 0;
     r->preferredRecordSyntax = 0;
     r->query = 0;
+#ifdef Z_95
+    r->additionalSearchInfo = 0;
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -96,6 +128,10 @@ Z_SearchResponse *zget_SearchResponse(ODR o)
     r->resultSetStatus = 0;
     r->presentStatus = 0;
     r->records = 0;
+#ifdef Z_95
+    r->additionalSearchInfo = 0;
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -109,8 +145,20 @@ Z_PresentRequest *zget_PresentRequest(ODR o)
     *r->resultSetStartPoint = 1;
     r->numberOfRecordsRequested = odr_malloc(o, sizeof(int));
     *r->numberOfRecordsRequested = 10;
+#ifdef Z_95
+    r->num_ranges = 0;
+    r->additionalRanges = 0;
+    r->recordComposition = 0;
+#else
     r->elementSetNames = 0;
+#endif
     r->preferredRecordSyntax = 0;
+#ifdef Z_95
+    r->maxSegmentCount = 0;
+    r->maxRecordSize = 0;
+    r->maxSegmentSize = 0;
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -126,6 +174,9 @@ Z_PresentResponse *zget_PresentResponse(ODR o)
     r->presentStatus = odr_malloc(o, sizeof(int));
     *r->presentStatus = Z_PRES_SUCCESS;
     r->records = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -138,6 +189,9 @@ Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o)
     *r->deleteFunction = Z_DeleteRequest_list;
     r->num_ids = 0;
     r->resultSetList = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -154,6 +208,9 @@ Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o)
     r->num_bulkStatuses = 0;
     r->bulkStatuses = 0;
     r->deleteMessage = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -170,6 +227,9 @@ Z_ScanRequest *zget_ScanRequest(ODR o)
     r->numberOfTermsRequested = odr_malloc(o, sizeof(int));
     *r->numberOfTermsRequested = 20;
     r->preferredPositionInResponse = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -186,6 +246,9 @@ Z_ScanResponse *zget_ScanResponse(ODR o)
     r->positionOfTerm =0;
     r->entries = 0;
     r->attributeSet = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -198,6 +261,9 @@ Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o)
     *r->requestedAction = Z_TriggerResourceCtrl_resourceReport;
     r->prefResourceReportFormat = 0;
     r->resultSetWanted = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -212,6 +278,9 @@ Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o)
     r->responseRequired = odr_malloc(o, sizeof(bool_t));
     *r->responseRequired = 0;
     r->triggeredRequestFlag = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -223,6 +292,9 @@ Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o)
     r->continueFlag = odr_malloc(o, sizeof(bool_t));
     *r->continueFlag = 1;
     r->resultSetWanted = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -233,6 +305,9 @@ Z_AccessControlRequest *zget_AccessControlRequest(ODR o)
     r->referenceId = 0;
     r->which = Z_AccessRequest_simpleForm;
     r->u.simpleForm = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -244,6 +319,38 @@ Z_AccessControlResponse *zget_AccessControlResponse(ODR o)
     r->which = Z_AccessResponse_simpleForm;
     r->u.simpleForm = 0;
     r->diagnostic = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
+    return r;
+}
+
+Z_Segment *zget_Segment(ODR o)
+{
+    Z_Segment *r = odr_malloc(o, sizeof(*r));
+
+    r->referenceId = 0;
+    r->numberOfRecordsReturned = odr_malloc(o, sizeof(int));
+    *r->numberOfRecordsReturned = 0;
+    r->num_segmentRecords = 0;
+    r->segmentRecords = 0;
+    r->otherInfo = 0;
+    return r;
+}
+
+Z_Close *zget_Close(ODR o)
+{
+    Z_Close *r = odr_malloc(o, sizeof(*r));
+
+    r->referenceId = 0;
+    r->closeReason = odr_malloc(o, sizeof(int));
+    *r->closeReason = Z_Close_finished;
+    r->diagnosticInformation = 0;
+    r->resourceReportFormat = 0;
+    r->resourceReport = 0;
+#ifdef Z_95
+    r->otherInfo = 0;
+#endif
     return r;
 }
 
@@ -283,6 +390,12 @@ Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which)
        case Z_APDU_resourceControlResponse:
            r->u.resourceControlResponse = zget_ResourceControlResponse(o);
            break;
+       case Z_APDU_segmentRequest:
+           r->u.segmentRequest = zget_Segment(o);
+           break;
+       case Z_APDU_close:
+           r->u.close = zget_Close(o);
+           break;
        default:
            fprintf(stderr, "Bad APDU-type to zget_APDU");
            exit(1);