#include <stdlib.h>
#include <yaz/yconfig.h>
Go to the source code of this file.
Definition in file zoom.h.
| #define ZOOM_ERROR_CCL_CONFIG 10013 |
| #define ZOOM_ERROR_CCL_PARSE 10014 |
| #define ZOOM_ERROR_CONNECT 10000 |
| #define ZOOM_ERROR_CONNECTION_LOST 10004 |
| #define ZOOM_ERROR_CQL_PARSE 10011 |
| #define ZOOM_ERROR_CQL_TRANSFORM 10012 |
| #define ZOOM_ERROR_DECODE 10003 |
| #define ZOOM_ERROR_ENCODE 10002 |
| #define ZOOM_ERROR_INIT 10005 |
| #define ZOOM_ERROR_INTERNAL 10006 |
| #define ZOOM_ERROR_INVALID_QUERY 10010 |
| #define ZOOM_ERROR_MEMORY 10001 |
| #define ZOOM_ERROR_NONE 0 |
Definition at line 123 of file zoom.h.
Referenced by ZOOM_connection_connect(), ZOOM_connection_create(), and ZOOM_diag_str().
| #define ZOOM_ERROR_TIMEOUT 10007 |
| #define ZOOM_ERROR_UNSUPPORTED_PROTOCOL 10008 |
| #define ZOOM_ERROR_UNSUPPORTED_QUERY 10009 |
| #define ZOOM_EVENT_END 10 |
| #define ZOOM_EVENT_NONE 0 |
Definition at line 143 of file zoom.h.
Referenced by ZOOM_API(), ZOOM_connection_create(), and ZOOM_connection_last_event().
| #define ZOOM_SELECT_EXCEPT 4 |
select/poll socket mask: except
Definition at line 356 of file zoom.h.
Referenced by ZOOM_event_sys_yaz_poll().
| #define ZOOM_SELECT_READ 1 |
select/poll socket mask: read
Definition at line 352 of file zoom.h.
Referenced by ZOOM_event_sys_yaz_poll().
| #define ZOOM_SELECT_WRITE 2 |
select/poll socket mask: write
Definition at line 354 of file zoom.h.
Referenced by ZOOM_event_sys_yaz_poll().
| typedef struct ZOOM_connection_p* ZOOM_connection |
| typedef typedefZOOM_BEGIN_CDECL struct ZOOM_options_p* ZOOM_options |
| typedef const char*(* ZOOM_options_callback)(void *handle, const char *name) |
| typedef struct ZOOM_package_p* ZOOM_package |
| typedef struct ZOOM_query_p* ZOOM_query |
| typedef struct ZOOM_record_p* ZOOM_record |
| typedef struct ZOOM_resultset_p* ZOOM_resultset |
| typedef struct ZOOM_scanset_p* ZOOM_scanset |
| ZOOM_connection_addinfo | ( | ZOOM_connection | c | ) |
| ZOOM_connection_connect | ( | ZOOM_connection | c, | |
| const char * | host, | |||
| int | portnum | |||
| ) |
Definition at line 451 of file zoom-c.c.
References xfree, xstrdup, yaz_log(), ZOOM_connection_add_task(), ZOOM_connection_option_set(), ZOOM_connection_remove_tasks(), ZOOM_ERROR_NONE, ZOOM_event(), ZOOM_options_get(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_options_set(), and ZOOM_TASK_CONNECT.
Referenced by ZOOM_connection_new().
| ZOOM_connection_create | ( | ZOOM_options | options | ) |
Definition at line 348 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::cs, ZOOM_connection_p::diagset, ZOOM_connection_p::group, ZOOM_connection_p::host_port, ZOOM_connection_p::lang, ZOOM_connection_p::last_event, ZOOM_connection_p::len_in, ZOOM_connection_p::len_out, ZOOM_connection_p::m_queue_back, ZOOM_connection_p::m_queue_front, ZOOM_connection_p::maximum_record_size, odr_createmem(), ODR_DECODE, ODR_ENCODE, ZOOM_connection_p::odr_in, ZOOM_connection_p::odr_out, ZOOM_connection_p::options, ZOOM_connection_p::password, ZOOM_connection_p::path, ZOOM_connection_p::preferred_message_size, ZOOM_connection_p::proto, PROTO_Z3950, ZOOM_connection_p::proxy, ZOOM_connection_p::reconnect_ok, ZOOM_connection_p::resultsets, ZOOM_connection_p::sru_version, ZOOM_connection_p::state, STATE_IDLE, ZOOM_connection_p::support_named_resultsets, ZOOM_connection_p::tasks, ZOOM_connection_p::user, xmalloc, yaz_log(), ZOOM_connection_set_mask(), ZOOM_ERROR_NONE, ZOOM_EVENT_NONE, and ZOOM_options_create_with_parent().
Referenced by ZOOM_connection_new(), and ZOOM_query_cql2rpn().
| ZOOM_connection_destroy | ( | ZOOM_connection | c | ) |
Definition at line 761 of file zoom-c.c.
References ZOOM_resultset_p::connection, cs_close, ZOOM_resultset_p::next, odr_destroy(), xfree, yaz_log(), ZOOM_connection_remove_tasks(), and ZOOM_options_destroy().
Referenced by ZOOM_query_cql2rpn().
| ZOOM_connection_diagset | ( | ZOOM_connection | c | ) |
| ZOOM_connection_errcode | ( | ZOOM_connection | c | ) |
| ZOOM_connection_errmsg | ( | ZOOM_connection | c | ) |
| ZOOM_connection_error | ( | ZOOM_connection | c, | |
| const char ** | cp, | |||
| const char ** | addinfo | |||
| ) |
Definition at line 4289 of file zoom-c.c.
References ZOOM_connection_error_x().
Referenced by ZOOM_connection_addinfo(), ZOOM_connection_errcode(), and ZOOM_connection_errmsg().
| ZOOM_connection_error_x | ( | ZOOM_connection | c, | |
| const char ** | cp, | |||
| const char ** | addinfo, | |||
| const char ** | diagset | |||
| ) |
Definition at line 4264 of file zoom-c.c.
References yaz_diag_srw_str(), z_HTTP_errmsg(), and ZOOM_diag_str().
Referenced by ZOOM_connection_diagset(), and ZOOM_connection_error().
| ZOOM_connection_fire_event_socket | ( | ZOOM_connection | c, | |
| int | mask | |||
| ) |
fire socket event activity (read,write,except)
| c | connection | |
| mask | or'ed mask of ZOOM_SELECT_.. values |
| 0 | event was fired OK | |
| -1 | event was not fired |
Referenced by ZOOM_event_sys_yaz_poll().
| ZOOM_connection_fire_event_timeout | ( | ZOOM_connection | c | ) |
fire socket event timeout
| c | connection |
| 0 | event was fired OK | |
| -1 | event was not fired |
Referenced by ZOOM_event_sys_yaz_poll().
| ZOOM_connection_get_mask | ( | ZOOM_connection | c | ) |
get socket mask for connection
| c | connection |
Referenced by ZOOM_event_sys_yaz_poll().
| ZOOM_connection_get_socket | ( | ZOOM_connection | c | ) |
get socket fd for ZOOM connection
| c | connection |
| -1 | no socket assigned for connection | |
| >=0 | socket for connection |
Referenced by ZOOM_event_sys_yaz_poll().
| ZOOM_connection_get_timeout | ( | ZOOM_connection | c | ) |
get timeout in seconds for ZOOM connection
| c | connection |
Referenced by ZOOM_event_sys_yaz_poll().
| ZOOM_connection_is_idle | ( | ZOOM_connection | c | ) |
determines if connection is idle (no active or pending work)
| c | connection |
| 1 | is idle | |
| 0 | is non-idle (active) |
| ZOOM_connection_last_event | ( | ZOOM_connection | cs | ) |
| ZOOM_connection_new | ( | const char * | host, | |
| int | portnum | |||
| ) |
Definition at line 429 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 | |||
| ) |
Definition at line 4164 of file zoom-c.c.
References ZOOM_options_set().
Referenced by ZOOM_connection_connect().
| ZOOM_connection_option_setl | ( | ZOOM_connection | c, | |
| const char * | key, | |||
| const char * | val, | |||
| int | len | |||
| ) |
| ZOOM_connection_package | ( | ZOOM_connection | c, | |
| ZOOM_options | options | |||
| ) |
Definition at line 3500 of file zoom-c.c.
References ZOOM_package_p::buf_out, ZOOM_package_p::connection, ZOOM_package_p::len_out, odr_createmem(), ODR_ENCODE, ZOOM_package_p::odr_out, ZOOM_package_p::options, ZOOM_package_p::refcount, xmalloc, and ZOOM_options_create_with_parent2().
| ZOOM_connection_peek_event | ( | ZOOM_connection | c | ) |
peek at next event
| c | connection |
| ZOOM_connection_process | ( | ZOOM_connection | c | ) |
process one event for connection
| c | connection |
| 0 | no event was processed | |
| 1 | event was processed for connection |
Definition at line 4452 of file zoom-c.c.
Referenced by ZOOM_event_nonblock().
| ZOOM_connection_scan | ( | ZOOM_connection | c, | |
| const char * | startterm | |||
| ) |
Definition at line 2710 of file zoom-c.c.
References ZOOM_connection_scan1(), ZOOM_query_create(), ZOOM_query_destroy(), and ZOOM_query_prefix().
| ZOOM_connection_scan1 | ( | ZOOM_connection | c, | |
| ZOOM_query | startterm | |||
| ) |
Definition at line 2724 of file zoom-c.c.
References ZOOM_scanset_p::connection, ZOOM_scanset_p::databaseNames, ZOOM_scanset_p::num_databaseNames, ZOOM_scanset_p::odr, odr_createmem(), ODR_DECODE, ZOOM_scanset_p::options, ZOOM_scanset_p::query, ZOOM_scanset_p::refcount, ZOOM_task_p::scan, ZOOM_scanset_p::scan_response, ZOOM_scanset_p::srw_scan_response, ZOOM_task_p::u, xmalloc, ZOOM_connection_add_task(), ZOOM_event(), ZOOM_options_create_with_parent(), and ZOOM_TASK_SCAN.
Referenced by ZOOM_connection_scan().
| ZOOM_connection_search | ( | ZOOM_connection | , | |
| ZOOM_query | q | |||
| ) |
Definition at line 845 of file zoom-c.c.
References ZOOM_resultset_p::connection, ZOOM_resultset_p::databaseNames, ZOOM_resultset_p::next, ZOOM_resultset_p::num_databaseNames, ZOOM_resultset_p::odr, ZOOM_resultset_p::options, ZOOM_resultset_p::piggyback, PROTO_HTTP, ZOOM_resultset_p::query, ZOOM_resultset_p::r_sort_spec, ZOOM_resultset_p::schema, ZOOM_task_p::search, ZOOM_resultset_p::setname, ZOOM_resultset_p::step, ZOOM_task_p::u, xstrdup, yaz_log(), ZOOM_connection_add_task(), ZOOM_event(), ZOOM_options_create_with_parent(), ZOOM_options_get(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_resultset_addref(), ZOOM_resultset_create(), ZOOM_TASK_CONNECT, and ZOOM_TASK_SEARCH.
Referenced by ZOOM_connection_search_pqf().
| ZOOM_connection_search_pqf | ( | ZOOM_connection | c, | |
| const char * | q | |||
| ) |
Definition at line 832 of file zoom-c.c.
References ZOOM_connection_search(), ZOOM_query_create(), ZOOM_query_destroy(), and ZOOM_query_prefix().
| ZOOM_connection_set_mask | ( | ZOOM_connection | c, | |
| int | mask | |||
| ) |
| ZOOM_diag_str | ( | int | error | ) |
Definition at line 4222 of file zoom-c.c.
References diagbib1_str(), ZOOM_ERROR_CCL_CONFIG, ZOOM_ERROR_CCL_PARSE, ZOOM_ERROR_CONNECT, ZOOM_ERROR_CONNECTION_LOST, ZOOM_ERROR_CQL_PARSE, ZOOM_ERROR_CQL_TRANSFORM, ZOOM_ERROR_DECODE, ZOOM_ERROR_ENCODE, ZOOM_ERROR_INIT, ZOOM_ERROR_INTERNAL, ZOOM_ERROR_INVALID_QUERY, ZOOM_ERROR_MEMORY, ZOOM_ERROR_NONE, ZOOM_ERROR_TIMEOUT, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, and ZOOM_ERROR_UNSUPPORTED_QUERY.
Referenced by ZOOM_connection_error_x().
| ZOOM_event | ( | int | no, | |
| ZOOM_connection * | cs | |||
| ) |
wait for events on connection(s) (BLOCKING)
| no | number of connections (size of cs) | |
| cs | connection array |
| 0 | no event was fired | |
| >0 | event was fired for connection at (retval-1) |
Definition at line 96 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(), and ZOOM_resultset_sort1().
| ZOOM_event_nonblock | ( | int | no, | |
| ZOOM_connection * | cs | |||
| ) |
process one event for one of connections given
| no | number of connections (size of cs) | |
| cs | connection array |
| 0 | no event was processed | |
| >0 | event was processed for connection at (retval-1) |
Definition at line 4475 of file zoom-c.c.
References yaz_log(), and ZOOM_connection_process().
Referenced by ZOOM_event().
| ZOOM_options_create | ( | void | ) |
Definition at line 67 of file zoom-opt.c.
References ZOOM_options_create_with_parent().
Referenced by ZOOM_options_dup().
| ZOOM_options_create_with_parent | ( | ZOOM_options | parent | ) |
Definition at line 61 of file zoom-opt.c.
References ZOOM_options_create_with_parent2().
Referenced by ZOOM_connection_create(), ZOOM_connection_scan1(), ZOOM_connection_search(), and ZOOM_options_create().
| ZOOM_options_create_with_parent2 | ( | ZOOM_options | parent1, | |
| ZOOM_options | parent2 | |||
| ) |
Definition at line 74 of file zoom-opt.c.
Referenced by ZOOM_connection_package(), and ZOOM_options_create_with_parent().
| ZOOM_options_destroy | ( | ZOOM_options | opt | ) |
Definition at line 114 of file zoom-opt.c.
References ZOOM_options_entry::name, ZOOM_options_entry::next, ZOOM_options_entry::value, xfree, and ZOOM_options_destroy().
Referenced by ZOOM_connection_destroy(), ZOOM_options_destroy(), ZOOM_package_destroy(), and ZOOM_scanset_destroy().
| ZOOM_options_dup | ( | ZOOM_options | src | ) |
Definition at line 38 of file zoom-opt.c.
References ZOOM_options_entry::len, ZOOM_options_entry::name, ZOOM_options_entry::next, ZOOM_options_entry::value, ZOOM_options_create(), and ZOOM_options_dup().
Referenced by ZOOM_options_dup().
| ZOOM_options_get | ( | ZOOM_options | opt, | |
| const char * | name | |||
| ) |
Definition at line 196 of file zoom-opt.c.
References ZOOM_options_getl().
Referenced by ZOOM_connection_connect(), ZOOM_connection_option_get(), ZOOM_connection_search(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_package_option_get(), ZOOM_resultset_option_get(), ZOOM_resultset_record_immediate(), and ZOOM_scanset_option_get().
| ZOOM_options_get_bool | ( | ZOOM_optio |