YAZ  5.23.1
Functions
rpn2cql.c File Reference

Implements RPN to CQL conversion. More...

#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <yaz/rpn2cql.h>
#include <yaz/xmalloc.h>
#include <yaz/diagbib1.h>
#include <yaz/z-core.h>
#include <yaz/wrbuf.h>
#include <yaz/logrpn.h>

Go to the source code of this file.

Functions

static const char * lookup_index_from_string_attr (Z_AttributeList *attributes, Odr_int *numeric_value)
 
static const char * lookup_relation_index_from_attr (Z_AttributeList *attributes)
 
static int rpn2cql_attr (cql_transform_t ct, Z_AttributeList *attributes, WRBUF w)
 
static Odr_int lookup_truncation (Z_AttributeList *attributes)
 
static int rpn2cql_simple (cql_transform_t ct, void(*pr)(const char *buf, void *client_data), void *client_data, Z_Operand *q, WRBUF w)
 
static int rpn2cql_structure (cql_transform_t ct, void(*pr)(const char *buf, void *client_data), void *client_data, Z_RPNStructure *q, int nested, WRBUF w)
 
int cql_transform_rpn2cql_stream_r (cql_transform_t ct, WRBUF addinfo, void(*pr)(const char *buf, void *client_data), void *client_data, Z_RPNQuery *q)
 transforms RPN query to CQL output stream (re-entrant) More...
 
int cql_transform_rpn2cql_stream (cql_transform_t ct, void(*pr)(const char *buf, void *client_data), void *client_data, Z_RPNQuery *q)
 transforms RPN query to CQL output stream (NOT re-entrant) More...
 
int cql_transform_rpn2cql_wrbuf (cql_transform_t ct, WRBUF w, Z_RPNQuery *q)
 transforms RPN query to CQL WRBUF (NOT re-entrant) More...
 

Detailed Description

Implements RPN to CQL conversion.

Definition in file rpn2cql.c.

Function Documentation

int cql_transform_rpn2cql_stream ( cql_transform_t  ct,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
Z_RPNQuery q 
)

transforms RPN query to CQL output stream (NOT re-entrant)

Parameters
ctCQL transform handle
prprint function
client_dataopaque data to be passed to print handler
qRPN Query
Return values
0success
!=0failure (error code)

Definition at line 368 of file rpn2cql.c.

References cql_transform_rpn2cql_stream_r(), cql_transform_set_error(), wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), and wrbuf_len.

Referenced by cql_transform_rpn2cql_wrbuf().

int cql_transform_rpn2cql_stream_r ( cql_transform_t  ct,
WRBUF  addinfo,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
Z_RPNQuery q 
)

transforms RPN query to CQL output stream (re-entrant)

Parameters
ctCQL transform handle
addinfofor additional error info
prprint function
client_dataopaque data to be passed to print handler
qRPN Query
Return values
0success
!=0failure (error code)

Definition at line 354 of file rpn2cql.c.

References rpn2cql_structure(), Z_RPNQuery::RPNStructure, and wrbuf_rewind().

Referenced by cql_transform_rpn2cql_stream().

int cql_transform_rpn2cql_wrbuf ( cql_transform_t  ct,
WRBUF  w,
Z_RPNQuery q 
)

transforms RPN query to CQL WRBUF (NOT re-entrant)

Parameters
ctCQL transform handle
wWRBUF handle for result
qRPN Query
Return values
0success
!=0failure (error code)

Definition at line 382 of file rpn2cql.c.

References cql_transform_rpn2cql_stream(), and wrbuf_vp_puts().

static const char* lookup_index_from_string_attr ( Z_AttributeList attributes,
Odr_int numeric_value 
)
static
static const char* lookup_relation_index_from_attr ( Z_AttributeList attributes)
static
static Odr_int lookup_truncation ( Z_AttributeList attributes)
static
static int rpn2cql_attr ( cql_transform_t  ct,
Z_AttributeList attributes,
WRBUF  w 
)
static
static int rpn2cql_simple ( cql_transform_t  ct,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
Z_Operand q,
WRBUF  w 
)
static
static int rpn2cql_structure ( cql_transform_t  ct,
void(*)(const char *buf, void *client_data)  pr,
void *  client_data,
Z_RPNStructure q,
int  nested,
WRBUF  w 
)
static