YAZ  5.23.1
Macros | Typedefs | Functions
zoom.h File Reference

Header for ZOOM. More...

#include <stdlib.h>
#include <yaz/yconfig.h>

Go to the source code of this file.

Macros

#define ZOOM_BEGIN_CDECL   YAZ_BEGIN_CDECL
 
#define ZOOM_END_CDECL   YAZ_END_CDECL
 
#define ZOOM_API(x)   x
 
#define ZOOM_ERROR_NONE   0
 
#define ZOOM_ERROR_CONNECT   10000
 
#define ZOOM_ERROR_MEMORY   10001
 
#define ZOOM_ERROR_ENCODE   10002
 
#define ZOOM_ERROR_DECODE   10003
 
#define ZOOM_ERROR_CONNECTION_LOST   10004
 
#define ZOOM_ERROR_INIT   10005
 
#define ZOOM_ERROR_INTERNAL   10006
 
#define ZOOM_ERROR_TIMEOUT   10007
 
#define ZOOM_ERROR_UNSUPPORTED_PROTOCOL   10008
 
#define ZOOM_ERROR_UNSUPPORTED_QUERY   10009
 
#define ZOOM_ERROR_INVALID_QUERY   10010
 
#define ZOOM_ERROR_CQL_PARSE   10011
 
#define ZOOM_ERROR_CQL_TRANSFORM   10012
 
#define ZOOM_ERROR_CCL_CONFIG   10013
 
#define ZOOM_ERROR_CCL_PARSE   10014
 
#define ZOOM_ERROR_ES_INVALID_ACTION   10015
 
#define ZOOM_ERROR_ES_INVALID_VERSION   10016
 
#define ZOOM_ERROR_ES_INVALID_SYNTAX   10017
 
#define ZOOM_ERROR_MEMCACHED   10018
 
#define ZOOM_EVENT_NONE   0
 
#define ZOOM_EVENT_CONNECT   1
 
#define ZOOM_EVENT_SEND_DATA   2
 
#define ZOOM_EVENT_RECV_DATA   3
 
#define ZOOM_EVENT_TIMEOUT   4
 
#define ZOOM_EVENT_UNKNOWN   5
 
#define ZOOM_EVENT_SEND_APDU   6
 
#define ZOOM_EVENT_RECV_APDU   7
 
#define ZOOM_EVENT_RECV_RECORD   8
 
#define ZOOM_EVENT_RECV_SEARCH   9
 
#define ZOOM_EVENT_END   10
 
#define ZOOM_EVENT_MAX   10
 
#define ZOOM_SELECT_READ   1
 select/poll socket mask: read More...
 
#define ZOOM_SELECT_WRITE   2
 select/poll socket mask: write More...
 
#define ZOOM_SELECT_EXCEPT   4
 select/poll socket mask: except More...
 

Typedefs

typedef typedefZOOM_BEGIN_CDECL struct ZOOM_options_pZOOM_options
 
typedef struct ZOOM_query_pZOOM_query
 
typedef struct ZOOM_connection_pZOOM_connection
 
typedef struct ZOOM_resultset_pZOOM_resultset
 
typedef struct ZOOM_record_pZOOM_record
 
typedef struct ZOOM_facet_field_pZOOM_facet_field
 
typedef struct ZOOM_scanset_pZOOM_scanset
 
typedef struct ZOOM_package_pZOOM_package
 
typedef const char *(* ZOOM_options_callback) (void *handle, const char *name)
 

