27 int server_choice = 1;
52 return "cql.serverChoice";
124 if (use_attribute != -1)
134 else if (!strcmp(relation,
"exact"))
136 else if (!strcmp(relation,
"eq"))
138 else if (!strcmp(relation,
"le"))
140 else if (!strcmp(relation,
"ge"))
143 if (strcmp(index,
"cql.serverChoice") || strcmp(relation,
"=")
144 || (structure && strcmp(structure,
"*")))
151 if (structure && strcmp(structure,
"*"))
178 void (*pr)(
const char *buf,
void *client_data),
191 const char *sterm = 0;
213 lterm = strlen(sterm);
221 if (trunc <= 3 || trunc == 100 || trunc == 102 || trunc == 104)
224 for (i = 0 ; i < lterm; i++)
225 if (strchr(
" ()=></", sterm[i]))
234 if (trunc == 2 || trunc == 3)
236 for (i = 0; i < lterm; i++)
238 if (sterm[i] ==
'\\' && i < lterm - 1)
241 if (strchr(
"*?\"\\", sterm[i]))
245 else if (trunc == 102 && sterm[i] ==
'.' && sterm[i+1] ==
'*')
250 else if (trunc == 102 && sterm[i] ==
'.')
252 else if (trunc == 104 && sterm[i] ==
'?')
254 else if (trunc == 104 && sterm[i] ==
'#')
256 else if (strchr(
"*?\"", sterm[i]))
264 if (trunc == 1 || trunc == 3)
282 void (*pr)(
const char *buf,
void *client_data),
296 pr(
"(", client_data);
304 pr(
" and ", client_data);
307 pr(
" or ", client_data);
310 pr(
" not ", client_data);
313 pr(
" prox", client_data);
318 char *op2name[6] = {
"<",
"<=",
"=",
">=",
">",
"<>" };
319 pr(
"/distance", client_data);
328 sprintf(buf,
"%ld", (
long) *prox->
distance);
329 pr(buf, client_data);
333 pr(
"/ordered", client_data);
335 pr(
"/unordered", client_data);
340 pr(
"/unit=", client_data);
343 pr(
" ", client_data);
349 pr(
")", client_data);
356 void (*pr)(
const char *buf,
void *client_data),
369 void (*pr)(
const char *buf,
void *client_data),
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.
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)
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)
static const char * lookup_relation_index_from_attr(Z_AttributeList *attributes)
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 const char * lookup_index_from_string_attr(Z_AttributeList *attributes, Odr_int *numeric_value)
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.
union Z_AttributeElement::@50 value
Z_ComplexAttribute * complex
Z_AttributeElement ** attributes
Z_AttributeList * attributes
Z_StringOrNumeric ** list
Z_AttributesPlusTerm * attributesPlusTerm
Z_ProximityOperator * prox
union Z_ProximityOperator::@51 u
Z_RPNStructure * RPNStructure
union Z_RPNStructure::@46 u
union Z_StringOrNumeric::@72 u
Z_InternationalString * string
Z_InternationalString * characterString
void wrbuf_destroy(WRBUF b)
destroy WRBUF and its buffer
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
const char * wrbuf_cstr(WRBUF b)
returns WRBUF content as C-string
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