From a9d1f1c7c6254115b779f46c3d12d6e59c240e0a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 6 Oct 1995 15:07:39 +0000 Subject: [PATCH] Structure 'local-number' handled. --- index/zrpn.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/index/zrpn.c b/index/zrpn.c index 4f50db2..3bca949 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.21 1995-10-06 13:52:06 adam + * Revision 1.22 1995-10-06 15:07:39 adam + * Structure 'local-number' handled. + * + * Revision 1.21 1995/10/06 13:52:06 adam * Bug fixes. Handler may abort further scanning. * * Revision 1.20 1995/10/06 11:06:33 adam @@ -521,6 +524,33 @@ static RSET rpn_search_APT_phrase (ZServerInfo *zi, return rset_create (rset_kind_isam, &parms); } +static RSET rpn_search_APT_local (ZServerInfo *zi, Z_AttributesPlusTerm *zapt) +{ + RSET result; + RSFD rsfd; + struct it_key key; + rset_temp_parms parms; + char termz[IT_MAX_WORD+1]; + + if (zapt->term->which != Z_Term_general) + { + zi->errCode = 124; + return NULL; + } + parms.key_size = sizeof (struct it_key); + result = rset_create (rset_kind_temp, &parms); + rsfd = rset_open (result, 1); + + trans_term (zi, zapt, termz); + key.sysno = atoi (termz); + if (key.sysno <= 0) + key.sysno = 1; + rset_write (result, rsfd, &key); + rset_close (result, rsfd); + return result; +} + + static RSET rpn_search_APT (ZServerInfo *zi, Z_AttributesPlusTerm *zapt) { AttrType relation; @@ -570,7 +600,7 @@ static RSET rpn_search_APT (ZServerInfo *zi, Z_AttributesPlusTerm *zapt) case 106: /* document-text */ return rpn_search_APT_relevance (zi, zapt); case 107: /* local-number */ - break; + return rpn_search_APT_local (zi, zapt); case 108: /* string */ return rpn_search_APT_word (zi, zapt); case 109: /* numeric string */ -- 1.7.10.4