YAZ 5.38.1
zoom-z3950.c File Reference

Implements ZOOM Z39.50 handling. More...

#include <assert.h>
#include <string.h>
#include <errno.h>
#include "zoom-p.h"
#include <yaz/yaz-util.h>
#include <yaz/xmalloc.h>
#include <yaz/otherinfo.h>
#include <yaz/log.h>
#include <yaz/pquery.h>
#include <yaz/marcdisp.h>
#include <yaz/diagbib1.h>
#include <yaz/charneg.h>
#include <yaz/ill.h>
#include <yaz/query-charset.h>
#include <yaz/copy_types.h>
#include <yaz/snprintf.h>
#include <yaz/facet.h>
#include <yaz/shptr.h>

Go to the source code of this file.

Functions

static Odr_oid * zoom_yaz_str_to_z3950oid (ZOOM_connection c, oid_classoid_class oid_classoid_class, const char *str)
static Z_APDU * create_es_package (ZOOM_package p, const Odr_oid *oid)
static const char * ill_array_lookup (void *clientData, const char *idx)
static Z_External * encode_ill_request (ZOOM_package p)
static Z_ItemOrder * encode_item_order (ZOOM_package p)
Z_APDU * create_admin_package (ZOOM_package p, int type, Z_ESAdminOriginPartToKeep **toKeepP, Z_ESAdminOriginPartNotToKeep **notToKeepP)
static Z_APDU * create_xmlupdate_package (ZOOM_package p)
static Z_APDU * create_update_package (ZOOM_package p)
static void otherInfo_attach (ZOOM_connection c, Z_APDU *a, ODR out)
static int encode_APDU (ZOOM_connection c, Z_APDU *a, ODR out)
static zoom_ret send_APDU (ZOOM_connection c, Z_APDU *a)
zoom_ret ZOOM_connection_Z3950_send_init (ZOOM_connection c)
static zoom_ret Z3950_send_search (ZOOM_connection c)
zoom_ret ZOOM_connection_Z3950_send_scan (ZOOM_connection c)
 ZOOM_package_send (ZOOM_package p, const char *type)
static void handle_Z3950_records (ZOOM_connection c, Z_Records *sr, int present_phase)
static void response_default_diag (ZOOM_connection c, Z_DefaultDiagFormat *r)
static void response_diag (ZOOM_connection c, Z_DiagRec *p)
static int es_response_taskpackage_update (ZOOM_connection c, Z_IUUpdateTaskPackage *utp)
static int es_response_taskpackage_update0 (ZOOM_connection c, Z_IU0UpdateTaskPackage *utp)
static int es_response_taskpackage (ZOOM_connection c, Z_TaskPackage *taskPackage)
static void handle_Z3950_es_response (ZOOM_connection c, Z_ExtendedServicesResponse *res)
static char * get_term_cstr (ODR odr, Z_Term *term)
static ZOOM_facet_field get_zoom_facet_field (ODR odr, Z_FacetField *facet)
void ZOOM_handle_facet_list (ZOOM_resultset r, Z_FacetList *fl)
void ZOOM_handle_facet_result (ZOOM_connection c, ZOOM_resultset r, Z_OtherInformation *o)
static void handle_queryExpressionTerm (ZOOM_options opt, const char *name, Z_Term *term)
static void handle_queryExpression (ZOOM_options opt, const char *name, Z_QueryExpression *exp)
void ZOOM_handle_search_result (ZOOM_connection c, ZOOM_resultset resultset, Z_OtherInformation *o)
static void handle_Z3950_search_response (ZOOM_connection c, Z_SearchResponse *sr)
static void handle_Z3950_sort_response (ZOOM_connection c, Z_SortResponse *res)
static void handle_Z3950_scan_response (ZOOM_connection c, Z_ScanResponse *res)
static void handle_Z3950_present_response (ZOOM_connection c, Z_PresentResponse *pr)
static void set_init_option (const char *name, void *clientData)
zoom_ret send_Z3950_sort (ZOOM_connection c, ZOOM_resultset resultset)
static zoom_ret Z3950_send_present (ZOOM_connection c)
zoom_ret ZOOM_connection_Z3950_search (ZOOM_connection c)
static zoom_ret send_Z3950_sort_present (ZOOM_connection c)
void ZOOM_handle_Z3950_apdu (ZOOM_connection c, Z_APDU *apdu)

Detailed Description

Implements ZOOM Z39.50 handling.

Definition in file zoom-z3950.c.

Function Documentation

◆ create_admin_package()

◆ create_es_package()

◆ create_update_package()