Functions

 ZOOM_connection_new (const char *host, int portnum)
 
 ZOOM_connection_create (ZOOM_options options)
 
 ZOOM_connection_connect (ZOOM_connection c, const char *host, int portnum)
 
 ZOOM_connection_close (ZOOM_connection c)
 
 ZOOM_connection_destroy (ZOOM_connection c)
 
 ZOOM_connection_option_get (ZOOM_connection c, const char *key)
 
 ZOOM_connection_option_getl (ZOOM_connection c, const char *key, int *lenp)
 
 ZOOM_connection_option_set (ZOOM_connection c, const char *key, const char *val)
 
 ZOOM_connection_option_setl (ZOOM_connection c, const char *key, const char *val, int len)
 
 ZOOM_connection_error (ZOOM_connection c, const char **cp, const char **addinfo)
 
 ZOOM_connection_error_x (ZOOM_connection c, const char **cp, const char **addinfo, const char **diagset)
 
 ZOOM_connection_errcode (ZOOM_connection c)
 
 ZOOM_connection_errmsg (ZOOM_connection c)
 
 ZOOM_connection_addinfo (ZOOM_connection c)
 
 ZOOM_connection_diagset (ZOOM_connection c)
 
 ZOOM_diag_str (int error)
 
 ZOOM_connection_last_event (ZOOM_connection cs)
 
 ZOOM_connection_search (ZOOM_connection, ZOOM_query q)
 
 ZOOM_connection_search_pqf (ZOOM_connection c, const char *q)
 
 ZOOM_resultset_destroy (ZOOM_resultset r)
 
 ZOOM_resultset_release (ZOOM_resultset r)
 
 ZOOM_resultset_option_get (ZOOM_resultset r, const char *key)
 
 ZOOM_resultset_option_set (ZOOM_resultset r, const char *key, const char *val)
 
 ZOOM_resultset_size (ZOOM_resultset r)
 
 ZOOM_resultset_records (ZOOM_resultset r, ZOOM_record *recs, size_t start, size_t count)
 
 ZOOM_resultset_record (ZOOM_resultset s, size_t pos)
 
 ZOOM_resultset_record_immediate (ZOOM_resultset s, size_t pos)
 
 ZOOM_resultset_cache_reset (ZOOM_resultset r)
 
 ZOOM_resultset_get_facet_field (ZOOM_resultset r, const char *facet_name)
 
 ZOOM_resultset_get_facet_field_by_index (ZOOM_resultset r, int pos)
 
 ZOOM_resultset_facets_size (ZOOM_resultset r)
 
 ZOOM_resultset_facets (ZOOM_resultset r)
 
 ZOOM_resultset_facets_names (ZOOM_resultset r)
 
 ZOOM_record_get (ZOOM_record rec, const char *type, int *len)
 
 ZOOM_record_destroy (ZOOM_record rec)
 
 ZOOM_record_clone (ZOOM_record srec)
 
 ZOOM_record_error (ZOOM_record rec, const char **msg, const char **addinfo, const char **diagset)
 
 ZOOM_facet_field_name (ZOOM_facet_field facet_field)
 
 ZOOM_facet_field_term_count (ZOOM_facet_field facet_field)
 
 ZOOM_facet_field_get_term (ZOOM_facet_field facet_field, size_t idx, int *freq)
 
 ZOOM_query_create (void)
 
 ZOOM_query_destroy (ZOOM_query s)
 
 ZOOM_query_cql (ZOOM_query s, const char *str)
 
 ZOOM_query_cql2rpn (ZOOM_query s, const char *str, ZOOM_connection conn)
 
 ZOOM_query_ccl2rpn (ZOOM_query s, const char *query_str, const char *config, int *ccl_error, const char **error_string, int *error_pos)
 
 ZOOM_query_prefix (ZOOM_query s, const char *str)
 
 ZOOM_query_sortby (ZOOM_query s, const char *criteria)
 
 ZOOM_query_sortby2 (ZOOM_query s, const char *strategy, const char *criteria)
 
 ZOOM_query_addref (ZOOM_query s)
 
 ZOOM_connection_scan (ZOOM_connection c, const char *startterm)
 
 ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query startterm)
 
 ZOOM_scanset_term (ZOOM_scanset scan, size_t pos, size_t *occ, size_t *len)
 
 ZOOM_scanset_display_term (ZOOM_scanset scan, size_t pos, size_t *occ, size_t *len)
 
 ZOOM_scanset_size (ZOOM_scanset scan)
 
 ZOOM_scanset_destroy (ZOOM_scanset scan)
 
 ZOOM_scanset_option_get (ZOOM_scanset scan, const char *key)
 
 ZOOM_scanset_option_set (ZOOM_scanset scan, const char *key, const char *val)
 
 ZOOM_connection_package (ZOOM_connection c, ZOOM_options options)
 
 ZOOM_package_destroy (ZOOM_package p)
 
 ZOOM_package_send (ZOOM_package p, const char *type)
 
 ZOOM_package_option_get (ZOOM_package p, const char *key)
 
 ZOOM_package_option_getl (ZOOM_package p, const char *key, int *lenp)
 
 ZOOM_package_option_set (ZOOM_package p, const char *key, const char *val)
 
 ZOOM_package_option_setl (ZOOM_package p, const char *key, const char *val, int len)
 
 ZOOM_resultset_sort (ZOOM_resultset r, const char *sort_type, const char *sort_spec)
 
 ZOOM_resultset_sort1 (ZOOM_resultset r, const char *sort_type, const char *sort_spec)
 
 ZOOM_options_set_callback (ZOOM_options opt, ZOOM_options_callback c, void *handle)
 
 ZOOM_options_create (void)
 
 ZOOM_options_create_with_parent (ZOOM_options parent)
 
 ZOOM_options_create_with_parent2 (ZOOM_options parent1, ZOOM_options parent2)
 
 ZOOM_options_dup (ZOOM_options src)
 
 ZOOM_options_get (ZOOM_options opt, const char *name)
 
 ZOOM_options_getl (ZOOM_options opt, const char *name, int *lenp)
 
 ZOOM_options_set (ZOOM_options opt, const char *name, const char *v)
 
 ZOOM_options_setl (ZOOM_options opt, const char *name, const char *value, int len)
 
 ZOOM_options_destroy (ZOOM_options opt)
 
 ZOOM_options_get_bool (ZOOM_options opt, const char *name, int defa)
 
 ZOOM_options_get_int (ZOOM_options opt, const char *name, int defa)
 
 ZOOM_options_set_int (ZOOM_options opt, const char *name, int value)
 
 ZOOM_event (int no, ZOOM_connection *cs)
 wait for events on connection(s) (BLOCKING) More...
 
 ZOOM_connection_is_idle (ZOOM_connection c)
 determines if connection is idle (no active or pending work) More...
 
 ZOOM_event_nonblock (int no, ZOOM_connection *cs)
 process one event for one of connections given More...
 
 ZOOM_connection_process (ZOOM_connection c)
 process one event for connection More...
 
 ZOOM_connection_exec_task (ZOOM_connection c)
 executes non-blocking tasks for connection More...
 
 ZOOM_connection_get_socket (ZOOM_connection c)
 get socket fd for ZOOM connection More...
 
 ZOOM_connection_get_mask (ZOOM_connection c)
 get socket mask for connection More...
 
 ZOOM_connection_set_mask (ZOOM_connection c, int mask)
 set socket mask for connection (DO NOT call outside zoom) More...
 
 ZOOM_connection_get_timeout (ZOOM_connection c)
 get timeout in seconds for ZOOM connection More...
 
 ZOOM_connection_fire_event_timeout (ZOOM_connection c)
 fire socket event timeout More...
 
 ZOOM_connection_fire_event_socket (ZOOM_connection c, int mask)
 fire socket event activity (read,write,except) More...
 
 ZOOM_connection_peek_event (ZOOM_connection c)
 peek at next event More...
 
 ZOOM_get_event_str (int event)
 

