X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fproto.h;h=c6757edc198bca79f0c1cb266c7d9288866245a6;hb=b200b3ce30a8db1d68b2ddfe9994acff1a5d2789;hp=313c60336d159dc8a41f7075642f3677737a3fd2;hpb=372a500da226336c7bb4036e980be2587ad5fdeb;p=yaz-moved-to-github.git diff --git a/include/proto.h b/include/proto.h index 313c603..c6757ed 100644 --- a/include/proto.h +++ b/include/proto.h @@ -4,7 +4,19 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.h,v $ - * Revision 1.1 1995-03-30 09:39:42 quinn + * Revision 1.5 1995-04-17 11:28:18 quinn + * Smallish + * + * Revision 1.4 1995/04/10 10:22:47 quinn + * Added SCAN + * + * Revision 1.3 1995/03/30 12:18:09 quinn + * Added info. + * + * Revision 1.2 1995/03/30 10:26:48 quinn + * Added Term structure + * + * Revision 1.1 1995/03/30 09:39:42 quinn * Moved .h files to include directory * * Revision 1.11 1995/03/30 09:08:44 quinn @@ -209,6 +221,7 @@ typedef struct Z_AttributeElement int *attributeValue; } Z_AttributeElement; +#define Z_V3 #ifdef Z_V3 typedef struct Z_Term @@ -226,13 +239,13 @@ typedef struct Z_Term } which; union { - Odr_oct *general; + Odr_oct *general; /* this is required for v2 */ int *numeric; char *characterString; Odr_oid *oid; char *dateTime; Odr_external *external; - Z_IntUnit *integerAndUnit; + /* Z_IntUnit *integerAndUnit; */ void *null; } u; } Z_Term; @@ -395,6 +408,119 @@ typedef struct Z_Records } u; } Z_Records; +/* ------------------------ SCAN SERVICE -------------------- */ + +typedef struct Z_AttributeList +{ + int num_attributes; + Z_AttributeElement **attributes; +} Z_AttributeList; + +typedef struct Z_AlternativeTerm +{ + int num_terms; + Z_AttributesPlusTerm **terms; +} Z_AlternativeTerm; + +typedef struct Z_OccurrenceByAttributes +{ + Z_AttributeList *attributes; +#if 0 + enum + { + Z_OByAtt_global, + Z_ObyAtt_byDatabase + } which; + union + { +#endif + int *global; +#if 0 + /* Z_ByDatabase *byDatabase; */ + } u; +#endif +} Z_OccurrenceByAttributes; + +typedef struct Z_TermInfo +{ + Z_Term *term; + Z_AttributeList *suggestedAttributes; /* OPTIONAL */ + Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */ + int *globalOccurrences; /* OPTIONAL */ + Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */ +} Z_TermInfo; + +typedef struct Z_Entry +{ + enum + { + Z_Entry_termInfo, + Z_Entry_surrogateDiagnostic + } which; + union + { + Z_TermInfo *termInfo; + Z_DiagRec *surrogateDiagnostic; + } u; +} Z_Entry; + +typedef struct Z_Entries +{ + int num_entries; + Z_Entry **entries; +} Z_Entries; + +typedef struct Z_DiagRecs +{ + int num_diagRecs; + Z_DiagRec **diagRecs; +} Z_DiagRecs; + +typedef struct Z_ListEntries +{ + enum + { + Z_ListEntries_entries, + Z_ListEntries_nonSurrogateDiagnostics + } which; + union + { + Z_Entries *entries; + Z_DiagRecs *nonSurrogateDiagnostics; + } u; +} Z_ListEntries; + +typedef struct Z_ScanRequest +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + int num_databaseNames; + char **databaseNames; + Odr_oid *attributeSet; /* OPTIONAL */ + Odr_any *eatme1; + Z_AttributesPlusTerm *termListAndStartPoint; + int *stepSize; /* OPTIONAL */ + int *numberOfTermsRequested; + int *preferredPositionInResponse; /* OPTIONAL */ +} Z_ScanRequest; + +typedef struct Z_ScanResponse +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + int *stepSize; /* OPTIONAL */ + int *scanStatus; +#define Z_Scan_success 0 +#define Z_Scan_partial_1 1 +#define Z_Scan_partial_2 2 +#define Z_Scan_partial_3 3 +#define Z_Scan_partial_4 4 +#define Z_Scan_partial_5 5 +#define Z_Scan_failure 6 + int *numberOfEntriesReturned; + int *positionOfTerm; /* OPTIONAL */ + Z_ListEntries *entries; /* OPTIONAL */ + Odr_oid *attributeSet; /* OPTIONAL */ +} Z_ScanResponse; + /* ------------------------ SEARCHRESPONSE ------------------ */ typedef struct Z_SearchResponse @@ -405,6 +531,9 @@ typedef struct Z_SearchResponse int *nextResultSetPosition; bool_t *searchStatus; int *resultSetStatus; /* OPTIONAL */ +#define Z_RES_SUBSET 1 +#define Z_RES_INTERIM 2 +#define Z_RES_NONE 3 int *presentStatus; /* OPTIONAL */ #define Z_PRES_SUCCESS 0 #define Z_PRES_PARTIAL_1 1 @@ -436,17 +565,66 @@ typedef struct Z_PresentResponse Z_Records *records; } Z_PresentResponse; +/* ------------------------ DELETE -------------------------- */ + +typedef struct Z_ListStatus +{ + Z_ResultSetId *id; + int *status; +} Z_ListStatus; + +typedef struct Z_DeleteResultSetRequest +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + int *deleteFunction; +#define Z_DeleteRequest_list 0 +#define Z_DeleteRequest_all 1 + int num_ids; + Z_ResultSetId *resultSetList; /* OPTIONAL */ +} Z_DeleteResultSetRequest; + +typedef enum Z_DeleteSetStatus +{ + Z_Delete_success = 0, + Z_Delete_resultSetDidNotExist, + Z_Delete_previouslyDeletedByTarget, + Z_Delete_systemProblemAtTarget, + Z_Delete_accessNotAllowed, + Z_Delete_resourceControlAtOrigin, + Z_Delete_resourceControlAtTarget, + Z_Delete_bulkDeleteNotSupported, + Z_Delete_notAllRsltSetsDeletedOnBulkDlte, + Z_Delete_notAllRequestedResultSetsDeleted, + Z_Delete_resultSetInUse +} Z_DeleteSetStatus; + +typedef struct Z_DeleteResultSetResponse +{ + Z_ReferenceId *referenceId; /* OPTIONAL */ + int *deleteOperationStatus; + int num_statuses; + Z_ListStatus *deleteListStatuses; /* OPTIONAL */ + int *numberNotDeleted; /* OPTIONAL */ + int num_bulkstatuses; + Z_ListStatus *bulkStatuses; /* OPTIONAL */ + char *deleteMessage; /* OPTIONAL */ +} Z_DeleteResultSetResponse; + /* ------------------------ APDU ---------------------------- */ typedef struct Z_APDU { - int which; -#define Z_APDU_initRequest 0 -#define Z_APDU_initResponse 1 -#define Z_APDU_searchRequest 2 -#define Z_APDU_searchResponse 3 -#define Z_APDU_presentRequest 4 -#define Z_APDU_presentResponse 5 + enum + { + Z_APDU_initRequest, + Z_APDU_initResponse, + Z_APDU_searchRequest, + Z_APDU_searchResponse, + Z_APDU_presentRequest, + Z_APDU_presentResponse, + Z_APDU_scanRequest, + Z_APDU_scanResponse + } which; union { Z_InitRequest *initRequest; @@ -455,6 +633,8 @@ typedef struct Z_APDU Z_SearchResponse *searchResponse; Z_PresentRequest *presentRequest; Z_PresentResponse *presentResponse; + Z_ScanRequest *scanRequest; + Z_ScanResponse *scanResponse; } u; } Z_APDU;