YAZ  5.23.1
Functions
srw.c File Reference

Implements SRW/SRU package encoding and decoding. More...

#include <stdlib.h>
#include <yaz/srw.h>
#include <yaz/wrbuf.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <assert.h>
#include <yaz/facet.h>
#include <yaz/proto.h>
#include "sru-p.h"

Go to the source code of this file.

Functions

char * yaz_negotiate_sru_version (char *input_ver)
 
static int yaz_srw_record (ODR o, xmlNodePtr pptr, Z_SRW_record *rec, Z_SRW_extra_record **extra, void *client_data, int version2)
 
static int yaz_srw_records (ODR o, xmlNodePtr pptr, Z_SRW_record **recs, Z_SRW_extra_record ***extra, int *num, void *client_data, int version2)
 
static int yaz_srw_version (ODR o, xmlNodePtr pptr, Z_SRW_recordVersion *rec, void *client_data, const char *ns)
 
static int yaz_srw_versions (ODR o, xmlNodePtr pptr, Z_SRW_recordVersion **vers, int *num, void *client_data, const char *ns)
 
Z_FacetTermyaz_sru_proxy_get_facet_term_count (ODR odr, xmlNodePtr node)
 
static Z_FacetFieldyaz_sru_proxy_decode_facet_field (ODR odr, xmlNodePtr ptr)
 
static int yaz_sru_proxy_decode_facets (ODR o, xmlNodePtr root, Z_FacetList **facetList)
 
static int yaz_srw_decode_diagnostics (ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, int *num, void *client_data, const char *ns)
 
int sru_decode_surrogate_diagnostics (const char *buf, size_t len, Z_SRW_diagnostic **diag, int *num, ODR odr)
 
static int yaz_srw_diagnostics (ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, int *num, void *client_data, const char *ns, int version2)
 
static int yaz_srw_term (ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term, void *client_data, const char *ns)
 
static int yaz_srw_terms (ODR o, xmlNodePtr pptr, Z_SRW_scanTerm **terms, int *num, void *client_data, const char *ns)
 
static void encode_echoed_args (xmlNodePtr ptr, Z_SRW_PDU *p, const char *name)
 
int yaz_srw_codec (ODR o, void *vptr, Z_SRW_PDU **handler_data, void *client_data, const char *ns)
 
int yaz_ucp_codec (ODR o, void *vptr, Z_SRW_PDU **handler_data, void *client_data, const char *ns_ucp_str)
 

Detailed Description

Implements SRW/SRU package encoding and decoding.

Definition in file srw.c.

Function Documentation

static void encode_echoed_args ( xmlNodePtr  ptr,
Z_SRW_PDU p,
const char *  name 
)
static
int sru_decode_surrogate_diagnostics ( const char *  buf,
size_t  len,
Z_SRW_diagnostic **  diag,
int *  num,
ODR  odr 
)

Definition at line 417 of file srw.c.

References yaz_srw_decode_diagnostics().

Referenced by handle_srw_response().

char* yaz_negotiate_sru_version ( char *  input_ver)

Definition at line 25 of file srw.c.

Referenced by yaz_sru_decode(), and yaz_srw_codec().

static Z_FacetField* yaz_sru_proxy_decode_facet_field ( ODR  odr,
xmlNodePtr  ptr 
)
static
static int yaz_sru_proxy_decode_facets ( ODR  o,
xmlNodePtr  root,
Z_FacetList **  facetList 
)
static
Z_FacetTerm* yaz_sru_proxy_get_facet_term_count ( ODR  odr,
xmlNodePtr  node 
)
int yaz_srw_codec ( ODR  o,
void *  vptr,
Z_SRW_PDU **  handler_data,
void *  client_data,
const char *  ns 
)

Definition at line 581 of file srw.c.

