X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fsnippet.c;h=cb8b65b2c962f26ebf46c8543a967aff43eef816;hb=ce2b82a980c06a45aa2eeeb88c927c90a014da61;hp=7341c111ac3108d0d1d1814897453cdceb3516af;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc;p=idzebra-moved-to-github.git diff --git a/util/snippet.c b/util/snippet.c index 7341c11..cb8b65b 100644 --- a/util/snippet.c +++ b/util/snippet.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -108,7 +111,7 @@ void zebra_snippets_log(const zebra_snippets *l, int log_level, int all) if (all || w->mark) yaz_log(log_level, "term='%s'%s mark=%d seqno=" ZINT_FORMAT " ord=%d", - wrbuf_cstr(wr_term), + wrbuf_cstr(wr_term), (w->match && !w->ws ? "*" : ""), w->mark, w->seqno, w->ord); wrbuf_destroy(wr_term); @@ -186,7 +189,7 @@ zebra_snippets *zebra_snippets_window(const zebra_snippets *doc, hit_w = hit_w->next) { if (hit_w->ord == ord && hit_w->seqno == doc_w->seqno) - + { match = 1; break; @@ -194,7 +197,7 @@ zebra_snippets *zebra_snippets_window(const zebra_snippets *doc, } zebra_snippets_append_match(result, doc_w->seqno, doc_w->ws, - ord, doc_w->term, + ord, doc_w->term, strlen(doc_w->term), match); } } @@ -266,7 +269,7 @@ void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, doc_w->mark = 1; break; } - + } /* mark following terms */ if (doc_w) @@ -274,7 +277,7 @@ void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, zebra_snippet_word *w = doc_w->next; while (w) if (w->ord == ord - && hit_w->seqno - before < w->seqno + && hit_w->seqno - before < w->seqno && hit_w->seqno + after > w->seqno) { w->mark = 1; @@ -289,7 +292,7 @@ void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, zebra_snippet_word *w = doc_w->prev; while (w) if (w->ord == ord - && hit_w->seqno - before < w->seqno + && hit_w->seqno - before < w->seqno && hit_w->seqno + after > w->seqno) { w->mark = 1; @@ -303,10 +306,11 @@ void zebra_snippets_ring(zebra_snippets *doc, const zebra_snippets *hit, } } - + /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab