28 int server_choice = 1;
53 return "cql.serverChoice";
125 if (use_attribute != -1)
135 else if (!strcmp(relation,
"exact"))
137 else if (!strcmp(relation,
"eq"))
139 else if (!strcmp(relation,
"le"))
141 else if (!strcmp(relation,
"ge"))
144 if (strcmp(index,
"cql.serverChoice") || strcmp(relation,
"=")
145 || (structure && strcmp(structure,
"*")))
152 if (structure && strcmp(structure,
"*"))
179 void (*pr)(
const char *buf,
void *client_data),
192 const char *sterm = 0;
214 lterm = strlen(sterm);
222 if (trunc <= 3 || trunc == 100 || trunc == 102 || trunc == 104)
225 for (i = 0 ; i < lterm; i++)
226 if (strchr(
" ()=></", sterm[i]))
235 if (trunc == 2 || trunc == 3)
237 for (i = 0; i < lterm; i++)
239 if (sterm[i] ==
'\\' && i < lterm - 1)
242 if (strchr(
"*?\"\\", sterm[i]))
246 else if (trunc == 102 && sterm[i] ==
'.' && sterm[i+1] ==
'*')
251 else if (trunc == 102 && sterm[i] ==
'.')
253 else if (trunc == 104 && sterm[i] ==
'?')
255 else if (trunc == 104 && sterm[i] ==
'#')
257 else if (strchr(
"*?\"", sterm[i]))
265 if (trunc == 1 || trunc == 3)
283 void (*pr)(
const char *buf,
void *client_data),
297 pr(
"(", client_data);
305 pr(
" and ", client_data);
308 pr(
" or ", client_data);
311 pr(
" not ", client_data);
314 pr(
" prox", client_data);
319 char *op2name[6] = {
"<",
"<=",
"=",
">=",
">",
"<>" };
320 pr(
"/distance", client_data);
330 pr(buf, client_data);
334 pr(
"/ordered", client_data);
336 pr(
"/unordered", client_data);
341 pr(
"/unit=", client_data);
344 pr(
" ", client_data);
350 pr(
")", client_data);
357 void (*pr)(
const char *buf,
void *client_data),
370 void (*pr)(
const char *buf,
void *client_data),
struct cql_transform_t_ * cql_transform_t
CQL transform handle. The transform describes how to convert from CQL to PQF (Type-1 AKA RPN).
Diagnostics: Generated by csvtodiag.tcl from ./bib1.csv.
#define YAZ_BIB1_UNSUPP_TRUNCATION_ATTRIBUTE
#define YAZ_BIB1_UNSUPP_USE_ATTRIBUTE
#define YAZ_BIB1_RESULT_SET_UNSUPP_AS_A_SEARCH_TERM
#define YAZ_BIB1_TERM_TYPE_UNSUPP
#define YAZ_BIB1_UNSUPP_SEARCH
const char * yaz_prox_unit_name(Z_ProximityOperator *op)
Header for Z39.50 Query Printing.
static const char * lookup_relation_index_from_attr(Z_AttributeList *attributes)
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)
static int rpn2cql_attr(cql_transform_t ct, Z_AttributeList *attributes, WRBUF w)
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 const char * lookup_index_from_string_attr(Z_AttributeList *attributes, Odr_int *numeric_value)
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)
int cql_transform_rpn2cql_wrbuf(cql_transform_t ct, WRBUF w, Z_RPNQuery *q)
transforms RPN query to CQL WRBUF (NOT re-entrant)
static Odr_int lookup_truncation(Z_AttributeList *attributes)
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)
Header for RPN to CQL tranform.
void yaz_snprintf(char *buf, size_t size, const char *fmt,...)
Header for config file reading utilities.
Z_ComplexAttribute * complex
union Z_AttributeElement::@260252174261265367116362007076255375270002041323 value
Z_AttributeElement ** attributes
Z_AttributeList * attributes
Z_StringOrNumeric ** list
Z_AttributesPlusTerm * attributesPlusTerm
union Z_Operand::@072322006164213251104156071070134267373322123052 u
Z_ProximityOperator * prox
union Z_Operator::@171225215357037113014354143242105145344254361002 u
union Z_ProximityOperator::@031336250334025346341060256205106006053041305237 u
Z_RPNStructure * RPNStructure
union Z_RPNStructure::@272042053041255367154306203353273370010236313243 u
union Z_StringOrNumeric::@255321135104110073015132067151226017215302214211 u
Z_InternationalString * string
union Z_Term::@023217361022206241314262227377164117366363003164 u
Z_InternationalString * characterString
void wrbuf_destroy(WRBUF b)
destroy WRBUF and its buffer
const char * wrbuf_cstr(WRBUF b)
returns WRBUF content as C-string
void wrbuf_rewind(WRBUF b)
empty WRBUF content (length of buffer set to 0)
WRBUF wrbuf_alloc(void)
construct WRBUF
void wrbuf_printf(WRBUF b, const char *fmt,...)
writes printf result to WRBUF
void wrbuf_vp_puts(const char *buf, void *client_data)
appends C-string to WRBUF - void pointer variant
void wrbuf_puts(WRBUF b, const char *buf)
appends C-string to WRBUF
Header for WRBUF (growing buffer).
Header for memory handling functions.
ASN.1 Module Z39-50-APDU-1995.
#define Z_AttributeValue_numeric
#define Z_Operator_and_not
#define Z_Term_characterString
#define Z_ProximityOperator_Prox_lessThanOrEqual
#define Z_ProximityOperator_known
#define Z_AttributeValue_complex
#define Z_StringOrNumeric_string
#define Z_ProximityOperator_Prox_lessThan
#define Z_RPNStructure_simple
#define Z_ProximityOperator_Prox_equal
#define Z_ProximityOperator_Prox_greaterThan
#define Z_ProximityOperator_Prox_greaterThanOrEqual
#define Z_ProximityOperator_Prox_notEqual