References add_XML_n(), add_xsd_integer(), add_xsd_string(), Z_SRW_searchRetrieveRequest::database, Z_SRW_explainRequest::database, Z_SRW_scanRequest::database, Z_SRW_searchRetrieveResponse::diagnostics, Z_SRW_explainResponse::diagnostics, Z_SRW_scanResponse::diagnostics, odr::direction, encode_echoed_args(), Z_SRW_explainResponse::extra_record, Z_SRW_searchRetrieveResponse::extra_records, Z_SRW_searchRetrieveRequest::facetList, Z_SRW_searchRetrieveResponse::facetList, yaz_facet_attr::limit, Z_SRW_searchRetrieveRequest::maximumRecords, Z_SRW_scanRequest::maximumTerms, Z_SRW_searchRetrieveResponse::nextRecordPosition, Z_SRW_searchRetrieveRequest::none, Z_SRW_searchRetrieveResponse::num_diagnostics, Z_SRW_explainResponse::num_diagnostics, Z_SRW_scanResponse::num_diagnostics, Z_SRW_searchRetrieveResponse::num_records, Z_SRW_scanResponse::num_terms, Z_SRW_searchRetrieveResponse::numberOfRecords, ODR_DECODE, ODR_ENCODE, odr_malloc(), Z_SRW_searchRetrieveRequest::packing, Z_SRW_explainRequest::packing, Z_SRW_searchRetrieveRequest::query, Z_SRW_searchRetrieveRequest::queryType, Z_SRW_scanRequest::queryType, Z_SRW_explainResponse::record, Z_SRW_record::recordData_buf, Z_SRW_record::recordData_len, Z_SRW_searchRetrieveRequest::recordPacking, Z_SRW_explainRequest::recordPacking, Z_SRW_record::recordPosition, Z_SRW_searchRetrieveResponse::records, Z_SRW_record::recordSchema, Z_SRW_searchRetrieveRequest::recordSchema, Z_SRW_searchRetrieveRequest::recordXPath, Z_SRW_scanRequest::responsePosition, Z_SRW_searchRetrieveResponse::resultCountPrecision, Z_SRW_searchRetrieveResponse::resultSetId, Z_SRW_searchRetrieveResponse::resultSetIdleTime, Z_SRW_searchRetrieveRequest::resultSetTTL, Z_SRW_scanRequest::scanClause, Z_SRW_searchRetrieveRequest::sort, Z_SRW_searchRetrieveRequest::sort_type, Z_SRW_searchRetrieveRequest::sortKeys, Z_SRW_PDU::srw_version, yaz_facet_attr::start, Z_SRW_searchRetrieveRequest::startRecord, Z_SRW_searchRetrieveRequest::stylesheet, Z_SRW_explainRequest::stylesheet, Z_SRW_scanRequest::stylesheet, Z_SRW_searchRetrieveResponse::suggestions, Z_SRW_scanResponse::terms, Z_SRW_searchRetrieveRequest::xSortKeys, yaz_match_xsd_element(), yaz_match_xsd_integer(), yaz_match_xsd_string(), yaz_match_xsd_XML_n(), yaz_negotiate_sru_version(), yaz_sru_facet_request(), yaz_sru_facet_response(), yaz_sru_proxy_decode_facets(), yaz_srw_diagnostics(), yaz_srw_get_core_v_2_0(), yaz_srw_record(), yaz_srw_records(), yaz_srw_terms(), Z_SRW_explain_request, Z_SRW_explain_response, Z_SRW_scan_request, Z_SRW_scan_response, Z_SRW_searchRetrieve_request, Z_SRW_searchRetrieve_response, Z_SRW_sort_type_none, Z_SRW_sort_type_sort, and Z_SRW_sort_type_xSort.

Referenced by process_http_request(), yaz_sru_decode(), yaz_sru_soap_encode(), yaz_srw_decode(), and ZOOM_handle_sru().

static int yaz_srw_decode_diagnostics ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_diagnostic **  recs,
int *  num,
void *  client_data,
const char *  ns 
)
static

Definition at line 369 of file srw.c.

References odr_malloc(), and yaz_match_xsd_string().

Referenced by sru_decode_surrogate_diagnostics(), and yaz_srw_diagnostics().

static int yaz_srw_diagnostics ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_diagnostic **  recs,
int *  num,
void *  client_data,
const char *  ns,
int  version2 
)
static
static int yaz_srw_record ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_record rec,
Z_SRW_extra_record **  extra,
void *  client_data,
int  version2 
)
static
static int yaz_srw_records ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_record **  recs,
Z_SRW_extra_record ***  extra,
int *  num,
void *  client_data,
int  version2 
)
static

Definition at line 165 of file srw.c.

References odr::direction, ODR_DECODE, ODR_ENCODE, odr_malloc(), and yaz_srw_record().

Referenced by yaz_srw_codec().

static int yaz_srw_term ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_scanTerm term,
void *  client_data,
const char *  ns 
)
static
static int yaz_srw_terms ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_scanTerm **  terms,
int *  num,
void *  client_data,
const char *  ns 
)
static

Definition at line 521 of file srw.c.

References odr::direction, ODR_DECODE, ODR_ENCODE, odr_malloc(), and yaz_srw_term().

Referenced by yaz_srw_codec().

static int yaz_srw_version ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_recordVersion rec,
void *  client_data,
const char *  ns 
)
static
static int yaz_srw_versions ( ODR  o,
xmlNodePtr  pptr,
Z_SRW_recordVersion **  vers,
int *  num,
void *  client_data,
const char *  ns 
)
static

Definition at line 236 of file srw.c.

References odr::direction, ODR_DECODE, ODR_ENCODE, odr_malloc(), and yaz_srw_version().

Referenced by yaz_ucp_codec().

int yaz_ucp_codec ( ODR  o,
void *  vptr,
Z_SRW_PDU **  handler_data,
void *  client_data,
const char *  ns_ucp_str 
)