Detailed Description

Header for ZOOM.

Definition in file zoom.h.

Macro Definition Documentation

#define ZOOM_API (   x)    x
#define ZOOM_BEGIN_CDECL   YAZ_BEGIN_CDECL

Definition at line 36 of file zoom.h.

#define ZOOM_END_CDECL   YAZ_END_CDECL

Definition at line 37 of file zoom.h.

#define ZOOM_ERROR_CCL_CONFIG   10013

Definition at line 141 of file zoom.h.

Referenced by ZOOM_diag_str().

#define ZOOM_ERROR_CCL_PARSE   10014

Definition at line 142 of file zoom.h.

Referenced by ZOOM_diag_str().

#define ZOOM_ERROR_CONNECT   10000
#define ZOOM_ERROR_CONNECTION_LOST   10004
#define ZOOM_ERROR_CQL_PARSE   10011

Definition at line 139 of file zoom.h.

Referenced by cql2pqf(), and ZOOM_diag_str().

#define ZOOM_ERROR_CQL_TRANSFORM   10012

Definition at line 140 of file zoom.h.

Referenced by cql2pqf(), and ZOOM_diag_str().

#define ZOOM_ERROR_DECODE   10003
#define ZOOM_ERROR_ENCODE   10002

Definition at line 130 of file zoom.h.

Referenced by encode_APDU(), and ZOOM_diag_str().

#define ZOOM_ERROR_ES_INVALID_ACTION   10015

Definition at line 143 of file zoom.h.

Referenced by create_update_package(), and ZOOM_diag_str().

#define ZOOM_ERROR_ES_INVALID_SYNTAX   10017

Definition at line 145 of file zoom.h.

Referenced by create_update_package(), and ZOOM_diag_str().

#define ZOOM_ERROR_ES_INVALID_VERSION   10016

Definition at line 144 of file zoom.h.

Referenced by create_update_package(), and ZOOM_diag_str().

#define ZOOM_ERROR_INIT   10005

Definition at line 133 of file zoom.h.

Referenced by clear_error(), ZOOM_diag_str(), and ZOOM_handle_Z3950_apdu().

#define ZOOM_ERROR_INTERNAL   10006

Definition at line 134 of file zoom.h.

Referenced by clear_error(), ZOOM_connection_connect(), and ZOOM_diag_str().

#define ZOOM_ERROR_INVALID_QUERY   10010

Definition at line 138 of file zoom.h.

Referenced by Z3950_send_search(), ZOOM_connection_Z3950_send_scan(), and ZOOM_diag_str().

#define ZOOM_ERROR_MEMCACHED   10018

Definition at line 146 of file zoom.h.

Referenced by ZOOM_diag_str(), and ZOOM_memcached_configure().

#define ZOOM_ERROR_MEMORY   10001

Definition at line 129 of file zoom.h.

Referenced by clear_error(), and ZOOM_diag_str().

#define ZOOM_ERROR_NONE   0
#define ZOOM_ERROR_TIMEOUT   10007

