Ravenports generated: 14 Jan 2019 13:07
[ravenports.git] / bucket_BB / clucene
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               clucene
4 VERSION=                2.3.3.4
5 KEYWORDS=               textproc
6 VARIANTS=               standard
7 SDESC[standard]=        C++ port of Lucene search engine
8 HOMEPAGE=               http://clucene.sourceforge.net/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            SF/clucene/clucene-core-unstable/2.3
13 DISTFILE[1]=            clucene-core-2.3.3.4.tar.gz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BUILD_DEPENDS=          boost-libraries:rest:python_default
21
22 USES=                   cmake iconv zlib c++:single
23
24 DISTNAME=               clucene-core-2.3.3.4
25
26 FPC_EQUIVALENT=         textproc/clucene
27
28 PLIST_SUB=              SOVERSION=2.3.3.4
29
30 CMAKE_ARGS=             -DBUILD_CONTRIBS_LIB:BOOL=ON
31
32 post-patch:
33         ${REINPLACE_CMD} \
34                 -e 's|%%DATADIR%%|share/clucene|' \
35                 -e 's|libdata|lib|' \
36                 ${WRKSRC}/src/core/CMakeLists.txt
37         ${ECHO_CMD} 'SET(CMAKE_NO_BUILTIN_CHRPATH OFF CACHE BOOL "" FORCE)' \
38                 >> ${WRKSRC}/CMakeLists.txt
39
40 post-install:
41         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so
42
43 [FILE:160:descriptions/desc.single]
44 CLucene is a C++ port of Lucene: the high-performance, full-featured text
45 search engine written in Java. CLucene is faster than lucene as it is
46 written in C++.
47
48
49 [FILE:106:distinfo]
50 ddfdc433dd8ad31b5c5819cc4404a8d2127472a3b720d3e744e8c51d79732eab      2241498 clucene-core-2.3.3.4.tar.gz
51
52
53 [FILE:7639:manifests/plist.single]
54 include/CLucene.h
55 include/CLucene/
56  CLConfig.h
57  LuceneThreads.h
58  SharedHeader.h
59  StdHeader.h
60  clucene-config.h
61 include/CLucene/analysis/
62  AnalysisHeader.h
63  Analyzers.h
64  CachingTokenFilter.h
65  LanguageBasedAnalyzer.h
66  PorterStemmer.h
67 include/CLucene/analysis/cjk/CJKAnalyzer.h
68 include/CLucene/analysis/de/
69  GermanAnalyzer.h
70  GermanStemFilter.h
71  GermanStemmer.h
72 include/CLucene/analysis/standard/
73  StandardAnalyzer.h
74  StandardFilter.h
75  StandardTokenizer.h
76  StandardTokenizerConstants.h
77 include/CLucene/debug/
78  error.h
79  lucenebase.h
80  mem.h
81 include/CLucene/document/
82  DateField.h
83  DateTools.h
84  Document.h
85  Field.h
86  FieldSelector.h
87  NumberTools.h
88 include/CLucene/ext/boost/
89  assert.hpp
90  checked_delete.hpp
91  config.hpp
92  current_function.hpp
93  memory_order.hpp
94  shared_ptr.hpp
95  throw_exception.hpp
96  version.hpp
97 include/CLucene/ext/boost/config/
98  abi_prefix.hpp
99  abi_suffix.hpp
100  auto_link.hpp
101  posix_features.hpp
102  requires_threads.hpp
103  select_compiler_config.hpp
104  select_platform_config.hpp
105  select_stdlib_config.hpp
106  suffix.hpp
107  user.hpp
108  warning_disable.hpp
109 include/CLucene/ext/boost/config/abi/
110  borland_prefix.hpp
111  borland_suffix.hpp
112  msvc_prefix.hpp
113  msvc_suffix.hpp
114 include/CLucene/ext/boost/config/compiler/
115  borland.hpp
116  codegear.hpp
117  comeau.hpp
118  common_edg.hpp
119  compaq_cxx.hpp
120  digitalmars.hpp
121  gcc.hpp
122  gcc_xml.hpp
123  greenhills.hpp
124  hp_acc.hpp
125  intel.hpp
126  kai.hpp
127  metrowerks.hpp
128  mpw.hpp
129  pgi.hpp
130  sgi_mipspro.hpp
131  sunpro_cc.hpp
132  vacpp.hpp
133  visualc.hpp
134 include/CLucene/ext/boost/config/no_tr1/
135  cmath.hpp
136  complex.hpp
137  functional.hpp
138  memory.hpp
139  utility.hpp
140 include/CLucene/ext/boost/config/platform/
141  aix.hpp
142  amigaos.hpp
143  beos.hpp
144  bsd.hpp
145  cygwin.hpp
146  hpux.hpp
147  irix.hpp
148  linux.hpp
149  macos.hpp
150  qnxnto.hpp
151  solaris.hpp
152  vxworks.hpp
153  win32.hpp
154 include/CLucene/ext/boost/config/stdlib/
155  dinkumware.hpp
156  libcomo.hpp
157  libstdcpp3.hpp
158  modena.hpp
159  msl.hpp
160  roguewave.hpp
161  sgi.hpp
162  stlport.hpp
163  vacpp.hpp
164 include/CLucene/ext/boost/detail/
165  algorithm.hpp
166  allocator_utilities.hpp
167  atomic_count.hpp
168  binary_search.hpp
169  call_traits.hpp
170  catch_exceptions.hpp
171  compressed_pair.hpp
172  container_fwd.hpp
173  dynamic_bitset.hpp
174  endian.hpp
175  has_default_constructor.hpp
176  identifier.hpp
177  indirect_traits.hpp
178  interlocked.hpp
179  is_function_ref_tester.hpp
180  is_incrementable.hpp
181  is_xxx.hpp
182  iterator.hpp
183  lcast_precision.hpp
184  lightweight_mutex.hpp
185  lightweight_test.hpp
186  lightweight_thread.hpp
187  limits.hpp
188  named_template_params.hpp
189  no_exceptions_support.hpp
190  none_t.hpp
191  numeric_traits.hpp
192  ob_call_traits.hpp
193  ob_compressed_pair.hpp
194  quick_allocator.hpp
195  reference_content.hpp
196  scoped_enum_emulation.hpp
197  select_type.hpp
198  sp_typeinfo.hpp
199  templated_streams.hpp
200  utf8_codecvt_facet.hpp
201  workaround.hpp
202 include/CLucene/ext/boost/exception/
203  all.hpp
204  current_exception_cast.hpp
205  diagnostic_information.hpp
206  enable_current_exception.hpp
207  enable_error_info.hpp
208  errinfo_api_function.hpp
209  errinfo_at_line.hpp
210  errinfo_errno.hpp
211  errinfo_file_handle.hpp
212  errinfo_file_name.hpp
213  errinfo_file_open_mode.hpp
214  errinfo_nested_exception.hpp
215  errinfo_type_info_name.hpp
216  error_info.hpp
217  exception.hpp
218  get_error_info.hpp
219  info.hpp
220  info_tuple.hpp
221  to_string.hpp
222  to_string_stub.hpp
223 include/CLucene/ext/boost/exception/detail/
224  attribute_noreturn.hpp
225  error_info_impl.hpp
226  exception_ptr.hpp
227  is_output_streamable.hpp
228  object_hex_dump.hpp
229  type_info.hpp
230 include/CLucene/ext/boost/smart_ptr/
231  bad_weak_ptr.hpp
232  enable_shared_from_this.hpp
233  enable_shared_from_this2.hpp
234  intrusive_ptr.hpp
235  make_shared.hpp
236  scoped_array.hpp
237  scoped_ptr.hpp
238  shared_array.hpp
239  shared_ptr.hpp
240  weak_ptr.hpp
241 include/CLucene/ext/boost/smart_ptr/detail/
242  atomic_count.hpp
243  atomic_count_gcc.hpp
244  atomic_count_gcc_x86.hpp
245  atomic_count_pthreads.hpp
246  atomic_count_solaris.hpp
247  atomic_count_sync.hpp
248  atomic_count_win32.hpp
249  lightweight_mutex.hpp
250  lwm_nop.hpp
251  lwm_pthreads.hpp
252  lwm_win32_cs.hpp
253  operator_bool.hpp
254  quick_allocator.hpp
255  shared_array_nmt.hpp
256  shared_count.hpp
257  shared_ptr_nmt.hpp
258  sp_convertible.hpp
259  sp_counted_base.hpp
260  sp_counted_base_acc_ia64.hpp
261  sp_counted_base_cw_ppc.hpp
262  sp_counted_base_cw_x86.hpp
263  sp_counted_base_gcc_ia64.hpp
264  sp_counted_base_gcc_mips.hpp
265  sp_counted_base_gcc_ppc.hpp
266  sp_counted_base_gcc_sparc.hpp
267  sp_counted_base_gcc_x86.hpp
268  sp_counted_base_nt.hpp
269  sp_counted_base_pt.hpp
270  sp_counted_base_solaris.hpp
271  sp_counted_base_spin.hpp
272  sp_counted_base_sync.hpp
273  sp_counted_base_w32.hpp
274  sp_counted_impl.hpp
275  sp_has_sync.hpp
276  spinlock.hpp
277  spinlock_gcc_arm.hpp
278  spinlock_nt.hpp
279  spinlock_pool.hpp
280  spinlock_pt.hpp
281  spinlock_sync.hpp
282  spinlock_w32.hpp
283  yield_k.hpp
284 include/CLucene/highlighter/
285  Encoder.h
286  Formatter.h
287  Fragmenter.h
288  HighlightScorer.h
289  Highlighter.h
290  QueryScorer.h
291  QueryTermExtractor.h
292  Scorer.h
293  SimpleFragmenter.h
294  SimpleHTMLEncoder.h
295  SimpleHTMLFormatter.h
296  TextFragment.h
297  TokenGroup.h
298  TokenSources.h
299  WeightedTerm.h
300 include/CLucene/index/
301  DirectoryIndexReader.h
302  IndexDeletionPolicy.h
303  IndexModifier.h
304  IndexReader.h
305  IndexWriter.h
306  MergePolicy.h
307  MergeScheduler.h
308  MultiReader.h
309  MultipleTermPositions.h
310  Payload.h
311  Term.h
312  TermVector.h
313  Terms.h
314 include/CLucene/queryParser/
315  MultiFieldQueryParser.h
316  QueryParser.h
317  QueryParserConstants.h
318  QueryParserTokenManager.h
319  QueryToken.h
320 include/CLucene/queryParser/legacy/
321  MultiFieldQueryParser.h
322  QueryParser.h
323  QueryToken.h
324 include/CLucene/search/
325  BooleanClause.h
326  BooleanQuery.h
327  CachingSpanFilter.h
328  CachingWrapperFilter.h
329  ChainedFilter.h
330  Compare.h
331  ConstantScoreQuery.h
332  DateFilter.h
333  Explanation.h
334  FieldCache.h
335  FieldDoc.h
336  FieldSortedHitQueue.h
337  Filter.h
338  FilterResultCache.h
339  FilteredTermEnum.h
340  FuzzyQuery.h
341  Hits.h
342  IndexSearcher.h
343  MatchAllDocsQuery.h
344  MultiPhraseQuery.h
345  MultiSearcher.h
346  MultiTermQuery.h
347  PhraseQuery.h
348  PrefixQuery.h
349  Query.h
350  QueryFilter.h
351  RangeFilter.h
352  RangeQuery.h
353  Scorer.h
354  ScorerDocQueue.h
355  SearchHeader.h
356  Searchable.h
357  Similarity.h
358  Sort.h
359  SpanFilter.h
360  SpanFilterResult.h
361  SpanQueryFilter.h
362  TermQuery.h
363  WildcardQuery.h
364  WildcardTermEnum.h
365 include/CLucene/search/spans/
366  SpanFirstQuery.h
367  SpanNearQuery.h
368  SpanNotQuery.h
369  SpanOrQuery.h
370  SpanQuery.h
371  SpanScorer.h
372  SpanTermQuery.h
373  SpanWeight.h
374  Spans.h
375 include/CLucene/snowball/
376  SnowballAnalyzer.h
377  SnowballFilter.h
378  libstemmer.h
379 include/CLucene/snowball/include/libstemmer.h
380 include/CLucene/snowball/libstemmer/modules.h
381 include/CLucene/snowball/runtime/
382  api.h
383  header.h
384 include/CLucene/snowball/src_c/
385  stem_ISO_8859_1_danish.h
386  stem_ISO_8859_1_dutch.h
387  stem_ISO_8859_1_english.h
388  stem_ISO_8859_1_finnish.h
389  stem_ISO_8859_1_french.h
390  stem_ISO_8859_1_german.h
391  stem_ISO_8859_1_italian.h
392  stem_ISO_8859_1_norwegian.h
393  stem_ISO_8859_1_porter.h
394  stem_ISO_8859_1_portuguese.h
395  stem_ISO_8859_1_spanish.h
396  stem_ISO_8859_1_swedish.h
397  stem_KOI8_R_russian.h
398  stem_UTF_8_danish.h
399  stem_UTF_8_dutch.h
400  stem_UTF_8_english.h
401  stem_UTF_8_finnish.h
402  stem_UTF_8_french.h
403  stem_UTF_8_german.h
404  stem_UTF_8_italian.h
405  stem_UTF_8_norwegian.h
406  stem_UTF_8_porter.h
407  stem_UTF_8_portuguese.h
408  stem_UTF_8_russian.h
409  stem_UTF_8_spanish.h
410  stem_UTF_8_swedish.h
411 include/CLucene/store/
412  Directory.h
413  FSDirectory.h
414  IndexInput.h
415  IndexOutput.h
416  Lock.h
417  LockFactory.h
418  RAMDirectory.h
419 include/CLucene/util/
420  Array.h
421  BitSet.h
422  CLStreams.h
423  Equators.h
424  PriorityQueue.h
425  Reader.h
426  VoidList.h
427  VoidMap.h
428  arrayinputstream.h
429  byteinputstream.h
430  gzipcompressstream.h
431  gzipinputstream.h
432  streamarray.h
433 lib/
434  libclucene-contribs-lib.so
435  libclucene-contribs-lib.so.%%SOVERSION%%
436  libclucene-contribs-lib.so.1
437  libclucene-core.so
438  libclucene-core.so.%%SOVERSION%%
439  libclucene-core.so.1
440  libclucene-shared.so
441  libclucene-shared.so.%%SOVERSION%%
442  libclucene-shared.so.1
443 lib/pkgconfig/libclucene-core.pc
444 share/clucene/CLuceneConfig.cmake
445
446
447 [FILE:320:patches/patch-CMakeLists.txt]
448 --- CMakeLists.txt.orig 2011-03-17 00:21:07 UTC
449 +++ CMakeLists.txt
450 @@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS )
451    SET(BUILD_CONTRIBS_LIB 1)
452  ENDIF ( BUILD_CONTRIBS )
453  IF ( BUILD_CONTRIBS_LIB )
454 -  ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL)
455 +  ADD_SUBDIRECTORY (src/contribs-lib)
456  ENDIF ( BUILD_CONTRIBS_LIB )
457  
458  
459
460
461 [FILE:450:patches/patch-src__contribs-lib__CLucene__analysis__cjk__CJKAnalyzer.h]
462 --- src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h.orig    2011-03-17 00:21:07 UTC
463 +++ src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h
464 @@ -39,7 +39,7 @@ private:
465       * character buffer, store the characters which are used to compose <br>
466       * the returned Token
467       */
468 -    TCHAR buffer[LUCENE_MAX_WORD_LEN];
469 +    TCHAR buffer[LUCENE_MAX_WORD_LEN+1];
470  
471      /**
472       * I/O buffer, used to store the content of the input(one of the <br>
473
474
475 [FILE:996:patches/patch-src__contribs-lib__CLucene__analysis__de__GermanStemmer.cpp]
476 --- src/contribs-lib/CLucene/analysis/de/GermanStemmer.cpp.orig 2011-03-17 00:21:07 UTC
477 +++ src/contribs-lib/CLucene/analysis/de/GermanStemmer.cpp
478 @@ -16,7 +16,7 @@ CL_NS_USE2(analysis,de)
479      }
480  
481      TCHAR* GermanStemmer::stem(const TCHAR* term, size_t length) {
482 -      if (length < 0) {
483 +      if (length <= 0) {
484          length = _tcslen(term);
485        }
486  
487 @@ -38,7 +38,7 @@ CL_NS_USE2(analysis,de)
488      }
489  
490      bool GermanStemmer::isStemmable(const TCHAR* term, size_t length) const {
491 -      if (length < 0) {
492 +      if (length <= 0) {
493          length = _tcslen(term);
494        }
495        for (size_t c = 0; c < length; c++) {
496 @@ -144,7 +144,7 @@ CL_NS_USE2(analysis,de)
497            {
498              buffer.setCharAt( i, _T('$') );
499              buffer.deleteChars( i + 1, i + 3 );
500 -            substCount =+ 2;
501 +            substCount += 2;
502            }
503            else if ( c == _T('c') && buffer.charAt( i + 1 ) == _T('h') ) {
504              buffer.setCharAt( i, 0xa7 ); // section sign in UTF-16
505
506
507 [FILE:2092:patches/patch-src__contribs-lib__CLucene__highlighter__Highlighter.cpp]
508 --- src/contribs-lib/CLucene/highlighter/Highlighter.cpp.orig   2011-03-17 00:21:07 UTC
509 +++ src/contribs-lib/CLucene/highlighter/Highlighter.cpp
510 @@ -214,8 +214,9 @@ CL_NS_USE(util)
511                         int32_t startOffset;
512                         int32_t endOffset;
513                         int32_t lastEndOffset = 0;
514 +                       int len;
515                         _textFragmenter->start(text);
516 -                       TCHAR substringBuffer[LUCENE_MAX_WORD_LEN];
517 +                       TCHAR substringBuffer[LUCENE_MAX_WORD_LEN+1];
518  
519                         TokenGroup* tokenGroup=_CLNEW TokenGroup();
520  
521 @@ -229,8 +230,9 @@ CL_NS_USE(util)
522                                          startOffset = tokenGroup->getStartOffset();
523                                          endOffset = tokenGroup->getEndOffset();
524  
525 -                                        _tcsncpy(substringBuffer,text+startOffset,endOffset-startOffset);
526 -                                        substringBuffer[endOffset-startOffset]=_T('\0');
527 +                                        len = cl_min(endOffset-startOffset,LUCENE_MAX_WORD_LEN);
528 +                                        _tcsncpy(substringBuffer,text+startOffset,len);
529 +                                        substringBuffer[len]=_T('\0');
530  
531                                          TCHAR* encoded = _encoder->encodeText(substringBuffer);
532                                          TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup);
533 @@ -238,9 +240,7 @@ CL_NS_USE(util)
534  
535                                          //store any whitespace etc from between this and last group
536                                          if (startOffset > lastEndOffset){
537 -                                                int len = startOffset-lastEndOffset;
538 -                                                if ( len > LUCENE_MAX_FIELD_LEN )
539 -                                                        len = LUCENE_MAX_FIELD_LEN;
540 +                                                len = cl_min(startOffset-lastEndOffset,LUCENE_MAX_FIELD_LEN);
541                                                  _tcsncpy(buffer,text+lastEndOffset,len);
542                                                  buffer[len]=_T('\0');
543  
544 @@ -287,8 +287,9 @@ CL_NS_USE(util)
545                     startOffset = tokenGroup->getStartOffset();
546                     endOffset = tokenGroup->getEndOffset();
547  
548 -                               _tcsncpy(substringBuffer,text+startOffset,endOffset-startOffset);
549 -                               substringBuffer[endOffset-startOffset]=_T('\0');
550 +                   len = cl_min(endOffset-startOffset,LUCENE_MAX_WORD_LEN);
551 +                   _tcsncpy(substringBuffer,text+startOffset,len);
552 +                   substringBuffer[len]=_T('\0');
553  
554                                 TCHAR* encoded = _encoder->encodeText(substringBuffer);
555          TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup);
556 @@ -393,6 +394,7 @@ CL_NS_USE(util)
557                                 }
558                         }
559                 )
560 +               return NULL;
561         }
562  
563  
564
565
566 [FILE:381:patches/patch-src__contribs-lib__CLucene__highlighter__WeightedTerm.cpp]
567 --- src/contribs-lib/CLucene/highlighter/WeightedTerm.cpp.orig  2011-03-17 00:21:07 UTC
568 +++ src/contribs-lib/CLucene/highlighter/WeightedTerm.cpp
569 @@ -73,7 +73,7 @@ CL_NS_DEF2(search,highlight)
570          * @param weight the weight associated with this term
571          */
572         void WeightedTerm::setWeight(float_t weight) {
573 -               this->_weight = _weight;
574 +               _weight = weight;
575                 cachedHashCode = 0;
576         }
577  
578
579
580 [FILE:2580:patches/patch-src__contribs-lib__CLucene__snowball__Snowball.cpp]
581 --- src/contribs-lib/CLucene/snowball/Snowball.cpp.orig 2011-03-17 00:21:07 UTC
582 +++ src/contribs-lib/CLucene/snowball/Snowball.cpp
583 @@ -19,16 +19,31 @@ CL_NS_USE2(analysis,standard)
584  
585  CL_NS_DEF2(analysis,snowball)
586  
587 +  class SnowballAnalyzer::SavedStreams : public TokenStream {
588 +  public:
589 +    StandardTokenizer* tokenStream;
590 +    TokenStream* filteredTokenStream;
591 +
592 +    SavedStreams():tokenStream(NULL), filteredTokenStream(NULL) {}
593 +    void close(){}
594 +    Token* next(Token* token) {return NULL;}
595 +  };
596 +  
597    /** Builds the named analyzer with no stop words. */
598    SnowballAnalyzer::SnowballAnalyzer(const TCHAR* language) {
599      this->language = STRDUP_TtoT(language);
600         stopSet = NULL;
601    }
602  
603 -  SnowballAnalyzer::~SnowballAnalyzer(){
604 -         _CLDELETE_CARRAY(language);
605 -         if ( stopSet != NULL )
606 -                 _CLDELETE(stopSet);
607 +  SnowballAnalyzer::~SnowballAnalyzer() {
608 +    SavedStreams* streams = reinterpret_cast<SavedStreams*>(getPreviousTokenStream());
609 +    if (streams != NULL) {
610 +      _CLDELETE(streams->filteredTokenStream);
611 +      _CLDELETE(streams);
612 +    }
613 +    _CLDELETE_CARRAY(language);
614 +    if (stopSet != NULL)
615 +      _CLDELETE(stopSet);
616    }
617  
618    /** Builds the named analyzer with the given stop words.
619 @@ -62,12 +77,29 @@ CL_NS_DEF2(analysis,snowball)
620      result = _CLNEW SnowballFilter(result, language, true);
621      return result;
622    }
623 -  
624 -  
625 -  
626 -  
627 -  
628 -  
629 +
630 +  TokenStream* SnowballAnalyzer::reusableTokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader) {
631 +    SavedStreams* streams = reinterpret_cast<SavedStreams*>(getPreviousTokenStream());
632 +
633 +    if (streams == NULL) {
634 +      streams = _CLNEW SavedStreams();
635 +      BufferedReader* bufferedReader = reader->__asBufferedReader();
636 +
637 +      if (bufferedReader == NULL)
638 +        streams->tokenStream = _CLNEW StandardTokenizer(_CLNEW FilteredBufferedReader(reader, false), true);
639 +      else
640 +        streams->tokenStream = _CLNEW StandardTokenizer(bufferedReader);
641 +
642 +      streams->filteredTokenStream = _CLNEW StandardFilter(streams->tokenStream, true);
643 +      streams->filteredTokenStream = _CLNEW LowerCaseFilter(streams->filteredTokenStream, true);
644 +      if (stopSet != NULL)
645 +        streams->filteredTokenStream = _CLNEW StopFilter(streams->filteredTokenStream, true, stopSet);
646 +      streams->filteredTokenStream = _CLNEW SnowballFilter(streams->filteredTokenStream, language, true);
647 +      setPreviousTokenStream(streams);
648 +    } else
649 +      streams->tokenStream->reset(reader);
650 +    return streams->filteredTokenStream;
651 +  }
652    
653      /** Construct the named stemming filter.
654     *
655
656
657 [FILE:791:patches/patch-src__contribs-lib__CLucene__snowball__SnowballAnalyzer.h]
658 --- src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h.orig   2011-03-17 00:21:07 UTC
659 +++ src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h
660 @@ -22,6 +22,7 @@ CL_NS_DEF2(analysis,snowball)
661  class CLUCENE_CONTRIBS_EXPORT SnowballAnalyzer: public Analyzer {
662    TCHAR* language;
663    CLTCSetList* stopSet;
664 +  class SavedStreams;
665  
666  public:
667    /** Builds the named analyzer with no stop words. */
668 @@ -37,6 +38,8 @@ public:
669        StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
670    TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
671    TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader, bool deleteReader);
672 +
673 +  TokenStream* reusableTokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader);
674  };
675  
676  CL_NS_END2
677
678
679 [FILE:868:patches/patch-src__contribs-lib__CLucene__snowball__libstemmer__libstemmer.c]
680 --- src/contribs-lib/CLucene/snowball/libstemmer/libstemmer.c.orig      2011-03-17 00:21:07 UTC
681 +++ src/contribs-lib/CLucene/snowball/libstemmer/libstemmer.c
682 @@ -35,9 +35,8 @@ sb_stemmer_new(const char * algorithm, c
683  {
684      stemmer_encoding enc;
685      struct stemmer_modules * module;
686 -    struct sb_stemmer * stemmer =
687 -           (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer));
688 -    if (stemmer == NULL) return NULL;
689 +    struct sb_stemmer * stemmer;
690 +
691      enc = sb_getenc(charenc);
692      if (enc == ENC_UNKNOWN) return NULL;
693  
694 @@ -46,6 +45,9 @@ sb_stemmer_new(const char * algorithm, c
695      }
696      if (module->name == NULL) return NULL;
697      
698 +    stemmer = (struct sb_stemmer *) malloc(sizeof(struct sb_stemmer));
699 +    if (stemmer == NULL) return NULL;
700 +
701      stemmer->create = module->create;
702      stemmer->close = module->close;
703      stemmer->stem = module->stem;
704
705
706 [FILE:985:patches/patch-src__contribs-lib__CMakeLists.txt]
707 --- src/contribs-lib/CMakeLists.txt.orig        2011-03-17 00:21:07 UTC
708 +++ src/contribs-lib/CMakeLists.txt
709 @@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED
710  )
711  TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs})
712  
713 +#install public headers.
714 +FOREACH(file ${HEADERS})
715 +       get_filename_component(apath ${file} PATH)
716 +       get_filename_component(aname ${file} NAME)
717 +       file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
718 +       IF ( NOT aname MATCHES "^_.*" )
719 +               install(FILES ${file} 
720 +                       DESTINATION include/${relpath}
721 +                       COMPONENT development)
722 +       ENDIF ( NOT aname MATCHES "^_.*" )
723 +ENDFOREACH(file)
724 +
725  #set properties on the libraries
726  SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES
727      VERSION ${CLUCENE_VERSION}
728      SOVERSION ${CLUCENE_SOVERSION}
729      COMPILE_DEFINITIONS_DEBUG _DEBUG
730  )
731 +
732 +#and install library
733 +install(TARGETS clucene-contribs-lib 
734 +        DESTINATION ${LIB_DESTINATION}  
735 +        COMPONENT runtime )
736
737
738 [FILE:394:patches/patch-src__core__CLucene__analysis__AnalysisHeader.cpp]
739 --- src/core/CLucene/analysis/AnalysisHeader.cpp.orig   2011-03-17 00:21:07 UTC
740 +++ src/core/CLucene/analysis/AnalysisHeader.cpp
741 @@ -212,7 +212,7 @@ TCHAR* Token::toString() const{
742      sb.append(_T(","));
743      sb.appendInt( _endOffset );
744  
745 -    if (!_tcscmp( _type, _T("word")) == 0 ){
746 +    if (_tcscmp( _type, _T("word")) != 0) {
747        sb.append(_T(",type="));
748        sb.append(_type);
749      }
750
751
752 [FILE:504:patches/patch-src__core__CLucene__index__DocumentsWriter.cpp]
753 --- src/core/CLucene/index/DocumentsWriter.cpp.orig     2011-03-17 00:21:07 UTC
754 +++ src/core/CLucene/index/DocumentsWriter.cpp
755 @@ -125,7 +125,7 @@ DocumentsWriter::~DocumentsWriter(){
756    if (this->postingsFreeListDW.values){
757        if (this->postingsFreeCountDW < this->postingsFreeListDW.length) {
758            memset(this->postingsFreeListDW.values + this->postingsFreeCountDW
759 -              , NULL
760 +              , 0
761                , sizeof(Posting*));
762        }
763        postingsFreeListDW.deleteUntilNULL();
764
765
766 [FILE:695:patches/patch-src__core__CLucene__index__DocumentsWriterThreadState.cpp]
767 --- src/core/CLucene/index/DocumentsWriterThreadState.cpp.orig  2011-03-17 00:21:07 UTC
768 +++ src/core/CLucene/index/DocumentsWriterThreadState.cpp
769 @@ -994,7 +994,7 @@ void DocumentsWriter::ThreadState::Field
770    const TCHAR* tokenText = token->termBuffer();
771    const int32_t tokenTextLen = token->termLength();
772  
773 -  int32_t code = 0;
774 +  uint32_t code = 0;
775  
776    // Compute hashcode
777    int32_t downto = tokenTextLen;
778 @@ -1203,7 +1203,8 @@ void DocumentsWriter::ThreadState::Field
779    const int32_t newMask = newSize-1;
780  
781    ValueArray<Posting*> newHash(newSize);
782 -  int32_t hashPos, code;
783 +  int32_t hashPos;
784 +  uint32_t code;
785    const TCHAR* pos = NULL;
786    const TCHAR* start = NULL;
787    Posting* p0;
788
789
790 [FILE:536:patches/patch-src__core__CLucene__index__IndexFileDeleter.cpp]
791 --- src/core/CLucene/index/IndexFileDeleter.cpp.orig    2011-03-17 00:21:07 UTC
792 +++ src/core/CLucene/index/IndexFileDeleter.cpp
793 @@ -129,7 +129,7 @@ IndexFileDeleter::IndexFileDeleter(Direc
794  
795           string& fileName = files.at(i);
796  
797 -    if (filter->accept(NULL, fileName.c_str()) && !fileName.compare(IndexFileNames::SEGMENTS_GEN) == 0) {
798 +    if (filter->accept(NULL, fileName.c_str()) && fileName.compare(IndexFileNames::SEGMENTS_GEN) != 0) {
799  
800             // Add this file to refCounts with initial count 0:
801             getRefCount(fileName.c_str());
802
803
804 [FILE:2342:patches/patch-src__core__CLucene__index__IndexWriter.cpp]
805 --- src/core/CLucene/index/IndexWriter.cpp.orig 2011-03-17 00:21:07 UTC
806 +++ src/core/CLucene/index/IndexWriter.cpp
807 @@ -53,7 +53,6 @@ const int32_t IndexWriter::DEFAULT_MERGE
808  
809  DEFINE_MUTEX(IndexWriter::MESSAGE_ID_LOCK)
810  int32_t IndexWriter::MESSAGE_ID = 0;
811 -const int32_t IndexWriter::MAX_TERM_LENGTH = DocumentsWriter::MAX_TERM_LENGTH;
812  
813  class IndexWriter::Internal{
814  public:
815 @@ -814,7 +813,7 @@ void IndexWriter::optimize(int32_t maxNu
816    ensureOpen();
817  
818    if (maxNumSegments < 1)
819 -    _CLTHROWA(CL_ERR_IllegalArgument, "maxNumSegments must be >= 1; got " + maxNumSegments);
820 +    _CLTHROWA(CL_ERR_IllegalArgument, (string("maxNumSegments must be >= 1; got ") + Misc::toString(maxNumSegments)).c_str());
821  
822    if (infoStream != NULL)
823      message("optimize: index now " + segString());
824 @@ -1392,7 +1391,7 @@ bool IndexWriter::doFlush(bool _flushDoc
825      // Check if the doc stores must be separately flushed
826      // because other segments, besides the one we are about
827      // to flush, reference it
828 -    if (_flushDocStores && (!flushDocs || !docWriter->getSegment().compare(docWriter->getDocStoreSegment())==0 )) {
829 +    if (_flushDocStores && (!flushDocs || docWriter->getSegment().compare(docWriter->getDocStoreSegment()) != 0)) {
830        // We must separately flush the doc store
831        if (infoStream != NULL)
832          message("  flush shared docStore segment " + docStoreSegment);
833 @@ -1631,7 +1630,7 @@ bool IndexWriter::commitMerge(MergePolic
834          // Load deletes present @ start of merge, for this segment:
835          BitVector previousDeletes(previousInfo->dir, previousInfo->getDelFileName().c_str());
836  
837 -        if (!currentInfo->getDelFileName().compare(previousInfo->getDelFileName())==0 ){
838 +        if (currentInfo->getDelFileName().compare(previousInfo->getDelFileName()) != 0) {
839            // This means this segment has had new deletes
840            // committed since we started the merge, so we
841            // must merge them:
842 @@ -1928,7 +1927,7 @@ void IndexWriter::_mergeInit(MergePolicy
843        mergeDocStores = true;
844      else if (lastDocStoreSegment.empty())
845        lastDocStoreSegment = docStoreSegment;
846 -    else if (!lastDocStoreSegment.compare(docStoreSegment)==0 )
847 +    else if (lastDocStoreSegment.compare(docStoreSegment) != 0)
848        mergeDocStores = true;
849  
850      // Segments' docScoreOffsets must be in-order,
851
852
853 [FILE:624:patches/patch-src__core__CLucene__index__IndexWriter.h]
854 --- src/core/CLucene/index/IndexWriter.h.orig   2011-03-17 00:21:07 UTC
855 +++ src/core/CLucene/index/IndexWriter.h
856 @@ -384,14 +384,6 @@ public:
857     */
858    static const int32_t DEFAULT_MAX_MERGE_DOCS;
859  
860 -  /**
861 -   * Absolute hard maximum length for a term.  If a term
862 -   * arrives from the analyzer longer than this length, it
863 -   * is skipped and a message is printed to infoStream, if
864 -   * set (see {@link #setInfoStream}).
865 -   */
866 -  static const int32_t MAX_TERM_LENGTH;
867 -
868  
869    /* Determines how often segment indices are merged by addDocument().  With
870     *  smaller values, less RAM is used while indexing, and searches on
871
872
873 [FILE:399:patches/patch-src__core__CLucene__index__TermInfosReader.cpp]
874 --- src/core/CLucene/index/TermInfosReader.cpp.orig     2011-03-17 00:21:07 UTC
875 +++ src/core/CLucene/index/TermInfosReader.cpp
876 @@ -111,7 +111,7 @@ CL_NS_DEF(index)
877               //destroy their elements
878  #ifdef _DEBUG
879           for ( int32_t i=0; i<indexTermsLength;++i ){
880 -            indexTerms[i].__cl_refcount--;
881 +            indexTerms[i].__cl_decref();
882           }
883  #endif
884           //Delete the arrays
885
886
887 [FILE:895:patches/patch-src__core__CLucene__queryParser__QueryParser.cpp]
888 --- src/core/CLucene/queryParser/QueryParser.cpp.orig   2011-03-17 00:21:07 UTC
889 +++ src/core/CLucene/queryParser/QueryParser.cpp
890 @@ -79,7 +79,7 @@ const TCHAR* QueryParserConstants::token
891      _T("<RANGEEX_GOOP>")
892  };
893  
894 -const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
895 +const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,int32_t(0x80000000),0x20000000,int32_t(0x80000000),0x10000,0x80000,0x10000,0x1f68000};
896  const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
897  
898  struct QueryParser::JJCalls {
899
900
901 [FILE:2469:patches/patch-src__core__CLucene__queryParser__QueryParserTokenManager.cpp]
902 --- src/core/CLucene/queryParser/QueryParserTokenManager.cpp.orig       2011-03-17 00:21:07 UTC
903 +++ src/core/CLucene/queryParser/QueryParserTokenManager.cpp
904 @@ -15,9 +15,9 @@
905  
906  CL_NS_DEF(queryParser)
907  
908 -const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
909 +const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))};
910  const int64_t QueryParserTokenManager::jjbitVec0[] = {
911 -       _ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
912 +       int64_t(_ILONGLONG(0xfffffffffffffffe)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff)), int64_t(_ILONGLONG(0xffffffffffffffff))
913  };
914  const int32_t QueryParserTokenManager::jjnextStates[]={
915                 15, 17, 18, 29, 32, 23, 33, 30, 20, 21, 32, 23, 33, 31, 34, 27,
916 @@ -544,7 +544,10 @@ int32_t QueryParserTokenManager::jjMoveN
917                         kind = 0x7fffffff;
918                 }
919                 ++curPos;
920 -               if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
921 +               i = jjnewStateCnt;
922 +               jjnewStateCnt = startsAt;
923 +               startsAt = 36 - jjnewStateCnt;
924 +               if (i == startsAt)
925                         return curPos;
926                 try { curChar = input_stream->readChar(); }
927                 catch(CLuceneError& e) {
928 @@ -756,7 +759,10 @@ int32_t QueryParserTokenManager::jjMoveN
929                         kind = 0x7fffffff;
930                 }
931                 ++curPos;
932 -               if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
933 +               i = jjnewStateCnt;
934 +               jjnewStateCnt = startsAt;
935 +               startsAt = 7 - jjnewStateCnt;
936 +               if (i == startsAt)
937                         return curPos;
938                 try { curChar = input_stream->readChar(); }
939                 catch(CLuceneError& e) {
940 @@ -854,7 +860,10 @@ int32_t QueryParserTokenManager::jjMoveN
941                         kind = 0x7fffffff;
942                 }
943                 ++curPos;
944 -               if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
945 +               i = jjnewStateCnt;
946 +               jjnewStateCnt = startsAt;
947 +               startsAt = 3 - jjnewStateCnt;
948 +               if (i == startsAt)
949                         return curPos;
950                 try { curChar = input_stream->readChar(); }
951                 catch(CLuceneError& e) {
952 @@ -1066,7 +1075,10 @@ int32_t QueryParserTokenManager::jjMoveN
953                         kind = 0x7fffffff;
954                 }
955                 ++curPos;
956 -               if ((i = jjnewStateCnt) == (startsAt = 7 - (jjnewStateCnt = startsAt)))
957 +               i = jjnewStateCnt;
958 +               jjnewStateCnt = startsAt;
959 +               startsAt = 7 - jjnewStateCnt;
960 +               if (i == startsAt)
961                         return curPos;
962                 try { curChar = input_stream->readChar(); }
963                 catch(CLuceneError& e) {
964
965
966 [FILE:412:patches/patch-src__core__CLucene__queryParser__legacy__Lexer.cpp]
967 --- src/core/CLucene/queryParser/legacy/Lexer.cpp.orig  2011-03-17 00:21:07 UTC
968 +++ src/core/CLucene/queryParser/legacy/Lexer.cpp
969 @@ -117,7 +117,7 @@ bool Lexer::GetNextToken(QueryToken* tok
970        if( _istspace(ch)!=0 ) {
971           continue;
972        }
973 -      TCHAR buf[2] = {ch,'\0'};
974 +      TCHAR buf[2] = {TCHAR(ch),'\0'};
975        switch(ch) {
976           case '+':
977              token->set(buf, QueryToken::PLUS);
978
979
980 [FILE:696:patches/patch-src__core__CLucene__search__ConstantScoreQuery.cpp]
981 --- src/core/CLucene/search/ConstantScoreQuery.cpp.orig 2011-03-17 00:21:07 UTC
982 +++ src/core/CLucene/search/ConstantScoreQuery.cpp
983 @@ -25,14 +25,17 @@ class ConstantScorer : public Scorer {
984      BitSet* bits;
985      const float_t theScore;
986      int32_t _doc;
987 +    bool shouldDelete;
988  
989  public:
990      ConstantScorer(Similarity* similarity, IndexReader* reader, Weight* w, Filter* filter) : Scorer(similarity),
991          bits(filter->bits(reader)), theScore(w->getValue()), _doc(-1)
992      {
993 +        shouldDelete = filter->shouldDeleteBitSet(bits);
994      }
995      virtual ~ConstantScorer() {
996 -        _CLLDELETE(bits);
997 +        if ( shouldDelete)
998 +            _CLLDELETE(bits);
999      }
1000  
1001      bool next() {
1002
1003
1004 [FILE:349:patches/patch-src__core__CLucene__store__FSDirectory.cpp]
1005 --- src/core/CLucene/store/FSDirectory.cpp.orig 2011-03-17 00:21:07 UTC
1006 +++ src/core/CLucene/store/FSDirectory.cpp
1007 @@ -219,9 +219,8 @@ CL_NS_USE(util)
1008                 _CLDECDELETE(handle);
1009  
1010                 //printf("handle=%d\n", handle->__cl_refcount);
1011 -               if ( dounlock ){
1012 -                       mutex->unlock();
1013 -               }else{
1014 +               mutex->unlock();
1015 +               if ( !dounlock ) {
1016                         delete mutex;
1017                 }
1018         }
1019
1020
1021 [FILE:435:patches/patch-src__core__CLucene__store__IndexInput.cpp]
1022 --- src/core/CLucene/store/IndexInput.cpp.orig  2011-03-17 00:21:07 UTC
1023 +++ src/core/CLucene/store/IndexInput.cpp
1024 @@ -41,8 +41,8 @@ CL_NS_USE(util)
1025    }
1026  
1027    int64_t IndexInput::readLong() {
1028 -    int64_t i = ((int64_t)readInt() << 32);
1029 -    return (i | ((int64_t)readInt() & 0xFFFFFFFFL));
1030 +    uint64_t i = ((uint64_t)readInt() << 32);
1031 +    return (i | ((uint64_t)readInt() & 0xFFFFFFFFL));
1032    }
1033  
1034    int64_t IndexInput::readVLong() {
1035
1036
1037 [FILE:2407:patches/patch-src__core__CLucene__util__BitSet.cpp]
1038 --- src/core/CLucene/util/BitSet.cpp.orig       2011-03-17 00:21:07 UTC
1039 +++ src/core/CLucene/util/BitSet.cpp
1040 @@ -32,6 +32,25 @@ const uint8_t BitSet::BYTE_COUNTS[256] =
1041      3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1042      4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};
1043  
1044 +const uint8_t BitSet::BYTE_OFFSETS[256] = {
1045 +    8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
1046 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
1047 +    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
1048 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
1049 +    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
1050 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1051 +    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1052 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1053 +    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1054 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1055 +    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1056 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1057 +    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1058 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1059 +    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 
1060 +    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0};
1061 +
1062 +
1063  BitSet::BitSet( const BitSet& copy ) :
1064         _size( copy._size ),
1065         _count(-1)
1066 @@ -180,19 +199,32 @@ BitSet* BitSet::clone() const {
1067      return                            factor * (4 + (8+40)*count()) < size();
1068    }
1069  
1070 -  int32_t BitSet::nextSetBit(int32_t fromIndex) const {
1071 +  int32_t BitSet::nextSetBit(int32_t fromIndex) const 
1072 +  {
1073        if (fromIndex < 0)
1074            _CLTHROWT(CL_ERR_IndexOutOfBounds, _T("fromIndex < 0"));
1075  
1076        if (fromIndex >= _size)
1077            return -1;
1078  
1079 -      while (true) {
1080 -          if ((bits[fromIndex >> 3] & (1 << (fromIndex & 7))) != 0)
1081 -              return fromIndex;
1082 -          if (++fromIndex == _size)
1083 -              return -1;
1084 +      int _max = ( _size+7 ) >> 3;
1085 +
1086 +      unsigned int i = (int)( fromIndex>>3 );
1087 +      unsigned int subIndex = fromIndex & 0x7; // index within the byte
1088 +      uint8_t byte = bits[i] >> subIndex;  // skip all the bits to the right of index
1089 +
1090 +      if ( byte != 0 ) 
1091 +      {
1092 +          return ( ( i<<3 ) + subIndex + BYTE_OFFSETS[ byte ] );
1093 +      }
1094 +
1095 +      while( ++i < _max ) 
1096 +      {
1097 +          byte = bits[i];
1098 +          if ( byte != 0 ) 
1099 +              return ( ( i<<3 ) + BYTE_OFFSETS[ byte ] );
1100        }
1101 +      return -1;
1102    }
1103  
1104  CL_NS_END
1105
1106
1107 [FILE:438:patches/patch-src__core__CLucene__util__BitSet.h]
1108 --- src/core/CLucene/util/BitSet.h.orig 2011-03-17 00:21:07 UTC
1109 +++ src/core/CLucene/util/BitSet.h
1110 @@ -39,6 +39,7 @@ class CLUCENE_EXPORT BitSet:LUCENE_BASE
1111    /** Indicates if the bit vector is sparse and should be saved as a d-gaps list, or dense, and should be saved as a bit set. */
1112    bool isSparse();
1113    static const uint8_t BYTE_COUNTS[256];
1114 +  static const uint8_t BYTE_OFFSETS[256];
1115  protected:
1116         BitSet( const BitSet& copy );
1117  
1118
1119
1120 [FILE:806:patches/patch-src__core__CLucene__util__MD5Digester.cpp]
1121 --- src/core/CLucene/util/MD5Digester.cpp.orig  2011-03-17 00:21:07 UTC
1122 +++ src/core/CLucene/util/MD5Digester.cpp
1123 @@ -72,18 +72,16 @@ static unsigned char PADDING[64] =
1124  // PrintMD5: Converts a completed md5 digest into a char* string.
1125  char* PrintMD5(uint8_t md5Digest[16])
1126  {
1127 -       char chBuffer[256];
1128 -       char chEach[10];
1129 +       const char toHex[] = "0123456789abcdef";
1130 +       char chBuffer[16 * 2 + 1];
1131         int nCount;
1132  
1133 -       memset(chBuffer,0,256);
1134 -       memset(chEach, 0, 10);
1135 -
1136         for (nCount = 0; nCount < 16; nCount++)
1137         {
1138 -               cl_sprintf(chEach, 10, "%02x", md5Digest[nCount]);
1139 -               strncat(chBuffer, chEach, sizeof(chEach));
1140 +               chBuffer[nCount * 2] = toHex[(md5Digest[nCount] & 0xf0) >> 4];
1141 +               chBuffer[nCount * 2 + 1] = toHex[md5Digest[nCount] & 0x0f];
1142         }
1143 +       chBuffer[nCount * 2] = '\0';
1144  
1145         return STRDUP_AtoA(chBuffer);
1146  }
1147
1148
1149 [FILE:839:patches/patch-src__core__CLucene__util__VoidMap.h]
1150 --- src/core/CLucene/util/VoidMap.h.orig        2011-03-17 00:21:07 UTC
1151 +++ src/core/CLucene/util/VoidMap.h
1152 @@ -11,8 +11,13 @@
1153  #include "CLucene/LuceneThreads.h"
1154  
1155  #if defined(_CL_HAVE_TR1_UNORDERED_MAP) && defined(_CL_HAVE_TR1_UNORDERED_SET)
1156 +#if defined(_LIBCPP_VERSION)
1157 +       #include <unordered_map>
1158 +       #include <unordered_set>
1159 +#else
1160         #include <tr1/unordered_map>
1161         #include <tr1/unordered_set>
1162 +#endif
1163  #elif defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET)
1164         //hashing is all or nothing!
1165         #include <hash_map>
1166 @@ -83,7 +88,7 @@ public:
1167         _vt get( _kt k) const {
1168                 const_iterator itr = base::find(k);
1169                 if ( itr==base::end() )
1170 -                       return (_vt)NULL;
1171 +                       return static_cast<_vt>(0);
1172                 else
1173                         return itr->second;
1174         }
1175 @@ -316,6 +321,7 @@ public:
1176                 if ( _this::dk || _this::dv )
1177                         _this::remove(k);
1178  
1179 +               (*this)[k] = v;;
1180         }
1181  };
1182  
1183
1184
1185 [FILE:1093:patches/patch-src__core__CMakeLists.txt]
1186 --- src/core/CMakeLists.txt.orig        2011-03-17 00:21:07 UTC
1187 +++ src/core/CMakeLists.txt
1188 @@ -252,13 +252,13 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/
1189      set(CLUCENE_SOVERSION ${CLUCENE_SOVERSION})
1190  ")
1191  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/CLuceneConfig.cmake"
1192 -        DESTINATION ${LIB_DESTINATION}/CLuceneConfig.cmake)
1193 +        DESTINATION %%DATADIR%%)
1194  
1195  # install pkg-config file
1196  IF(NOT WIN32)
1197    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libclucene-core.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libclucene-core.pc @ONLY)
1198    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libclucene-core.pc
1199 -          DESTINATION ${LIB_DESTINATION}/pkgconfig )
1200 +          DESTINATION libdata/pkgconfig )
1201  ENDIF(NOT WIN32)
1202  
1203  
1204 @@ -274,9 +274,6 @@ ELSE ( LUCENE_SYS_INCLUDES )
1205      install(FILES ${clucene-shared_BINARY_DIR}/CLucene/clucene-config.h 
1206              DESTINATION include/CLucene
1207              COMPONENT development)
1208 -    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CLuceneConfig.cmake 
1209 -            DESTINATION include/CLucene
1210 -            COMPONENT development)
1211  ENDIF ( LUCENE_SYS_INCLUDES )
1212  
1213  
1214
1215
1216 [FILE:559:patches/patch-src__core__libclucene-core.pc.cmake]
1217 --- src/core/libclucene-core.pc.cmake.orig      2011-03-17 00:21:07 UTC
1218 +++ src/core/libclucene-core.pc.cmake
1219 @@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i
1220  Name: libclucene
1221  Description: CLucene - a C++ search engine, ported from the popular Apache Lucene
1222  Version: @CLUCENE_VERSION_MAJOR@.@CLUCENE_VERSION_MINOR@.@CLUCENE_VERSION_REVISION@.@CLUCENE_VERSION_PATCH@
1223 -Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core
1224 +Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
1225  Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
1226  ~
1227
1228
1229 [FILE:289:patches/patch-src__shared__CLucene__LuceneThreads.h]
1230 --- src/shared/CLucene/LuceneThreads.h.orig     2011-03-17 00:21:07 UTC
1231 +++ src/shared/CLucene/LuceneThreads.h
1232 @@ -7,6 +7,9 @@
1233  #ifndef _LuceneThreads_h
1234  #define  _LuceneThreads_h
1235  
1236 +#if defined(_CL_HAVE_PTHREAD)
1237 +#include <pthread.h>
1238 +#endif
1239  
1240  CL_NS_DEF(util)
1241  class CLuceneThreadIdCompare;
1242
1243
1244 [FILE:1062:patches/patch-src__shared__CMakeLists.txt]
1245 --- src/shared/CMakeLists.txt.orig      2011-03-17 00:21:07 UTC
1246 +++ src/shared/CMakeLists.txt
1247 @@ -42,7 +42,7 @@ INCLUDE (CheckAtomicFunctions)
1248  find_package(ZLIB)
1249  IF ( ZLIB_FOUND )
1250    SET ( EXTRA_LIBS ${EXTRA_LIBS} ${ZLIB_LIBRARY} )
1251 -ELSEIF ( ZLIB_FOUND )
1252 +ELSE ( ZLIB_FOUND )
1253    MESSAGE( "ZLIB not found, using local: ${clucene-ext_SOURCE_DIR}/zlib" )
1254    SET(ZLIB_INCLUDE_DIR ${clucene-ext_SOURCE_DIR}/zlib )
1255    SET(ZLIB_LIBRARY ${clucene-ext_BINARY_DIR})
1256 @@ -62,7 +62,7 @@ CHECK_OPTIONAL_HEADERS ( string.h sys/ti
1257                          stdint.h unistd.h io.h direct.h sys/dir.h sys/ndir.h dirent.h wctype.h fcntl.h
1258                          stat.h sys/stat.h stdexcept errno.h fcntl.h windef.h windows.h wchar.h 
1259                          hash_map hash_set ext/hash_map ext/hash_map tr1/unordered_set tr1/unordered_map
1260 -                        sys/timeb.h tchar.h strings.h stdexcept sys/mman.h winerror.h )
1261 +                        tchar.h strings.h stdexcept sys/mman.h winerror.h )
1262  
1263  
1264  ########################################################################
1265
1266
1267 [FILE:470:patches/patch-src__shared__cmake__CheckHashmaps.cmake]
1268 --- src/shared/cmake/CheckHashmaps.cmake.orig   2011-03-17 00:21:07 UTC
1269 +++ src/shared/cmake/CheckHashmaps.cmake
1270 @@ -35,8 +35,12 @@ MACRO(HASHMAP_TEST HashingValue namespac
1271  #elif defined(_CL_HAVE_EXT_HASH_MAP)
1272         #include <ext/hash_map>
1273  #elif defined(_CL_HAVE_TR1_UNORDERED_MAP)
1274 +#if defined(_LIBCPP_VERSION)
1275 +       #include <unordered_map>
1276 +#else
1277         #include <tr1/unordered_map>
1278  #endif
1279 +#endif
1280  int main() {  
1281      ${namespace}::${_CL_HASH_MAP}<int,char> a; 
1282      return 0; 
1283