Z_APDU * create_update_package ( ZOOM_package p)
static

Definition at line 282 of file zoom-z3950.c.

References Z_IUOriginPartToKeep::action, Z_IUOriginPartToKeep::actionQualifier, CLASS_RECSYN, ZOOM_package_p::connection, Z_IUSuppliedRecords_elem::correlationInfo, create_es_package(), create_update_package(), Z_IUOriginPartToKeep::databaseName, Z_External::descriptor, Z_External::direct_reference, Z_IUSuppliedRecords::elements, Z_IUOriginPartToKeep::elementSetName, Z_IUCorrelationInfo::id, Z_External::indirect_reference, Z_IUCorrelationInfo::note, Z_IUSuppliedRecords::num, odr_create_Odr_oct(), odr_createmem(), odr_destroy(), odr_intdup(), odr_malloc(), odr_oiddup(), ZOOM_package_p::odr_out, ODR_PRINT, odr_strdup(), odr_strdup_null(), ZOOM_package_p::options, Z_IUSuppliedRecords_elem::record, Z_IUOriginPartToKeep::schema, Z_IUSuppliedRecords_elem::supplementalId, Z_APDU::u, Z_External::u, Z_IUSuppliedRecords_elem::u, Z_External::which, Z_IUSuppliedRecords_elem::which, yaz_oid_extserv_database_update, yaz_oid_extserv_database_update_first_version, yaz_oid_extserv_database_update_second_version, yaz_oid_std(), yaz_string_to_oid_odr(), z_APDU(), z_ext_record_oid(), z_ext_record_oid_any(), Z_External_update, Z_IUOriginPartToKeep_elementUpdate, Z_IUOriginPartToKeep_recordDelete, Z_IUOriginPartToKeep_recordInsert, Z_IUOriginPartToKeep_recordReplace, Z_IUOriginPartToKeep_specialUpdate, Z_IUSuppliedRecords_elem_number, Z_IUSuppliedRecords_elem_opaque, Z_IUSuppliedRecords_elem_string, Z_IUUpdate_esRequest, ZOOM_connection_get_databases(), ZOOM_ERROR_ES_INVALID_ACTION, ZOOM_ERROR_ES_INVALID_SYNTAX, ZOOM_ERROR_ES_INVALID_VERSION, ZOOM_options_get(), ZOOM_options_getl(), and ZOOM_set_error().

Referenced by create_update_package(), and ZOOM_package_send().

◆ create_xmlupdate_package()

◆ encode_APDU()

◆ encode_ill_request()

◆ encode_item_order()

◆ es_response_taskpackage()

◆ es_response_taskpackage_update()

◆ es_response_taskpackage_update0()

◆ get_term_cstr()

char * get_term_cstr ( ODR odr,
Z_Term * term )
static

◆ get_zoom_facet_field()

◆ handle_queryExpression()

◆ handle_queryExpressionTerm()

◆ handle_Z3950_es_response()

◆ handle_Z3950_present_response()

void handle_Z3950_present_response ( ZOOM_connection c,
Z_PresentResponse * pr )
static

◆ handle_Z3950_records()

◆ handle_Z3950_scan_response()

◆ handle_Z3950_search_response()

◆ handle_Z3950_sort_response()

◆ ill_array_lookup()

const char * ill_array_lookup ( void * clientData,
const char * idx )
static

Definition at line 91 of file zoom-z3950.c.

References ill_array_lookup(), ZOOM_package_p::options, and ZOOM_options_get().

Referenced by encode_ill_request(), and ill_array_lookup().

◆ otherInfo_attach()

◆ response_default_diag()

◆ response_diag()

◆ send_APDU()

◆ send_Z3950_sort()

◆ send_Z3950_sort_present()

◆ set_init_option()

void set_init_option ( const char * name,
void * clientData )
static

◆ Z3950_send_present()

◆ Z3950_send_search()

zoom_ret Z3950_send_search ( ZOOM_connection c)
static

Definition at line 648 of file zoom-z3950.c.

