X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fyaz%2Fsrw.h;h=0c7cb77523c12348e1406242172842b2feefd020;hp=24fd5d6bcd022452f068a5b2aa27e46301562b11;hb=964580242e2e0b2e570f652afa58bfb90ad0bb5e;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505 diff --git a/include/yaz/srw.h b/include/yaz/srw.h index 24fd5d6..0c7cb77 100644 --- a/include/yaz/srw.h +++ b/include/yaz/srw.h @@ -1,8 +1,36 @@ /* + * Copyright (c) 1995-2006, Index Data + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Index Data nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $Id: srw.h,v 1.29 2006-10-09 21:02:41 adam Exp $ */ + +/* * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srw.h,v 1.22 2005-06-25 15:46:03 adam Exp $ + * $Id: srw.h,v 1.29 2006-10-09 21:02:41 adam Exp $ */ /** * \file srw.h @@ -19,10 +47,21 @@ YAZ_BEGIN_CDECL typedef struct { + int type; + char *recordReviewCode; + char *recordReviewNote; + char *recordId; + char *nonDupRecordId; + char *recordLockStatus; + char *recordOldVersion; +} Z_SRW_extra_record; + +typedef struct { char *recordSchema; int recordPacking; #define Z_SRW_recordPacking_string 0 #define Z_SRW_recordPacking_XML 1 +#define Z_SRW_recordPacking_URL 2 char *recordData_buf; int recordData_len; int *recordPosition; @@ -76,6 +115,8 @@ typedef struct { Z_SRW_diagnostic *diagnostics; int num_diagnostics; int *nextRecordPosition; + + Z_SRW_extra_record **extra_records; /* of size num_records */ } Z_SRW_searchRetrieveResponse; typedef struct { @@ -88,6 +129,7 @@ typedef struct { Z_SRW_record record; Z_SRW_diagnostic *diagnostics; int num_diagnostics; + Z_SRW_extra_record *extra_record; } Z_SRW_explainResponse; typedef struct { @@ -117,12 +159,39 @@ typedef struct { int num_diagnostics; } Z_SRW_scanResponse; + +typedef struct { + char *database; + char *operation; + char *recordId; + char *recordVersion; + char *recordOldVersion; + Z_SRW_record record; + Z_SRW_extra_record *extra_record; + char *extraRequestData; + char *stylesheet; +} Z_SRW_updateRequest; + +typedef struct { + char *operationStatus; + char *recordId; + char *recordVersion; + char *recordChecksum; + char *extraResponseData; + Z_SRW_record record; + Z_SRW_extra_record *extra_record; + Z_SRW_diagnostic *diagnostics; + int num_diagnostics; +} Z_SRW_updateResponse; + #define Z_SRW_searchRetrieve_request 1 #define Z_SRW_searchRetrieve_response 2 #define Z_SRW_explain_request 3 #define Z_SRW_explain_response 4 #define Z_SRW_scan_request 5 #define Z_SRW_scan_response 6 +#define Z_SRW_update_request 7 +#define Z_SRW_update_response 8 typedef struct { int which; @@ -133,14 +202,24 @@ typedef struct { Z_SRW_explainResponse *explain_response; Z_SRW_scanRequest *scan_request; Z_SRW_scanResponse *scan_response; + Z_SRW_updateRequest *update_request; + Z_SRW_updateResponse *update_response; } u; char *srw_version; + char *username; /* From HTTP header or request */ + char *password; /* From HTTP header or request */ + char *extra_args; /* For SRU GET/POST only */ } Z_SRW_PDU; YAZ_EXPORT int yaz_srw_codec(ODR o, void * pptr, Z_SRW_PDU **handler_data, void *client_data, const char *ns); +YAZ_EXPORT int yaz_ucp_codec(ODR o, void * pptr, + Z_SRW_PDU **handler_data, + void *client_data, const char *ns); +YAZ_EXPORT Z_SRW_PDU *yaz_srw_get_core_v_1_1(ODR o); YAZ_EXPORT Z_SRW_PDU *yaz_srw_get(ODR o, int which); +YAZ_EXPORT Z_SRW_extra_record *yaz_srw_get_extra_record(ODR o); YAZ_EXPORT int yaz_diag_bib1_to_srw (int bib1_code); @@ -160,8 +239,26 @@ YAZ_EXPORT void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d, int *num, int code, const char *addinfo); + YAZ_EXPORT void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d, int code, const char *details); + +YAZ_EXPORT void yaz_add_srw_diagnostic_uri(ODR o, Z_SRW_diagnostic **d, + int *num, const char *uri, + const char *message, + const char *details); + +YAZ_EXPORT void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d, + const char *uri, const char *message, + const char *details); + +YAZ_EXPORT int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, + ODR encode, const char *charset); +YAZ_EXPORT int yaz_sru_post_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, + ODR encode, const char *charset); +YAZ_EXPORT int yaz_sru_soap_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, + ODR odr, const char *charset); + YAZ_END_CDECL #endif