From 2947a1e4e735df14104e984b90f588cee8cc3ad3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 25 Jul 2002 12:48:54 +0000 Subject: [PATCH] Print @term --- zutil/logrpn.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/zutil/logrpn.c b/zutil/logrpn.c index 5d52db6..57d2d24 100644 --- a/zutil/logrpn.c +++ b/zutil/logrpn.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2001, Index Data * All rights reserved. * - * $Id: logrpn.c,v 1.6 2002-01-22 10:54:46 adam Exp $ + * $Id: logrpn.c,v 1.7 2002-07-25 12:48:54 adam Exp $ */ #include @@ -266,14 +266,25 @@ static void zlog_structure (Z_RPNStructure *zs, int level, enum oid_value ast) { Z_AttributesPlusTerm *zapt = zs->u.simple->u.attributesPlusTerm; - if (zapt->term->which == Z_Term_general) + switch (zapt->term->which) { + case Z_Term_general: yaz_log (LOG_LOG, "%*.0s term '%.*s' (general)", level, "", zapt->term->u.general->len, zapt->term->u.general->buf); - } - else - { + break; + case Z_Term_characterString: + yaz_log (LOG_LOG, "%*.0s term '%s' (string)", level, "", + zapt->term->u.characterString); + break; + case Z_Term_numeric: + yaz_log (LOG_LOG, "%*.0s term '%d' (numeric)", level, "", + *zapt->term->u.numeric); + break; + case Z_Term_null: + yaz_log (LOG_LOG, "%*.0s term (null)", level, ""); + break; + default: yaz_log (LOG_LOG, "%*.0s term (not general)", level, ""); } zlog_attributes (zapt, level+2, ast); -- 1.7.10.4