- wrbuf_printf(b, "%.*s ", len, term);
+ wrbuf_printf(b, "%.*s ", len, term);
- wrbuf_putc(b, '"');
- for (i = 0; i<len; i++)
- {
- if (term[i] == '"')
- wrbuf_putc(b, '\\');
- wrbuf_putc(b, term[i]);
- }
- wrbuf_printf(b, "\" ");
+ wrbuf_putc(b, '"');
+ for (i = 0; i<len; i++)
+ {
+ if (term[i] == '"')
+ wrbuf_putc(b, '\\');
+ wrbuf_putc(b, term[i]);
+ }
+ wrbuf_printf(b, "\" ");
- wrbuf_printf(b,"@attr %s%s%d=%d ", setname, sep,
- *element->attributeType, *element->value.numeric);
- break;
+ wrbuf_printf(b,"@attr %s%s%d=%d ", setname, sep,
+ *element->attributeType, *element->value.numeric);
+ break;
- wrbuf_printf(b,"@attr %s%s\"%d=", setname, sep,
- *element->attributeType);
- for (i = 0; i<element->value.complex->num_list; i++)
- {
- if (i)
- wrbuf_printf(b,",");
- if (element->value.complex->list[i]->which ==
- Z_StringOrNumeric_string)
- wrbuf_printf (b, "%s",
- element->value.complex->list[i]->u.string);
- else if (element->value.complex->list[i]->which ==
- Z_StringOrNumeric_numeric)
- wrbuf_printf (b, "%d",
- *element->value.complex->list[i]->u.numeric);
- }
- wrbuf_printf(b, "\" ");
- break;
+ wrbuf_printf(b,"@attr %s%s\"%d=", setname, sep,
+ *element->attributeType);
+ for (i = 0; i<element->value.complex->num_list; i++)
+ {
+ if (i)
+ wrbuf_printf(b,",");
+ if (element->value.complex->list[i]->which ==
+ Z_StringOrNumeric_string)
+ wrbuf_printf (b, "%s",
+ element->value.complex->list[i]->u.string);
+ else if (element->value.complex->list[i]->which ==
+ Z_StringOrNumeric_numeric)
+ wrbuf_printf (b, "%d",
+ *element->value.complex->list[i]->u.numeric);
+ }
+ wrbuf_printf(b, "\" ");
+ break;
- element = t->attributes->attributes[of];
- if (element->attributeSet)
- {
- oident *attrset;
- attrset = oid_getentbyoid (element->attributeSet);
- attset_name = attrset->desc;
- }
+ element = t->attributes->attributes[of];
+ if (element->attributeSet)
+ {
+ oident *attrset;
+ attrset = oid_getentbyoid (element->attributeSet);
+ attset_name = attrset->desc;
+ }
- attrStr (*element->attributeType,
- *element->value.numeric, ast, str);
+ attrStr (*element->attributeType,
+ *element->value.numeric, ast, str);
yaz_log (loglevel, "%*.0s%s %s", depth, "", attset_name, str);
break;
case Z_AttributeValue_complex:
yaz_log (loglevel, "%*.0s%s attributeType=%d complex",
yaz_log (loglevel, "%*.0s%s %s", depth, "", attset_name, str);
break;
case Z_AttributeValue_complex:
yaz_log (loglevel, "%*.0s%s attributeType=%d complex",
- depth, "", attset_name, *element->attributeType);
+ depth, "", attset_name, *element->attributeType);
for (i = 0; i<element->value.complex->num_list; i++)
{
if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_string)
yaz_log (loglevel, "%*.0s string: '%s'", depth, "",
for (i = 0; i<element->value.complex->num_list; i++)
{
if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_string)
yaz_log (loglevel, "%*.0s string: '%s'", depth, "",
else if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_numeric)
yaz_log (loglevel, "%*.0s numeric: '%d'", depth, "",
else if (element->value.complex->list[i]->which ==
Z_StringOrNumeric_numeric)
yaz_log (loglevel, "%*.0s numeric: '%d'", depth, "",
case Z_Operator_and_not:
yaz_log (loglevel, "%*.0s %s", depth, "", complex_op_name(op) );
break;
case Z_Operator_and_not:
yaz_log (loglevel, "%*.0s %s", depth, "", complex_op_name(op) );
break;
yaz_log (loglevel, "%*.0s prox excl=%s dist=%d order=%s "
"rel=%s unit=%s",
depth, "", op->u.prox->exclusion ?
yaz_log (loglevel, "%*.0s prox excl=%s dist=%d order=%s "
"rel=%s unit=%s",
depth, "", op->u.prox->exclusion ?
*op->u.prox->ordered ? "T" : "F",
relToStr(*op->u.prox->relationType),
prox_unit_name(op->u.prox) );
*op->u.prox->ordered ? "T" : "F",
relToStr(*op->u.prox->relationType),
prox_unit_name(op->u.prox) );
default:
yaz_log (loglevel, "%*.0s unknown complex", depth, "");
return;
default:
yaz_log (loglevel, "%*.0s unknown complex", depth, "");
return;
{
case Z_Term_general:
yaz_log (loglevel, "%*.0s term '%.*s' (general)", depth, "",
{
case Z_Term_general:
yaz_log (loglevel, "%*.0s term '%.*s' (general)", depth, "",
- zapt->term->u.general->len,
- zapt->term->u.general->buf);
+ zapt->term->u.general->len,
+ zapt->term->u.general->buf);
break;
case Z_Term_characterString:
yaz_log (loglevel, "%*.0s term '%s' (string)", depth, "",
break;
case Z_Term_characterString:
yaz_log (loglevel, "%*.0s term '%s' (string)", depth, "",
break;
case Z_Term_numeric:
yaz_log (loglevel, "%*.0s term '%d' (numeric)", depth, "",
break;
case Z_Term_numeric:
yaz_log (loglevel, "%*.0s term '%d' (numeric)", depth, "",
break;
case Z_Term_null:
yaz_log (loglevel, "%*.0s term (null)", depth, "");
break;
case Z_Term_null:
yaz_log (loglevel, "%*.0s term (null)", depth, "");
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
yaz_log (loglevel, "%*.0s set '%s'", depth, "",
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
yaz_log (loglevel, "%*.0s set '%s'", depth, "",
}
else
yaz_log (loglevel, "%*.0s unknown simple structure", depth, "");
}
else
yaz_log (loglevel, "%*.0s unknown simple structure", depth, "");
- wrbuf_term(b, zapt->term->u.general->buf,
- zapt->term->u.general->len);
- break;
+ wrbuf_term(b, (const char *)zapt->term->u.general->buf,
+ zapt->term->u.general->len);
+ break;
- wrbuf_printf(b, "@term string ");
- wrbuf_term (b, zapt->term->u.characterString,
- strlen(zapt->term->u.characterString));
- break;
+ wrbuf_printf(b, "@term string ");
+ wrbuf_term (b, zapt->term->u.characterString,
+ strlen(zapt->term->u.characterString));
+ break;
wrbuf_printf(b, "@%s ", complex_op_name(op) );
if (op->which== Z_Operator_prox)
{
wrbuf_printf(b, "@%s ", complex_op_name(op) );
if (op->which== Z_Operator_prox)
{
- wrbuf_printf(b, " %d %d %d ", *op->u.prox->distance,
- *op->u.prox->ordered,
- *op->u.prox->relationType);
+ wrbuf_printf(b, " %d %d %d ", *op->u.prox->distance,
+ *op->u.prox->ordered,
+ *op->u.prox->relationType);
- switch(op->u.prox->which)
- {
- case Z_ProximityOperator_known:
- wrbuf_putc(b, 'k');
- break;
- case Z_ProximityOperator_private:
- wrbuf_putc(b, 'p');
- break;
- default:
- wrbuf_printf(b, "%d", op->u.prox->which);
- }
- if (op->u.prox->u.known)
- wrbuf_printf(b, " %d ", *op->u.prox->u.known);
- else
- wrbuf_printf(b, " 0 ");
+ switch(op->u.prox->which)
+ {
+ case Z_ProximityOperator_known:
+ wrbuf_putc(b, 'k');
+ break;
+ case Z_ProximityOperator_private:
+ wrbuf_putc(b, 'p');
+ break;
+ default:
+ wrbuf_printf(b, "%d", op->u.prox->which);
+ }
+ if (op->u.prox->u.known)
+ wrbuf_printf(b, " %d ", *op->u.prox->u.known);
+ else
+ wrbuf_printf(b, " 0 ");
}
wrbuf_structure (b,zs->u.complex->s1, ast);
wrbuf_structure (b,zs->u.complex->s2, ast);
}
wrbuf_structure (b,zs->u.complex->s1, ast);
wrbuf_structure (b,zs->u.complex->s2, ast);
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
wrbuf_printf(b, "@set ");
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
wrbuf_printf(b, "@set ");
- wrbuf_term(b, zs->u.simple->u.resultSetId,
- strlen(zs->u.simple->u.resultSetId));
+ wrbuf_term(b, zs->u.simple->u.resultSetId,
+ strlen(zs->u.simple->u.resultSetId));
}
zlog_structure (rpn->RPNStructure, 0, ast, loglevel);
}
}
zlog_structure (rpn->RPNStructure, 0, ast, loglevel);
}
- yaz_log (loglevel, "%*.0s term '%.*s' (general)", depth, "",
- zapt->term->u.general->len, zapt->term->u.general->buf);
+ yaz_log (loglevel, "%*.0s term '%.*s' (general)", depth, "",
+ zapt->term->u.general->len, zapt->term->u.general->buf);
- yaz_log (loglevel, "%*.0s term (not general)", depth, "");
+ yaz_log (loglevel, "%*.0s term (not general)", depth, "");
zlog_attributes (zapt, depth+2, ast, loglevel);
}
zlog_attributes (zapt, depth+2, ast, loglevel);
}
- yaz_log(loglevel, "CCL: %.*s", q->u.type_2->len, q->u.type_2->buf);
- break;
+ yaz_log(loglevel, "CCL: %.*s", q->u.type_2->len, q->u.type_2->buf);
+ break;
- yaz_log(loglevel, "Z39.58: %.*s", q->u.type_100->len,
- q->u.type_100->buf);
- break;
+ yaz_log(loglevel, "Z39.58: %.*s", q->u.type_100->len,
+ q->u.type_100->buf);
+ break;
case Z_Query_type_104:
if (q->u.type_104->which == Z_External_CQL)
yaz_log (loglevel, "CQL: %s", q->u.type_104->u.cql);
case Z_Query_type_104:
if (q->u.type_104->which == Z_External_CQL)
yaz_log (loglevel, "CQL: %s", q->u.type_104->u.cql);
- wrbuf_printf(b,"RPN:");
- wrbuf_rpn_query(b,q->u.type_1);
- break;
+ wrbuf_printf(b,"RPN:");
+ wrbuf_rpn_query(b,q->u.type_1);
+ break;
- wrbuf_printf(b, "CCL: %.*s", q->u.type_2->len, q->u.type_2->buf);
- break;
+ wrbuf_printf(b, "CCL: %.*s", q->u.type_2->len, q->u.type_2->buf);
+ break;
- wrbuf_printf(b, "Z39.58: %.*s", q->u.type_100->len,
- q->u.type_100->buf);
- break;
+ wrbuf_printf(b, "Z39.58: %.*s", q->u.type_100->len,
+ q->u.type_100->buf);
+ break;
- if (q->u.type_104->which == Z_External_CQL)
- wrbuf_printf(b, "CQL: %s", q->u.type_104->u.cql);
- else
- wrbuf_printf(b,"Unknown type 104 query %d", q->u.type_104->which);
+ if (q->u.type_104->which == Z_External_CQL)
+ wrbuf_printf(b, "CQL: %s", q->u.type_104->u.cql);
+ else
+ wrbuf_printf(b,"Unknown type 104 query %d", q->u.type_104->which);