metaproxy 1.22.4
filter_zoom.cpp File Reference
#include "config.hpp"
#include <stdlib.h>
#include <sys/types.h>
#include "filter_zoom.hpp"
#include <metaproxy/package.hpp>
#include <metaproxy/util.hpp>
#include <metaproxy/xmlutil.hpp>
#include <yaz/comstack.h>
#include <yaz/poll.h>
#include "torus.hpp"
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <yaz/yaz-version.h>
#include <yaz/tpath.h>
#include <yaz/srw.h>
#include <yaz/ccl_xml.h>
#include <yaz/ccl.h>
#include <yaz/rpn2cql.h>
#include <yaz/rpn2solr.h>
#include <yaz/pquery.h>
#include <yaz/cql.h>
#include <yaz/oid_db.h>
#include <yaz/diagbib1.h>
#include <yaz/log.h>
#include <yaz/zgdu.h>
#include <yaz/querytowrbuf.h>
#include <yaz/sortspec.h>
#include <yaz/tokenizer.h>
#include <yaz/zoom.h>
#include <yaz/otherinfo.h>
#include <yaz/match_glob.h>
Include dependency graph for filter_zoom.cpp:

Go to the source code of this file.

Classes

class  metaproxy_1::filter::Zoom::Searchable
class  metaproxy_1::filter::Zoom::Backend
class  metaproxy_1::filter::Zoom::Frontend
class  metaproxy_1::filter::Zoom::Impl

Namespaces

namespace  metaproxy_1
namespace  metaproxy_1::filter

Functions

static xmlNode * xml_node_search (xmlNode *ptr, int *num, int m)
static bool match_element (const char *actual_element_set_name, const std::string &config_element)
static bool wait_conn (COMSTACK cs, int secs)
std::string escape_cql_term (std::string inp)
static mp::filter::Base * filter_creator ()

Variables

struct metaproxy_1_filter_struct metaproxy_1_filter_zoom

Function Documentation

◆ escape_cql_term()

std::string escape_cql_term ( std::string inp)

Definition at line 2676 of file filter_zoom.cpp.

2677{
2678 std::string res;
2679 size_t l = inp.length();
2680 size_t i;
2681 for (i = 0; i < l; i++)
2682 {
2683 if (strchr("*?^\"", inp[i]))
2684 res += "\\";
2685 res += inp[i];
2686 }
2687 return res;
2688}

Referenced by metaproxy_1::filter::Zoom::Frontend::auth().

◆ filter_creator()

mp::filter::Base * filter_creator ( )
static

Definition at line 2889 of file filter_zoom.cpp.

2890{
2891 return new mp::filter::Zoom;
2892}

◆ match_element()

bool match_element ( const char * actual_element_set_name,
const std::string & config_element )
static

Definition at line 1629 of file filter_zoom.cpp.

1631{
1632 if (config_element.length() == 0)
1633 return false;
1634 const char *cp = config_element.c_str();
1635 if (*cp == '?')
1636 {
1637 if (actual_element_set_name == 0)
1638 return true;
1639 cp++;
1640 }
1641 if (actual_element_set_name && !strcmp(cp, actual_element_set_name))
1642 return true;
1643 return false;
1644}

Referenced by metaproxy_1::filter::Zoom::Frontend::prepare_elements().

◆ wait_conn()

bool wait_conn ( COMSTACK cs,
int secs )
static

Definition at line 2171 of file filter_zoom.cpp.

2172{
2173 struct yaz_poll_fd pfd;
2174
2175 pfd.input_mask = yaz_poll_none;
2176 pfd.output_mask = yaz_poll_none;
2177 yaz_poll_add(pfd.input_mask, yaz_poll_except);
2178 if (cs->io_pending & CS_WANT_WRITE)
2179 yaz_poll_add(pfd.input_mask, yaz_poll_write);
2180 if (cs->io_pending & CS_WANT_READ)
2181 yaz_poll_add(pfd.input_mask, yaz_poll_read);
2182
2183 pfd.fd = cs_fileno(cs);
2184 pfd.client_data = 0;
2185
2186 int ret = yaz_poll(&pfd, 1, secs, 0);
2187 return ret > 0;
2188}

Referenced by metaproxy_1::filter::Zoom::Impl::check_proxy().

◆ xml_node_search()

xmlNode * xml_node_search ( xmlNode * ptr,
int * num,
int m )
static

Definition at line 253 of file filter_zoom.cpp.

254{
255 while (ptr)
256 {
257 if (ptr->type == XML_ELEMENT_NODE &&
258 !strcmp((const char *) ptr->name, "recordData"))
259 {
260 (*num)++;
261 if (m == *num)
262 return ptr;
263 }
264 else // else: we don't want to find nested nodes
265 {
266 xmlNode *ret_node = xml_node_search(ptr->children, num, m);
267 if (ret_node)
268 return ret_node;
269 }
270 ptr = ptr->next;
271 }
272 return 0;
273}
static xmlNode * xml_node_search(xmlNode *ptr, int *num, int m)

References xml_node_search().

Referenced by metaproxy_1::filter::Zoom::Frontend::explain_search(), metaproxy_1::filter::Zoom::Frontend::get_explain_records(), and xml_node_search().

Here is the call graph for this function:

Variable Documentation

◆ metaproxy_1_filter_zoom

struct metaproxy_1_filter_struct metaproxy_1_filter_zoom
Initial value:
= {
0,
"zoom",
}
static mp::filter::Base * filter_creator()

Definition at line 2895 of file filter_zoom.cpp.

2895 {
2896 0,
2897 "zoom",
2899 };

Referenced by metaproxy_1::FactoryStatic::FactoryStatic().