References Z_SearchRequest::additionalSearchInfo, CLASS_RECSYN, Z_SearchRequest::databaseNames, ZOOM_resultset_p::databaseNames, Z_SearchRequest::largeSetLowerBound, ZOOM_connection_p::log_details, Z_SearchRequest::mediumSetElementSetNames, Z_SearchRequest::mediumSetPresentNumber, ZOOM_resultset_p::next, Z_SearchRequest::num_databaseNames, ZOOM_resultset_p::num_databaseNames, ZOOM_resultset_p::odr, odr_malloc(), ZOOM_connection_p::odr_out, odr_strdup(), ZOOM_resultset_p::options, ZOOM_resultset_p::piggyback, Z_SearchRequest::preferredRecordSyntax, Z_SearchRequest::query, ZOOM_resultset_p::query, ZOOM_resultset_p::r_sort_spec, ZOOM_resultset_p::req_facets, Z_SearchRequest::resultSetName, ZOOM_connection_p::resultsets, send_APDU(), ZOOM_resultset_p::setname, Z_SearchRequest::smallSetElementSetNames, Z_SearchRequest::smallSetUpperBound, ZOOM_resultset_p::step, ZOOM_connection_p::support_named_resultsets, ZOOM_connection_p::tasks, Z_APDU::u, Z_ElementSetNames::u, Z_Query::u, ZOOM_task_p::u, Z_ElementSetNames::which, Z_Query::which, ZOOM_task_p::which, yaz_copy_Z_Query(), yaz_iconv_close(), yaz_iconv_open(), yaz_log(), yaz_oi_set_facetlist(), yaz_pqf_parse_facet_list(), yaz_query_charset_convert_rpnquery_check(), yaz_snprintf(), YLOG_WARN, Z3950_send_search(), Z_APDU_searchRequest, Z_ElementSetNames_generic, Z_Query_type_1, Z_Query_type_101, zget_APDU(), zoom_complete, ZOOM_ERROR_INVALID_QUERY, ZOOM_options_get(), ZOOM_options_get_int(), ZOOM_options_set(), ZOOM_query_get_Z_Query(), ZOOM_set_error(), ZOOM_TASK_SEARCH, and zoom_yaz_str_to_z3950oid().

Referenced by Z3950_send_search(), and ZOOM_connection_Z3950_search().

◆ ZOOM_connection_Z3950_search()

◆ ZOOM_connection_Z3950_send_init()

zoom_ret ZOOM_connection_Z3950_send_init ( ZOOM_connection c)

Definition at line 570 of file zoom-z3950.c.

References ZOOM_connection_p::charset, ZOOM_connection_p::group, Z_IdPass::groupId, ZOOM_connection_p::host_port, Z_InitRequest::idAuthentication, Z_InitRequest::implementationId, Z_InitRequest::implementationName, Z_InitRequest::implementationVersion, Z_OtherInformationUnit::information, ZOOM_connection_p::lang, ZOOM_connection_p::maximum_record_size, Z_InitRequest::maximumRecordSize, odr_malloc(), ODR_MASK_SET, ZOOM_connection_p::odr_out, odr_prepend(), odr_strdup(), odr_strdup_null(), Z_InitRequest::options, ZOOM_connection_p::options, Z_InitRequest::otherInfo, Z_IdPass::password, ZOOM_connection_p::password, ZOOM_connection_p::preferred_message_size, Z_InitRequest::preferredMessageSize, Z_InitRequest::protocolVersion, ZOOM_connection_p::proxy_mode, send_APDU(), Z_APDU::u, Z_IdAuthentication::u, ZOOM_connection_p::user, Z_IdPass::userId, Z_IdAuthentication::which, Z_OtherInformationUnit::which, yaz_oi_APDU(), yaz_oi_set_string_oid(), yaz_oi_update(), yaz_oid_userinfo_proxy, yaz_set_proposal_charneg_list(), Z_APDU_initRequest, Z_IdAuthentication_idPass, Z_IdAuthentication_open, Z_Options_extendedServices, Z_Options_namedResultSets, Z_Options_negotiationModel, Z_Options_present, Z_Options_scan, Z_Options_search, Z_Options_sort, Z_OtherInfo_externallyDefinedInfo, Z_ProtocolVersion_1, Z_ProtocolVersion_2, Z_ProtocolVersion_3, zget_APDU(), ZOOM_connection_Z3950_send_init(), and ZOOM_options_get().

Referenced by do_connect_host(), ZOOM_connection_do_io(), and ZOOM_connection_Z3950_send_init().

◆ ZOOM_connection_Z3950_send_scan()

◆ ZOOM_handle_facet_list()

◆ ZOOM_handle_facet_result()

◆ ZOOM_handle_search_result()

◆ ZOOM_handle_Z3950_apdu()

void ZOOM_handle_Z3950_apdu ( ZOOM_connection c,
Z_APDU * apdu )

◆ ZOOM_package_send()

◆ zoom_yaz_str_to_z3950oid()

Odr_oid * zoom_yaz_str_to_z3950oid ( ZOOM_connection c,
oid_class oid_class,
const char * str )
static