YAZ  5.23.1
Data Structures | Macros | Typedefs | Enumerations | Functions
zoom-p.h File Reference

Internal header for ZOOM implementation. More...

#include <yaz/proto.h>
#include <yaz/oid_db.h>
#include <yaz/comstack.h>
#include <yaz/wrbuf.h>
#include <yaz/zoom.h>
#include <yaz/srw.h>
#include <yaz/cookie.h>
#include <yaz/mutex.h>

Go to the source code of this file.

Data Structures

struct  ZOOM_connection_p
 
struct  ZOOM_resultset_p
 
struct  facet_term_p
 
struct  ZOOM_facet_field_p
 
struct  ZOOM_scanset_p
 
struct  ZOOM_package_p
 
struct  ZOOM_task_p
 

Macros

#define SHPTR   1
 
#define STATE_IDLE   0
 
#define STATE_CONNECTING   1
 
#define STATE_ESTABLISHED   2
 
#define RECORD_HASH_SIZE   131
 
#define ZOOM_TASK_SEARCH   1
 
#define ZOOM_TASK_CONNECT   3
 
#define ZOOM_TASK_SCAN   4
 
#define ZOOM_TASK_PACKAGE   5
 
#define ZOOM_TASK_SORT   6
 

Typedefs

typedef struct ZOOM_Event_pZOOM_Event
 
typedef struct ZOOM_task_pZOOM_task
 
typedef struct ZOOM_record_cache_pZOOM_record_cache
 

Enumerations

enum  zoom_sru_mode {
  zoom_sru_error, zoom_sru_soap, zoom_sru_get, zoom_sru_post,
  zoom_sru_solr
}
 
enum  zoom_ret { zoom_pending, zoom_complete }
 

Functions

void ZOOM_options_addref (ZOOM_options opt)
 
void ZOOM_handle_Z3950_apdu (ZOOM_connection c, Z_APDU *apdu)
 
void ZOOM_set_dset_error (ZOOM_connection c, int error, const char *dset, const char *addinfo, const char *addinfo2)
 
void ZOOM_set_error (ZOOM_connection c, int error, const char *addinfo)
 
ZOOM_Event ZOOM_Event_create (int kind)
 
void ZOOM_connection_put_event (ZOOM_connection c, ZOOM_Event event)
 
zoom_ret ZOOM_connection_Z3950_search (ZOOM_connection c)
 
zoom_ret ZOOM_connection_Z3950_send_scan (ZOOM_connection c)
 
zoom_ret ZOOM_send_buf (ZOOM_connection c)
 
zoom_ret send_Z3950_sort (ZOOM_connection c, ZOOM_resultset resultset)
 
char ** ZOOM_connection_get_databases (ZOOM_connection con, ZOOM_options options, int *num, ODR odr)
 
zoom_ret ZOOM_connection_Z3950_send_init (ZOOM_connection c)
 
ZOOM_task ZOOM_connection_add_task (ZOOM_connection c, int which)
 
void ZOOM_connection_remove_task (ZOOM_connection c)
 
void ZOOM_connection_remove_tasks (ZOOM_connection c)
 
int ZOOM_test_reconnect (ZOOM_connection c)
 
ZOOM_record ZOOM_record_cache_lookup (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema)
 
void ZOOM_record_cache_add (ZOOM_resultset r, Z_NamePlusRecord *npr, int pos, const char *syntax, const char *elementSetName, const char *schema, Z_SRW_diagnostic *diag)
 
Z_QueryZOOM_query_get_Z_Query (ZOOM_query s)
 
Z_SortKeySpecListZOOM_query_get_sortspec (ZOOM_query s)
 
const char * ZOOM_query_get_query_string (ZOOM_query s)
 
const char * ZOOM_query_get_sru11 (ZOOM_query s)
 
void ZOOM_query_get_hash (ZOOM_query s, WRBUF w)
 
int ZOOM_uri_to_code (const char *uri)
 
zoom_ret ZOOM_connection_srw_send_search (ZOOM_connection c)
 
zoom_ret ZOOM_connection_srw_send_scan (ZOOM_connection c)
 
int ZOOM_handle_sru (ZOOM_connection c, Z_HTTP_Response *hres, zoom_ret *cret, char **addinfo)
 
void ZOOM_set_HTTP_error (ZOOM_connection c, int error, const char *addinfo, const char *addinfo2)
 
ZOOM_Event ZOOM_connection_get_event (ZOOM_connection c)
 
void ZOOM_connection_remove_events (ZOOM_connection c)
 