Definition at line 135 of file zoom.h.

Referenced by ZOOM_connection_last_event(), and ZOOM_diag_str().

#define ZOOM_ERROR_UNSUPPORTED_PROTOCOL   10008

Definition at line 136 of file zoom.h.

Referenced by clear_error(), do_connect_host(), ZOOM_connection_connect(), and ZOOM_diag_str().

#define ZOOM_ERROR_UNSUPPORTED_QUERY   10009
#define ZOOM_EVENT_CONNECT   1

Definition at line 152 of file zoom.h.

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

#define ZOOM_EVENT_END   10

Definition at line 161 of file zoom.h.

Referenced by ZOOM_connection_remove_task().

#define ZOOM_EVENT_MAX   10

Definition at line 162 of file zoom.h.

#define ZOOM_EVENT_NONE   0
#define ZOOM_EVENT_RECV_APDU   7

Definition at line 158 of file zoom.h.

Referenced by do_read().

#define ZOOM_EVENT_RECV_DATA   3

Definition at line 154 of file zoom.h.

Referenced by do_read().

#define ZOOM_EVENT_RECV_RECORD   8

Definition at line 159 of file zoom.h.

Referenced by record_cache_add(), and ZOOM_record_cache_lookup().

#define ZOOM_EVENT_RECV_SEARCH   9
#define ZOOM_EVENT_SEND_APDU   6

Definition at line 157 of file zoom.h.

Referenced by send_APDU(), send_package(), and ZOOM_send_GDU().

#define ZOOM_EVENT_SEND_DATA   2

Definition at line 153 of file zoom.h.

Referenced by do_write_ex().

#define ZOOM_EVENT_TIMEOUT   4

Definition at line 155 of file zoom.h.

Referenced by ZOOM_connection_last_event().

#define ZOOM_EVENT_UNKNOWN   5

Definition at line 156 of file zoom.h.

#define ZOOM_SELECT_EXCEPT   4

select/poll socket mask: except

Definition at line 419 of file zoom.h.

Referenced by do_connect_host(), do_write_ex(), ZOOM_connection_do_io(), and ZOOM_event_sys_yaz_poll().

#define ZOOM_SELECT_READ   1

select/poll socket mask: read

Definition at line 415 of file zoom.h.

Referenced by do_connect_host(), do_write_ex(), ZOOM_connection_do_io(), and ZOOM_event_sys_yaz_poll().

#define ZOOM_SELECT_WRITE   2

select/poll socket mask: write

Definition at line 417 of file zoom.h.

Referenced by do_connect_host(), do_write_ex(), ZOOM_connection_do_io(), and ZOOM_event_sys_yaz_poll().

Typedef Documentation

Definition at line 52 of file zoom.h.

Definition at line 55 of file zoom.h.

typedef typedefZOOM_BEGIN_CDECL struct ZOOM_options_p* ZOOM_options

Definition at line 50 of file zoom.h.

typedef const char*(* ZOOM_options_callback) (void *handle, const char *name)

Definition at line 59 of file zoom.h.

typedef struct ZOOM_package_p* ZOOM_package

Definition at line 57 of file zoom.h.

typedef struct ZOOM_query_p* ZOOM_query

Definition at line 51 of file zoom.h.

typedef struct ZOOM_record_p* ZOOM_record

Definition at line 54 of file zoom.h.

Definition at line 53 of file zoom.h.

typedef struct ZOOM_scanset_p* ZOOM_scanset

Definition at line 56 of file zoom.h.

Function Documentation

ZOOM_connection_addinfo ( ZOOM_connection  c)

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

References ZOOM_API(), and ZOOM_connection_error().

ZOOM_connection_close ( ZOOM_connection  c)
ZOOM_connection_connect ( ZOOM_connection  c,
const char *  host,
int  portnum 
)

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

