- zlog_structure (zs->u.complex->s1, depth+2, ast, loglevel);
- zlog_structure (zs->u.complex->s2, depth+2, ast, loglevel);
- }
- else if (zs->which == Z_RPNStructure_simple)
- {
- if (zs->u.simple->which == Z_Operand_APT)
- {
- Z_AttributesPlusTerm *zapt = zs->u.simple->u.attributesPlusTerm;
-
- switch (zapt->term->which)
- {
- case Z_Term_general:
- yaz_log (loglevel, "%*.0s term '%.*s' (general)", depth, "",
- zapt->term->u.general->len,
- zapt->term->u.general->buf);
- break;
- case Z_Term_characterString:
- yaz_log (loglevel, "%*.0s term '%s' (string)", depth, "",
- zapt->term->u.characterString);
- break;
- case Z_Term_numeric:
- yaz_log (loglevel, "%*.0s term '%d' (numeric)", depth, "",
- *zapt->term->u.numeric);
- break;
- case Z_Term_null:
- yaz_log (loglevel, "%*.0s term (null)", depth, "");
- break;
- default:
- yaz_log (loglevel, "%*.0s term (not general)", depth, "");
- }
- zlog_attributes (zapt, depth+2, ast, loglevel);
- }
- else if (zs->u.simple->which == Z_Operand_resultSetId)
- {
- yaz_log (loglevel, "%*.0s set '%s'", depth, "",
- zs->u.simple->u.resultSetId);
- }
- else
- yaz_log (loglevel, "%*.0s unknown simple structure", depth, "");
- }
- else
- yaz_log (loglevel, "%*.0s unknown structure", depth, "");
-}
-
-static void wrbuf_structure (WRBUF b, Z_RPNStructure *zs, enum oid_value ast)
-{
- int i;
- if (zs->which == Z_RPNStructure_complex)
- {
- Z_Operator *op = zs->u.complex->roperator;
- wrbuf_printf(b, "@%s ", complex_op_name(op) );
- if (op->which== Z_Operator_prox)
- {
- wrbuf_printf(b, "(excl=%s dist=%d order=%s "
- "rel=%s unit=%s) ",
- op->u.prox->exclusion ?
- (*op->u.prox->exclusion ? "T" : "F") : "N",
- *op->u.prox->distance,
- *op->u.prox->ordered ? "T" : "F",
- relToStr(*op->u.prox->relationType),
- prox_unit_name(op->u.prox) );
- }
- wrbuf_structure (b,zs->u.complex->s1, ast);
- wrbuf_structure (b,zs->u.complex->s2, ast);