X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzlogs.c;h=73942e25f7c145ed4807012a22fee397aa4c2b9e;hb=9289fb373f6404bb9d795c3a9eef42b4ce5d50d7;hp=7532c803a1b562b2c9d906792d810c5c72b85a71;hpb=6f1d59535b020d95c6c8b20cc21f28ac1c192818;p=idzebra-moved-to-github.git diff --git a/index/zlogs.c b/index/zlogs.c index 7532c80..73942e2 100644 --- a/index/zlogs.c +++ b/index/zlogs.c @@ -1,10 +1,16 @@ /* - * Copyright (C) 1994-1995, Index Data I/S + * Copyright (C) 1995-1998, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: zlogs.c,v $ - * Revision 1.6 1997-09-29 09:06:41 adam + * Revision 1.8 1998-04-02 14:35:29 adam + * First version of Zebra that works with compiled ASN.1. + * + * Revision 1.7 1998/01/29 13:40:11 adam + * Better logging for scan service. + * + * Revision 1.6 1997/09/29 09:06:41 adam * Removed static var to make this module thread safe. * * Revision 1.5 1997/04/30 08:56:07 quinn @@ -214,10 +220,20 @@ static void zlog_attributes (Z_AttributesPlusTerm *t, int level, { int of, i; char str[80]; - for (of = 0; of < t->num_attributes; of++) +#ifdef ASN_COMPILED + int num_attributes = t->attributes->num_attributes; +#else + int num_attributes = t->num_attributes; +#endif + + for (of = 0; of < num_attributes; of++) { Z_AttributeElement *element; +#ifdef ASN_COMPILED + element = t->attributes->attributes[of]; +#else element = t->attributeList[of]; +#endif switch (element->which) { @@ -307,3 +323,16 @@ void zlog_rpn (Z_RPNQuery *rpn) logf (LOG_LOG, "RPN query. Type: %s", attrset->desc); zlog_structure (rpn->RPNStructure, 0, ast); } + +void zlog_scan (Z_AttributesPlusTerm *zapt, oid_value ast) +{ + int level = 0; + if (zapt->term->which == Z_Term_general) + { + logf (LOG_LOG, "%*.s term '%.*s' (general)", level, "", + zapt->term->u.general->len, zapt->term->u.general->buf); + } + else + logf (LOG_LOG, "%*.s term (not general)", level, ""); + zlog_attributes (zapt, level+2, ast); +}