References ZOOM_connection_p::async, ZOOM_connection_p::charset, ZOOM_connection_p::client_IP, ZOOM_resultset_p::connection, ZOOM_connection_p::cookie_out, ZOOM_connection_p::cookies, ZOOM_connection_p::cs, get_sru_mode_from_string(), ZOOM_connection_p::group, ZOOM_connection_p::host_port, initlog(), ZOOM_connection_p::lang, ZOOM_connection_p::log_api, ZOOM_connection_p::log_details, ZOOM_connection_p::maximum_record_size, ZOOM_resultset_p::next, odr_createmem(), odr_destroy(), ZOOM_connection_p::odr_print, ODR_PRINT, odr_setprint(), odr_setprint_noclose(), ZOOM_connection_p::options, ZOOM_connection_p::password, ZOOM_connection_p::preferred_message_size, ZOOM_connection_p::proxy, ZOOM_connection_p::reconnect_ok, ZOOM_connection_p::resultsets, ZOOM_connection_p::sru_mode, ZOOM_connection_p::sru_version, ZOOM_connection_p::tproxy, ZOOM_connection_p::url_authentication, ZOOM_connection_p::user, wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), xfree, xmalloc, xstrdup, yaz_cookies_create(), yaz_cookies_destroy(), yaz_log(), yaz_log_file(), ZOOM_API(), ZOOM_connection_add_task(), ZOOM_connection_option_set(), ZOOM_connection_remove_tasks(), ZOOM_ERROR_INTERNAL, ZOOM_ERROR_NONE, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, ZOOM_event(), ZOOM_memcached_configure(), ZOOM_options_get(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_options_set(), ZOOM_resultset_release(), ZOOM_set_error(), zoom_sru_error, and ZOOM_TASK_CONNECT.

Referenced by ZOOM_connection_new().

ZOOM_connection_create ( ZOOM_options  options)

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

References ZOOM_connection_p::addinfo, ZOOM_connection_p::async, ZOOM_connection_p::buf_in, ZOOM_connection_p::buf_out, ZOOM_connection_p::charset, ZOOM_connection_p::client_IP, ZOOM_connection_p::cookie_in, ZOOM_connection_p::cookie_out, ZOOM_connection_p::cookies, ZOOM_connection_p::cs, ZOOM_connection_p::diagset, ZOOM_connection_p::group, ZOOM_connection_p::host_port, initlog(), ZOOM_connection_p::lang, ZOOM_connection_p::last_event, ZOOM_connection_p::len_in, ZOOM_connection_p::len_out, ZOOM_connection_p::location, ZOOM_connection_p::log_api, log_api0, ZOOM_connection_p::log_details, log_details0, ZOOM_connection_p::m_queue_back, ZOOM_connection_p::m_queue_front, ZOOM_connection_p::maximum_record_size, ZOOM_connection_p::no_redirects, odr_createmem(), ODR_DECODE, ODR_ENCODE, ZOOM_connection_p::odr_in, ZOOM_connection_p::odr_out, ZOOM_connection_p::odr_print, ZOOM_connection_p::odr_save, ZOOM_connection_p::options, ZOOM_connection_p::password, ZOOM_connection_p::preferred_message_size, ZOOM_connection_p::proto, PROTO_Z3950, ZOOM_connection_p::proxy, ZOOM_connection_p::proxy_mode, ZOOM_connection_p::reconnect_ok, ZOOM_connection_p::resultsets, ZOOM_connection_p::saveAPDU_wrbuf, ZOOM_connection_p::sru_version, ZOOM_connection_p::state, STATE_IDLE, ZOOM_connection_p::support_named_resultsets, ZOOM_connection_p::tasks, ZOOM_connection_p::tproxy, ZOOM_connection_p::url_authentication, ZOOM_connection_p::user, xmalloc, yaz_log(), ZOOM_connection_set_mask(), ZOOM_ERROR_NONE, ZOOM_EVENT_NONE, ZOOM_memcached_init(), ZOOM_options_create_with_parent(), and ZOOM_set_error().

Referenced by ZOOM_connection_new(), and ZOOM_query_cql2rpn().

ZOOM_connection_destroy ( ZOOM_connection  c)
ZOOM_connection_diagset ( ZOOM_connection  c)

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

References ZOOM_API(), and ZOOM_connection_error_x().

ZOOM_connection_errcode ( ZOOM_connection  c)

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

References ZOOM_API(), and ZOOM_connection_error().

ZOOM_connection_errmsg ( ZOOM_connection  c)

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

References ZOOM_API(), and ZOOM_connection_error().

ZOOM_connection_error ( ZOOM_connection  c,
const char **  cp,
const char **  addinfo 
)
ZOOM_connection_error_x ( ZOOM_connection  c,
const char **  cp,
const char **  addinfo,
const char **  diagset 
)
ZOOM_connection_exec_task ( ZOOM_connection  c)

executes non-blocking tasks for connection

Parameters
cconnection
Return values
0no task was executed
1task was executed (but probably not completed)

This function, unlike, ZOOM_connection_process, does not try to return any events (and remove them). But events may be generated from it. These are saved and may later be retrieved with ZOOM_connection_process and ZOOM_connection_last_event .

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

References ZOOM_connection_p::cs, do_connect(), ZOOM_connection_p::error, ZOOM_connection_p::log_details, ZOOM_connection_p::proto, PROTO_HTTP, ZOOM_task_p::running, send_package(), send_Z3950_sort(), ZOOM_task_p::sort, ZOOM_connection_p::tasks, ZOOM_task_p::u, ZOOM_task_p::which, yaz_log(), zoom_complete, ZOOM_connection_remove_task(), ZOOM_connection_remove_tasks(), ZOOM_connection_srw_send_scan(), ZOOM_connection_srw_send_search(), ZOOM_connection_Z3950_search(), ZOOM_connection_Z3950_send_scan(), ZOOM_ERROR_NONE, ZOOM_query_get_sortspec(), ZOOM_TASK_CONNECT, ZOOM_TASK_PACKAGE, ZOOM_TASK_SCAN, ZOOM_TASK_SEARCH, and ZOOM_TASK_SORT.

Referenced by do_connect_host(), ZOOM_connection_do_io(), ZOOM_connection_process(), and ZOOM_handle_Z3950_apdu().

ZOOM_connection_fire_event_socket ( ZOOM_connection  c,
int  mask 
)

fire socket event activity (read,write,except)

Parameters
cconnection
maskor'ed mask of ZOOM_SELECT_.. values
Return values
0event was fired OK
-1event was not fired

Referenced by ZOOM_event_nonblock(), and ZOOM_event_sys_yaz_poll().

ZOOM_connection_fire_event_timeout ( ZOOM_connection  c)

fire socket event timeout

Parameters
cconnection
Return values
0event was fired OK
-1event was not fired

Call this function when a timeout occurs - for example in the case of select(2) returning 0.

Referenced by ZOOM_connection_last_event(), and ZOOM_event_sys_yaz_poll().

ZOOM_connection_get_mask ( ZOOM_connection  c)

get socket mask for connection

Parameters
cconnection
Returns
mask for connection (possibly 0)

Use this function when preparing for socket select/poll and in conjunction with ZOOM_connection_get_socket.

Referenced by ZOOM_event_nonblock(), and ZOOM_event_sys_yaz_poll().

ZOOM_connection_get_socket ( ZOOM_connection  c)

get socket fd for ZOOM connection

Parameters
cconnection
Return values
-1no socket assigned for connection
>=0socket for connection

Use this function when preparing for socket/poll and in conjunction with ZOOM_connection_get_mask.

Referenced by ZOOM_event_nonblock(), and ZOOM_event_sys_yaz_poll().

ZOOM_connection_get_timeout ( ZOOM_connection  c)

get timeout in seconds for ZOOM connection

Parameters
cconnection
Returns
timeout value in seconds

Use this function when preparing for socket/poll and in conjunction with ZOOM_connection_get_socket.

Referenced by ZOOM_event_nonblock(), and ZOOM_event_sys_yaz_poll().

ZOOM_connection_is_idle ( ZOOM_connection  c)

determines if connection is idle (no active or pending work)

Parameters
cconnection
Return values
1is idle
0is non-idle (active)
ZOOM_connection_last_event ( ZOOM_connection  cs)
ZOOM_connection_new ( const char *  host,
int  portnum 
)

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

References ZOOM_connection_connect(), and ZOOM_connection_create().

ZOOM_connection_option_get ( ZOOM_connection  c,
const char *  key 
)
ZOOM_connection_option_getl ( ZOOM_connection  c,
const char *  key,
int *  lenp 
)
ZOOM_connection_option_set ( ZOOM_connection  c,
const char *  key,
const char *  val 
)
ZOOM_connection_option_setl ( ZOOM_connection  c,
const char *  key,
const char *  val,
int  len 
)

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

References ZOOM_connection_p::options, ZOOM_API(), and ZOOM_options_setl().

Referenced by get_cert().

ZOOM_connection_package ( ZOOM_connection  c,
ZOOM_options  options 
)
ZOOM_connection_peek_event ( ZOOM_connection  c)

peek at next event

Parameters
cconnection
Returns
ZOOM_EVENT_NONE (for no events in queue), ZOOM_EVENT_CONNECT, ..

Does not actually remove the event from the event queue. ZOOM_event and ZOOM_process_event removes one event.

ZOOM_connection_process ( ZOOM_connection  c)

process one event for connection

Parameters
cconnection
Return values
0no event was processed
1event was processed for connection

This function attemps to deal with outstandings events in a non-blocking fashion. If no event was processed (return value of 0), then the system should attempt to deal with sockets in blocking mode using socket select/poll which means calling the following functions: ZOOM_connection_get_socket, ZOOM_connection_get_mask, ZOOM_connection_get_timeout. If an event was processed call this function again.

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

References ZOOM_API(), ZOOM_connection_exec_task(), ZOOM_connection_get_event(), and ZOOM_Event_destroy().

Referenced by ZOOM_event_nonblock().

ZOOM_connection_scan ( ZOOM_connection  c,
const char *  startterm 
)
ZOOM_connection_scan1 ( ZOOM_connection  c,
ZOOM_query  startterm 
)
ZOOM_connection_search ( ZOOM_connection  ,
ZOOM_query  q 
)
ZOOM_connection_search_pqf ( ZOOM_connection  c,
const char *  q 
)
ZOOM_connection_set_mask ( ZOOM_connection  c,
int  mask 
)

set socket mask for connection (DO NOT call outside zoom)

Referenced by do_connect_host(), do_write_ex(), handle_http(), ZOOM_connection_create(), ZOOM_connection_do_io(), ZOOM_event_nonblock(), and ZOOM_handle_Z3950_apdu().

ZOOM_diag_str ( int  error)
ZOOM_event ( int  no,
ZOOM_connection cs 
)

wait for events on connection(s) (BLOCKING)

Parameters
nonumber of connections (size of cs)
csconnection array
Return values
0no event was fired
>0event was fired for connection at (retval-1)

blocking poll for events on a number of connections. Returns positive integer if event occurred ; zero if none occurred and no more events are pending. The positive integer specifies the connection for which the event occurred.

Definition at line 99 of file zoom-socket.c.

References ZOOM_event_nonblock(), and ZOOM_event_sys_yaz_poll().

Referenced by ZOOM_connection_connect(), ZOOM_connection_scan1(), ZOOM_connection_search(), ZOOM_package_send(), ZOOM_resultset_retrieve(), and ZOOM_resultset_sort1().

ZOOM_event_nonblock ( int  no,
ZOOM_connection cs 
)

process one event for one of connections given

Parameters
nonumber of connections (size of cs)
csconnection array
Return values
0no event was processed
>0event was processed for connection at (retval-1)

This function attemps to deal with outstandings events in a non-blocking mode. If no events was processed (return value of 0), then the system should attempt to deal with sockets in blocking mode using socket select/poll which means calling the following functions: ZOOM_connection_get_socket, ZOOM_connection_get_mask, ZOOM_connection_get_timeout.

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

References ZOOM_connection_p::cs, cs_close, cs_fileno, log_details0, ZOOM_connection_p::mask, mask, ZOOM_connection_p::options, ZOOM_connection_p::state, STATE_IDLE, yaz_log(), ZOOM_API(), ZOOM_connection_close(), ZOOM_connection_do_io(), ZOOM_connection_fire_event_socket(), ZOOM_connection_get_mask(), ZOOM_connection_get_socket(), ZOOM_connection_get_timeout(), ZOOM_connection_process(), ZOOM_connection_set_mask(), and ZOOM_options_get_int().

Referenced by ZOOM_event().

ZOOM_facet_field_get_term ( ZOOM_facet_field  facet_field,
size_t  idx,
int *  freq 
)

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

ZOOM_facet_field_name ( ZOOM_facet_field  facet_field)

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

References ZOOM_API().

Referenced by ZOOM_handle_facet_list().

ZOOM_facet_field_term_count ( ZOOM_facet_field  facet_field)

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

References ZOOM_API().

ZOOM_get_event_str ( int  event)
ZOOM_options_create ( void  )

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

References ZOOM_API, and ZOOM_options_create_with_parent().

Referenced by ZOOM_options_dup().

ZOOM_options_create_with_parent ( ZOOM_options  parent)
ZOOM_options_create_with_parent2 ( ZOOM_options  parent1,
ZOOM_options  parent2 
)

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

References opt, and xmalloc.

Referenced by ZOOM_connection_package(), and ZOOM_options_create_with_parent().

ZOOM_options_destroy ( ZOOM_options  opt)
ZOOM_options_dup ( ZOOM_options  src)
ZOOM_options_get ( ZOOM_options  opt,
const char *  name 
)
ZOOM_options_get_bool ( ZOOM_options  opt,
const char *  name,
int  defa 
)
ZOOM_options_get_int ( ZOOM_options  opt,
const char *  name,
int  defa 
)
ZOOM_options_getl ( ZOOM_options  opt,
const char *  name,
int *  lenp 
)
ZOOM_options_set ( ZOOM_options  opt,
const char *  name,
const char *  v 
)
ZOOM_options_set_callback ( ZOOM_options  opt,
ZOOM_options_callback  c,
void *  handle 
)

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

References opt, and ZOOM_API.

ZOOM_options_set_int ( ZOOM_options  opt,
const char *  name,
int  value 
)
ZOOM_options_setl ( ZOOM_options  opt,
const char *  name,
const char *  value,
int  len 
)
ZOOM_package_destroy ( ZOOM_package  p)
ZOOM_package_option_get ( ZOOM_package  p,
const char *  key 
)

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

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

ZOOM_package_option_getl ( ZOOM_package  p,
const char *  key,
int *  lenp 
)

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

References ZOOM_package_p::options, ZOOM_API(), and ZOOM_options_getl().

ZOOM_package_option_set ( ZOOM_package  p,
const char *  key,
const char *  val 
)

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

References ZOOM_package_p::options, ZOOM_API(), and ZOOM_options_set().

ZOOM_package_option_setl ( ZOOM_package  p,
const char *  key,
const char *  val,
int  len 
)

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

References ZOOM_package_p::options, ZOOM_API(), and ZOOM_options_setl().

ZOOM_package_send ( ZOOM_package  p,
const char *  type 
)
ZOOM_query_addref ( ZOOM_query  s)

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

References ZOOM_query_p::refcount, and ZOOM_API.

Referenced by ZOOM_connection_scan1(), and ZOOM_connection_search().

ZOOM_query_ccl2rpn ( ZOOM_query  s,
const char *  query_str,
const char *  config,
int *  ccl_error,
const char **  error_string,
int *  error_pos 
)
ZOOM_query_cql ( ZOOM_query  s,
const char *  str 
)
ZOOM_query_cql2rpn ( ZOOM_query  s,
const char *  str,
ZOOM_connection  conn 
)
ZOOM_query_create ( void  )
ZOOM_query_destroy ( ZOOM_query  s)
ZOOM_query_prefix ( ZOOM_query  s,
const char *  str 
)
ZOOM_query_sortby ( ZOOM_query  s,
const char *  criteria 
)

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

References ZOOM_API, and ZOOM_query_sortby2().

Referenced by ZOOM_resultset_sort1().

ZOOM_query_sortby2 ( ZOOM_query  s,
const char *  strategy,
const char *  criteria 
)
ZOOM_record_clone ( ZOOM_record  srec)
ZOOM_record_destroy ( ZOOM_record  rec)

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

References xfree, and ZOOM_record_release().

ZOOM_record_error ( ZOOM_record  rec,
const char **  msg,
const char **  addinfo,
const char **  diagset 
)
ZOOM_record_get ( ZOOM_record  rec,
const char *  type,
int *  len 
)

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

References wrbuf_alloc(), yaz_record_render(), YAZ_SHPTR_INIT, and ZOOM_API.

ZOOM_resultset_cache_reset ( ZOOM_resultset  r)
ZOOM_resultset_destroy ( ZOOM_resultset  r)

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

References resultset_destroy().

ZOOM_resultset_facets ( ZOOM_resultset  r)

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

References ZOOM_resultset_p::res_facets, and ZOOM_API().

ZOOM_resultset_facets_names ( ZOOM_resultset  r)

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

References ZOOM_resultset_p::facets_names, and ZOOM_API().

ZOOM_resultset_facets_size ( ZOOM_resultset  r)

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

References ZOOM_resultset_p::num_res_facets, and ZOOM_API().

ZOOM_resultset_get_facet_field ( ZOOM_resultset  r,
const char *  facet_name 
)
ZOOM_resultset_get_facet_field_by_index ( ZOOM_resultset  r,
int  pos 
)
ZOOM_resultset_option_get ( ZOOM_resultset  r,
const char *  key 
)
ZOOM_resultset_option_set ( ZOOM_resultset  r,
const char *  key,
const char *  val 
)

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

References ZOOM_resultset_p::options, ZOOM_API(), and ZOOM_options_set().

Referenced by handle_srw_response().

ZOOM_resultset_record ( ZOOM_resultset  s,
size_t  pos 
)
ZOOM_resultset_record_immediate ( ZOOM_resultset  s,
size_t  pos 
)
ZOOM_resultset_records ( ZOOM_resultset  r,
ZOOM_record recs,
size_t  start,
size_t  count 
)
ZOOM_resultset_release ( ZOOM_resultset  r)

release result set from connection.

The result will will no longer be able to perform retrievals from the connection from which it was created.

Referenced by resultset_destroy(), and ZOOM_connection_connect().

ZOOM_resultset_size ( ZOOM_resultset  r)

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

References ZOOM_resultset_p::size.

ZOOM_resultset_sort ( ZOOM_resultset  r,
const char *  sort_type,
const char *  sort_spec 
)

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

References ZOOM_API(), and ZOOM_resultset_sort1().

ZOOM_resultset_sort1 ( ZOOM_resultset  r,
const char *  sort_type,
const char *  sort_spec 
)
ZOOM_scanset_destroy ( ZOOM_scanset  scan)
ZOOM_scanset_display_term ( ZOOM_scanset  scan,
size_t  pos,
size_t *  occ,
size_t *  len 
)

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

References ZOOM_API(), and ZOOM_scanset_term_x().

ZOOM_scanset_option_get ( ZOOM_scanset  scan,
const char *  key 
)

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

References ZOOM_scanset_p::options, ZOOM_API(), and ZOOM_options_get().

ZOOM_scanset_option_set ( ZOOM_scanset  scan,
const char *  key,
const char *  val 
)

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

References ZOOM_scanset_p::options, ZOOM_API(), and ZOOM_options_set().

ZOOM_scanset_size ( ZOOM_scanset  scan)
ZOOM_scanset_term ( ZOOM_scanset  scan,
size_t  pos,
size_t *  occ,
size_t *  len 
)

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

References ZOOM_API(), and ZOOM_scanset_term_x().