void ZOOM_Event_destroy (ZOOM_Event event)
 
zoom_ret ZOOM_send_GDU (ZOOM_connection c, Z_GDU *gdu)
 
void ZOOM_handle_facet_list (ZOOM_resultset r, Z_FacetList *fl)
 
void ZOOM_memcached_init (ZOOM_connection c)
 
int ZOOM_memcached_configure (ZOOM_connection c)
 
void ZOOM_memcached_destroy (ZOOM_connection c)
 
void ZOOM_memcached_resultset (ZOOM_resultset r, ZOOM_query q)
 
void ZOOM_memcached_search (ZOOM_connection c, ZOOM_resultset r)
 
void ZOOM_memcached_hitcount (ZOOM_connection c, ZOOM_resultset result, Z_OtherInformation *oi, const char *precision)
 
void ZOOM_memcached_add (ZOOM_resultset r, Z_NamePlusRecord *npr, int pos, const char *syntax, const char *elementSetName, const char *schema, Z_SRW_diagnostic *diag)
 
Z_NamePlusRecordZOOM_memcached_lookup (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema)
 
ZOOM_record ZOOM_record_cache_lookup_i (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema)
 
void ZOOM_handle_facet_result (ZOOM_connection c, ZOOM_resultset r, Z_OtherInformation *o)
 
void ZOOM_handle_search_result (ZOOM_connection c, ZOOM_resultset resultset, Z_OtherInformation *o)
 

Detailed Description

Internal header for ZOOM implementation.

Definition in file zoom-p.h.

Macro Definition Documentation

#define RECORD_HASH_SIZE   131

Definition at line 131 of file zoom-p.h.

Referenced by record_hash(), ZOOM_resultset_cache_reset(), and ZOOM_resultset_create().

#define SHPTR   1

Definition at line 46 of file zoom-p.h.

#define STATE_CONNECTING   1

Definition at line 62 of file zoom-p.h.

Referenced by do_connect_host(), and do_write_ex().

#define STATE_ESTABLISHED   2

Definition at line 63 of file zoom-p.h.

Referenced by do_connect_host(), and ZOOM_connection_do_io().

#define STATE_IDLE   0

Definition at line 61 of file zoom-p.h.

Referenced by do_connect_host(), ZOOM_connection_create(), and ZOOM_event_nonblock().

#define ZOOM_TASK_CONNECT   3
#define ZOOM_TASK_PACKAGE   5
#define ZOOM_TASK_SCAN   4
#define ZOOM_TASK_SEARCH   1
#define ZOOM_TASK_SORT   6

Typedef Documentation

typedef struct ZOOM_Event_p* ZOOM_Event

Definition at line 48 of file zoom-p.h.

Definition at line 129 of file zoom-p.h.

typedef struct ZOOM_task_p* ZOOM_task

Definition at line 59 of file zoom-p.h.

Enumeration Type Documentation

enum zoom_ret
Enumerator
zoom_pending 
zoom_complete 

Definition at line 222 of file zoom-p.h.

Enumerator
zoom_sru_error 
zoom_sru_soap 
zoom_sru_get 
zoom_sru_post 
zoom_sru_solr 

Definition at line 50 of file zoom-p.h.

Function Documentation

zoom_ret send_Z3950_sort ( ZOOM_connection  c,
ZOOM_resultset  resultset 
)
ZOOM_task ZOOM_connection_add_task ( ZOOM_connection  c,
int  which 
)
char** ZOOM_connection_get_databases ( ZOOM_connection  con,
ZOOM_options  options,
int *  num,
ODR  odr 
)
ZOOM_Event ZOOM_connection_get_event ( ZOOM_connection  c)
void ZOOM_connection_put_event ( ZOOM_connection  c,
ZOOM_Event  event 
)
void ZOOM_connection_remove_events ( ZOOM_connection  c)

Definition at line 95 of file zoom-event.c.

References ZOOM_connection_get_event(), and ZOOM_Event_destroy().

Referenced by clear_error(), and ZOOM_connection_destroy().

void ZOOM_connection_remove_task ( ZOOM_connection  c)
void ZOOM_connection_remove_tasks ( ZOOM_connection  c)
zoom_ret ZOOM_connection_srw_send_scan ( ZOOM_connection  c)
zoom_ret ZOOM_connection_srw_send_search ( ZOOM_connection  c)

Definition at line 145 of file zoom-sru.c.

