YAZ 5.37.0
zoom-query.c File Reference

Implements ZOOM C query interface. 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/log.h>
#include <yaz/pquery.h>
#include <yaz/cql.h>
#include <yaz/ccl.h>
#include <yaz/sortspec.h>
#include <yaz/snprintf.h>

Go to the source code of this file.

Data Structures

struct  ZOOM_query_p

Macros

#define SORT_STRATEGY_Z3950   0
#define SORT_STRATEGY_TYPE7   1
#define SORT_STRATEGY_CQL   2
#define SORT_STRATEGY_SRU11   3
#define SORT_STRATEGY_EMBED   4
#define SORT_STRATEGY_SOLR   5

Functions

static int generate (ZOOM_query s)
const char * ZOOM_query_get_sru11 (ZOOM_query s)
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)
void ZOOM_query_get_hash (ZOOM_query s, WRBUF w)
static char * cql2pqf (ZOOM_connection c, const char *cql)
 ZOOM_query_create (void)
 ZOOM_query_destroy (ZOOM_query s)
 ZOOM_query_addref (ZOOM_query s)
 ZOOM_query_prefix (ZOOM_query s, const char *str)
 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 *str, const char *config, int *ccl_error, const char **error_string, int *error_pos)
 ZOOM_query_sortby (ZOOM_query s, const char *criteria)
 ZOOM_query_sortby2 (ZOOM_query s, const char *strategy, const char *criteria)

Detailed Description

Implements ZOOM C query interface.

Definition in file zoom-query.c.

Macro Definition Documentation

◆ SORT_STRATEGY_CQL

#define SORT_STRATEGY_CQL   2

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

Referenced by generate(), and ZOOM_query_sortby2().

◆ SORT_STRATEGY_EMBED

#define SORT_STRATEGY_EMBED   4

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

Referenced by generate(), and ZOOM_query_sortby2().

◆ SORT_STRATEGY_SOLR

#define SORT_STRATEGY_SOLR   5

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

Referenced by generate(), and ZOOM_query_sortby2().

◆ SORT_STRATEGY_SRU11

#define SORT_STRATEGY_SRU11   3

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

Referenced by generate(), and ZOOM_query_sortby2().

◆ SORT_STRATEGY_TYPE7

#define SORT_STRATEGY_TYPE7   1

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

Referenced by generate(), and ZOOM_query_sortby2().

◆ SORT_STRATEGY_Z3950

#define SORT_STRATEGY_Z3950   0

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

Referenced by ZOOM_query_create(), ZOOM_query_get_sortspec(), and ZOOM_query_sortby2().

Function Documentation

◆ cql2pqf()

◆ generate()

◆ ZOOM_query_addref()

ZOOM_query_addref ( ZOOM_query s)

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

References ZOOM_query_addref().

Referenced by ZOOM_connection_scan1(), ZOOM_connection_search(), and ZOOM_query_addref().

◆ ZOOM_query_ccl2rpn()

ZOOM_query_ccl2rpn ( ZOOM_query s,
const char * str,
const char * config,
int * ccl_error,
const char ** error_string,
int * error_pos )

◆ ZOOM_query_cql()

ZOOM_query_cql ( ZOOM_query s,
const char * str )

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

References generate(), xfree, xstrdup, Z_Query_type_104, and ZOOM_query_cql().

Referenced by ZOOM_query_cql().

◆ ZOOM_query_cql2rpn()

ZOOM_query_cql2rpn ( ZOOM_query s,
const char * str,
ZOOM_connection conn )

◆ ZOOM_query_create()

◆ ZOOM_query_destroy()

◆ ZOOM_query_get_hash()

◆ ZOOM_query_get_query_string()

const char * ZOOM_query_get_query_string ( ZOOM_query s)

◆ ZOOM_query_get_sortspec()

◆ ZOOM_query_get_sru11()

const char * ZOOM_query_get_sru11 ( ZOOM_query s)

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

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

Referenced by ZOOM_connection_srw_send_search().

◆ ZOOM_query_get_Z_Query()

◆ ZOOM_query_prefix()

ZOOM_query_prefix ( ZOOM_query s,
const char * str )

◆ ZOOM_query_sortby()

ZOOM_query_sortby ( ZOOM_query s,
const char * criteria )

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

References ZOOM_query_sortby(), and ZOOM_query_sortby2().

Referenced by ZOOM_query_sortby(), and ZOOM_resultset_sort1().

◆ ZOOM_query_sortby2()

ZOOM_query_sortby2 ( ZOOM_query s,
const char * strategy,
const char * criteria )