X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=asn%2Fzget.c;h=72b67a1859f9ba31e52da91bd4dcefe435641077;hp=71477d0e6a2cbc81e0eea8eb837416abf69972e1;hb=c195f14eb2fd48882f7b19dcb1b2421b1d174900;hpb=a8cbf4e58821b5a7e64063f6a1b50c453494167f diff --git a/asn/zget.c b/asn/zget.c index 71477d0..72b67a1 100644 --- a/asn/zget.c +++ b/asn/zget.c @@ -4,14 +4,40 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zget.c,v $ - * Revision 1.1 1995-05-22 11:30:20 quinn + * Revision 1.10 1996-01-02 08:57:23 quinn + * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass + * + * 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 * Adding Z39.50-1992 stuff to proto.c. Adding zget.c * * */ #include -#include "../version.h" Z_InitRequest *zget_InitRequest(ODR o) { @@ -27,10 +53,13 @@ Z_InitRequest *zget_InitRequest(ODR o) r->maximumRecordSize = odr_malloc(o, sizeof(int)); *r->maximumRecordSize = 30*1024; r->idAuthentication = 0; - r->implementationId = "YAZ"; + 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; } @@ -47,10 +76,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; } @@ -74,6 +108,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; } @@ -93,6 +131,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; } @@ -106,8 +148,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; } @@ -123,6 +177,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; } @@ -135,6 +192,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; } @@ -151,6 +211,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; } @@ -167,6 +230,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; } @@ -183,6 +249,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; } @@ -195,6 +264,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; } @@ -209,6 +281,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; } @@ -220,6 +295,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; } @@ -230,6 +308,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; } @@ -241,10 +322,42 @@ 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_APDU *zget_APDU(ODR o, enum Z_APDU_which which) +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; +} + +Z_APDU *zget_APDU(ODR o, int which) { Z_APDU *r = odr_malloc(o, sizeof(*r)); @@ -280,6 +393,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);