X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fsrw.h;h=bf61fda92c7a37c069352a2c797d93626711a430;hb=9c0500654d398012434385e07f44aa2a7545133b;hp=18cc7430a75a350cb476a0fc1db873eec75e2072;hpb=e12377e7ea8e58cf447492b5cb9887b839a78700;p=yaz-moved-to-github.git diff --git a/include/yaz/srw.h b/include/yaz/srw.h index 18cc743..bf61fda 100644 --- a/include/yaz/srw.h +++ b/include/yaz/srw.h @@ -2,7 +2,7 @@ * Copyright (c) 2002-2003, Index Data. * See the file LICENSE for details. * - * $Id: srw.h,v 1.4 2003-02-19 15:22:11 adam Exp $ + * $Id: srw.h,v 1.8 2003-12-09 12:51:16 adam Exp $ */ #ifndef YAZ_SRW_H @@ -10,8 +10,13 @@ #include +YAZ_BEGIN_CDECL + typedef struct { char *recordSchema; + int recordPacking; +#define Z_SRW_recordPacking_string 0 +#define Z_SRW_recordPacking_XML 1 char *recordData_buf; int recordData_len; int *recordPosition; @@ -23,11 +28,26 @@ typedef struct { } Z_SRW_diagnostic; typedef struct { - char *query; - char *pQuery; - void *xQuery; - char *sortKeys; - void *xSortKeys; + +#define Z_SRW_query_type_cql 1 +#define Z_SRW_query_type_xcql 2 +#define Z_SRW_query_type_pqf 3 + int query_type; + union { + char *cql; + char *xcql; + char *pqf; + } query; + +#define Z_SRW_sort_type_none 1 +#define Z_SRW_sort_type_sort 2 +#define Z_SRW_sort_type_xSort 3 + int sort_type; + union { + char *none; + char *sortKeys; + char *xSortKeys; + } sort; int *startRecord; int *maximumRecords; char *recordSchema; @@ -48,21 +68,35 @@ typedef struct { int *nextRecordPosition; } Z_SRW_searchRetrieveResponse; +typedef struct { + int dummy; +} Z_SRW_explainRequest; + +typedef struct { + int explainPacking; + char *explainData_buf; + int explainData_len; +} Z_SRW_explainResponse; + #define Z_SRW_searchRetrieve_request 1 #define Z_SRW_searchRetrieve_response 2 +#define Z_SRW_explain_request 3 +#define Z_SRW_explain_response 4 typedef struct { int which; union { Z_SRW_searchRetrieveRequest *request; Z_SRW_searchRetrieveResponse *response; + Z_SRW_explainRequest *explain_request; + Z_SRW_explainResponse *explain_response; } u; -} Z_SRW_searchRetrieve; +} Z_SRW_PDU; YAZ_EXPORT int yaz_srw_codec(ODR o, void * pptr, - Z_SRW_searchRetrieve **handler_data, + Z_SRW_PDU **handler_data, void *client_data, const char *ns); -YAZ_EXPORT Z_SRW_searchRetrieve *yaz_srw_get(ODR o, int which); +YAZ_EXPORT Z_SRW_PDU *yaz_srw_get(ODR o, int which); YAZ_EXPORT const char *yaz_diag_srw_str (int code); @@ -70,5 +104,6 @@ YAZ_EXPORT int yaz_diag_bib1_to_srw (int bib1_code); YAZ_EXPORT int yaz_diag_srw_to_bib1(int srw_code); +YAZ_END_CDECL #endif