X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fproto.h;h=901ec32d9cd756e07271258c2d444280c2e32da5;hp=a90a17560d84b239b668748e3db7c1c694251112;hb=91481d554b60c13c6c163d20b7bd71c24af562aa;hpb=cb914e4afd1e815bf47604efdfa964cee69557fa diff --git a/include/proto.h b/include/proto.h index a90a175..901ec32 100644 --- a/include/proto.h +++ b/include/proto.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1999, 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, @@ -24,7 +24,53 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.33 1996-02-23 10:00:51 quinn + * Revision 1.47 1999-04-20 09:56:48 adam + * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun). + * Modified all encoders/decoders to reflect this change. + * + * Revision 1.46 1998/10/20 13:55:44 quinn + * Fixed Scan bug in asn and client + * + * Revision 1.45 1998/08/19 16:10:07 adam + * Changed som member names of DeleteResultSetRequest/Response. + * + * Revision 1.44 1998/05/18 10:14:08 adam + * Minor change - removed 'dead' definitions. + * + * Revision 1.43 1998/03/31 11:07:45 adam + * Furhter work on UNIverse resource report. + * Added Extended Services handling in frontend server. + * + * Revision 1.42 1998/03/20 14:46:06 adam + * Added UNIverse Resource Reports. + * + * Revision 1.41 1998/02/10 15:31:52 adam + * Implemented date and time structure. Changed the Update Extended + * Service. + * + * Revision 1.40 1997/09/01 08:49:50 adam + * New windows NT/95 port using MSV5.0. To export DLL functions the + * YAZ_EXPORT modifier was added. Defined in yconfig.h. + * + * Revision 1.39 1997/05/14 06:53:44 adam + * C++ support. + * + * Revision 1.38 1997/04/30 08:52:09 quinn + * Null + * + * Revision 1.37 1996/10/09 15:54:58 quinn + * Added SearchInfoReport + * + * Revision 1.36 1996/10/07 15:29:20 quinn + * Added SOIF support + * + * Revision 1.35 1996/06/10 08:57:38 quinn + * Added OPAC, ResourceReport + * + * Revision 1.34 1996/06/10 08:55:36 quinn + * Added Summary. + * + * Revision 1.33 1996/02/23 10:00:51 quinn * SCAN Work * * Revision 1.32 1996/02/20 12:52:39 quinn @@ -166,16 +212,9 @@ #include #include -/* - * Because we didn't have time to put all of the extra v3 elements in here - * before the first applications were written, we have to place them - * in #ifdefs in places where they would break existing code. If you are - * developing new stuff, we urge you to leave them in, even if you don't - * intend to use any v3 features. When we are comfortable that the old - * apps have been updated, we'll remove the #ifdefs. - */ - -#define Z_95 +#ifdef __cplusplus +extern "C" { +#endif /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/ @@ -306,10 +345,8 @@ typedef struct Z_InitRequest char *implementationId; /* OPTIONAL */ char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ - Z_External *userInformationField; /* OPTIONAL */ -#ifdef Z_95 + Z_External *userInformationField; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_InitRequest; typedef struct Z_InitResponse @@ -324,9 +361,7 @@ typedef struct Z_InitResponse char *implementationName; /* OPTIONAL */ char *implementationVersion; /* OPTIONAL */ Z_External *userInformationField; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_InitResponse; typedef struct Z_NSRAuthentication @@ -336,9 +371,10 @@ typedef struct Z_NSRAuthentication char *account; } Z_NSRAuthentication; -int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt); +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt, + const char *name); -int z_StrAuthentication(ODR o, char **p, int opt); +int z_StrAuthentication(ODR o, char **p, int opt, const char *name); /* ------------------ SEARCH SERVICE ----------------*/ @@ -378,11 +414,8 @@ typedef struct Z_ComplexAttribute typedef struct Z_AttributeElement { -#ifdef Z_95 Odr_oid *attributeSet; /* OPTIONAL - v3 only */ -#endif int *attributeType; -#ifdef Z_95 int which; #define Z_AttributeValue_numeric 0 #define Z_AttributeValue_complex 1 @@ -391,9 +424,6 @@ typedef struct Z_AttributeElement int *numeric; Z_ComplexAttribute *complex; } value; -#else - int *attributeValue; -#endif } Z_AttributeElement; typedef struct Z_Term @@ -548,18 +578,14 @@ typedef struct Z_SearchRequest Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */ Odr_oid *preferredRecordSyntax; /* OPTIONAL */ Z_Query *query; -#ifdef Z_95 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_SearchRequest; /* ------------------------ RECORD -------------------------- */ typedef Z_External Z_DatabaseRecord; -#ifdef Z_95 - typedef struct Z_DefaultDiagFormat { Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */ @@ -584,17 +610,6 @@ typedef struct Z_DiagRec } u; } Z_DiagRec; -#else - -typedef struct Z_DiagRec -{ - Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */ - int *condition; - char *addinfo; -} Z_DiagRec; - -#endif - typedef struct Z_DiagRecs { int num_diagRecs; @@ -655,10 +670,8 @@ typedef struct Z_SearchResponse #define Z_PRES_PARTIAL_4 4 #define Z_PRES_FAILURE 5 Z_Records *records; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *additionalSearchInfo; Z_OtherInformation *otherInfo; -#endif } Z_SearchResponse; /* ------------------------- PRESENT SERVICE -----------------*/ @@ -721,20 +734,14 @@ typedef struct Z_PresentRequest Z_ResultSetId *resultSetId; int *resultSetStartPoint; int *numberOfRecordsRequested; -#ifdef Z_95 int num_ranges; Z_Range **additionalRanges; /* OPTIONAL */ Z_RecordComposition *recordComposition; /* OPTIONAL */ -#else - Z_ElementSetNames *elementSetNames; /* OPTIONAL */ -#endif Odr_oid *preferredRecordSyntax; /* OPTIONAL */ -#ifdef Z_95 int *maxSegmentCount; /* OPTIONAL */ int *maxRecordSize; /* OPTIONAL */ int *maxSegmentSize; /* OPTIONAL */ Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_PresentRequest; typedef struct Z_PresentResponse @@ -744,9 +751,7 @@ typedef struct Z_PresentResponse int *nextResultSetPosition; int *presentStatus; Z_Records *records; -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_PresentResponse; /* ------------------ RESOURCE CONTROL ----------------*/ @@ -760,9 +765,7 @@ typedef struct Z_TriggerResourceControlRequest #define Z_TriggerResourceCtrl_cancel 3 Odr_oid *prefResourceReportFormat; /* OPTIONAL */ bool_t *resultSetWanted; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_TriggerResourceControlRequest; typedef struct Z_ResourceControlRequest @@ -776,9 +779,7 @@ typedef struct Z_ResourceControlRequest #define Z_ResourceControlRequest_none 3 bool_t *responseRequired; bool_t *triggeredRequestFlag; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ResourceControlRequest; typedef struct Z_ResourceControlResponse @@ -786,9 +787,7 @@ typedef struct Z_ResourceControlResponse Z_ReferenceId *referenceId; /* OPTIONAL */ bool_t *continueFlag; bool_t *resultSetWanted; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ResourceControlResponse; @@ -805,9 +804,7 @@ typedef struct Z_AccessControlRequest Odr_oct *simpleForm; Z_External *externallyDefined; } u; -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_AccessControlRequest; typedef struct Z_AccessControlResponse @@ -822,9 +819,7 @@ typedef struct Z_AccessControlResponse Z_External *externallyDefined; } u; Z_DiagRec *diagnostic; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_AccessControlResponse; /* ------------------------ SCAN SERVICE -------------------- */ @@ -841,8 +836,6 @@ typedef struct Z_AlternativeTerm Z_AttributesPlusTerm **terms; } Z_AlternativeTerm; -#if 1 - typedef struct Z_ByDatabase { char *db; @@ -882,31 +875,6 @@ typedef struct Z_OccurrenceByAttributes Z_OccurrenceByAttributesElem **elements; } Z_OccurrenceByAttributes; -#else - -/* - * Old, incomplete definition of OccurrenceByAttributes. - */ - -typedef struct Z_OccurrenceByAttributes -{ - Z_AttributeList *attributes; -#if 0 - int which; -#define Z_OByAtt_global 0 -#define Z_ObyAtt_byDatabase 1 - union - { -#endif - int *global; -#if 0 - /* Z_ByDatabase *byDatabase; */ - } u; -#endif -} Z_OccurrenceByAttributes; - -#endif - typedef struct Z_TermInfo { Z_Term *term; @@ -930,6 +898,8 @@ typedef struct Z_Entry } u; } Z_Entry; +#ifdef BUGGY_LISTENTRIES + typedef struct Z_Entries { int num_entries; @@ -948,6 +918,15 @@ typedef struct Z_ListEntries } u; } Z_ListEntries; +#endif + +typedef struct Z_ListEntries { + int num_entries; + Z_Entry **entries; /* OPT */ + int num_nonsurrogateDiagnostics; + Z_DiagRec **nonsurrogateDiagnostics; /* OPT */ +} Z_ListEntries; + typedef struct Z_ScanRequest { Z_ReferenceId *referenceId; /* OPTIONAL */ @@ -958,9 +937,7 @@ typedef struct Z_ScanRequest int *stepSize; /* OPTIONAL */ int *numberOfTermsRequested; int *preferredPositionInResponse; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ScanRequest; typedef struct Z_ScanResponse @@ -979,9 +956,7 @@ typedef struct Z_ScanResponse int *positionOfTerm; /* OPTIONAL */ Z_ListEntries *entries; /* OPTIONAL */ Odr_oid *attributeSet; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_ScanResponse; @@ -1011,26 +986,25 @@ typedef struct Z_DeleteResultSetRequest int *deleteFunction; #define Z_DeleteRequest_list 0 #define Z_DeleteRequest_all 1 - int num_ids; + int num_resultSetList; Z_ResultSetId **resultSetList; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_DeleteResultSetRequest; +typedef struct Z_ListStatuses { + int num; + Z_ListStatus **elements; +} Z_ListStatuses; + typedef struct Z_DeleteResultSetResponse { Z_ReferenceId *referenceId; /* OPTIONAL */ int *deleteOperationStatus; - int num_statuses; - Z_ListStatus *deleteListStatuses; /* OPTIONAL */ + Z_ListStatuses *deleteListStatuses;/* OPTIONAL */ int *numberNotDeleted; /* OPTIONAL */ - int num_bulkStatuses; - Z_ListStatus *bulkStatuses; /* OPTIONAL */ + Z_ListStatuses *bulkStatuses; /* OPTIONAL */ char *deleteMessage; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; -#endif } Z_DeleteResultSetResponse; /* ------------------------ CLOSE SERVICE ------------------- */ @@ -1052,9 +1026,7 @@ typedef struct Z_Close char *diagnosticInformation; /* OPTIONAL */ Odr_oid *resourceReportFormat; /* OPTIONAL */ Z_External *resourceReport; /* OPTIONAL */ -#ifdef Z_95 Z_OtherInformation *otherInfo; /* OPTIONAL */ -#endif } Z_Close; /* ------------------------ SEGMENTATION -------------------- */ @@ -1223,6 +1195,32 @@ typedef struct Z_SortRequest Z_OtherInformation *otherInfo; /* OPTIONAL */ } Z_SortRequest; +/* ----------------------- Resource Report ------------------ */ + +typedef struct Z_ResourceReportRequest +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + Z_ReferenceId *opId; /* OPTIONAL */ + Odr_oid *prefResourceReportFormat; /* OPTIONAL */ + Z_OtherInformation *otherInfo; /* OPTIONAL */ +} Z_ResourceReportRequest; + +typedef struct Z_ResourceReportResponse +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + int *resourceReportStatus; +#define Z_ResourceReportStatus_success 0 +#define Z_ResourceReportStatus_partial 1 +#define Z_ResourceReportStatus_failure_1 2 +#define Z_ResourceReportStatus_failure_2 3 +#define Z_ResourceReportStatus_failure_3 4 +#define Z_ResourceReportStatus_failure_4 5 +#define Z_ResourceReportStatus_failure_5 6 +#define Z_ResourceReportStatus_failure_6 7 + Z_External *resourceReport; /* OPTIONAL */ + Z_OtherInformation *otherInfo; /* OPTIONAL */ +} Z_ResourceReportResponse; + /* ------------------------ APDU ---------------------------- */ typedef struct Z_APDU @@ -1249,6 +1247,8 @@ typedef struct Z_APDU #define Z_APDU_accessControlResponse 18 #define Z_APDU_sortRequest 20 #define Z_APDU_sortResponse 21 +#define Z_APDU_resourceReportRequest 22 +#define Z_APDU_resourceReportResponse 23 union { Z_InitRequest *initRequest; @@ -1264,6 +1264,8 @@ typedef struct Z_APDU Z_ResourceControlRequest *resourceControlRequest; Z_ResourceControlResponse *resourceControlResponse; Z_TriggerResourceControlRequest *triggerResourceControlRequest; + Z_ResourceReportRequest *resourceReportRequest; + Z_ResourceReportResponse *resourceReportResponse; Z_ScanRequest *scanRequest; Z_ScanResponse *scanResponse; Z_SortRequest *sortRequest; @@ -1275,48 +1277,68 @@ typedef struct Z_APDU } u; } Z_APDU; -int z_APDU(ODR o, Z_APDU **p, int opt); -int z_SUTRS(ODR o, Odr_oct **p, int opt); - -Z_InitRequest *zget_InitRequest(ODR o); -Z_InitResponse *zget_InitResponse(ODR o); -Z_SearchRequest *zget_SearchRequest(ODR o); -Z_SearchResponse *zget_SearchResponse(ODR o); -Z_PresentRequest *zget_PresentRequest(ODR o); -Z_PresentResponse *zget_PresentResponse(ODR o); -Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o); -Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o); -Z_ScanRequest *zget_ScanRequest(ODR o); -Z_ScanResponse *zget_ScanResponse(ODR o); -Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o); -Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o); -Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o); -Z_Close *zget_Close(ODR o); -int z_StringList(ODR o, Z_StringList **p, int opt); -int z_InternationalString(ODR o, char **p, int opt); -int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt); -int z_ElementSetName(ODR o, char **p, int opt); -int z_IntUnit(ODR o, Z_IntUnit **p, int opt); -int z_Unit(ODR o, Z_Unit **p, int opt); -int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt); -int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt); -int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt); -int z_Term(ODR o, Z_Term **p, int opt); -int z_Specification(ODR o, Z_Specification **p, int opt); -int z_Permissions(ODR o, Z_Permissions **p, int opt); -int z_DiagRec(ODR o, Z_DiagRec **p, int opt); -int z_AttributeList(ODR o, Z_AttributeList **p, int opt); -int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt); -Z_APDU *zget_APDU(ODR o, int which); +YAZ_EXPORT int z_APDU(ODR o, Z_APDU **p, int opt, const char *name); +YAZ_EXPORT int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name); + +YAZ_EXPORT Z_InitRequest *zget_InitRequest(ODR o); +YAZ_EXPORT Z_InitResponse *zget_InitResponse(ODR o); +YAZ_EXPORT Z_SearchRequest *zget_SearchRequest(ODR o); +YAZ_EXPORT Z_SearchResponse *zget_SearchResponse(ODR o); +YAZ_EXPORT Z_PresentRequest *zget_PresentRequest(ODR o); +YAZ_EXPORT Z_PresentResponse *zget_PresentResponse(ODR o); +YAZ_EXPORT Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o); +YAZ_EXPORT Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o); +YAZ_EXPORT Z_ScanRequest *zget_ScanRequest(ODR o); +YAZ_EXPORT Z_ScanResponse *zget_ScanResponse(ODR o); +YAZ_EXPORT Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o); +YAZ_EXPORT Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o); +YAZ_EXPORT Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o); +YAZ_EXPORT Z_Close *zget_Close(ODR o); +YAZ_EXPORT int z_StringList(ODR o, Z_StringList **p, int opt, + const char *name); +YAZ_EXPORT int z_InternationalString(ODR o, char **p, int opt, + const char *name); +YAZ_EXPORT int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt, + const char *naem); +YAZ_EXPORT int z_ElementSetName(ODR o, char **p, int opt, const char *name); +YAZ_EXPORT int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name); +YAZ_EXPORT int z_Unit(ODR o, Z_Unit **p, int opt, const char *name); +YAZ_EXPORT int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, + const char *name); +YAZ_EXPORT int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, + const char *name); +YAZ_EXPORT int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, + int opt, const char *name); +YAZ_EXPORT int z_Term(ODR o, Z_Term **p, int opt, const char *name); +YAZ_EXPORT int z_Specification(ODR o, Z_Specification **p, int opt, + const char *name); +YAZ_EXPORT int z_Permissions(ODR o, Z_Permissions **p, int opt, + const char *name); +YAZ_EXPORT int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name); +YAZ_EXPORT int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name); +YAZ_EXPORT int z_AttributeList(ODR o, Z_AttributeList **p, int opt, + const char *name); +YAZ_EXPORT int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt, + const char *name); +YAZ_EXPORT Z_APDU *zget_APDU(ODR o, int which); +YAZ_EXPORT int z_Query(ODR o, Z_Query **p, int opt, const char *name); + +#ifdef __cplusplus +} +#endif #include #include #include #include +#include #include #include #include +#include +#include +#include #include #endif