References Z_External::cql, ZOOM_connection_p::error, Z_SRW_searchRetrieveRequest::facetList, ZOOM_resultset_p::live_set, Z_SRW_searchRetrieveRequest::maximumRecords, ZOOM_resultset_p::odr, odr_intdup(), ZOOM_connection_p::odr_out, odr_strdup(), odr_strdup_null(), ZOOM_resultset_p::options, Z_SRW_searchRetrieveRequest::query, ZOOM_resultset_p::query, Z_SRW_searchRetrieveRequest::queryType, Z_SRW_searchRetrieveRequest::recordPacking, Z_SRW_searchRetrieveRequest::recordSchema, ZOOM_resultset_p::req_facets, Z_SRW_PDU::request, ZOOM_task_p::search, send_srw(), ZOOM_resultset_p::setname, ZOOM_resultset_p::size, Z_SRW_searchRetrieveRequest::sort, Z_SRW_searchRetrieveRequest::sort_type, Z_SRW_searchRetrieveRequest::sortKeys, Z_SRW_searchRetrieveRequest::startRecord, ZOOM_resultset_p::step, ZOOM_connection_p::tasks, Z_Query::type_1, Z_Query::type_104, Z_External::u, Z_SRW_PDU::u, ZOOM_task_p::u, Z_Query::u, Z_External::which, ZOOM_task_p::which, Z_Query::which, yaz_encode_sru_extra(), yaz_pqf_parse_facet_list(), Z_External_CQL, Z_Query_type_1, Z_Query_type_104, Z_SRW_searchRetrieve_request, Z_SRW_sort_type_sort, zoom_complete, ZOOM_ERROR_UNSUPPORTED_QUERY, ZOOM_memcached_search(), ZOOM_options_set(), ZOOM_query_get_query_string(), ZOOM_query_get_sru11(), ZOOM_query_get_Z_Query(), ZOOM_record_cache_lookup(), ZOOM_resultset_option_get(), ZOOM_set_error(), ZOOM_srw_get_pdu(), and ZOOM_TASK_SEARCH.

Referenced by handle_srw_response(), and ZOOM_connection_exec_task().

zoom_ret ZOOM_connection_Z3950_search ( ZOOM_connection  c)
zoom_ret ZOOM_connection_Z3950_send_init ( ZOOM_connection  c)

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

References ZOOM_connection_p::charset, Z_OtherInformationUnit::externallyDefinedInfo, ZOOM_connection_p::group, Z_IdPass::groupId, ZOOM_connection_p::host_port, Z_InitRequest::idAuthentication, Z_IdAuthentication::idPass, Z_InitRequest::implementationId, Z_InitRequest::implementationName, Z_InitRequest::implementationVersion, Z_OtherInformationUnit::information, Z_APDU::initRequest, 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_IdAuthentication::open, ZOOM_connection_p::options, Z_InitRequest::options, Z_InitRequest::otherInfo, ZOOM_connection_p::password, Z_IdPass::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(), and ZOOM_options_get().

Referenced by do_connect_host(), and ZOOM_connection_do_io().

zoom_ret ZOOM_connection_Z3950_send_scan ( ZOOM_connection  c)
ZOOM_Event ZOOM_Event_create ( int  kind)
void ZOOM_Event_destroy ( ZOOM_Event  event)

Definition at line 90 of file zoom-event.c.

References xfree.

Referenced by ZOOM_connection_process(), and ZOOM_connection_remove_events().

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 
)
void ZOOM_handle_search_result ( ZOOM_connection  c,
ZOOM_resultset  resultset,
Z_OtherInformation o 
)
int ZOOM_handle_sru ( ZOOM_connection  c,
Z_HTTP_Response hres,
zoom_ret cret,
char **  addinfo 
)
void ZOOM_handle_Z3950_apdu ( ZOOM_connection  c,
Z_APDU apdu 
)

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

References Z_APDU::close, ZOOM_connection_p::cookie_in, Z_Close::diagnosticInformation, Z_APDU::extendedServicesResponse, handle_Z3950_es_response(), handle_Z3950_present_response(), handle_Z3950_scan_response(), handle_Z3950_search_response(), handle_Z3950_sort_response(), ZOOM_connection_p::host_port, Z_InitResponse::implementationId, Z_InitResponse::implementationName, Z_InitResponse::implementationVersion, Z_APDU::initResponse, ZOOM_connection_p::log_api, ZOOM_connection_p::log_details, nmem_create(), nmem_destroy(), ODR_MASK_GET, Z_InitResponse::options, Z_InitResponse::otherInfo, Z_APDU::presentResponse, Z_InitResponse::protocolVersion, response_default_diag(), Z_InitResponse::result, Z_APDU::scanResponse, Z_APDU::searchResponse, send_Z3950_sort_present(), set_init_option(), Z_APDU::sortResponse, ZOOM_connection_p::support_named_resultsets, ZOOM_connection_p::tasks, Z_APDU::u, ZOOM_task_p::which, Z_APDU::which, xfree, xstrdup, yaz_decode_init_diag(), yaz_get_charneg_record(), yaz_get_response_charneg(), yaz_init_opt_decode(), yaz_log(), yaz_oi_get_string_oid(), yaz_oid_userinfo_cookie, Z_APDU_close, Z_APDU_extendedServicesResponse, Z_APDU_initResponse, Z_APDU_presentResponse, Z_APDU_scanResponse, Z_APDU_searchResponse, Z_APDU_sortResponse, Z_Options_namedResultSets, Z_Options_negotiationModel, Z_ProtocolVersion_3, zoom_complete, ZOOM_connection_close(), ZOOM_connection_exec_task(), ZOOM_connection_option_set(), ZOOM_connection_remove_task(), ZOOM_connection_set_mask(), ZOOM_connection_Z3950_search(), ZOOM_ERROR_CONNECTION_LOST, ZOOM_ERROR_DECODE, ZOOM_ERROR_INIT, ZOOM_set_dset_error(), ZOOM_set_error(), ZOOM_TASK_CONNECT, and ZOOM_test_reconnect().

Referenced by do_read().

void ZOOM_memcached_add ( ZOOM_resultset  r,
Z_NamePlusRecord npr,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema,
Z_SRW_diagnostic diag 
)
int ZOOM_memcached_configure ( ZOOM_connection  c)
void ZOOM_memcached_destroy ( ZOOM_connection  c)
void ZOOM_memcached_hitcount ( ZOOM_connection  c,
ZOOM_resultset  result,
Z_OtherInformation oi,
const char *  precision 
)
void ZOOM_memcached_init ( ZOOM_connection  c)
Z_NamePlusRecord* ZOOM_memcached_lookup ( ZOOM_resultset  r,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema 
)
void ZOOM_memcached_resultset ( ZOOM_resultset  r,
ZOOM_query  q 
)
void ZOOM_memcached_search ( ZOOM_connection  c,
ZOOM_resultset  r 
)
void ZOOM_options_addref ( ZOOM_options  opt)

Definition at line 113 of file zoom-opt.c.

References ZOOM_API.

void ZOOM_query_get_hash ( ZOOM_query  s,
WRBUF  w 
)
const char* ZOOM_query_get_query_string ( ZOOM_query  s)
Z_SortKeySpecList* ZOOM_query_get_sortspec ( ZOOM_query  s)
const char* ZOOM_query_get_sru11 ( ZOOM_query  s)

Definition at line 122 of file zoom-query.c.

References ZOOM_query_p::sru11_sort_spec, wrbuf_cstr(), and wrbuf_len.

Referenced by ZOOM_connection_srw_send_search().

Z_Query* ZOOM_query_get_Z_Query ( ZOOM_query  s)
void ZOOM_record_cache_add ( ZOOM_resultset  r,
Z_NamePlusRecord npr,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema,
Z_SRW_diagnostic diag 
)

Definition at line 124 of file zoom-record-cache.c.

References record_cache_add(), and ZOOM_memcached_add().

Referenced by handle_srw_response(), and handle_Z3950_records().

ZOOM_record ZOOM_record_cache_lookup ( ZOOM_resultset  r,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema 
)
ZOOM_record ZOOM_record_cache_lookup_i ( ZOOM_resultset  r,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema 
)
zoom_ret ZOOM_send_buf ( ZOOM_connection  c)
zoom_ret ZOOM_send_GDU ( ZOOM_connection  c,
Z_GDU gdu 
)
void ZOOM_set_dset_error ( ZOOM_connection  c,
int  error,
const char *  dset,
const char *  addinfo,
const char *  addinfo2 
)
void ZOOM_set_error ( ZOOM_connection  c,
int  error,
const char *  addinfo 
)
void ZOOM_set_HTTP_error ( ZOOM_connection  c,
int  error,
const char *  addinfo,
const char *  addinfo2 
)

Definition at line 1546 of file zoom-c.c.

References ZOOM_set_dset_error().

Referenced by handle_http(), and ZOOM_handle_sru().

int ZOOM_test_reconnect ( ZOOM_connection  c)
int ZOOM_uri_to_code ( const char *  uri)

Definition at line 89 of file zoom-c.c.

Referenced by set_SRU_error(), and ZOOM_record_error().