From: <ust...@us...> - 2008-07-21 10:17:31
|
Revision: 2782 http://clucene.svn.sourceforge.net/clucene/?rev=2782&view=rev Author: ustramooner Date: 2008-07-21 10:07:43 +0000 (Mon, 21 Jul 2008) Log Message: ----------- various gcc-pedantic warnings fixed fixed MMap implementation start using proper Sleep function (fixed cmake) using size_t for stringbuffer fix for various test-* tests un-deprecated Token::termText, since termText was already using the 'performance fix' that termBuffer brought. Can deprecate it if this is changed throughout the code. mingw32 fixes Modified Paths: -------------- branches/lucene2_3_2/doc/coding standards.txt branches/lucene2_3_2/src/core/CLucene/CLConfig.h branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp branches/lucene2_3_2/src/core/CLucene/document/DateField.cpp branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp branches/lucene2_3_2/src/core/CLucene/document/Field.cpp branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeInfo.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserBase.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/_MMap.h branches/lucene2_3_2/src/core/CLucene/util/Array.h branches/lucene2_3_2/src/core/CLucene/util/BitSet.cpp branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/IndexFiles.cpp branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/config/_threads.h branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h branches/lucene2_3_2/src/shared/CMakeLists.txt branches/lucene2_3_2/src/shared/cmake/DefineDword.cmake branches/lucene2_3_2/src/test/document/TestDocument.cpp branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp branches/lucene2_3_2/src/test/test.h Modified: branches/lucene2_3_2/doc/coding standards.txt =================================================================== --- branches/lucene2_3_2/doc/coding standards.txt 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/doc/coding standards.txt 2008-07-21 10:07:43 UTC (rev 2782) @@ -46,3 +46,14 @@ int32_t value=-1 (-1 should be some logical value, not necessarily -1). then in the implementation, check if -1 and default to the x static constant. * Try and use the functions in util/Array.h instead of Void Map/List functions. Void Map/List will be deprecated for public access +* Most compilers don't complain about this (in normal mode), but we require pedantic mode behaviour. Some important things for this are: + 1. Initialise variables in correct order as in the class + class x{ + int a; + int b; + x(): + b(12), + a(11) //THIS IS WRONG! a is initialised after b. + { + } + }; Modified: branches/lucene2_3_2/src/core/CLucene/CLConfig.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/CLConfig.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/CLConfig.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -47,10 +47,6 @@ //define this to force the build into ucs2 mode //#define _UCS2 // -//if a wide character is being converted to a ascii character and it -//cannot fit, this character is used instead. Required. -#define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF)) -// //define this to enable mmap support in the fsdirectory IndexInput //todo: only available for windows so far...need to add MMapInput.cpp to project //EXPERIMENTAL Modified: branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -16,17 +16,6 @@ #include "CLucene/analysis/standard/StandardAnalyzer.cpp" #include "CLucene/analysis/standard/StandardFilter.cpp" #include "CLucene/analysis/standard/StandardTokenizer.cpp" -#include "CLucene/config/gunichartables.cpp" -#include "CLucene/config/repl_tcscasecmp.cpp" -#include "CLucene/config/repl_tcslwr.cpp" -#include "CLucene/config/repl_tcstod.cpp" -#include "CLucene/config/repl_lltot.cpp" -#include "CLucene/config/repl_tcstoll.cpp" -#include "CLucene/config/repl_tprintf.cpp" -#include "CLucene/config/threads.cpp" -#include "CLucene/config/utf8.cpp" -#include "CLucene/debug/condition.cpp" -#include "CLucene/debug/error.cpp" #include "CLucene/document/DateField.cpp" #include "CLucene/document/DateTools.cpp" #include "CLucene/document/Document.cpp" @@ -115,9 +104,8 @@ #include "CLucene/util/FastCharStream.cpp" #include "CLucene/util/fileinputstream.cpp" #include "CLucene/util/MD5Digester.cpp" -#include "CLucene/util/Misc.cpp" #include "CLucene/util/Reader.cpp" -#include "CLucene/util/StringBuffer.cpp" #include "CLucene/util/StringIntern.cpp" -#include "CLucene/util/dirent.cpp" #include "CLucene/util/ThreadLocal.cpp" + +#include "CLucene/CLSharedMonolithic.cpp" Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -40,18 +40,6 @@ <br><br> - <p><b>NOTE:</b> As of 2.3, Token stores the term text - internally as a malleable char[] termBuffer instead of - String termText. The indexing code and core tokenizers - have been changed re-use a single Token instance, changing - its buffer and other fields in-place as the Token is - processed. This provides substantially better indexing - performance as it saves the GC cost of new'ing a Token and - String for every term. The APIs that accept String - termText are still available but a warning about the - associated performance cost has been added (below). The - {@link #termText()} method has been deprecated.</p> - <p>Tokenizers and filters should try to re-use a Token instance when possible for best performance, by implementing the {@link TokenStream#next(Token)} API. @@ -119,11 +107,12 @@ */ void setPositionIncrement(int32_t posIncr); int32_t getPositionIncrement() const; - _CL_DEPRECATED( termBuffer ) const TCHAR* termText() const; - size_t termTextLength(); - void resetTermTextLen(); - void setText(const TCHAR* txt); + const TCHAR* termText() const; //< See #termBuffer() + size_t termTextLength(); //< Length of the the termBuffer. See #termBuffer + void resetTermTextLen(); //< Empties the termBuffer. See #termBuffer + void setText(const TCHAR* txt); //< Sets the termBuffer. See #termBuffer + /** Returns the internal termBuffer character array which * you can then directly alter. If the array is too * small for your token, use {@link Modified: branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -167,9 +167,9 @@ StopFilter::StopFilter(TokenStream* in, bool deleteTokenStream, CLTCSetList* stopTable, bool _deleteStopTable): TokenFilter(in, deleteTokenStream), stopWords (stopTable), + deleteStopTable(_deleteStopTable), enablePositionIncrements(ENABLE_POSITION_INCREMENTS_DEFAULT), - ignoreCase(false), - deleteStopTable(_deleteStopTable) + ignoreCase(false) { } //static Modified: branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -93,11 +93,11 @@ StandardTokenizer::StandardTokenizer(Reader* reader): - rd(_CLNEW FastCharStream(reader)), /* rdPos is zero-based. It starts at -1, and will advance to the first ** position when readChar() is first called. */ rdPos(-1), - tokenStart(-1) + tokenStart(-1), + rd(_CLNEW FastCharStream(reader)) { } Modified: branches/lucene2_3_2/src/core/CLucene/document/DateField.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/document/DateField.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/document/DateField.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -5,7 +5,7 @@ * the GNU Lesser General Public License, as specified in the COPYING file. ------------------------------------------------------------------------------*/ #include "CLucene/_ApiHeader.h" - + #include "DateField.h" #include "CLucene/util/Misc.h" Modified: branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -28,6 +28,7 @@ #include "DateTools.h" #include "CLucene/util/Misc.h" + CL_NS_USE(util) CL_NS_DEF(document) @@ -180,6 +181,7 @@ return ret; } -DateTools::~DateTools() {}; +DateTools::~DateTools(){ +} CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/document/Field.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/document/Field.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/document/Field.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -110,7 +110,7 @@ bool Field::getOmitNorms() const { return (internal->config & INDEX_NONORMS) != 0; } void Field::setOmitNorms(const bool omitNorms) { internal->config |= INDEX_NONORMS; } -bool Field::isLazy() const { return (internal->config & LAZY_YES) != 0; }; +bool Field::isLazy() const { return (internal->config & LAZY_YES) != 0; } void Field::setValue(const TCHAR* value) { _resetValue(); Modified: branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -68,12 +68,12 @@ DocumentWriter::DocumentWriter(Directory* d, Analyzer* a, CL_NS(search)::Similarity* sim, const int32_t mfl): analyzer(a), directory(d), + fieldInfos(NULL), maxFieldLength(mfl), - fieldInfos(NULL), + similarity(sim), + termIndexInterval( IndexWriter::DEFAULT_TERM_INDEX_INTERVAL ), postingTable(_CLNEW PostingTableType), fieldLengths(NULL), - similarity(sim), - termIndexInterval( IndexWriter::DEFAULT_TERM_INDEX_INTERVAL ), fieldPositions(NULL), fieldBoosts(NULL), termBuffer(_CLNEW Term){ @@ -92,12 +92,12 @@ DocumentWriter::DocumentWriter(CL_NS(store)::Directory* d, CL_NS(analysis)::Analyzer* a, IndexWriter* writer): analyzer(a), directory(d), + fieldInfos(NULL), maxFieldLength(writer->getMaxFieldLength()), - fieldInfos(NULL), + similarity(writer->getSimilarity()), + termIndexInterval( writer->getTermIndexInterval() ), postingTable(_CLNEW PostingTableType), fieldLengths(NULL), - similarity(writer->getSimilarity()), - termIndexInterval( writer->getTermIndexInterval() ), fieldPositions(NULL), fieldBoosts(NULL), termBuffer(_CLNEW Term){ Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -66,10 +66,10 @@ IndexWriter::IndexWriter(const char* path, Analyzer* a, const bool create, const bool _closeDir): + analyzer(a), + closeDir(_closeDir), directory( FSDirectory::getDirectory(path, create) ), - analyzer(a), - segmentInfos (_CLNEW SegmentInfos), - closeDir(_closeDir){ + segmentInfos (_CLNEW SegmentInfos){ //Func - Constructor // Constructs an IndexWriter for the index in path. //Pre - path != NULL and contains a named directory path @@ -85,10 +85,10 @@ } IndexWriter::IndexWriter(Directory* d, Analyzer* a, const bool create, const bool _closeDir): + analyzer(a), + closeDir(_closeDir), directory(_CL_POINTER(d)), - analyzer(a), - segmentInfos (_CLNEW SegmentInfos), - closeDir(_closeDir) + segmentInfos (_CLNEW SegmentInfos) { //Func - Constructor // Constructs an IndexWriter for the index in path. @@ -578,7 +578,7 @@ // start with zero or 1 seg so optimize the current optimize(); - int32_t start = segmentInfos->size(); + //int32_t start = segmentInfos->size(); //Iterate through the directories int32_t i = 0; Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -22,13 +22,26 @@ SegmentInfo::SegmentInfo(const char* Name, const int32_t DocCount, CL_NS(store)::Directory* Dir): - docCount(DocCount),dir(Dir),delGen(0),normGen(NULL),isCompoundFile(0),hasSingleNorm(false),preLockless(true){ + dir(Dir), + docCount(DocCount), + preLockless(true), + normGen(NULL), + delGen(0), + hasSingleNorm(false), + isCompoundFile(0) + { name = STRDUP_AtoA(Name); - } SegmentInfo::SegmentInfo(const char* Name, const int32_t DocCount, CL_NS(store)::Directory* Dir, const int64_t DelGen, int64_t* NormGen, const uint8_t IsCompoundFile, const bool HasSingleNorm, const bool PreLockless ): - docCount(DocCount),dir(Dir),delGen(DelGen),normGen(NormGen),isCompoundFile(IsCompoundFile),hasSingleNorm(HasSingleNorm),preLockless(PreLockless){ + dir(Dir), + docCount(DocCount), + preLockless(PreLockless), + normGen(NormGen), + delGen(DelGen), + hasSingleNorm(HasSingleNorm), + isCompoundFile(IsCompoundFile) + { //Func - Constructor. Initialises SegmentInfo. //Pre - Name holds the unique name in the directory Dir // DocCount holds the number of documents in the segment Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeInfo.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeInfo.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeInfo.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -12,7 +12,11 @@ CL_NS_DEF(index) SegmentMergeInfo::SegmentMergeInfo(const int32_t b, TermEnum* te, IndexReader* r): - reader(r),termEnum(te),base(b), docMap(NULL) { + docMap(NULL), + termEnum(te), + base(b), + reader(r) +{ //Func - Constructor //Pre - b >= 0 // te contains a valid reference to a SegmentTermEnum instance Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -264,7 +264,7 @@ CND_CONDITION(reader != NULL, "No IndexReader found"); //Get the total number documents including the documents that have been marked deleted - int32_t maxDoc = reader->maxDoc(); + maxDoc = reader->maxDoc(); //document buffer Document doc; Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -12,8 +12,9 @@ #include "_FieldsReader.h" #include "IndexReader.h" #include "_TermInfosReader.h" -#include "Terms.h" -#include "CLucene/search/Similarity.h" +#include "Terms.h" +#include "CLucene/search/Similarity.h" +#include "CLucene/store/FSDirectory.h" CL_NS_USE(util) CL_NS_USE(store) @@ -324,7 +325,6 @@ size_t patternLength = strlen(pattern); string res; - bool ret=false; vector<string>::iterator itr = names.begin(); while ( itr != names.end() ){ if ( (*itr).length()>patternLength && strncmp((*itr).c_str(),pattern,patternLength) == 0 ){ Modified: branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -316,7 +316,6 @@ free(buffer); terms[numTerms]=NULL; //null terminate terms array - SegmentTermVector* tv = NULL; if (storePositions || storeOffsets){ return _CLNEW SegmentTermPositionVector(field, terms, termFreqs, positions, offsets); }else { Modified: branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserBase.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserBase.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserBase.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -52,7 +52,6 @@ void QueryParserBase::discardEscapeChar(TCHAR* source) const{ int len = _tcslen(source); - int j = 0; for (int i = 0; i < len; i++) { if (source[i] == '\\' && source[i+1] != '\0' ) { _tcscpy(source+i,source+i+1); Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -79,8 +79,8 @@ BooleanQuery::BooleanQuery(const BooleanQuery& clone): Query(clone), - disableCoord(clone.disableCoord), - clauses(_CLNEW ClausesType(true)) + clauses(_CLNEW ClausesType(true)), + disableCoord(clone.disableCoord) { minNrShouldMatch = clone.minNrShouldMatch; for ( uint32_t i=0;i<clone.clauses->size();i++ ){ @@ -477,10 +477,10 @@ BooleanClause::BooleanClause(Query* q, const bool DeleteQuery,const bool req, const bool p): query(q), + occur(SHOULD), + deleteQuery(DeleteQuery), required(req), - prohibited(p), - occur(SHOULD), - deleteQuery(DeleteQuery) + prohibited(p) { if (required) { if (prohibited) { @@ -500,10 +500,10 @@ BooleanClause::BooleanClause(const BooleanClause& clone): query(clone.query->clone()), + occur(clone.occur), + deleteQuery(true), required(clone.required), - prohibited(clone.prohibited), - occur(clone.occur), - deleteQuery(true) + prohibited(clone.prohibited) { } @@ -540,13 +540,13 @@ return query->hashCode() ^ ( (occur == MUST) ?1:0) ^ ( (occur == MUST_NOT)?2:0); } - BooleanClause::Occur BooleanClause::getOccur() const { return occur; }; + BooleanClause::Occur BooleanClause::getOccur() const { return occur; } void BooleanClause::setOccur(Occur o) { occur = o; setFields(o); - }; + } - Query* BooleanClause::getQuery() const { return query; }; + Query* BooleanClause::getQuery() const { return query; } void BooleanClause::setQuery(Query* q) { if ( deleteQuery ) _CLDELETE( query ); Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -32,13 +32,12 @@ private: ClausesType* clauses; static size_t maxClauseCount; - static bool useScorer14; LUCENE_STATIC_CONSTANT(bool, allowDocsOutOfOrder=false); bool disableCoord; - protected: + protected: int32_t minNrShouldMatch; Weight* _createWeight(Searcher* searcher); BooleanQuery(const BooleanQuery& clone); Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -28,10 +28,10 @@ nextMask(1), end(0), current(NULL), + minNrShouldMatch(minNrShouldMatch), requiredMask(0), prohibitedMask(0), - coordFactors(NULL), - minNrShouldMatch(minNrShouldMatch) + coordFactors(NULL) { bucketTable = _CLNEW BucketTable(this); } Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -383,8 +383,8 @@ BooleanScorer2::BSConjunctionScorer::BSConjunctionScorer( CL_NS(search)::BooleanScorer2::Coordinator* coordinator, int32_t requiredNrMatchers ): ConjunctionScorer( Similarity::getDefault() ), coordinator(coordinator), - requiredNrMatchers(requiredNrMatchers), - lastScoredDoc(-1) + lastScoredDoc(-1), + requiredNrMatchers(requiredNrMatchers) { } BooleanScorer2::BSConjunctionScorer::~BSConjunctionScorer(){ @@ -418,13 +418,13 @@ } BooleanScorer2::Internal::Internal( BooleanScorer2* parent, int32_t minNrShouldMatch, bool allowDocsOutOfOrder ): - minNrShouldMatch(minNrShouldMatch), - allowDocsOutOfOrder(allowDocsOutOfOrder), - countingSumScorer(NULL), requiredScorers(false), optionalScorers(false), - prohibitedScorers(false) - { + prohibitedScorers(false), + countingSumScorer(NULL), + minNrShouldMatch(minNrShouldMatch), + allowDocsOutOfOrder(allowDocsOutOfOrder) +{ if ( minNrShouldMatch < 0 ) { // todO: throw some sort of exception } Modified: branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -57,8 +57,8 @@ }; PhraseQuery::PhraseQuery(): - terms(_CLNEW CL_NS(util)::CLVector<CL_NS(index)::Term*>(false) ), - positions(_CLNEW CL_NS(util)::CLVector<int32_t,CL_NS(util)::Deletor::DummyInt32>) + positions(_CLNEW CL_NS(util)::CLVector<int32_t,CL_NS(util)::Deletor::DummyInt32>), + terms(_CLNEW CL_NS(util)::CLVector<CL_NS(index)::Term*>(false) ) { //Func - Constructor //Pre - true @@ -69,9 +69,9 @@ field = NULL; } PhraseQuery::PhraseQuery(const PhraseQuery& clone): - Query(clone), - terms(_CLNEW CL_NS(util)::CLVector<CL_NS(index)::Term*>(false) ), - positions(_CLNEW CL_NS(util)::CLVector<int32_t,CL_NS(util)::Deletor::DummyInt32>) + Query(clone), + positions(_CLNEW CL_NS(util)::CLVector<int32_t,CL_NS(util)::Deletor::DummyInt32>), + terms(_CLNEW CL_NS(util)::CLVector<CL_NS(index)::Term*>(false) ) { slop = clone.slop; field = clone.field; Modified: branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -275,6 +275,6 @@ return bts; } -CL_NS(index)::Term* PrefixFilter::getPrefix() const { return prefix; }; +CL_NS(index)::Term* PrefixFilter::getPrefix() const { return prefix; } CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -33,7 +33,7 @@ this->_doc = _scorer->doc(); } -ScorerDocQueue::ScorerDocQueue( int32_t maxSize ) : _size(0), maxSize(maxSize) +ScorerDocQueue::ScorerDocQueue( int32_t maxSize ) : maxSize(maxSize), _size(0) { int heapSize = maxSize + 1; heap = _CL_NEWARRAY( HeapedScorerDoc*, heapSize ); Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -129,8 +129,8 @@ TopDocs::TopDocs(const int32_t th, ScoreDoc*sds, int32_t scoreDocsLen): totalHits(th), - scoreDocsLength(scoreDocsLen), - scoreDocs(sds) + scoreDocs(sds), + scoreDocsLength(scoreDocsLen) { //Func - Constructor //Pre - sds may or may not be NULL Modified: branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -6,13 +6,14 @@ ------------------------------------------------------------------------------*/ #include "CLucene/_ApiHeader.h" -#include "Directory.h" -#include "LockFactory.h" +#include "Directory.h" +#include "LockFactory.h" +#include "CLucene/util/Misc.h" CL_NS_DEF(store) Directory::~Directory(){ -}; +} LuceneLock* Directory::makeLock(const char* name) { return lockFactory->makeLock( name ); @@ -20,7 +21,12 @@ void Directory::setLockFactory( LockFactory* lockFactory ) { this->lockFactory = lockFactory; - lockFactory->setLockPrefix( getLockID() ); + + TCHAR* lockId = getLockID(); + char* alockId = STRDUP_TtoA(lockId); + lockFactory->setLockPrefix( alockId ); + _CLDELETE_CARRAY(lockId); + _CLDELETE_CaARRAY(alockId); } LockFactory* Directory::getLockFactory() { Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -29,6 +29,9 @@ #include "CLucene/util/_MD5Digester.h" #include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used +#ifdef LUCENE_FS_MMAP + #include "_MMap.h" +#endif CL_NS_DEF(store) CL_NS_USE(util) @@ -301,10 +304,10 @@ FSDirectory::FSDirectory(const char* path, const bool createDir, LockFactory* lockFactory): Directory(), + directory(_CL_NEWARRAY(char,CL_MAX_PATH)), + lockDir(_CL_NEWARRAY(char,CL_MAX_PATH)), refCount(0), - useMMap(false), - directory(_CL_NEWARRAY(char,CL_MAX_PATH)), - lockDir(_CL_NEWARRAY(char,CL_MAX_PATH)) + useMMap(false) { _realpath(path,directory);//set a realpath so that if we change directory, we can still function if ( !directory || !*directory ){ Modified: branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -144,7 +144,6 @@ TCHAR* FSLock::toString() { - const wchar_t* xx= L"SimpleFSLock@"; TCHAR* ret = _CL_NEWARRAY(TCHAR,strlen(lockFile)+14); // 14 = strlen("SimpleFSLock@") _tcscpy(ret,_T("SimpleFSLock@")); STRCPY_AtoT(ret+13,lockFile,strlen(lockFile)+1); Modified: branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -25,16 +25,17 @@ LockFactory::~LockFactory() { - _CLDELETE_CARRAY( lockPrefix ); + _CLDELETE_CaARRAY( lockPrefix ); } -void LockFactory::setLockPrefix( TCHAR* lockPrefix ) +void LockFactory::setLockPrefix( char* lockPrefix ) { - _CLDELETE_CARRAY( lockPrefix ); - this->lockPrefix = lockPrefix; + _CLDELETE_CaARRAY( this->lockPrefix ); + if ( lockPrefix != NULL ) + this->lockPrefix = STRDUP_AtoA(lockPrefix); } -TCHAR* LockFactory::getLockPrefix() +char* LockFactory::getLockPrefix() { return lockPrefix; } @@ -112,10 +113,7 @@ char name[CL_MAX_DIR]; if ( lockPrefix != NULL ) { - cl_sprintf(name, CL_MAX_DIR, "%S-%s", lockPrefix, lockName); - //STRCPY_TtoA(name,lockPrefix,_tcslen(lockPrefix)+1); - //strcat(name,"-"); - //strcat(name,lockName); + cl_sprintf(name, CL_MAX_DIR, "%s-%s", lockPrefix, lockName); } else { cl_strcpy(name,lockName,CL_MAX_DIR); } @@ -131,7 +129,7 @@ struct fileStat buf; if ( lockPrefix != NULL ) { - STRCPY_TtoA(name,lockPrefix,_tcslen(lockPrefix)+1); + STRCPY_AtoA(name,lockPrefix,strlen(lockPrefix)+1); strcat(name,"-"); strcat(name,lockName); } else { Modified: branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -19,15 +19,15 @@ class CLUCENE_EXPORT LockFactory: LUCENE_BASE { protected: - TCHAR* lockPrefix; + char* lockPrefix; public: LockFactory(); virtual ~LockFactory(); - void setLockPrefix( TCHAR* lockPrefix ); - TCHAR* getLockPrefix(); + void setLockPrefix( char* lockPrefix ); + char* getLockPrefix(); virtual LuceneLock* makeLock( const char* lockName )=0; virtual void clearLock( const char* lockName )=0; Modified: branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -8,20 +8,97 @@ #if defined(LUCENE_FS_MMAP) #include "FSDirectory.h" +#include "_MMap.h" #include "CLucene/util/Misc.h" #ifdef _CL_HAVE_SYS_MMAN_H #include <sys/mman.h> #endif +#ifdef _CL_HAVE_WINERROR_H + #include <winerror.h> +#endif +#if defined(_CL_HAVE_FUNCTION_MAPVIEWOFFILE) + typedef int HANDLE; + + #define GENERIC_READ (0x80000000L) + #define FILE_SHARE_READ 0x00000001 + #define OPEN_EXISTING 3 + #define PAGE_READONLY 0x02 + #define SECTION_MAP_READ 0x0004 + #define FILE_MAP_READ SECTION_MAP_READ + + typedef struct _SECURITY_ATTRIBUTES + { + _cl_dword_t nLength; + void* lpSecurityDescriptor; + bool bInheritHandle; + } SECURITY_ATTRIBUTES; + + extern "C" __declspec(dllimport) _cl_dword_t __stdcall GetFileSize( HANDLE hFile, _cl_dword_t* lpFileSizeHigh ); + + extern "C" __declspec(dllimport) bool __stdcall UnmapViewOfFile( void* lpBaseAddress ); + + extern "C" __declspec(dllimport) bool __stdcall CloseHandle( HANDLE hObject ); + extern "C" __declspec(dllimport) HANDLE __stdcall CreateFileA( + const char* lpFileName, + _cl_dword_t dwDesiredAccess, + _cl_dword_t dwShareMode, + SECURITY_ATTRIBUTES* lpSecurityAttributes, + _cl_dword_t dwCreationDisposition, + _cl_dword_t dwFlagsAndAttributes, + HANDLE hTemplateFile + ); + extern "C" __declspec(dllimport) HANDLE __stdcall CreateFileMappingA( + HANDLE hFile, + SECURITY_ATTRIBUTES* lpFileMappingAttributes, + _cl_dword_t flProtect, + _cl_dword_t dwMaximumSizeHigh, + _cl_dword_t dwMaximumSizeLow, + const char* lpName + ); + extern "C" __declspec(dllimport) void* __stdcall MapViewOfFile( + HANDLE hFileMappingObject, + _cl_dword_t dwDesiredAccess, + _cl_dword_t dwFileOffsetHigh, + _cl_dword_t dwFileOffsetLow, + _cl_dword_t dwNumberOfBytesToMap + ); + extern "C" __declspec(dllimport) _cl_dword_t __stdcall GetLastError(); +#endif + + CL_NS_DEF(store) CL_NS_USE(util) - FSDirectory::MMapIndexInput::MMapIndexInput(const char* path): - pos(0), - data(NULL), - _length(0), - isClone(false) + class MMapIndexInput::Internal: LUCENE_BASE{ + public: + uint8_t* data; + int64_t pos; +#if defined(_CL_HAVE_FUNCTION_MAPVIEWOFFILE) + HANDLE mmaphandle; + HANDLE fhandle; +#elif defined(_CL_HAVE_FUNCTION_MMAP) + int fhandle; +#else + #error no mmap implementation set +#endif + bool isClone; + int64_t _length; + + Internal(): + data(NULL), + pos(0), + isClone(false), + _length(0) + { + } + ~Internal(){ + } + }; + + MMapIndexInput::MMapIndexInput(const char* path): + internal(_CLNEW Internal) { //Func - Constructor. // Opens the file named path @@ -30,13 +107,13 @@ CND_PRECONDITION(path != NULL, "path is NULL"); -#ifdef _CL_HAVE_MAPVIEWOFFILE - mmaphandle = NULL; - fhandle = CreateFileA(path,GENERIC_READ,FILE_SHARE_READ, 0,OPEN_EXISTING,0,0); +#if defined(_CL_HAVE_FUNCTION_MAPVIEWOFFILE) + internal->mmaphandle = NULL; + internal->fhandle = CreateFileA(path,GENERIC_READ,FILE_SHARE_READ, 0,OPEN_EXISTING,0,0); //Check if a valid fhandle was retrieved - if (fhandle < 0){ - DWORD err = GetLastError(); + if (internal->fhandle < 0){ + _cl_dword_t err = GetLastError(); if ( err == ERROR_FILE_NOT_FOUND ) _CLTHROWA(CL_ERR_IO, "File does not exist"); else if ( err == EACCES ) @@ -47,24 +124,24 @@ _CLTHROWA(CL_ERR_IO, "File IO Error"); } - DWORD dummy=0; - _length = GetFileSize(fhandle,&dummy); + _cl_dword_t dummy=0; + internal->_length = GetFileSize(internal->fhandle, &dummy); - if ( _length > 0 ){ - mmaphandle = CreateFileMappingA(fhandle,NULL,PAGE_READONLY,0,0,NULL); - if ( mmaphandle != NULL ){ - void* address = MapViewOfFile(mmaphandle,FILE_MAP_READ,0,0,0); + if ( internal->_length > 0 ){ + internal->mmaphandle = CreateFileMappingA(internal->fhandle,NULL,PAGE_READONLY,0,0,NULL); + if ( internal->mmaphandle != NULL ){ + void* address = MapViewOfFile(internal->mmaphandle,FILE_MAP_READ,0,0,0); if ( address != NULL ){ - data = (uint8_t*)address; + internal->data = (uint8_t*)address; return; //SUCCESS! } } - CloseHandle(mmaphandle); + CloseHandle(internal->mmaphandle); char* lpMsgBuf=0; - DWORD dw = GetLastError(); + _cl_dword_t dw = GetLastError(); - FormatMessageA( + /*FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, @@ -77,79 +154,81 @@ sprintf(errstr, "MMapIndexInput::MMapIndexInput failed with error %d: %s", dw, lpMsgBuf); LocalFree(lpMsgBuf); - _CLTHROWA_DEL(CL_ERR_IO,errstr); + _CLTHROWA_DEL(CL_ERR_IO,errstr);*/ } -#else //_CL_HAVE_MAPVIEWOFFILE - fhandle = ::open (path, O_RDONLY); - if (fhandle < 0){ +#else //_CL_HAVE_FUNCTION_MAPVIEWOFFILE + internal->fhandle = ::open (path, O_RDONLY); + if (internal->fhandle < 0){ _CLTHROWA(CL_ERR_IO,strerror(errno)); }else{ // stat it struct stat sb; - if (::fstat (fhandle, &sb)){ + if (::fstat (internal->fhandle, &sb)){ _CLTHROWA(CL_ERR_IO,strerror(errno)); }else{ // get length from stat - _length = sb.st_size; + internal->_length = sb.st_size; // mmap the file - void* address = ::mmap(0, _length, PROT_READ, MAP_SHARED, fhandle, 0); + void* address = ::mmap(0, internal->_length, PROT_READ, MAP_SHARED, internal->fhandle, 0); if (address == MAP_FAILED){ _CLTHROWA(CL_ERR_IO,strerror(errno)); }else{ - data = (uint8_t*)address; + internal->data = (uint8_t*)address; } } } #endif } - FSDirectory::MMapIndexInput::MMapIndexInput(const MMapIndexInput& clone): IndexInput(clone){ + MMapIndexInput::MMapIndexInput(const MMapIndexInput& clone): IndexInput(clone){ //Func - Constructor // Uses clone for its initialization //Pre - clone is a valide instance of FSIndexInput //Post - The instance has been created and initialized by clone - -#ifdef _CL_HAVE_MAPVIEWOFFILE - mmaphandle = NULL; - fhandle = NULL; + internal = _CLNEW Internal; + +#if defined(_CL_HAVE_FUNCTION_MAPVIEWOFFILE) + internal->mmaphandle = NULL; + internal->fhandle = NULL; #endif - data = clone.data; - pos = clone.pos; + internal->data = clone.internal->data; + internal->pos = clone.internal->pos; //clone the file length - _length = clone._length; + internal->_length = clone.internal->_length; //Keep in mind that this instance is a clone - isClone = true; + internal->isClone = true; } - uint8_t FSDirectory::MMapIndexInput::readByte(){ - return *(data+(pos++)); + uint8_t MMapIndexInput::readByte(){ + return *(internal->data+(internal->pos++)); } - void FSDirectory::MMapIndexInput::readBytes(uint8_t* b, const int32_t len){ - memcpy(b, data+pos, len); - pos+=len; + void MMapIndexInput::readBytes(uint8_t* b, const int32_t len){ + memcpy(b, internal->data+internal->pos, len); + internal->pos+=len; } - int32_t FSDirectory::MMapIndexInput::readVInt(){ - uint8_t b = *(data+(pos++)); + int32_t MMapIndexInput::readVInt(){ + uint8_t b = *(internal->data+(internal->pos++)); int32_t i = b & 0x7F; for (int shift = 7; (b & 0x80) != 0; shift += 7) { - b = *(data+(pos++)); + b = *(internal->data+(internal->pos++)); i |= (b & 0x7F) << shift; } return i; } - int64_t FSDirectory::MMapIndexInput::getFilePointer() const{ - return pos; + int64_t MMapIndexInput::getFilePointer() const{ + return internal->pos; } - void FSDirectory::MMapIndexInput::seek(const int64_t pos){ - this->pos=pos; + void MMapIndexInput::seek(const int64_t pos){ + this->internal->pos=pos; } + int64_t MMapIndexInput::length() const{ return internal->_length; } - FSDirectory::MMapIndexInput::~MMapIndexInput(){ + MMapIndexInput::~MMapIndexInput(){ //Func - Destructor //Pre - True //Post - The file for which this instance is responsible has been closed. @@ -158,43 +237,41 @@ close(); } - IndexInput* FSDirectory::MMapIndexInput::clone() const + IndexInput* MMapIndexInput::clone() const { - return _CLNEW FSDirectory::MMapIndexInput(*this); + return _CLNEW MMapIndexInput(*this); } - void FSDirectory::MMapIndexInput::close() { - //IndexInput::close(); - - if ( !isClone ){ -#ifdef _CL_HAVE_MAPVIEWOFFILE - if ( data != NULL ){ - if ( ! UnmapViewOfFile(data) ){ + void MMapIndexInput::close() { + if ( !internal->isClone ){ +#if defined(_CL_HAVE_FUNCTION_MAPVIEWOFFILE) + if ( internal->data != NULL ){ + if ( ! UnmapViewOfFile(internal->data) ){ CND_PRECONDITION( false, "UnmapViewOfFile(data) failed"); //todo: change to rich error } } - if ( mmaphandle != NULL ){ - if ( ! CloseHandle(mmaphandle) ){ + if ( internal->mmaphandle != NULL ){ + if ( ! CloseHandle(internal->mmaphandle) ){ CND_PRECONDITION( false, "CloseHandle(mmaphandle) failed"); } } - if ( fhandle != NULL ){ - if ( !CloseHandle(fhandle) ){ + if ( internal->fhandle != NULL ){ + if ( !CloseHandle(internal->fhandle) ){ CND_PRECONDITION( false, "CloseHandle(fhandle) failed"); } } - mmaphandle = NULL; - fhandle = NULL; + internal->mmaphandle = NULL; + internal->fhandle = NULL; #else - if ( data != NULL ) - ::munmap(data, _length); - if ( fhandle > 0 ) - ::close(fhandle); - fhandle = 0; + if ( internal->data != NULL ) + ::munmap(internal->data, internal->_length); + if ( internal->fhandle > 0 ) + ::close(internal->fhandle); + internal->fhandle = 0; #endif } - data = NULL; - pos = 0; + internal->data = NULL; + internal->pos = 0; } Modified: branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -121,12 +121,24 @@ file = NULL; } RAMIndexOutput::RAMIndexOutput(RAMFile* f): - file(f),currentBuffer(NULL),currentBufferIndex(-1),bufferPosition(0),bufferStart(0),bufferLength(0),deleteFile(false) + file(f), + deleteFile(false), + currentBuffer(NULL), + currentBufferIndex(-1), + bufferPosition(0), + bufferStart(0), + bufferLength(0) { } RAMIndexOutput::RAMIndexOutput(): - file(_CLNEW RAMFile),currentBuffer(NULL),currentBufferIndex(-1),bufferPosition(0),bufferStart(0),bufferLength(0),deleteFile(true) + file(_CLNEW RAMFile), + deleteFile(true), + currentBuffer(NULL), + currentBufferIndex(-1), + bufferPosition(0), + bufferStart(0), + bufferLength(0) { } @@ -147,8 +159,8 @@ } void RAMIndexOutput::reset(){ - seek(_ILONGLONG(0)); - file->setLength(_ILONGLONG(0)); + seek((int64_t)0); + file->setLength((int64_t)0); } void RAMIndexOutput::close() { @@ -234,7 +246,13 @@ RAMIndexInput::RAMIndexInput(RAMFile* f): - file(f), currentBufferIndex(-1), currentBuffer(NULL), bufferPosition(0), bufferStart(0), bufferLength(0) { + file(f), + currentBuffer(NULL), + currentBufferIndex(-1), + bufferPosition(0), + bufferStart(0), + bufferLength(0) + { _length = f->getLength(); if ( _length/BUFFER_SIZE >= 0x7FFFFFFFL ) { Modified: branches/lucene2_3_2/src/core/CLucene/store/_MMap.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/_MMap.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/store/_MMap.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -7,39 +7,33 @@ #ifndef _lucene_store_MMap_ #define _lucene_store_MMap_ +#include "IndexInput.h" -#if defined(LUCENE_FS_MMAP) - class MMapIndexInput: public IndexInput{ - uint8_t* data; - int64_t pos; -#ifdef _CL_HAVE_MAPVIEWOFFILE - HANDLE mmaphandle; - HANDLE fhandle; -#else - int fhandle; -#endif - bool isClone; - int64_t _length; +CL_NS_DEF(store) - MMapIndexInput(const MMapIndexInput& clone); - public: - MMapIndexInput(const char* path); - ~MMapIndexInput(); - IndexInput* clone() const; + class MMapIndexInput: public IndexInput{ + class Internal; + Internal* internal; - inline uint8_t readByte(); - int32_t readVInt(); - void readBytes(uint8_t* b, const int32_t len); - void close(); - int64_t getFilePointer() const; - void seek(const int64_t pos); - int64_t length(){ return _length; } - - static const char* DirectoryType(){ return "MMAP"; } - const char* getDirectoryType() const{ return DirectoryType(); } - - const char* getObjectName(){ return MMapIndexInput::getClassName(); } - static const char* getClassName(){ return "MMapIndexInput"; } - }; - friend class FSDirectory::MMapIndexInput; + MMapIndexInput(const MMapIndexInput& clone); + public: + MMapIndexInput(const char* path); + ~MMapIndexInput(); + IndexInput* clone() const; + + inline uint8_t readByte(); + int32_t readVInt(); + void readBytes(uint8_t* b, const int32_t len); + void close(); + int64_t getFilePointer() const; + void seek(const int64_t pos); + int64_t length() const; + + static const char* DirectoryType(){ return "MMAP"; } + const char* getDirectoryType() const{ return DirectoryType(); } + + const char* getObjectName(){ return MMapIndexInput::getClassName(); } + static const char* getClassName(){ return "MMapIndexInput"; } + }; +CL_NS_END #endif Modified: branches/lucene2_3_2/src/core/CLucene/util/Array.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/Array.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/util/Array.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -101,9 +101,9 @@ template<typename T> class CLUCENE_EXPORT Array: public ArrayBase<T>{ public: - _CL_DEPRECATED(ObjectArray) Array():ArrayBase<T>(){} - _CL_DEPRECATED(ObjectArray) Array(T* values, size_t length):ArrayBase<T>(values,length){} - _CL_DEPRECATED(ObjectArray) Array(size_t length):ArrayBase<T>(length){} + /*_CL_DEPRECATED(ObjectArray or ValueArray)*/ Array():ArrayBase<T>(){} + /*_CL_DEPRECATED(ObjectArray or ValueArray)*/ Array(T* values, size_t length):ArrayBase<T>(values,length){} + /*_CL_DEPRECATED(ObjectArray or ValueArray)*/ Array(size_t length):ArrayBase<T>(length){} void deleteValues(){ if ( this->values == NULL ) return; Modified: branches/lucene2_3_2/src/core/CLucene/util/BitSet.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/BitSet.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CLucene/util/BitSet.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -31,7 +31,8 @@ memset(bits,0,len); } -BitSet::BitSet(CL_NS(store)::Directory* d, const char* name) { +BitSet::BitSet(CL_NS(store)::Directory* d, const char* name) +{ _count=-1; CL_NS(store)::IndexInput* input = d->openInput( name ); try { Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2008-07-21 10:07:43 UTC (rev 2782) @@ -146,6 +146,7 @@ SOVERSION ${CPACK_PACKAGE_SOVERSION} DEFINE_SYMBOL "" COMPILE_DEFINITIONS_DEBUG _DEBUG + OUTPUT_NAME "clucene-core" ) #install public headers. Modified: branches/lucene2_3_2/src/demo/IndexFiles.cpp =================================================================== --- branches/lucene2_3_2/src/demo/IndexFiles.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/demo/IndexFiles.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -17,10 +17,6 @@ #include <cctype> #include <string> -#ifndef _CL_HAVE__SNPRINTF - #define _snprintf snprintf -#endif - using namespace std; using namespace lucene::index; using namespace lucene::analysis; @@ -41,7 +37,7 @@ // Add the last modified date of the file a field named "modified". Use a // Keyword field, so that it's searchable, but so that no attempt is made // to tokenize the field into words. - //doc->add( *Field.Keyword("modified", DateField.timeToString(f->lastModified()))); + //doc->add( *Field.Keyword("modified", DateTools::timeToString(f->lastModified()))); // Add the contents of the file a field named "contents". Use a Text // field, specifying a Reader, so that the text of the file is tokenized. Modified: branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -45,7 +45,11 @@ #define _LUCENE_SLEEP(ms) CL_NS(util)::Misc::sleep(ms) +//if a wide character is being converted to a ascii character and it +//cannot fit, this character is used instead. +#define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF)) + #include "CLucene/config/repl_tchar.h" //replacements for functions #include "CLucene/config/repl_wctype.h" //replacements for functions Modified: branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake 2008-07-21 10:07:43 UTC (rev 2782) @@ -72,10 +72,6 @@ ${FUNCTION__FTIME} ${FUNCTION_SLEEPFUNCTION} -//todo: this is not checked, i think -#define _LUCENE_PRAGMA_WARNINGS - - /* CMake will determine these specifics. Things like bugs, etc */ /* Does not support new float byte<->float conversions */ Modified: branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake 2008-07-21 10:07:43 UTC (rev 2782) @@ -32,6 +32,7 @@ #cmakedefine _CL_HAVE_SYS_TIME_H 1 #cmakedefine _CL_HAVE_TCHAR_H 1 #cmakedefine _CL_HAVE_SYS_MMAN_H 1 +#cmakedefine _CL_HAVE_WINERROR_H 1 // our needed types ${TYPE_INT8_T} @@ -44,7 +45,7 @@ ${TYPE_UINT64_T} ${TYPE_FLOAT_T} -${TYPE__CL_DWORD} +${TYPE__CL_DWORD_T} ${TYPE_SIZE_T} /* tchar & _T definitions... */ Modified: branches/lucene2_3_2/src/shared/CLucene/config/_threads.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/_threads.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/config/_threads.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -11,7 +11,25 @@ #if defined(_LUCENE_DONTIMPLEMENT_THREADMUTEX) //do nothing #elif defined(_CL_HAVE_WIN32_THREADS) - #include <windows.h> + //we have not explicity included windows.h and windows.h has + //not been included (check _WINDOWS_), then we must define + //our own definitions to the thread locking functions: + extern "C"{ + struct CRITICAL_SECTION + { + struct critical_section_debug * DebugInfo; + long LockCount; + long RecursionCount; + void * OwningThread; + void * LockSemaphore; + _cl_dword_t SpinCount; + }; + __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION *); + __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION *); + __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION *); + __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION *); + __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(); + } #elif defined(_CL_HAVE_PTHREAD) #include <pthread.h> #endif Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -113,7 +113,8 @@ _CLDELETE(tmp); } } - + +#ifdef _UCS2 //print a list of arguments to a string int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...){ va_list ap; @@ -143,3 +144,4 @@ wcsncpy(strbuf,buffer.getBuffer(),ret); return ret; } +#endif Modified: branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -31,7 +31,7 @@ #ifdef _CL_HAVE_FUNCTION_SLEEP //don't ignore windows.h... breaks mingw32 in some cases. Define Sleep instead - extern void Sleep(_cl_dword); + extern "C" __declspec(dllimport) void __stdcall Sleep(_cl_dword_t); #endif CL_NS_DEF(util) Modified: branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp 2008-07-21 10:07:43 UTC (rev 2782) @@ -10,7 +10,7 @@ CL_NS_DEF(util) - StringBuffer::StringBuffer(TCHAR* buf,int32_t maxlen, const bool consumeBuffer){ + StringBuffer::StringBuffer(TCHAR* buf,size_t maxlen, const bool consumeBuffer){ buffer = buf; bufferLength = maxlen; bufferOwner = !consumeBuffer; @@ -29,7 +29,7 @@ bufferOwner = true; } - StringBuffer::StringBuffer(const int32_t initSize){ + StringBuffer::StringBuffer(const size_t initSize){ //Func - Constructor. Allocates a buffer of length initSize + 1 //Pre - initSize > 0 //Post - A buffer has been allocated of length initSize + 1 @@ -49,10 +49,10 @@ //Post - An instance of StringBuffer has been created containing the copy of the string value //Initialize the length of the string to be stored in buffer - len = (int32_t) _tcslen(value); + len = (size_t) _tcslen(value); //Calculate the space occupied in buffer by a copy of value - const int32_t occupiedLength = len + 1; + const size_t occupiedLength = len + 1; // Minimum allocated buffer length is LUCENE_DEFAULT_TOKEN_BUFFER_SIZE. bufferLength = (occupiedLength >= LUCENE_DEFAULT_TOKEN_BUFFER_SIZE @@ -137,7 +137,7 @@ len += appendedLength; } - void StringBuffer::appendInt(const int32_t value) { + void StringBuffer::appendInt(const size_t value) { //Func - Appends an integer (after conversion to a character string) //Pre - true //Post - The converted integer value has been appended to the string in buffer @@ -150,7 +150,7 @@ append(buf); } - void StringBuffer::appendFloat(const float_t value, const int32_t digits){ + void StringBuffer::appendFloat(const float_t value, const size_t digits){ //Func - Appends a float_t (after conversion to a character string) //Pre - digits > 0. Indicates the minimum number of characters printed //Post - The converted float_t value has been appended to the string in buffer @@ -180,7 +180,7 @@ // significant part of the number. Fixes a bug when trying to print // numbers that have zeros right after the decimal point if (remadj) { - int32_t numZeros = dig - (int32_t)log10((float_t)remadj) - 1; + size_t numZeros = dig - (size_t)log10((float_t)remadj) - 1; while(numZeros-- > 0) _tcscat(buf,_T("0")); //add a zero before the decimal point } @@ -222,7 +222,7 @@ len += prependedLength; } - int32_t StringBuffer::length() const{ + size_t StringBuffer::length() const{ //Func - Returns the length of the string in the StringBuffer //Pre - true //Post - The length len of the string in the buffer has been returned @@ -262,7 +262,7 @@ return buffer; } - void StringBuffer::reserve(const int32_t size){ + void StringBuffer::reserve(const size_t size){ if ( bufferLength >= size ) return; bufferLength = size; @@ -280,14 +280,14 @@ buffer = tmp; } - void StringBuffer::growBuffer(const int32_t minLength) { + void StringBuffer::growBuffer(const size_t minLength) { //Func - Has the buffer grown to a minimum length of minLength or bigger //Pre - minLength >= len + 1 //Post - The buffer has been grown to a minimum length of minLength or bigger growBuffer(minLength, 0); } - void StringBuffer::growBuffer(const int32_t minLength, const int32_t skippingNInitialChars) { + void StringBuffer::growBuffer(const size_t minLength, const size_t skippingNInitialChars) { //Func - Has the buffer grown to a minimum length of minLength or bigger and shifts the // current string in buffer by skippingNInitialChars forward //Pre - After growth, must have at least enough room for contents + terminator so Modified: branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h 2008-07-20 07:06:29 UTC (rev 2781) +++ branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h 2008-07-21 10:07:43 UTC (rev 2782) @@ -13,13 +13,13 @@ ///Constructor. Allocates a buffer with the default length. StringBuffer(); ///Constructor. Allocates a buffer of length initSize + 1 - StringBuffer(const int32_t initSize); + StringBuffer(const size_t initSize); ///Constructor. Creates an instance of Stringbuffer containing a copy of ///the string value StringBuffer(const TCHAR* value); ///Constructs a StringBuffer using another buffer. The StringBuffer can ///the be used to easily manipulate the buffer. - StringBuffer(TCHAR* buf,int32_t maxlen, const bool consumeBuffer); + StringBuffer(TCHAR* buf,size_t maxlen, const bool consumeBuffer); ///Destructor ~StringBuffer(); ///Clears the Stringbuffer and resets it to it default empty state @@ -32,9 +32,9 @@ ///Appends a copy of the string value void append(const TCHAR* value, size_t appendedLength); ///Appends an integer (after conversion to a character string) - void appendInt(const int32_t value); + void appendInt(const size_t value); ///Appends a float_t (after conversion to a character string) - void appendFloat(const float_t value, const int32_t digits); + void appendFloat(const float_t value, const size_t digits); ///Puts a copy of the string value in front of the current string in the StringBuffer void prepend(const TCHAR* value); ///Puts a copy of the string value in front of the current string in the StringBuffer @@ -42,9 +42,9 @@ ///Contains the length of string in the StringBuffer ///Public so that analyzer... [truncated message content] |
From: <ust...@us...> - 2008-07-23 10:02:09
|
Revision: 2799 http://clucene.svn.sourceforge.net/clucene/?rev=2799&view=rev Author: ustramooner Date: 2008-07-23 10:02:06 +0000 (Wed, 23 Jul 2008) Log Message: ----------- include the ChooseStatus macro Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/src/shared/cmake/CheckHashmaps.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseSymbol.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseType.cmake Added Paths: ----------- branches/lucene2_3_2/src/shared/cmake/Macro_ChooseStatus.cmake Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-23 09:58:51 UTC (rev 2798) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-23 10:02:06 UTC (rev 2799) @@ -118,11 +118,12 @@ #check flags... INCLUDE (TestCXXAcceptsFlag) -#todo: fail if a warning occurs...(visual studio just warns, kind of annoying!) -CHECK_CXX_ACCEPTS_FLAG(-g GccFlagG) -IF ( GccFlagG ) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") -ENDIF ( GccFlagG ) +IF ( CMAKE_COMPILER_IS_GNUCC ) + CHECK_CXX_ACCEPTS_FLAG(-g GccFlagG) + IF ( GccFlagG ) + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") + ENDIF ( GccFlagG ) +ENDIF ( CMAKE_COMPILER_IS_GNUCC ) IF(ENABLE_GPROF) CHECK_CXX_ACCEPTS_FLAG(-pg GccFlagPg) Modified: branches/lucene2_3_2/src/shared/cmake/CheckHashmaps.cmake =================================================================== --- branches/lucene2_3_2/src/shared/cmake/CheckHashmaps.cmake 2008-07-23 09:58:51 UTC (rev 2798) +++ branches/lucene2_3_2/src/shared/cmake/CheckHashmaps.cmake 2008-07-23 10:02:06 UTC (rev 2799) @@ -2,6 +2,8 @@ #HashingValue is filled with namespace definition #DisableHashing is set if we can't support hashing +INCLUDE (Macro_ChooseStatus) + #find hashing namespace (internal, use CHECK_HASH_MAPS) ... MACRO(HASHMAP_TEST HashingValue namespace) IF ( NOT ${HashingValue} ) Modified: branches/lucene2_3_2/src/shared/cmake/MacroChooseSymbol.cmake =================================================================== --- branches/lucene2_3_2/src/shared/cmake/MacroChooseSymbol.cmake 2008-07-23 09:58:51 UTC (rev 2798) +++ branches/lucene2_3_2/src/shared/cmake/MacroChooseSymbol.cmake 2008-07-23 10:02:06 UTC (rev 2799) @@ -1,5 +1,6 @@ INCLUDE (CheckSymbolExists) +INCLUDE (Macro_ChooseStatus) MACRO(CHOOSE_SYMBOL name options) IF ( HAVE_WINDOWS_H ) Modified: branches/lucene2_3_2/src/shared/cmake/MacroChooseType.cmake =================================================================== --- branches/lucene2_3_2/src/shared/cmake/MacroChooseType.cmake 2008-07-23 09:58:51 UTC (rev 2798) +++ branches/lucene2_3_2/src/shared/cmake/MacroChooseType.cmake 2008-07-23 10:02:06 UTC (rev 2799) @@ -1,5 +1,6 @@ INCLUDE (CheckTypeSize) +INCLUDE (Macro_ChooseStatus) #macro that sets OUTPUT as the value of oneof options (if _CL_HAVE_OPTION exists) MACRO(CHOOSE_TYPE name size sign options) Added: branches/lucene2_3_2/src/shared/cmake/Macro_ChooseStatus.cmake =================================================================== --- branches/lucene2_3_2/src/shared/cmake/Macro_ChooseStatus.cmake (rev 0) +++ branches/lucene2_3_2/src/shared/cmake/Macro_ChooseStatus.cmake 2008-07-23 10:02:06 UTC (rev 2799) @@ -0,0 +1,20 @@ +#internal macro for choose_* macros. + +MACRO(_CHOOSE_STATUS status name type) + STRING(TOUPPER ${name} NAME) + STRING(TOUPPER ${type} TYPE) + + IF ( ${status} STREQUAL "PROGRESS" ) + IF ( "" STREQUAL "${_CHOOSE_STATUS_${TYPE}_${NAME}}" ) + MESSAGE ( STATUS "Choosing ${type} for ${name}" ) + SET ( _CHOOSE_STATUS_${TYPE}_${NAME} "XXX" ) + ENDIF ( "" STREQUAL "${_CHOOSE_STATUS_${TYPE}_${NAME}}" ) + ENDIF ( ${status} STREQUAL "PROGRESS" ) + + IF ( ${status} STREQUAL "END" ) + IF ( "XXX" STREQUAL "${_CHOOSE_STATUS_${TYPE}_${NAME}}" ) + MESSAGE ( STATUS "Choosing ${type} for ${name} - ${ARGV3}" ) + SET ( _CHOOSE_STATUS_${TYPE}_${NAME} ON CACHE INTERNAL "Chose ${type} for ${name} - ${ARGV3}" ) + ENDIF ( "XXX" STREQUAL "${_CHOOSE_STATUS_${TYPE}_${NAME}}" ) + ENDIF ( ${status} STREQUAL "END" ) +ENDMACRO(_CHOOSE_STATUS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-07-25 11:27:49
|
Revision: 2822 http://clucene.svn.sourceforge.net/clucene/?rev=2822&view=rev Author: ustramooner Date: 2008-07-25 11:27:47 +0000 (Fri, 25 Jul 2008) Log Message: ----------- decided to use version 0.9.23 as start of branch version updates to cmake/cpack packaging scripts Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/INSTALL Added Paths: ----------- branches/lucene2_3_2/cmake/CreateClucenePackages.cmake Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-25 11:19:38 UTC (rev 2821) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-25 11:27:47 UTC (rev 2822) @@ -1,63 +1,13 @@ PROJECT (clucene) -#create package command - -#Rules for version: -#MAJOR and MINOR versions are purely political -#REVISION version MUST be revised if the headers or compatibility change -#PATCH should be 0 unless a patch is made that doesn't affect the public signature (i.e. clients don't need to re-compile). SET(CPACK_PACKAGE_VERSION_MAJOR "0") SET(CPACK_PACKAGE_VERSION_MINOR "9") -SET(CPACK_PACKAGE_VERSION_REVISION "30") +SET(CPACK_PACKAGE_VERSION_REVISION "23") SET(CPACK_PACKAGE_VERSION_PATCH "0") SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_REVISION}.${CPACK_PACKAGE_VERSION_PATCH}") SET(CPACK_PACKAGE_SOVERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_REVISION}") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene") -SET(CPACK_PACKAGE_VENDOR "Ben van Klinken") - -SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene - a C++ search engine, ported from the popular Apache Lucene") - -SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README") -SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") - -SET(CPACK_GENERATOR "TGZ") -SET(CPACK_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}") - -IF(WIN32 AND NOT UNIX) - SET(CPACK_SOURCE_GENERATOR "ZIP") -ELSE(WIN32 AND NOT UNIX) - SET(CPACK_SOURCE_GENERATOR "TBZ2;TGZ") -ENDIF(WIN32 AND NOT UNIX) -SET(CPACK_SOURCE_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-Source") - -#don't include the current binary dir. -get_filename_component(clucene_BINARY_DIR_name ${clucene_BINARY_DIR} NAME) -#SET(CPACK_SOURCE_INSTALL_CMAKE_PROJECTS "/home/ben/workspaces/lucene232/gcc;clucene;ALL;/") -#SET(CPACK_SOURCE_IGNORE_FILES "/CVS/;/\\\\.svn/;\\\\.swp$;\\\\.#;/#") -SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;.*\\\\.tmp;/${clucene_BINARY_DIR_name}/") - -#IF(WIN32 AND NOT UNIX) - # There is a bug in NSI that does not handle full unix paths properly. Make - # sure there is at least one set of four (4) backlasshes. - #SET(CPACK_GENERATOR "${CPACK_GENERATOR};NSIS") - #SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp") - #SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe") - #SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project") - #SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.my-project-home-page.org") - #SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com") - #SET(CPACK_NSIS_CONTACT "me...@my...") - #SET(CPACK_NSIS_MODIFY_PATH ON) -#ELSE(WIN32 AND NOT UNIX) -# SET(CPACK_STRIP_FILES "bin/MyExecutable") -# SET(CPACK_SOURCE_STRIP_FILES "") -#ENDIF(WIN32 AND NOT UNIX) -#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") - -INCLUDE(CPack) - CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2 FATAL_ERROR) if(COMMAND cmake_policy) @@ -101,6 +51,9 @@ OPTION(ENABLE_GPROF "turn on gprof profiling support" OFF) +OPTION(ENABLE_PACKAGING + "create build scripts for creating clucene packages" + OFF) SET ( ENABLE_COMPILE_TESTS_VALUE ON ) IF ( MSVC_IDE ) @@ -134,7 +87,12 @@ ENDIF ( GccFlagPg ) ENDIF(ENABLE_GPROF) +IF (ENABLE_PACKAGING) + INCLUDE(CreateClucenePackages) + CREATE_CLUCENE_PACKAGES() +ENDIF ( ENABLE_PACKAGING) + #Single output directory for building all executables and libraries. SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executable Output Directory" FORCE) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Library Output Directory" FORCE) Modified: branches/lucene2_3_2/INSTALL =================================================================== --- branches/lucene2_3_2/INSTALL 2008-07-25 11:19:38 UTC (rev 2821) +++ branches/lucene2_3_2/INSTALL 2008-07-25 11:27:47 UTC (rev 2822) @@ -144,6 +144,8 @@ CPack is used for creating distributions. * Create a out-of-source build as per usual * Make sure the version number is correct (see <clucene>/CMakeList.txt, right at the top of the file) +* Make sure you are compiling in the correct release mode (check ccmake or the cmake gui) +* Make sure you enable ENABLE_PACKAGING (check ccmake or the cmake gui) * Next, check that the package is compliant using several tests (must be done from a linux terminal, or cygwin): # cd <clucene>/build-name # ../dist-check.sh Added: branches/lucene2_3_2/cmake/CreateClucenePackages.cmake =================================================================== --- branches/lucene2_3_2/cmake/CreateClucenePackages.cmake (rev 0) +++ branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2008-07-25 11:27:47 UTC (rev 2822) @@ -0,0 +1,61 @@ +#Creates all the relevant packages + +MACRO( CREATE_CLUCENE_PACKAGES ) + +#Rules for version: +#MAJOR and MINOR versions are purely political +#REVISION version MUST be revised if the headers or compatibility change +#PATCH should be 0 unless a patch is made that doesn't affect the public signature (i.e. clients don't need to re-compile). + +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene") +SET(CPACK_PACKAGE_VENDOR "Ben van Klinken") + +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene - a C++ search engine, ported from the popular Apache Lucene") + +SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") + +SET(CPACK_GENERATOR "TGZ") +SET(CPACK_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}") + +IF(WIN32 AND NOT UNIX) + SET(CPACK_SOURCE_GENERATOR "ZIP") +ELSE(WIN32 AND NOT UNIX) + SET(CPACK_SOURCE_GENERATOR "TBZ2;TGZ") +ENDIF(WIN32 AND NOT UNIX) +SET(CPACK_SOURCE_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-Source") + +#don't include the current binary dir. +get_filename_component(clucene_BINARY_DIR_name ${clucene_BINARY_DIR} NAME) +SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;.*\\\\.tmp;/${clucene_BINARY_DIR_name}/") + +IF(WIN32 AND NOT UNIX) + # There is a bug in NSI that does not handle full unix paths properly. Make + # sure there is at least one set of four (4) backlasshes. + SET(CPACK_GENERATOR "${CPACK_GENERATOR};NSIS") + #SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp") + #SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe") + #SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project") + #SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.my-project-home-page.org") + #SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com") + #SET(CPACK_NSIS_CONTACT "me...@my...") + #SET(CPACK_NSIS_MODIFY_PATH ON) +ELSE(WIN32 AND NOT UNIX) +# SET(CPACK_STRIP_FILES "bin/xxx") + SET(CPACK_SOURCE_STRIP_FILES "") +ENDIF(WIN32 AND NOT UNIX) +#SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") + +INCLUDE(CPack) + + +ADD_CUSTOM_TARGET(dist-package + COMMAND rsync -avP -e ssh ${CPACK_PACKAGE_FILE_NAME}.* frs.sourceforge.net:uploads/ +# DEPENDS package +) +ADD_CUSTOM_TARGET(dist-package_source + COMMAND rsync -avP -e ssh ${CPACK_SOURCE_PACKAGE_FILE_NAME}.* frs.sourceforge.net:uploads/ +# DEPENDS package_source +) +ENDMACRO( CREATE_CLUCENE_PACKAGES ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-07-27 12:41:05
|
Revision: 2825 http://clucene.svn.sourceforge.net/clucene/?rev=2825&view=rev Author: ustramooner Date: 2008-07-27 12:40:59 +0000 (Sun, 27 Jul 2008) Log Message: ----------- improvements to documentation. Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/REQUESTS branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.h branches/lucene2_3_2/src/core/CLucene/document/DateField.h branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h branches/lucene2_3_2/src/shared/CLucene/util/dirent.h Added Paths: ----------- branches/lucene2_3_2/cmake/CLuceneDocs.cmake branches/lucene2_3_2/doc/Doxyfile.cmake Removed Paths: ------------- branches/lucene2_3_2/Doxyfile.cmake branches/lucene2_3_2/doc/clucene.jpg Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-27 12:40:59 UTC (rev 2825) @@ -23,7 +23,7 @@ #define options... -Include (Documentation) +Include (CLuceneDocs) IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING @@ -102,34 +102,6 @@ ENABLE_TESTING() ADD_TEST(SimpleTest ${EXECUTABLE_OUTPUT_PATH}/cl_test ) -# To build the documention, you will have to enable it -# and then do the equivalent of "make DoxygenDoc". -IF(BUILD_DOCUMENTATION) - IF(DOT) - SET(HAVE_DOT YES) - ELSE(DOT) - SET(HAVE_DOT NO) - ENDIF(DOT) - # This processes our Doxyfile.cmake and substitutes paths to generate a final Doxyfile - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/Doxyfile.cmake ${PROJECT_BINARY_DIR}/doc/doxyfile ) - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/helpheader.htm.cmake ${PROJECT_BINARY_DIR}/doc/helpheader.htm ) - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/helpfooter.htm.cmake ${PROJECT_BINARY_DIR}/doc/helpfooter.htm ) - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/doxygen.css.cmake ${PROJECT_BINARY_DIR}/doc/html/doxygen.css ) - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/clucene.jpg ${PROJECT_BINARY_DIR}/doc/clucene.jpg COPYONLY ) - - # This creates a new target to build documentation. - # It runs ${DOXYGEN} which is the full path and executable to - # Doxygen on your system, set by the FindDoxygen.cmake module - # (called by FindDocumentation.cmake). - # It runs the final generated Doxyfile against it. - # The DOT_PATH is substituted into the Doxyfile. - ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN} - ${PROJECT_BINARY_DIR}/doc/doxyfile - #COMMAND("tar -czf doc/clucene-core-doc.tar.gz ${PROJECT_BINARY_DIR}/doc/html/") - ) -ENDIF(BUILD_DOCUMENTATION) - - #use single output directory INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/shared ) INCLUDE_DIRECTORIES( ${clucene_BINARY_DIR}/src/shared ) Deleted: branches/lucene2_3_2/Doxyfile.cmake =================================================================== --- branches/lucene2_3_2/Doxyfile.cmake 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/Doxyfile.cmake 2008-07-27 12:40:59 UTC (rev 2825) @@ -1,235 +0,0 @@ -# Doxyfile 1.2.18 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- - -PROJECT_NAME = CLucene-core -PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@ - -OUTPUT_DIRECTORY = ./doc -OUTPUT_LANGUAGE = English - -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = NO -STRIP_CODE_COMMENTS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = YES -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ALIASES = "memory=\par Memory management:\n" -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = doxygen.warnings.log - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -INPUT = @PROJECT_SOURCE_DIR@/src/core/CLucene -FILE_PATTERNS = *.h -RECURSIVE = YES -EXCLUDE = mem.h bufferedstream.h fileinputstream.h stringreader.h Misc.h LuceneThreads.h jstreamconfig.h -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = "**/config/**" \ - "**/.svn/**" \ - "**/debug/**" \ - "_*.h" -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = ./doc/helpheader.htm -HTML_FOOTER = ./doc/helpfooter.htm -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -GENERATE_XML = NO -XML_SCHEMA = -XML_DTD = - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = YES -SEARCH_INCLUDES = YES -INCLUDE_PATH = ./src/ -INCLUDE_FILE_PATTERNS = -PREDEFINED = "_MSC_VER=1400" -PREDEFINED += "WIN32" -PREDEFINED += "LUCENE_HIDE_INTERNAL" - -#namespaces -PREDEFINED += "CL_NS(sub)=lucene::sub" -PREDEFINED += "CL_NS2(sub,sub2)=lucene::sub:sub2" -PREDEFINED += "CL_NS_DEF(sub)=namespace lucene{ namespace sub{" -PREDEFINED += "CL_NS_DEF2(sub,sub2)=namespace lucene{ namespace sub{ namespace sub2 {" -PREDEFINED += "CL_NS_END=}}" -PREDEFINED += "CL_NS_END2=}}}" -PREDEFINED += "CL_NS_USE(sub)=using namespace lucene::sub" -PREDEFINED += "CL_NS_USE2(sub,sub2)=using namespace lucene::sub::sub2" -PREDEFINED += "CL_NS_STD(func)=std::func" -PREDEFINED += "CL_NS_HASHING(func)=std::func" - -PREDEFINED += "LUCENE_BASE=public CL_NS(debug)::LuceneBase" -PREDEFINED += "LUCENE_REFBASE=public CL_NS(debug)::LuceneBase" -PREDEFINED += "_CL_DEPRECATED(x)=" - -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- - -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = @HAVE_DOT@ -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -GENERATE_LEGEND = YES -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- - -SEARCHENGINE = NO Modified: branches/lucene2_3_2/REQUESTS =================================================================== --- branches/lucene2_3_2/REQUESTS 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/REQUESTS 2008-07-27 12:40:59 UTC (rev 2825) @@ -1,3 +1,4 @@ The todo list has been moved to the tracker at http://sourceforge.net/tracker/?func=browse&group_id=80013&atid=558449 +You need to be logged into sourceforge to view this list. Added: branches/lucene2_3_2/cmake/CLuceneDocs.cmake =================================================================== --- branches/lucene2_3_2/cmake/CLuceneDocs.cmake (rev 0) +++ branches/lucene2_3_2/cmake/CLuceneDocs.cmake 2008-07-27 12:40:59 UTC (rev 2825) @@ -0,0 +1,146 @@ +# - CLuceneDocs.cmake +# This file provides support for building the CLucene Documentation. +# To build the documention, you will have to enable it +# and then do the equivalent of "make doc-doxygen". +OPTION(BUILD_CLDOCS "Build the clucene documentation." OFF) + +MACRO(SET_YESNO) + FOREACH(param ${ARGV}) + IF ( ${param} ) + SET(${param} "YES") + ELSE ( ${param} ) + SET(${param} "NO") + ENDIF ( ${param} ) + ENDFOREACH(param) +ENDMACRO(SET_YESNO) +MACRO(SET_BLANK) + FOREACH(param ${ARGV}) + IF ( NOT ${param} ) + SET(${param} "") + ENDIF ( NOT ${param} ) + ENDFOREACH(param) +ENDMACRO(SET_BLANK) + +IF (BUILD_CLDOCS) + OPTION(CLDOCS_HTML_HELP + "Doxygen should compile HTML into a Help file (CHM)." NO) + + OPTION(CLDOCS_HTML + "Doxygen should build HTML documentation." YES) + OPTION(CLDOCS_XML + "Doxygen should build XML documentation." NO) + OPTION(CLDOCS_RTF + "Doxygen should build RTF documentation." NO) + OPTION(CLDOCS_MAN + "Doxygen should build man documentation." NO) + OPTION(CLDOCS_TAGFILE + "Doxygen should build a tagfile." NO) + + OPTION(CLDOCS_LATEX + "Doxygen should build Latex documentation." NO ) + + MARK_AS_ADVANCED( + CLDOCS_HTML_HELP + CLDOCS_LATEX + CLDOCS_XML + CLDOCS_HTML + CLDOCS_RTF + CLDOCS_MAN + CLDOCS_TAGFILE + ) + + # + # Check for the tools + # + FIND_PACKAGE(Doxygen) + + IF ( DOXYGEN_FOUND ) + # This creates a new target to build documentation. + # It runs ${DOXYGEN_EXECUTABLE} which is the full path and executable to + # Doxygen on your system, set by the FindDoxygen.cmake module + # (called by FindDocumentation.cmake). + # It runs the final generated Doxyfile against it. + # The DOT_PATH is substituted into the Doxyfile. + ADD_CUSTOM_TARGET(doc-doxygen + ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/doxyfile + ) + + IF ( CLDOCS_HTML_HELP ) + IF ( NOT CLDOCS_HTML ) + MESSAGE ( FATAL_ERROR "CLDOCS_HTML is required to buidl CLDOCS_HTML_HELP" ) + ENDIF ( NOT CLDOCS_HTML ) + FIND_PACKAGE(HTMLHelp) + IF ( NOT HTML_HELP_COMPILER ) + MESSAGE(FATAL_ERROR "HTML Help compiler not found, turn CLDOCS_HTML_HELP off to proceed") + ENDIF ( NOT HTML_HELP_COMPILER ) + + #make cygwin work with hhc... + IF ( CYGWIN ) + EXECUTE_PROCESS ( COMMAND cygpath "${HTML_HELP_COMPILER}" + OUTPUT_VARIABLE HTML_HELP_COMPILER_EX ) + STRING ( REPLACE "\n" "" HTML_HELP_COMPILER_EX ${HTML_HELP_COMPILER_EX} ) + STRING ( REPLACE "\r" "" HTML_HELP_COMPILER_EX ${HTML_HELP_COMPILER_EX} ) + SET ( HTML_HELP_COMPILER_EX "\"${HTML_HELP_COMPILER_EX}\"" ) + ELSE ( CYGWIN ) + SET ( HTML_HELP_COMPILER_EX ${HTML_HELP_COMPILER} ) + ENDIF ( CYGWIN ) + ENDIF ( CLDOCS_HTML_HELP ) + + IF ( CLDOCS_LATEX ) + FIND_PACKAGE(LATEX) + IF ( NOT LATEX_COMPILER ) + MESSAGE(FATAL_ERROR "Latex compiler not found, turn CLDOCS_LATEX off to proceed") + ENDIF ( NOT LATEX_COMPILER ) + ENDIF ( CLDOCS_LATEX ) + + FIND_PACKAGE(Perl) + + IF ( DOXYGEN_DOT_EXECUTABLE ) + SET ( HAVE_DOT "YES" ) + ELSE ( DOXYGEN_DOT_EXECUTABLE ) + SET ( HAVE_DOT "NO" ) + ENDIF ( DOXYGEN_DOT_EXECUTABLE ) + + #doxygen expects YES/NO parameters + SET_YESNO( + CLDOCS_HTML_HELP + CLDOCS_LATEX + CLDOCS_XML + CLDOCS_HTML + CLDOCS_RTF + CLDOCS_MAN + ) + #empty out paths if not found + SET_BLANK( + PERL_EXECUTABLE + DOXYGEN_DOT_EXECUTABLE + HTML_HELP_COMPILER + LATEX_COMPILER + ) + + IF ( CLDOCS_TAGFILE ) + SET ( CLDOCS_TAGFILE_LOCATION "${PROJECT_BINARY_DIR}/doc/tag/clucene.tag" ) + ENDIF ( CLDOCS_TAGFILE ) + + # This processes our Doxyfile.cmake and substitutes paths to generate a final Doxyfile + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfile.cmake ${PROJECT_BINARY_DIR}/doc/doxyfile ) + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/helpheader.htm.cmake ${PROJECT_BINARY_DIR}/doc/helpheader.htm ) + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/helpfooter.htm.cmake ${PROJECT_BINARY_DIR}/doc/helpfooter.htm ) + CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/doxygen.css.cmake ${PROJECT_BINARY_DIR}/doc/html/doxygen.css ) + + #create a target for tar.gz html help + FIND_PACKAGE(UnixCommands) + IF ( TAR AND GZIP ) + ADD_CUSTOM_TARGET(doc-tarz + "${TAR} -cf doc/clucene-core-doc.tar ${PROJECT_BINARY_DIR}/doc/html/" + "${GZIP} doc/clucene-core-doc.tar" + #DEPENDS doc-doxygen + ) + ENDIF ( TAR AND GZIP ) + + ELSE ( DOXYGEN_FOUND ) + MESSAGE(FATAL_ERROR "Doxygen not found, turn BUILD_CLDOCS off to proceed") + ENDIF ( DOXYGEN_FOUND ) + + +ENDIF (BUILD_CLDOCS) Copied: branches/lucene2_3_2/doc/Doxyfile.cmake (from rev 2824, branches/lucene2_3_2/Doxyfile.cmake) =================================================================== --- branches/lucene2_3_2/doc/Doxyfile.cmake (rev 0) +++ branches/lucene2_3_2/doc/Doxyfile.cmake 2008-07-27 12:40:59 UTC (rev 2825) @@ -0,0 +1,237 @@ +# Doxyfile 1.2.18 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- + +PROJECT_NAME = CLucene-core +PROJECT_NUMBER = @CPACK_PACKAGE_VERSION@ + +OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc +OUTPUT_LANGUAGE = English + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +STRIP_CODE_COMMENTS = YES +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = "memory=\par Memory management:\n" +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = @PROJECT_BINARY_DIR@/doc/doxygen.warnings.log + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +INPUT = @PROJECT_SOURCE_DIR@/src/core/CLucene +INPUT += @PROJECT_SOURCE_DIR@/src/shared/CLucene +FILE_PATTERNS = *.h +RECURSIVE = YES +#EXCLUDE = mem.h bufferedstream.h fileinputstream.h stringreader.h Misc.h LuceneThreads.h jstreamconfig.h +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = "**/config/**" \ + "**/.svn/**" \ + "**/debug/**" \ + "_*.h" +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +GENERATE_HTML = @CLDOCS_HTML@ +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = @PROJECT_BINARY_DIR@/doc/helpheader.htm +HTML_FOOTER = @PROJECT_BINARY_DIR@/doc/helpfooter.htm +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES + +GENERATE_HTMLHELP = @CLDOCS_HTML_HELP@ +CHM_FILE = clucene.chm +HHC_LOCATION = @HTML_HELP_COMPILER_EX@ +GENERATE_CHI = YES +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +GENERATE_LATEX = @CLDOCS_LATEX@ +LATEX_OUTPUT = latex +LATEX_CMD_NAME = @LATEX_COMPILER@ +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +GENERATE_RTF = @CLDOCS_RTF@ +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = @CLDOCS_MAN@ +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +GENERATE_XML = @CLDOCS_XML@ +XML_SCHEMA = +XML_DTD = + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = @PROJECT_SOURCE_DIR@/src/core +INCLUDE_PATH += @PROJECT_SOURCE_DIR@/src/shared +INCLUDE_PATH += @PROJECT_BINARY_DIR@/src/shared +INCLUDE_FILE_PATTERNS = + +PREDEFINED = "_MSC_VER=1400" +PREDEFINED += "WIN32" +PREDEFINED += "_CL_DISABLE_MULTITHREADING" +PREDEFINED += "_CL_DEPRECATED(x)=" + +#namespaces +PREDEFINED += "CL_NS(sub)=lucene::sub" +PREDEFINED += "CL_NS2(sub,sub2)=lucene::sub:sub2" +PREDEFINED += "CL_NS_DEF(sub)=namespace lucene{ namespace sub{" +PREDEFINED += "CL_NS_DEF2(sub,sub2)=namespace lucene{ namespace sub{ namespace sub2 {" +PREDEFINED += "CL_NS_END=}}" +PREDEFINED += "CL_NS_END2=}}}" +PREDEFINED += "CL_NS_USE(sub)=using namespace lucene::sub" +PREDEFINED += "CL_NS_USE2(sub,sub2)=using namespace lucene::sub::sub2" +PREDEFINED += "CL_NS_STD(func)=std::func" +PREDEFINED += "CL_NS_HASHING(func)=std::func" + +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- + +TAGFILES = +GENERATE_TAGFILE = @CLDOCS_TAGFILE_LOCATION@ +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = @PERL_EXECUTABLE@ + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = @HAVE_DOT@ +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = @DOXYGEN_DOT_EXECUTABLE@ +DOTFILE_DIRS = +GENERATE_LEGEND = YES +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- + +SEARCHENGINE = NO Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -29,8 +29,8 @@ with type "eos". The default token type is "word". <p> A Token can optionally have metadata (a.k.a. Payload) in the form of a variable - length byte array. Use {@link TermPositions#getPayloadLength()} and - {@link TermPositions#getPayload(byte[], int)} to retrieve the payloads from the index. + length byte array. Use {@link lucene::index::TermPositions#getPayloadLength()} and + {@link lucene::index::TermPositions#getPayload(byte[], int)} to retrieve the payloads from the index. <br><br> <p><font color="#FF0000"> @@ -42,7 +42,7 @@ <p>Tokenizers and filters should try to re-use a Token instance when possible for best performance, by - implementing the {@link TokenStream#next(Token)} API. + implementing the {@link lucene::index::TokenStream#next(Token)} API. Failing that, to create a new Token you should first use one of the constructors that starts with null text. Then you should call either {@link #termBuffer()} or {@link Modified: branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -39,7 +39,7 @@ public: CharTokenizer(CL_NS(util)::Reader* in); bool next(Token* token); - void reset(CL_NS(util)::Reader* input); + void reset(CL_NS(util)::Reader* input); virtual ~CharTokenizer(); }; @@ -183,7 +183,7 @@ * Note: behavior of a single StopFilter instance can be modified * with {@link #setEnablePositionIncrements(boolean)}. * This static method allows control over behavior of classes using StopFilters internally, - * for example {@link org.apache.lucene.analysis.standard.StandardAnalyzer StandardAnalyzer}. + * for example {@link lucene::analysis::standard::StandardAnalyzer StandardAnalyzer}. * <p> * Default : false. * @see #setEnablePositionIncrements(boolean). @@ -315,9 +315,9 @@ void addAnalyzer(const TCHAR* fieldName, Analyzer* analyzer); TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); - TokenStream* reusableTokenStream(TCHAR* fieldName, CL_NS(util)::Reader* reader); - - /** Return the positionIncrementGap from the analyzer assigned to fieldName */ + TokenStream* reusableTokenStream(TCHAR* fieldName, CL_NS(util)::Reader* reader); + + /** Return the positionIncrementGap from the analyzer assigned to fieldName */ int32_t getPositionIncrementGap(TCHAR* fieldName); }; @@ -353,7 +353,7 @@ public: KeywordTokenizer(CL_NS(util)::Reader* input, int bufferSize=-1); bool next(Token* token); - void reset(CL_NS(util)::Reader* input); + void reset(CL_NS(util)::Reader* input); virtual ~KeywordTokenizer(); }; Modified: branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -20,8 +20,8 @@ CL_NS_DEF2(analysis,standard) /** -* Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link -* LowerCaseFilter} and {@link StopFilter}, using a list of English stop words. +* Filters {@link lucene::analysis::standard::StandardTokenizer} with {@link lucene::analysis::standard::StandardFilter}, +* {@link lucene::analysis::LowerCaseFilter} and {@link lucene::analysis::StopFilter}, using a list of English stop words. * */ class CLUCENE_EXPORT StandardAnalyzer : public Analyzer Modified: branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -16,7 +16,7 @@ CL_NS_DEF2(analysis,standard) - /** Normalizes tokens extracted with {@link StandardTokenizer}. */ + /** Normalizes tokens extracted with {@link lucene::analysis::standard::StandardTokenizer}. */ class CLUCENE_EXPORT StandardFilter: public TokenFilter{ public: // Construct filtering <i>in</i>. Modified: branches/lucene2_3_2/src/core/CLucene/document/DateField.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/document/DateField.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/document/DateField.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -22,18 +22,18 @@ * which makes them suitable for use as field values and search terms. * * <P>Note that this class saves dates with millisecond granularity, -* which is bad for {@link RangeQuery} and {@link PrefixQuery}, as those +* which is bad for {@link lucene::search::RangeQuery} and {@link lucene::search::PrefixQuery}, as those * queries are expanded to a BooleanQuery with a potentially large number * of terms when searching. Thus you might want to use -* {@link DateTools} instead. +* {@link lucene::document::DateTools} instead. * * <P> * Note: dates before 1970 cannot be used, and therefore cannot be -* indexed when using this class. See {@link DateTools} for an +* indexed when using this class. See {@link lucene::document::DateTools} for an * alternative without such a limitation. * - * @deprecated If you build a new index, use {@link DateTools} instead. This class is included for use with existing - * indices and will be removed in a future release. +* @deprecated If you build a new index, use {@link lucene::document::DateTools} instead. +* This class is included for use with existing indices and will be removed in a future release. */ class CLUCENE_EXPORT DateField :LUCENE_BASE { public: Modified: branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -22,8 +22,8 @@ CL_NS_DEF(search) /** - * A {@link Query} that matches documents containing a subset of terms provided - * by a {@link FilteredTermEnum} enumeration. + * A {@link lucene::search::Query} that matches documents containing a subset of terms provided + * by a {@link lucene::search::FilteredTermEnum} enumeration. * <P> * <code>MultiTermQuery</code> is not designed to be used by itself. * <BR> Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -22,7 +22,7 @@ CL_NS_DEF(store) /** - * Straightforward implementation of {@link Directory} as a directory of files. + * Straightforward implementation of {@link lucene::store::Directory} as a directory of files. * <p>If the system property 'disableLuceneLocks' has the String value of * "true", lock creation will be disabled. * Modified: branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -13,7 +13,7 @@ CL_NS_DEF(store) - /** Abstract base class for input from a file in a {@link Directory}. A + /** Abstract base class for input from a file in a {@link lucene::store::Directory}. A * random-access input stream. Used for all Lucene index input operations. * @see Directory * @see IndexOutput @@ -91,7 +91,7 @@ /** Returns the current position in this file, where the next read will * occur. - * @see #seek(long) + * @see #seek(int64_t) */ virtual int64_t getFilePointer() const =0; Modified: branches/lucene2_3_2/src/shared/CLucene/util/dirent.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-07-25 12:56:40 UTC (rev 2824) +++ branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-07-27 12:40:59 UTC (rev 2825) @@ -15,7 +15,6 @@ /** -\unit * dirent.c * * Derived from DIRLIB.C by Matt J. Weinstein This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-07-27 12:56:25
|
Revision: 2826 http://clucene.svn.sourceforge.net/clucene/?rev=2826&view=rev Author: ustramooner Date: 2008-07-27 12:56:21 +0000 (Sun, 27 Jul 2008) Log Message: ----------- fixed dox-tarz target fixed chm doc build renamed some @memory type documentation Modified Paths: -------------- branches/lucene2_3_2/cmake/CLuceneDocs.cmake branches/lucene2_3_2/doc/Doxyfile.cmake branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h branches/lucene2_3_2/src/core/CLucene/search/FieldCache.h branches/lucene2_3_2/src/core/CLucene/search/Filter.h Modified: branches/lucene2_3_2/cmake/CLuceneDocs.cmake =================================================================== --- branches/lucene2_3_2/cmake/CLuceneDocs.cmake 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/cmake/CLuceneDocs.cmake 2008-07-27 12:56:21 UTC (rev 2826) @@ -132,8 +132,8 @@ FIND_PACKAGE(UnixCommands) IF ( TAR AND GZIP ) ADD_CUSTOM_TARGET(doc-tarz - "${TAR} -cf doc/clucene-core-doc.tar ${PROJECT_BINARY_DIR}/doc/html/" - "${GZIP} doc/clucene-core-doc.tar" + COMMAND "${TAR}" "-cf" "doc/clucene-core-doc.tar" "${PROJECT_BINARY_DIR}/doc/html/" + COMMAND "${GZIP}" "doc/clucene-core-doc.tar" #DEPENDS doc-doxygen ) ENDIF ( TAR AND GZIP ) Modified: branches/lucene2_3_2/doc/Doxyfile.cmake =================================================================== --- branches/lucene2_3_2/doc/Doxyfile.cmake 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/doc/Doxyfile.cmake 2008-07-27 12:56:21 UTC (rev 2826) @@ -109,10 +109,10 @@ HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = @CLDOCS_HTML_HELP@ -CHM_FILE = clucene.chm +CHM_FILE = ../clucene.chm HHC_LOCATION = @HTML_HELP_COMPILER_EX@ GENERATE_CHI = YES -BINARY_TOC = NO +BINARY_TOC = YES TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-07-27 12:56:21 UTC (rev 2826) @@ -152,8 +152,9 @@ * every document. This is used by the search code to score documents. * * The number of bytes returned is the size of the IndexReader->maxDoc() - * MEMORY: The values are cached, so don't delete the returned byte array. + * * @see Field#setBoost(float_t) + * @memory The values are cached, so don't delete the returned byte array. */ virtual uint8_t* norms(const TCHAR* field) = 0; Modified: branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h 2008-07-27 12:56:21 UTC (rev 2826) @@ -198,7 +198,7 @@ * @return Resulting {@link Query} object. * return NULL to disallow * - * Memory: clauses must all be cleaned up by this function. + * @memory clauses must all be cleaned up by this function. */ virtual CL_NS(search)::Query* GetBooleanQuery(std::vector<CL_NS(search)::BooleanClause*>& clauses); virtual CL_NS(search)::Query* GetBooleanQuery(std::vector<CL_NS(search)::BooleanClause*>& clauses, bool disableCoord ); Modified: branches/lucene2_3_2/src/core/CLucene/search/FieldCache.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/FieldCache.h 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/src/core/CLucene/search/FieldCache.h 2008-07-27 12:56:21 UTC (rev 2826) @@ -40,7 +40,7 @@ int count; /** Creates one of these objects - Consumes all memory given. + @memory Consumes all memory given. */ StringIndex (int32_t* values, TCHAR** lookup, int count); ~StringIndex(); Modified: branches/lucene2_3_2/src/core/CLucene/search/Filter.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Filter.h 2008-07-27 12:40:59 UTC (rev 2825) +++ branches/lucene2_3_2/src/core/CLucene/search/Filter.h 2008-07-27 12:56:21 UTC (rev 2826) @@ -23,7 +23,7 @@ /** * Returns a BitSet with true for documents which should be permitted in * search results, and false for those that should not. - * MEMORY: read shouldDeleteBitSet + * @memory see {@link #shouldDeleteBitSet} */ virtual CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader)=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-07-27 16:06:32
|
Revision: 2827 http://clucene.svn.sourceforge.net/clucene/?rev=2827&view=rev Author: ustramooner Date: 2008-07-27 16:06:19 +0000 (Sun, 27 Jul 2008) Log Message: ----------- resurrected contribs code Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/COPYING branches/lucene2_3_2/cmake/CreateClucenePackages.cmake branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake branches/lucene2_3_2/src/shared/CMakeLists.txt Added Paths: ----------- branches/lucene2_3_2/src/contribs/ branches/lucene2_3_2/src/contribs/CLucene/ branches/lucene2_3_2/src/contribs/CLucene/analysis/ branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.cpp branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.h branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.cpp branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/ branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.cpp branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/HighlightScorer.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/Highlighter.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/Highlighter.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/QueryScorer.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/QueryScorer.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/QueryTermExtractor.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/QueryTermExtractor.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/Scorer.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleFragmenter.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleFragmenter.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleHTMLEncoder.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleHTMLEncoder.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleHTMLFormatter.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/SimpleHTMLFormatter.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/TextFragment.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/TextFragment.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/TokenGroup.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/TokenGroup.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/TokenSources.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/TokenSources.h branches/lucene2_3_2/src/contribs/CLucene/highlighter/WeightedTerm.cpp branches/lucene2_3_2/src/contribs/CLucene/highlighter/WeightedTerm.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/ branches/lucene2_3_2/src/contribs/CLucene/jstreams/Reader.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/bufferedstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/bz2inputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/bz2inputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/dostime.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/dostime.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/fileinputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/fileinputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/filereader.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/filereader.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/gzipcompressstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/gzipcompressstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/gzipinputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/gzipinputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/inputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/inputstreambuffer.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/inputstreamreader.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/inputstreamreader.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/jstreamsconfig.h.cmake branches/lucene2_3_2/src/contribs/CLucene/jstreams/streambase.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/streamreader.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/stringreader.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/subinputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/subinputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/substreamprovider.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/tarinputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/tarinputstream.h branches/lucene2_3_2/src/contribs/CLucene/jstreams/zipinputstream.cpp branches/lucene2_3_2/src/contribs/CLucene/jstreams/zipinputstream.h branches/lucene2_3_2/src/contribs/CLucene/snowball/ branches/lucene2_3_2/src/contribs/CLucene/snowball/SNOWBALL_README branches/lucene2_3_2/src/contribs/CLucene/snowball/Snowball.cpp branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballAnalyzer.h branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballFilter.h branches/lucene2_3_2/src/contribs/CLucene/snowball/include/ branches/lucene2_3_2/src/contribs/CLucene/snowball/include/libstemmer.h branches/lucene2_3_2/src/contribs/CLucene/snowball/libstemmer/ branches/lucene2_3_2/src/contribs/CLucene/snowball/libstemmer/libstemmer.c branches/lucene2_3_2/src/contribs/CLucene/snowball/libstemmer/modules.h branches/lucene2_3_2/src/contribs/CLucene/snowball/libstemmer.h branches/lucene2_3_2/src/contribs/CLucene/snowball/runtime/ branches/lucene2_3_2/src/contribs/CLucene/snowball/runtime/api.c branches/lucene2_3_2/src/contribs/CLucene/snowball/runtime/api.h branches/lucene2_3_2/src/contribs/CLucene/snowball/runtime/header.h branches/lucene2_3_2/src/contribs/CLucene/snowball/runtime/utilities.c branches/lucene2_3_2/src/contribs/CLucene/snowball/snowball.version branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/ branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_danish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_danish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_dutch.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_dutch.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_english.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_english.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_finnish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_finnish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_french.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_french.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_german.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_german.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_italian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_italian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_norwegian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_norwegian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_porter.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_porter.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_portuguese.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_portuguese.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_spanish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_spanish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_swedish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_ISO_8859_1_swedish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_KOI8_R_russian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_KOI8_R_russian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_danish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_danish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_dutch.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_dutch.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_english.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_english.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_finnish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_finnish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_french.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_french.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_german.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_german.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_italian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_italian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_norwegian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_norwegian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_porter.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_porter.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_portuguese.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_portuguese.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_russian.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_russian.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_spanish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_spanish.h branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_swedish.c branches/lucene2_3_2/src/contribs/CLucene/snowball/src_c/stem_UTF_8_swedish.h branches/lucene2_3_2/src/contribs/CMakeLists.txt branches/lucene2_3_2/src/contribs/cmake/ branches/lucene2_3_2/src/contribs/cmake/FindIconv.cmake Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-27 12:56:21 UTC (rev 2826) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) @@ -1,13 +1,18 @@ PROJECT (clucene) -SET(CPACK_PACKAGE_VERSION_MAJOR "0") -SET(CPACK_PACKAGE_VERSION_MINOR "9") -SET(CPACK_PACKAGE_VERSION_REVISION "23") -SET(CPACK_PACKAGE_VERSION_PATCH "0") +#Rules for version: +#MAJOR and MINOR versions are purely political +#REVISION version MUST be revised if the headers or compatibility change +#PATCH should be 0 unless a patch is made that doesn't affect the public signature (i.e. clients don't need to re-compile). -SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_REVISION}.${CPACK_PACKAGE_VERSION_PATCH}") -SET(CPACK_PACKAGE_SOVERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_REVISION}") +SET(CLUCENE_VERSION_MAJOR "0") +SET(CLUCENE_VERSION_MINOR "9") +SET(CLUCENE_VERSION_REVISION "23") +SET(CLUCENE_VERSION_PATCH "0") +SET(CLUCENE_VERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}.${CLUCENE_VERSION_PATCH}") +SET(CLUCENE_SOVERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}") + CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2 FATAL_ERROR) if(COMMAND cmake_policy) @@ -112,3 +117,4 @@ ADD_SUBDIRECTORY (src/core) ADD_SUBDIRECTORY (src/test) ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL) +ADD_SUBDIRECTORY (src/contribs EXCLUDE_FROM_ALL) Modified: branches/lucene2_3_2/COPYING =================================================================== --- branches/lucene2_3_2/COPYING 2008-07-27 12:56:21 UTC (rev 2826) +++ branches/lucene2_3_2/COPYING 2008-07-27 16:06:19 UTC (rev 2827) @@ -1,5 +1,11 @@ License +The CLucene code is split into two sections for licensing reasons. The 'Core' +is strictly dual licensed Apache 2 and LGPL. The CLucene Contributions code +could not be licensed under Apache because of the subcomponents it uses. + +CLUCENE CORE: + The CLucene Core Library uses a dual license strategy for the source code. These licenses are the GNU Lesser General Public License (LGPL) and the Apache License (Version 2.0). Users can choose the license they wish to distribute @@ -7,16 +13,23 @@ licenses, but rather than you can choose the license which most suits your needs. -To rephrase this and to make it perfectly clear: +For details of these licenses see APACHE.license and LGPL.license in the root +of the source distribution. + +Some components of CLucene Core use other licenses. See the CLUCENE CORE SUBCOMPONENTS +section for details. We understand that these licenses are compatible with LGPL and/or +Apache v2, but please consult with a lawyer to be certain of this. + +To rephrase the licensing and to make it perfectly clear: CLucene is distributed under the GNU Lesser General Public License (LGPL) *or* the Apache License, Version 2.0 -However, we are an open source project, and we encourage users to use the LGPL -license and participate fully in the free software community. Dual licensing -of the CLucene source code provides open and free access to the technology both -for the GPL community and for other developers or companies that cannot use the -GPL. +However, we are an open source project, and we encourage users to participate fully +in the free software community by contributing their code back to the project. +Dual licensing of the CLucene source code provides open and free access to the +technology both for the GPL community and for other developers or companies +that cannot use the GPL license. You can freely modify, extend, and improve the CLucene source code. The only question is whether or not you must provide the source code and contribute @@ -30,7 +43,7 @@ more information. -CLUCENE SUBCOMPONENTS: +CLUCENE CORE SUBCOMPONENTS: CLucene includes a number of subcomponents with separate copyright notices and license terms. Your use of the source code for the @@ -67,10 +80,16 @@ documentation and/or software. */ - For the cmake/MacroCheckGccVisibility.cmake and cmake/MacroEnsureVersion.cmake components: + + +the cmake/MacroCheckGccVisibility.cmake and MacroEnsureVersion.cmake components: # # Copyright (c) 2006, Alexander Neundorf <neu...@kd...> # Copyright (c) 2006, Laurent Montel, <mo...@kd...> # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +CLUCENE CONTRIBUTIONS CODE: + + Modified: branches/lucene2_3_2/cmake/CreateClucenePackages.cmake =================================================================== --- branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2008-07-27 12:56:21 UTC (rev 2826) +++ branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2008-07-27 16:06:19 UTC (rev 2827) @@ -7,6 +7,14 @@ #REVISION version MUST be revised if the headers or compatibility change #PATCH should be 0 unless a patch is made that doesn't affect the public signature (i.e. clients don't need to re-compile). +SET(CPACK_PACKAGE_VERSION_MAJOR ${CLUCENE_VERSION_MAJOR}) +SET(CPACK_PACKAGE_VERSION_MINOR ${CLUCENE_VERSION_MINOR}) +SET(CPACK_PACKAGE_VERSION_REVISION ${CLUCENE_VERSION_REVISION}) +SET(CPACK_PACKAGE_VERSION_PATCH ${CLUCENE_VERSION_MAJOR}) + +SET(CPACK_PACKAGE_VERSION ${CLUCENE_VERSION}) +SET(CPACK_PACKAGE_SOVERSION ${CLUCENE_SOVERSION}) + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene") SET(CPACK_PACKAGE_VENDOR "Ben van Klinken") Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2008-07-27 12:56:21 UTC (rev 2826) +++ branches/lucene2_3_2/dist-test.sh 2008-07-27 16:06:19 UTC (rev 2827) @@ -35,14 +35,13 @@ #check that all classes are exported + echo "$X:"; awk '/^[ \t]*(class|struct)/ { print $line }' $X|grep -v ";$"|grep -v CLUCENE_EXPORT; echo ""; done|nl fi done -#pring out classes that are not exported: -echo "These list of files and classes in them that weren't exported: " -find src/CLucene -name *.h| while read X; do echo "$X:"; awk '/^[ \t]*(class|struct)/ { print $line }' $X|grep -v ";$"|grep -v CLUCENE_EXPORT; echo ""; done|nl|more +#test that each header compiles independently... -#test if headers can compile by themselves: +#test if headers can compile together by themselves: echo "int main(){return 0;}" >>$TMP/pub-headers.cpp g++ -Isrc pub-headers.cpp Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,50 @@ +#include "CLucene/_ApiHeader.h" +#include "LanguageBasedAnalyzer.h" +#include "CLucene/analysis/cjk/CJKAnalyzer.h" +#include "CLucene/analysis/Analyzers.h" +#include "CLucene/analysis/standard/StandardTokenizer.h" +#include "CLucene/analysis/standard/StandardFilter.h" +#include "CLucene/snowball/SnowballFilter.h" + +CL_NS_DEF(analysis) +CL_NS_USE(util) +CL_NS_USE2(analysis,cjk) +CL_NS_USE2(analysis,standard) +CL_NS_USE2(analysis,snowball) + +LanguageBasedAnalyzer::LanguageBasedAnalyzer(const TCHAR* language, bool stem) +{ + _tcsncpy(lang,language,100); + this->stem = stem; +} +LanguageBasedAnalyzer::~LanguageBasedAnalyzer(){ +} +void LanguageBasedAnalyzer::setLanguage(const TCHAR* language){ + _tcsncpy(lang,language,100); +} +void LanguageBasedAnalyzer::setStem(bool stem){ + this->stem = stem; +} +TokenStream* LanguageBasedAnalyzer::tokenStream(const TCHAR* fieldName, Reader* reader) { + TokenStream* ret = NULL; + if ( _tcscmp(lang, _T("cjk"))==0 ){ + ret = _CLNEW CL_NS2(analysis,cjk)::CJKTokenizer(reader); + }else{ + ret = _CLNEW StandardTokenizer(reader); + ret = _CLNEW StandardFilter(ret,true); + + if ( stem ) + ret = _CLNEW SnowballFilter(ret,lang, true); //todo: should check whether snowball supports the language + + if ( stem ) //hmm... this could be configured seperately from stem + ret = _CLNEW ISOLatin1AccentFilter(ret, true); //todo: this should really only be applied to latin languages... + + //lower case after the latin1 filter + ret = _CLNEW LowerCaseFilter(ret,true); + } + //todo: could add a stop filter based on the language - need to fix the stoplist loader first + + return ret; +} + +CL_NS_END Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/LanguageBasedAnalyzer.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,35 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef _lucene_analysis_languagebasedanalyzer_ +#define _lucene_analysis_languagebasedanalyzer_ + +#include "CLucene/analysis/AnalysisHeader.h" + +CL_NS_DEF(analysis) + +class CLUCENE_EXPORT LanguageBasedAnalyzer: public CL_NS(analysis)::Analyzer{ + TCHAR lang[100]; + bool stem; +public: + LanguageBasedAnalyzer(const TCHAR* language=LUCENE_BLANK_STRING, bool stem=true); + ~LanguageBasedAnalyzer(); + void setLanguage(const TCHAR* language); + void setStem(bool stem); + TokenStream* tokenStream(const TCHAR* fieldName, CL_NS(util)::Reader* reader); + }; + +CL_NS_END +#endif Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,313 @@ +/* This is the Porter stemming algorithm, originally written by Martin Porter. + It may be regarded as cononical, in that it follows the + algorithm presented in + + Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, + no. 3, pp 130-137, + + See also http://www.tartarus.org/~martin/PorterStemmer + + Modified by "Hemant Muthiyan" + email: hem...@ya... + +*/ + +#include "CLucene/_ApiHeader.h" +#include "PorterStemmer.h" + +CL_NS_DEF(analysis) + + bool PorterStemmer::cons(size_t i) { + switch (b[i]) { + case 'a': case 'e': case 'i': case 'o': case 'u': + return false; + case 'y': + return (i==k0) ? true : !cons(i-1); + default: + return true; + } + } + + int32_t PorterStemmer::m() { + int32_t n = 0; + size_t i = k0; + while(true) { + if (i > j) + return n; + if (! cons(i)) + break; + i++; + } + i++; + while(true) { + while(true) { + if (i > j) + return n; + if (cons(i)) + break; + i++; + } + i++; + n++; + while(true) { + if (i > j) + return n; + if (! cons(i)) + break; + i++; + } + i++; + } + } + + bool PorterStemmer::vowelinstem() { + for (size_t i = k0; i <= j; i++) + if (! cons(i)) + return true; + return false; + } + + /* doublec(j) is true <=> j,(j-1) contain a double consonant. */ + bool PorterStemmer::doublec(size_t j) { + if (j < k0+1) + return false; + if (b[j] != b[j-1]) + return false; + return cons(j); + } + + /* cvc(i) is true <=> i-2,i-1,i has the form consonant - vowel - consonant + and also if the second c is not w,x or y. this is used when trying to + restore an e at the end of a short word. e.g. + + cav(e), lov(e), hop(e), crim(e), but + snow, box, tray. + + */ + bool PorterStemmer::cvc(size_t i) { + if (i < k0+2 || !cons(i) || cons(i-1) || !cons(i-2)) + return false; + else { + int32_t ch = b[i]; + if (ch == 'w' || ch == 'x' || ch == 'y') return false; + } + return true; + } + + bool PorterStemmer::ends(TCHAR *s) { + size_t l = _tcslen(s); + size_t o = k-l+1; + if (o < k0) + return false; + for (size_t i = 0; i < l; i++) + if (b[o+i] != s[i]) + return false; + j = (l > k) ? 0 : k-l; + return true; + } + + void PorterStemmer::setto(const TCHAR *s) { + size_t l = _tcslen(s); + size_t o = j+1; + for (size_t i = 0; i < l; i++) + b[o+i] = s[i]; + k = j+l; + dirty = true; + } + + void PorterStemmer::r(const TCHAR *s) { + if (m() > 0) setto(s); + } + + void PorterStemmer::step1() { + if (b[k] == _T('s')) { + if (ends(_T("sses"))) k -= 2; + else if (ends(_T("ies"))) setto(_T("i")); + else if (b[k-1] != _T('s')) k--; + } + if (ends(_T("eed"))) { + if (m() > 0) + k--; + } + else if ((ends(_T("ed")) || ends(_T("ing"))) && vowelinstem()) { + k = j; + if (ends(_T("at"))) setto(_T("ate")); + else if (ends(_T("bl"))) setto(_T("ble")); + else if (ends(_T("iz"))) setto(_T("ize")); + else if (doublec(k)) { + int32_t ch = b[k--]; + if (ch == _T('l') || ch == _T('s') || ch == _T('z')) + k++; + } + else if (m() == 1 && cvc(k)) + setto(_T("e")); + } + } + + void PorterStemmer::step2() { + if (ends(_T("y")) && vowelinstem()) { + b[k] = 'i'; + dirty = true; + } + } + + void PorterStemmer::step3() { + if (k == k0) return; /* For Bug 1 */ + switch (b[k-1]) { + case 'a': + if (ends(_T("ational"))) { r(_T("ate")); break; } + if (ends(_T("tional"))) { r(_T("tion")); break; } + break; + case 'c': + if (ends(_T("enci"))) { r(_T("ence")); break; } + if (ends(_T("anci"))) { r(_T("ance")); break; } + break; + case 'e': + if (ends(_T("izer"))) { r(_T("ize")); break; } + break; + case 'l': + if (ends(_T("bli"))) { r(_T("ble")); break; } + if (ends(_T("alli"))) { r(_T("al")); break; } + if (ends(_T("entli"))) { r(_T("ent")); break; } + if (ends(_T("eli"))) { r(_T("e")); break; } + if (ends(_T("ousli"))) { r(_T("ous")); break; } + break; + case 'o': + if (ends(_T("ization"))) { r(_T("ize")); break; } + if (ends(_T("ation"))) { r(_T("ate")); break; } + if (ends(_T("ator"))) { r(_T("ate")); break; } + break; + case 's': + if (ends(_T("alism"))) { r(_T("al")); break; } + if (ends(_T("iveness"))) { r(_T("ive")); break; } + if (ends(_T("fulness"))) { r(_T("ful")); break; } + if (ends(_T("ousness"))) { r(_T("ous")); break; } + break; + case 't': + if (ends(_T("aliti"))) { r(_T("al")); break; } + if (ends(_T("iviti"))) { r(_T("ive")); break; } + if (ends(_T("biliti"))) { r(_T("ble")); break; } + break; + case 'g': + if (ends(_T("logi"))) { r(_T("log")); break; } + } + } + + void PorterStemmer::step4() { + switch (b[k]) { + case 'e': + if (ends(_T("icate"))) { r(_T("ic")); break; } + if (ends(_T("ative"))) { r(LUCENE_BLANK_STRING); break; } + if (ends(_T("alize"))) { r(_T("al")); break; } + break; + case 'i': + if (ends(_T("iciti"))) { r(_T("ic")); break; } + break; + case 'l': + if (ends(_T("ical"))) { r(_T("ic")); break; } + if (ends(_T("ful"))) { r(LUCENE_BLANK_STRING); break; } + break; + case 's': + if (ends(_T("ness"))) { r(LUCENE_BLANK_STRING); break; } + break; + } + } + + void PorterStemmer::step5() { + if (k == k0) return; /* for Bug 1 */ + switch (b[k-1]) { + case 'a': + if (ends(_T("al"))) break; + return; + case 'c': + if (ends(_T("ance"))) break; + if (ends(_T("ence"))) break; + return; + case 'e': + if (ends(_T("er"))) break; return; + case 'i': + if (ends(_T("ic"))) break; return; + case 'l': + if (ends(_T("able"))) break; + if (ends(_T("ible"))) break; return; + case 'n': + if (ends(_T("ant"))) break; + if (ends(_T("ement"))) break; + if (ends(_T("ment"))) break; + /* element etc. not stripped before the m */ + if (ends(_T("ent"))) break; + return; + case 'o': + if (ends(_T("ion")) && j >= 0 && (b[j] == 's' || b[j] == 't')) break; + /* j >= 0 fixes Bug 2 */ + if (ends(_T("ou"))) break; + return; + /* takes care of -ous */ + case 's': + if (ends(_T("ism"))) break; + return; + case 't': + if (ends(_T("ate"))) break; + if (ends(_T("iti"))) break; + return; + case 'u': + if (ends(_T("ous"))) break; + return; + case 'v': + if (ends(_T("ive"))) break; + return; + case 'z': + if (ends(_T("ize"))) break; + return; + default: + return; + } + if (m() > 1) + k = j; + } + + void PorterStemmer::step6() { + j = k; + if (b[k] == 'e') { + int32_t a = m(); + if (a > 1 || a == 1 && !cvc(k-1)) + k--; + } + if (b[k] == 'l' && doublec(k) && m() > 1) + k--; + } + + + PorterStemmer::PorterStemmer(TCHAR *Text) { + b = Text; + i = _tcslen(b); + dirty = false; + } + + PorterStemmer::~PorterStemmer(){ + b = NULL; + } + + + int32_t PorterStemmer::getResultLength() { return i; } + + bool PorterStemmer::stem() { + //i = strlen(b); + k = i -1; + k0 = 0; + if (k > k0+1) { + step1(); step2(); step3(); step4(); step5(); step6(); + } + // Also, a word is considered dirty if we lopped off letters + // Thanks to Ifigenia Vairelles for pointing this out. + if (i != k+1) + dirty = true; + i = k+1; + return dirty; + } + + const TCHAR* PorterStemmer::getResultBuffer() { + return b; + } + +CL_NS_END Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,143 @@ +/* This is the Porter stemming algorithm, originally written by Martin Porter. + It may be regarded as cononical, in that it follows the + algorithm presented in + + Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, + no. 3, pp 130-137, + + See also http://www.tartarus.org/~martin/PorterStemmer + + Modified by "Hemant Muthiyan" + email: hem...@ya... + +*/ +#ifndef _lucene_analysis_PorterStemmer_ +#define _lucene_analysis_PorterStemmer_ + +CL_NS_DEF(analysis) + +class CLUCENE_EXPORT PorterStemmer +{ +private: + TCHAR *b; + size_t i, /* offset into b */ + j, k, k0; + bool dirty; + //private static final int32_t EXTRA = 1; + + /* cons(i) is true <=> b[i] is a consonant. */ + +private: + bool cons(size_t i); + + /* m() measures the number of consonant sequences between k0 and j. if c is + a consonant sequence and v a vowel sequence, and <..> indicates arbitrary + presence, + + <c><v> gives 0 + <c>vc<v> gives 1 + <c>vcvc<v> gives 2 + <c>vcvcvc<v> gives 3 + .... + */ + + int32_t m(); + + /* vowelinstem() is true <=> k0,...j contains a vowel */ + + bool vowelinstem(); + + /* doublec(j) is true <=> j,(j-1) contain a double consonant. */ + bool doublec(size_t j); + + /* cvc(i) is true <=> i-2,i-1,i has the form consonant - vowel - consonant + and also if the second c is not w,x or y. this is used when trying to + restore an e at the end of a short word. e.g. + + cav(e), lov(e), hop(e), crim(e), but + snow, box, tray. + + */ + bool cvc(size_t i); + + bool ends(TCHAR *s); + + /* setto(s) sets (j+1),...k to the characters in the string s, readjusting + k. */ + + void setto(const TCHAR *s); + + /* r(s) is used further down. */ + + void r(const TCHAR *s); + + /* step1() gets rid of plurals and -ed or -ing. e.g. + + caresses -> caress + ponies -> poni + ties -> ti + caress -> caress + cats -> cat + + feed -> feed + agreed -> agree + disabled -> disable + + matting -> mat + mating -> mate + meeting -> meet + milling -> mill + messing -> mess + + meetings -> meet + + */ + + void step1(); + + /* step2() turns terminal y to i when there is another vowel in the stem. */ + + void step2(); + + /* step3() maps double suffices to single ones. so -ization ( = -ize plus + -ation) maps to -ize etc. note that the string before the suffix must give + m() > 0. */ + + void step3(); + + /* step4() deals with -ic-, -full, -ness etc. similar strategy to step3. */ + + void step4(); + + /* step5() takes off -ant, -ence etc., in context <c>vcvc<v>. */ + + void step5(); + + /* step6() removes a final -e if m() > 1. */ + + void step6(); + + public: + + PorterStemmer(TCHAR *Text); + ~PorterStemmer(); + + + /** + * Returns the length of the word resulting from the stemming process. + */ + int32_t getResultLength(); + + bool stem(); + + /** + * Returns a reference to a character buffer containing the results of + * the stemming process. You also need to consult getResultLength() + * to determine the length of the result. + */ + const TCHAR* getResultBuffer(); + +}; +CL_NS_END + +#endif Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,184 @@ +#include "CLucene/_ApiHeader.h" +#include "CJKAnalyzer.h" +#include "CLucene/util/Reader.h" + +CL_NS_DEF2(analysis,cjk) +CL_NS_USE(analysis) +CL_NS_USE(util) + + +const TCHAR* CJKTokenizer::tokenTypeSingle = _T("single"); +const TCHAR* CJKTokenizer::tokenTypeDouble = _T("double"); + +CJKTokenizer::CJKTokenizer(Reader* in): + Tokenizer(in) +{ + tokenType = Token::getDefaultType(); + offset = 0; + bufferIndex = 0; + dataLen = 0; + preIsTokened = false; + ignoreSurrogates = true; +} + +bool CJKTokenizer::next(Token* token){ + /** how many character(s) has been stored in buffer */ + int32_t length = 0; + + /** the position used to create Token */ + int32_t start = offset; + + while (true) { + /** current character */ + clunichar c; + int charlen = 1; + + offset++; + + if (bufferIndex >= dataLen) { + dataLen = input->read(ioBuffer); + bufferIndex = 0; + } + + if (dataLen == -1) { + if (length > 0) { + if (preIsTokened == true) { + length = 0; + preIsTokened = false; + } + + break; + } else { + return false; + } + } else { + //get current character + c = ioBuffer[bufferIndex++]; + } + + //to support surrogates, we'll need to convert the incoming utf16 into + //ucs4(c variable). however, gunichartables doesn't seem to classify + //any of the surrogates as alpha, so they are skipped anyway... + //so for now we just convert to ucs4 so that we dont corrupt the input. + if ( c >= 0xd800 || c <= 0xdfff ){ + clunichar c2 = ioBuffer[bufferIndex]; + if ( c2 >= 0xdc00 && c2 <= 0xdfff ){ + bufferIndex++; + offset++; + charlen=2; + + c = (((c & 0x03ffL) << 10) | ((c2 & 0x03ffL) << 0)) + 0x00010000L; + } + } + + //if the current character is ASCII or Extend ASCII + if ((c <= 0xFF) //is BASIC_LATIN + || (c>=0xFF00 && c<=0xFFEF) //ascii >0x74 cast to unsigned... + ) { + if (c >= 0xFF00) { + //todo: test this... only happens on platforms where char is signed, i think... + /** convert HALFWIDTH_AND_FULLWIDTH_FORMS to BASIC_LATIN */ + c -= 0xFEE0; + } + + // if the current character is a letter or "_" "+" "#" + if (_istalnum(c) || ((c == '_') || (c == '+') || (c == '#')) ) { + if (length == 0) { + // "javaC1C2C3C4linux" <br> + // ^--: the current character begin to token the ASCII + // letter + start = offset - 1; + } else if (tokenType == tokenTypeDouble) { + // "javaC1C2C3C4linux" <br> + // ^--: the previous non-ASCII + // : the current character + offset-=charlen; + bufferIndex-=charlen; + tokenType = tokenTypeSingle; + + if (preIsTokened == true) { + // there is only one non-ASCII has been stored + length = 0; + preIsTokened = false; + + break; + } else { + break; + } + } + + // store the LowerCase(c) in the buffer + buffer[length++] = _totlower((TCHAR)c); + tokenType = tokenTypeSingle; + + // break the procedure if buffer overflowed! + if (length == LUCENE_MAX_WORD_LEN) { + break; + } + } else if (length > 0) { + if (preIsTokened == true) { + length = 0; + preIsTokened = false; + } else { + break; + } + } + } else { + // non-ASCII letter, eg."C1C2C3C4" + if ( _istalpha(c) || (!ignoreSurrogates && c>=0x10000) ) { + if (length == 0) { + start = offset - 1; + + if ( c < 0x00010000L ) + buffer[length++] = (TCHAR)c; + else{ + clunichar ucs4 = c - 0x00010000L; + buffer[length++] = (TCHAR)((ucs4 >> 10) & 0x3ff) | 0xd800; + buffer[length++] = (TCHAR)((ucs4 >> 0) & 0x3ff) | 0xdc00; + } + + tokenType = tokenTypeDouble; + } else { + if (tokenType == tokenTypeSingle) { + offset-=charlen; + bufferIndex-=charlen; + + //return the previous ASCII characters + break; + } else { + if ( c < 0x00010000L ) + buffer[length++] = (TCHAR)c; + else{ + clunichar ucs4 = c - 0x00010000L; + buffer[length++] = (TCHAR)((ucs4 >> 10) & 0x3ff) | 0xd800; + buffer[length++] = (TCHAR)((ucs4 >> 0) & 0x3ff) | 0xdc00; + } + tokenType = tokenTypeDouble; + + if (length >= 2) { + offset-=charlen; + bufferIndex-=charlen; + preIsTokened = true; + + break; + } + } + } + } else if (length > 0) { + if (preIsTokened == true) { + // empty the buffer + length = 0; + preIsTokened = false; + } else { + break; + } + } + } + } + + buffer[length]='\0'; + token->set(buffer,start, start+length, tokenType); + return true; +} + +CL_NS_END2 Added: branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/cjk/CJKAnalyzer.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,103 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef _lucene_analysis_cjk_cjkanalyzer_ +#define _lucene_analysis_cjk_cjkanalyzer_ + +#include "CLucene/analysis/AnalysisHeader.h" + +CL_NS_DEF2(analysis,cjk) + +/** + * CJKTokenizer was modified from StopTokenizer which does a decent job for + * most European languages. It performs other token methods for double-byte + * Characters: the token will return at each two charactors with overlap match.<br> + * Example: "java C1C2C3C4" will be segment to: "java" "C1C2" "C2C3" "C3C4" it + * also need filter filter zero length token ""<br> + * for Digit: digit, '+', '#' will token as letter<br> + * for more info on Asia language(Chinese Japanese Korean) text segmentation: + * please search <a + * href="http://www.google.com/search?q=word+chinese+segment">google</a> + * + * @author Che, Dong + */ +class CLUCENE_EXPORT CJKTokenizer: public CL_NS(analysis)::Tokenizer { +private: + /** word offset, used to imply which character(in ) is parsed */ + int32_t offset; + + /** the index used only for ioBuffer */ + int32_t bufferIndex; + + /** data length */ + int32_t dataLen; + + /** + * character buffer, store the characters which are used to compose <br> + * the returned Token + */ + TCHAR buffer[LUCENE_MAX_WORD_LEN]; + + /** + * I/O buffer, used to store the content of the input(one of the <br> + * members of Tokenizer) + */ + const TCHAR* ioBuffer; + + /** word type: single=>ASCII double=>non-ASCII word=>default */ + const TCHAR* tokenType; + + static const TCHAR* tokenTypeSingle; + static const TCHAR* tokenTypeDouble; + + /** + * tag: previous character is a cached double-byte character "C1C2C3C4" + * ----(set the C1 isTokened) C1C2 "C2C3C4" ----(set the C2 isTokened) + * C1C2 C2C3 "C3C4" ----(set the C3 isTokened) "C1C2 C2C3 C3C4" + */ + bool preIsTokened; + + + bool ignoreSurrogates; + +public: + /** + * Construct a token stream processing the given input. + * + * @param in I/O reader + */ + CJKTokenizer(CL_NS(util)::Reader* in); + + /** + * Returns the next token in the stream, or null at EOS. + * See http://java.sun.com/j2se/1.3/docs/api/java/lang/Character.UnicodeBlock.html + * for detail. + * + * @return Token + * + * @throws java.io.IOException - throw IOException when read error <br> + * hanppened in the InputStream + * + */ + bool next(CL_NS(analysis)::Token* token); + + bool getIgnoreSurrogates(){ return ignoreSurrogates; }; + void setIgnoreSurrogates(bool ignoreSurrogates){ this->ignoreSurrogates = ignoreSurrogates; }; +}; + + + +CL_NS_END2 +#endif Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,3 @@ +#include "CLucene/_ApiHeader.h" +#include "Encoder.h" + Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Encoder.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,56 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef _lucene_search_highlight_encoder_ +#define _lucene_search_highlight_encoder_ + + +CL_NS_DEF2(search,highlight) + +/** + * Encodes original text. The Encoder works with the Formatter to generate the output. + * + */ +class Encoder:LUCENE_BASE +{ +public: + /** Virtual destructor */ + virtual ~Encoder(){ + } + + /** + * @param originalText The section of text being output + */ + virtual TCHAR* encodeText(TCHAR* originalText) = 0; +}; + +/** + * Simple {@link Encoder} implementation that does not modify the output + * @author Nicko Cadell + * + */ +class DefaultEncoder: public Encoder +{ +public: + TCHAR* encodeText(TCHAR* originalText) + { + return STRDUP_TtoT(originalText); + } +}; + + +CL_NS_END2 + +#endif Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,2 @@ +#include "CLucene/_ApiHeader.h" +#include "Formatter.h" Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Formatter.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,49 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _lucene_search_highlight_formatter_ +#define _lucene_search_highlight_formatter_ + +CL_NS_DEF2(search,highlight) +class TokenGroup; + +/** + * Processes terms found in the original text, typically by applying some form + * of mark-up to highlight terms in HTML search results pages. + * + */ +class Formatter:LUCENE_BASE +{ +public: + + /** Virtual destructor */ + virtual ~Formatter(){ + } + + /** + * @param originalText The section of text being considered for markup + * @param tokenGroup contains one or several overlapping Tokens along with + * their scores and positions. + */ + virtual TCHAR* highlightTerm(const TCHAR* originalTermText, const TokenGroup* tokenGroup) = 0; +}; + +CL_NS_END2 + +#endif + + + Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,3 @@ +#include "CLucene/_ApiHeader.h" +#include "Fragmenter.h" + Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Fragmenter.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,52 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _lucene_search_highlight_fragmenter_ +#define _lucene_search_highlight_fragmenter_ + + +CL_CLASS_DEF(analysis, Token) + +CL_NS_DEF2(search,highlight) + +/** + * Implements the policy for breaking text into multiple fragments for consideration + * by the {@link Highlighter} class. A sophisticated implementation may do this on the basis + * of detecting end of sentences in the text. + */ +class Fragmenter:LUCENE_BASE +{ +public: + /** Virtual destructor */ + virtual ~Fragmenter(){ + } + + /** + * Initializes the Fragmenter + * @param originalText + */ + virtual void start(const TCHAR* originalText) = 0; + + /** + * Test to see if this token from the stream should be held in a new TextFragment + * @param nextToken + */ + virtual bool isNewFragment(const CL_NS(analysis)::Token * nextToken) = 0; +}; + +CL_NS_END2 + +#endif Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/HighlightScorer.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/HighlightScorer.h (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/HighlightScorer.h 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,63 @@ +/** + * Copyright 2002-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _lucene_search_highlight_highlighterscorer_ +#define _lucene_search_highlight_highlighterscorer_ + + +CL_CLASS_DEF(analysis, Token) +//#include "TextFragment.h" + +CL_NS_DEF2(search,highlight) +class TextFragment; + +/** + * Adds to the score for a fragment based on its tokens + */ +class HighlightScorer:LUCENE_BASE +{ +public: + virtual ~HighlightScorer(){ + } + + /** + * called when a new fragment is started for consideration + * @param newFragment + */ + virtual void startFragment(TextFragment* newFragment) = 0; + + /** + * Called for each token in the current fragment + * @param token The token to be scored + * @return a score which is passed to the Highlighter class to influence the mark-up of the text + * (this return value is NOT used to score the fragment) + */ + virtual float_t getTokenScore(CL_NS(analysis)::Token* token) = 0; + + + /** + * Called when the highlighter has no more tokens for the current fragment - the scorer returns + * the weighting it has derived for the most recent fragment, typically based on the tokens + * passed to getTokenScore(). + * + */ + virtual float_t getFragmentScore() = 0; +}; + +CL_NS_END2 +#endif + + Added: branches/lucene2_3_2/src/contribs/CLucene/highlighter/Highlighter.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/highlighter/Highlighter.cpp (rev 0) +++ branches/lucene2_3_2/src/contribs/CLucene/highlighter/Highlighter.cpp 2008-07-27 16:06:19 UTC (rev 2827) @@ -0,0 +1,509 @@ +#include "CLucene/_ApiHeader.h" +#include "Highlighter.h" +#include "TokenGroup.h" +#include "Encoder.h" +#include "Scorer.h" +#include "Formatter.h" +#include "HighlightScorer.h" +#include "Fragmenter.h" +#include "TextFragment.h" +#include "SimpleFragmenter.h" +#include "SimpleHTMLFormatter.h" +#include "CLucene/analysis/AnalysisHeader.h" +#include "CLucene/util/PriorityQueue.h" +#include "CLucene/util/StringBuffer.h" +#include "CLucene/util/Reader.h" + +CL_NS_DEF2(search,highlight) +CL_NS_USE(analysis) +CL_NS_USE(util) + + class FragmentQueue : public CL_NS(util)::PriorityQueue<TextFragment*, CL_NS(util)::Deletor::Object<TextFragment> > + { + public: + FragmentQueue(int32_t size) + { + initialize(size, true); + } + + protected: + bool lessThan(TextFragment * fragA, TextFragment * fragB) + { + if (fragA->getScore() == fragB->getScore()) + return fragA->getFragNum() > fragB->getFragNum(); + else + return fragA->getScore() < fragB->getScore(); + } + }; + + + Highlighter::Highlighter(HighlightScorer * fragmentScorer): + delete_textFragmenter(true), + delete_fragmentScorer(false), + delete_formatter(true), + delete_encoder(true) + { + maxDocBytesToAnalyze = DEFAULT_MAX_DOC_BYTES_TO_ANALYZE; + + _textFragmenter = _CLNEW SimpleFragmenter(); + _fragmentScorer = fragmentScorer; + _formatter = _CLNEW SimpleHTMLFormatter(); + _encoder = _CLNEW DefaultEncoder(); + } + + Highlighter::Highlighter(Formatter * formatter, HighlightScorer * fragmentScorer): + delete_textFragmenter(true), + delete_fragmentScorer(false), + delete_formatter(false), + delete_encoder(true) + { + maxDocBytesToAnalyze = DEFAULT_MAX_DOC_BYTES_TO_ANALYZE; + + _textFragmenter = _CLNEW SimpleFragmenter(); + _fragmentScorer = fragmentScorer; + _formatter = formatter; + _encoder = _CLNEW DefaultEncoder(); + } + + Highlighter::Highlighter(Formatter * formatter, Encoder* encoder, HighlightScorer * fragmentScorer): + delete_textFragmenter(true), + delete_fragmentScorer(false), + delete_formatter(false), + delete_encoder(false) + { + maxDocBytesToAnalyze = DEFAULT_MAX_DOC_BYTES_TO_ANALYZE; + _textFragmenter = _CLNEW SimpleFragmenter(); + _fragmentScorer = fragmentScorer; + _formatter = formatter; + _encoder = encoder; + } + + Highlighter::~Highlighter() + { + if ( delete_textFragmenter ) + _CLDELETE ( _textFragmenter ); + + if ( delete_fragmentScorer ) + _CLDELETE(_fragmentScorer); + + if( delete_formatter ) + _CLDELETE(_formatter); + + if ( delete_encoder ) + _CLDELETE(_encoder); + } + + TCHAR* Highlighter::getBestFragment(TokenStream * tokenStream, const TCHAR* text) + { + TCHAR** results = getBestFragments(tokenStream,text, 1); + TCHAR* result = 0; + + if (results[0] != NULL ) + result = stringDuplicate(results[0]); + + _CLDELETE_CARRAY_ALL(results); + + return result; + } + + /** + * Highlights chosen terms in a text, extracting the most relevant section. + * This is a convenience method that calls + * {@link #getBestFragment(TokenStream, const TCHAR*)} + * + * @param analyzer the analyzer that will be used to split <code>text</code> + * into chunks + * @param text text to highlight terms in + * @param fieldName Name of field used to influence analyzer's tokenization policy + * + * @return highlighted text fragment or NULL if no terms found + */ + TCHAR* Highlighter::getBestFragment(Analyzer* analyzer, const TCHAR* fieldName, const TCHAR* text) + { + TokenStream* tokenStream = analyzer->tokenStream(fieldName, _CLNEW StringReader(text)); + return getBestFragment(tokenStream, text); + } + + TCHAR** Highlighter::getBestFragments( + TokenStream * tokenStream, + const TCHAR* text, + int32_t maxNumFragments) + { + maxNumFragments = cl_max((int32_t)1, maxNumFragments); //sanity check + + StringBuffer buffer; + TextFragment** frags = getBestTextFragments(&buffer,tokenStream,text, true,maxNumFragments); + + //Get text + std::vector<TCHAR*> fragTexts; + for (uint32_t i=0; frags[i]!=NULL; i++) + { + TextFragment* f = frags[i]; + if ((f != NULL) && (f->getScore() > 0)) + { + fragTexts.push_back(f->toString(&buffer)); + } + _CLDELETE(f); + } + + _CLDELETE_ARRAY(frags); + + size_t l = fragTexts.size(); + TCHAR** ret = _CL_NEWARRAY(TCHAR*,l+1); + for ( size_t j=0;j<l;j++ ) + ret[j] = fragTexts[j]; + ret[l] = NULL; + + return ret; + } + + TCHAR* Highlighter::getBestFragments( + TokenStream * tokenStream, + const TCHAR* text, + int32_t maxNumFragments, + const TCHAR* separator) + { + TCHAR** sections = getBestFragments(tokenStream,text, maxNumFragments); + StringBuffer result; + + for (int32_t i = 0; sections[i]!=NULL; i++) + { + if (i > 0) + { + result.append(separator); + } + result.append(sections[i]); + } + + _CLDELETE_CARRAY_ALL(sections); + return result.toString(); + } + + TextFragment** Highlighter::getBestTextFragments( + StringBuffer* writeTo, + TokenStream * tokenStream, + const TCHAR* text, + bool mergeContiguousFragments, + int32_t maxNumFragments) + { + CLArrayList<TextFragment*> docFrags(false); + TextFragment* currentFrag = _CLNEW TextFragment(writeTo->length(), docFrags.size()); + _fragmentScorer->startFragment(currentFrag); + docFrags.push_back(currentFrag); + + FragmentQueue fragQueue(maxNumFragments); + + try + { + int32_t startOffset; + int32_t endOffset; + int32_t lastEndOffset = 0; + _textFragmenter->start(text); + TCHAR substringBuffer[LUCENE_MAX_WORD_LEN]; + + TokenGroup* tokenGroup=_CLNEW TokenGroup(); + + TCHAR buffer[LUCENE_MAX_FIELD_LEN+1]; + Token token; + while ( tokenStream->next(&token) ) + { + if((tokenGroup->getNumTokens()>0)&&(tokenGroup->isDistinct(&token))){ + //the current token is distinct from previous tokens - + // markup the cached token group info + startOffset = tokenGroup->getStartOffset(); + endOffset = tokenGroup->getEndOffset(); + + _tcsncpy(substringBuffer,text+startOffset,endOffset-startOffset); + substringBuffer[endOffset-startOffset]=_T('\0'); + + TCHAR* encoded = _encoder->encodeText(substringBuffer); + const TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup); + _CLDELETE_CARRAY(encoded); + + //store any whitespace etc from between this and last group + if (startOffset > lastEndOffset){ + int len = startOffset-lastEndOffset; + if ( len > LUCENE_MAX_FIELD_LEN ) + len = LUCENE_MAX_FIELD_LEN; + _tcsncpy(buffer,text+lastEndOffset,len); + buffer[len]=_T('\0'); + + TCHAR* encoded = _encoder->encodeText(buffer); + writeTo->append(encoded); + _CLDELETE_CARRAY(encoded); + } + writeTo->append(markedUpText); + lastEndOffset=endOffset; + tokenGroup->clear(); + _CLDELETE_CARRAY(markedUpText); + + //check if current token marks the start of a new fragment + if (_textFragmenter->isNewFragment(&token)) + { + currentFrag->setScore(_fragmentScorer->getFragmentScore()); + //record stats for a new fragment + currentFrag->setTextEndPos( writeTo->length() ); + currentFrag =_CLNEW TextFragment(writeTo->length(), docFrags.size()); + _fragmentScorer->startFragment(currentFrag); + docFrags.push_back(currentFrag); + } + } + + // does query contain current token? + float_t score=_fragmentScorer->getTokenScore(&token); + //TCHAR* highlightedTerm = _formatter->highlightTerm(&substringBuffer, token->termText(), score, startOffset); + //newText->append(highlightedTerm); + //_CLDELETE_CARRAY(highlightedTerm); + //_CLDELETE(token); + + tokenGroup->addToken(&token,_fragmentScorer->getTokenScore(&token)); + + if(lastEndOffset>maxDocBytesToAnalyze) + { + break; + ... [truncated message content] |
From: <ust...@us...> - 2008-07-29 10:07:36
|
Revision: 2828 http://clucene.svn.sourceforge.net/clucene/?rev=2828&view=rev Author: ustramooner Date: 2008-07-29 10:07:29 +0000 (Tue, 29 Jul 2008) Log Message: ----------- some more documentation work on making contribs package a dll moved lucenebase.h and mem.h to core give option to link shared library against shared, static OR use the object files (set USE_SHARED_OBJECT_FILES ON ) export clucene-shared classes & functions so that we can have a clucene-shared shared library define CLUCENE_CONTRIBS_EXPORT and CLUCENE_SHARED_EXPORT appropriately fixed test-X defintions command Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/COPYING branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballFilter.h branches/lucene2_3_2/src/contribs/CMakeLists.txt branches/lucene2_3_2/src/core/CLucene/StdHeader.h branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/config/repl_tchar.h branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h branches/lucene2_3_2/src/shared/CLucene/config/repl_wctype.h branches/lucene2_3_2/src/shared/CLucene/util/Misc.h branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h branches/lucene2_3_2/src/shared/CLucene/util/dirent.h branches/lucene2_3_2/src/shared/CMakeLists.txt branches/lucene2_3_2/src/test/CMakeLists.txt Added Paths: ----------- branches/lucene2_3_2/src/core/CLucene/debug/ branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h branches/lucene2_3_2/src/core/CLucene/debug/mem.h Removed Paths: ------------- branches/lucene2_3_2/src/shared/CLucene/debug/lucenebase.h branches/lucene2_3_2/src/shared/CLucene/debug/mem.h Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -70,9 +70,9 @@ "enable various projects that test alternative build switches" ${ENABLE_COMPILE_TESTS_VALUE}) -OPTION(TESTS_USE_SHARED_LIBRARY - "Link tests against the shared library" - ON) +OPTION(USE_STATIC_SHARED_LIBRARY + "Link libraries and executables against the static linked clucene-shared library instead of shared" + OFF) #check flags... INCLUDE (TestCXXAcceptsFlag) @@ -88,7 +88,7 @@ IF ( GccFlagPg ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") - #todo: add flag to linker also... + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") ENDIF ( GccFlagPg ) ENDIF(ENABLE_GPROF) @@ -118,3 +118,13 @@ ADD_SUBDIRECTORY (src/test) ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL) ADD_SUBDIRECTORY (src/contribs EXCLUDE_FROM_ALL) + +#add uninstall command +#CONFIGURE_FILE( +# "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" +# "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" +# IMMEDIATE @ONLY) + +#ADD_CUSTOM_TARGET(uninstall +# "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + \ No newline at end of file Modified: branches/lucene2_3_2/COPYING =================================================================== --- branches/lucene2_3_2/COPYING 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/COPYING 2008-07-29 10:07:29 UTC (rev 2828) @@ -90,6 +90,15 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + + CLUCENE CONTRIBUTIONS CODE: +PorterStemmer code: couldn't find license. This component is deprecated and will be removed very soon. +Snowball code: needs to be researched. + +Jstreams: needs to be researched + +All code needs to be clearly marked with license headers... Modified: branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/contribs/CLucene/analysis/PorterStemmer.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -9,6 +9,14 @@ Modified by "Hemant Muthiyan" email: hem...@ya... + + The Porter stemmer should be regarded as \x91frozen\x92, that is, strictly defined, + and not amenable to further modification. As a stemmer, it is slightly inferior + to the Snowball English or Porter2 stemmer, which derives from it, and which is + subjected to occasional improvements. For practical work, therefore, the new + Snowball stemmer is recommended. The Porter stemmer is appropriate to IR + research work involving stemming where the experiments need to be exactly + repeatable. */ #ifndef _lucene_analysis_PorterStemmer_ Modified: branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballFilter.h =================================================================== --- branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballFilter.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/contribs/CLucene/snowball/SnowballFilter.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -14,7 +14,7 @@ * * Note: todo: This is not thread safe... */ -class SnowballFilter: public TokenFilter { +class CLUCENE_CONTRIBS_EXPORT SnowballFilter: public TokenFilter { struct sb_stemmer * stemmer; public: Modified: branches/lucene2_3_2/src/contribs/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -2,9 +2,7 @@ INCLUDE (DefineOptions) DEFINE_OPTIONS(EXTRA_OPTIONS) -ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_CONTRIBS_LIB) - set(CMAKE_MODULE_PATH "${clucene-contribs_SOURCE_DIR}/cmake") Include(FindIconv) @@ -125,9 +123,10 @@ +IF ( USE_SHARED_OBJECT_FILES ) + GET_SHARED_FILES(clucene_shared_Files) +ENDIF ( USE_SHARED_OBJECT_FILES ) -GET_SHARED_FILES(clucene_shared_Files) - #create the libraries INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/core ) INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/contribs ) @@ -136,10 +135,14 @@ add_library(clucene-contribs SHARED ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} ) -MESSAGE ( STATUS "${clucene-contrib-libs}" ) +IF ( NOT USE_SHARED_OBJECT_FILES ) + IF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared-static) + ELSE ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared) + ENDIF ( USE_STATIC_SHARED_LIBRARY ) +ENDIF ( NOT USE_SHARED_OBJECT_FILES ) -TARGET_LINK_LIBRARIES(clucene-contribs clucene-core ${clucene-contrib-libs}) - add_library(clucene-contribs-static STATIC ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} ) @@ -149,13 +152,13 @@ SET_TARGET_PROPERTIES(clucene-contribs PROPERTIES VERSION ${CLUCENE_VERSION} SOVERSION ${CLUCENE_SOVERSION} - DEFINE_SYMBOL "CLUCENE_EXPORT_SYMBOLS" + DEFINE_SYMBOL "MAKE_CLUCENE_CONTRIBS_LIB" COMPILE_DEFINITIONS_DEBUG _DEBUG ) SET_TARGET_PROPERTIES(clucene-contribs-static PROPERTIES VERSION ${CLUCENE_VERSION} SOVERSION ${CLUCENE_SOVERSION} - DEFINE_SYMBOL "" + DEFINE_SYMBOL "MAKE_CLUCENE_CONTRIBS_LIB" COMPILE_DEFINITIONS_DEBUG _DEBUG ) Modified: branches/lucene2_3_2/src/core/CLucene/StdHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/StdHeader.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/core/CLucene/StdHeader.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -13,12 +13,12 @@ * which contains platform specific code configured by cmake. */ +//configurations for library +#include "CLucene/CLConfig.h" + //shared header #include "CLucene/SharedHeader.h" -//configurations for library -#include "CLucene/CLConfig.h" - //todo: would be good to deprecate this... it's ugly #define StringArrayWithDeletor CL_NS(util)::CLVector<TCHAR*, CL_NS(util)::Deletor::tcArray > #define StringArray std::vector<TCHAR*> Copied: branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h (from rev 2824, branches/lucene2_3_2/src/shared/CLucene/debug/lucenebase.h) =================================================================== --- branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h (rev 0) +++ branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -0,0 +1,57 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_debug_lucenebase_ +#define _lucene_debug_lucenebase_ + +#ifdef _LUCENE_PRAGMA_ONCE +# pragma once +#endif + +CL_NS_DEF(debug) + +//Lucenebase is the superclass of all clucene objects. It provides +//memory debugging tracking and/or reference counting +class CLUCENE_EXPORT LuceneBase{ +public: + int __cl_refcount; + LuceneBase(){ + __cl_refcount=1; + } + inline int __cl_getref(){ + return __cl_refcount; + } + inline int __cl_addref(){ + __cl_refcount++; + return __cl_refcount; + } + inline int __cl_decref(){ + __cl_refcount--; + return __cl_refcount; + } + virtual ~LuceneBase(){}; +}; + +class CLUCENE_EXPORT LuceneVoidBase{ + public: + #ifdef _DEBUG + //a compile time check to make sure that _CLDELETE and _CLDECDELETE is being + //used correctly. + int dummy__see_mem_h_for_details; + #endif + virtual ~LuceneVoidBase(){}; +}; + +#if defined(LUCENE_ENABLE_REFCOUNT) + #define LUCENE_BASE public CL_NS(debug)::LuceneBase +#else + #define LUCENE_BASE public CL_NS(debug)::LuceneVoidBase +#endif +#define LUCENE_REFBASE public CL_NS(debug)::LuceneBase //this is the base of classes who *always* need refcounting + + +CL_NS_END +#endif //_lucene_debug_lucenebase_ Copied: branches/lucene2_3_2/src/core/CLucene/debug/mem.h (from rev 2824, branches/lucene2_3_2/src/shared/CLucene/debug/mem.h) =================================================================== --- branches/lucene2_3_2/src/core/CLucene/debug/mem.h (rev 0) +++ branches/lucene2_3_2/src/core/CLucene/debug/mem.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -0,0 +1,78 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_debug_mem_h +#define _lucene_debug_mem_h + +//todo: this is a hack... +#ifndef CND_PRECONDITION + #define CND_PRECONDITION(x,y) +#endif + +//Macro for creating new objects +#if defined(LUCENE_ENABLE_REFCOUNT) + #define _CLNEW new +#else + #define _CLNEW new + //todo: get this working again... + //#define LUCENE_BASE_CHECK(obj) (obj)->dummy__see_mem_h_for_details +#endif +#define _CL_POINTER(x) (x==NULL?NULL:(x->__cl_addref()>=0?x:x)) //return a add-ref'd object + +#if defined(_DEBUG) + #if !defined(LUCENE_BASE_CHECK) + #define LUCENE_BASE_CHECK(x) + #endif +#else + #undef LUCENE_BASE_CHECK + #define LUCENE_BASE_CHECK(x) +#endif + +#if defined(_MSC_VER) && (_MSC_VER < 1300) +//6.0 + #define _CLDELETE_CARRAY(x) if (x!=NULL){delete[] const_cast<TCHAR*>(x); x=NULL;} + #define _CLDELETE_CaARRAY(x) if (x!=NULL){delete[] const_cast<char*>(x); x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete[] const_cast<TCHAR*>(x);} + #define _CLDELETE_LCaARRAY(x) if (x!=NULL){delete[] const_cast<char*>(x);} +#endif + +//Macro for creating new arrays +#define _CL_NEWARRAY(type,size) new type[size] +#define _CLDELETE_ARRAY(x) if (x!=NULL){delete [] x; x=NULL;} +#define _CLDELETE_LARRAY(x) if (x!=NULL){delete [] x;} +#ifndef _CLDELETE_CARRAY + #define _CLDELETE_CARRAY(x) if (x!=NULL){delete [] x; x=NULL;} + #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete [] x;} +#endif + +//a shortcut for deleting a carray and all its contents +#define _CLDELETE_CARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; +#define _CLDELETE_CaARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CaARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; +#define _CLDELETE_ARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE(x[xcda]);}_CLDELETE_ARRAY(x)}; +#ifndef _CLDELETE_CaARRAY + #define _CLDELETE_CaARRAY _CLDELETE_CARRAY + #define _CLDELETE_LCaARRAY _CLDELETE_LCARRAY +#endif + +//Macro for deleting +#ifdef LUCENE_ENABLE_REFCOUNT + #define _CLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } + #define _CLLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } +#else + #define _CLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; x=NULL; } + #define _CLLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; } +#endif + +//_CLDECDELETE deletes objects which are *always* refcounted +#define _CLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } +#define _CLLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } + +//_VDelete should be used for deleting non-clucene objects. +//when using reference counting, _CLDELETE casts the object +//into a LuceneBase*. +#define _CLVDELETE(x) if(x!=NULL){delete x; x=NULL;} + +#endif //_lucene_debug_lucenebase_ Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -2,13 +2,13 @@ INCLUDE (DefineOptions) DEFINE_OPTIONS(EXTRA_OPTIONS) -ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_CORE_LIB) #add the files to our groups and core SOURCE_GROUP("analysis" ./CLucene/analysis/*) #seems to be a bug in cmake, can't put these in analysis\\standard folder :( SOURCE_GROUP("analysis-standard" ./CLucene/analysis/standard/*) SOURCE_GROUP("document" ./CLucene/document/*) +SOURCE_GROUP("debug" ./CLucene/debug/*) SOURCE_GROUP("index" ./CLucene/index/*) SOURCE_GROUP("queryParser" ./CLucene/queryParser/*) SOURCE_GROUP("search" ./CLucene/search/*) @@ -117,7 +117,10 @@ ./CLucene/search/DateFilter.cpp ) -GET_SHARED_FILES(clucene_shared_Files) +#if USE_SHARED_OBJECT_FILES then we link directly to the object files (means rebuilding them for the core) +IF ( USE_SHARED_OBJECT_FILES ) + GET_SHARED_FILES(clucene_shared_Files) +ENDIF ( USE_SHARED_OBJECT_FILES ) #find our headers file(GLOB_RECURSE HEADERS ${clucene-core_SOURCE_DIR}/*.h) @@ -138,14 +141,23 @@ SET_TARGET_PROPERTIES(clucene-core PROPERTIES VERSION ${CLUCENE_VERSION} SOVERSION ${CLUCENE_SOVERSION} - DEFINE_SYMBOL "CLUCENE_EXPORT_SYMBOLS" + DEFINE_SYMBOL "MAKE_CLUCENE_CORE_LIB" COMPILE_DEFINITIONS_DEBUG _DEBUG ) +#link the clucene-core library against the releavent clucene-shared library (if we aren't using the object files) +IF ( NOT USE_SHARED_OBJECT_FILES ) + IF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared-static) + ELSE ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared) + ENDIF ( USE_STATIC_SHARED_LIBRARY ) +ENDIF ( NOT USE_SHARED_OBJECT_FILES ) + SET_TARGET_PROPERTIES(clucene-core-static PROPERTIES VERSION ${CLUCENE_VERSION} SOVERSION ${CLUCENE_SOVERSION} - DEFINE_SYMBOL "" + DEFINE_SYMBOL "MAKE_CLUCENE_CORE_LIB" COMPILE_DEFINITIONS_DEBUG _DEBUG ) @@ -168,9 +180,9 @@ # code for installing an script to help cmake applications determint the Strigi # version number -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/StrigiConfig.cmake" " -set(STRIGI_VERSION_MAJOR ${STRIGI_VERSION_MAJOR}) -set(STRIGI_VERSION_MINOR ${STRIGI_VERSION_MINOR}) -set(STRIGI_VERSION_PATCH ${STRIGI_VERSION_PATCH}) -") -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/StrigiConfig.cmake DESTINATION ${LIB_DESTINATION}/strigi) +#file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/StrigiConfig.cmake" " +#set(STRIGI_VERSION_MAJOR ${STRIGI_VERSION_MAJOR}) +#set(STRIGI_VERSION_MINOR ${STRIGI_VERSION_MINOR}) +#set(STRIGI_VERSION_PATCH ${STRIGI_VERSION_PATCH}) +#") +#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/StrigiConfig.cmake DESTINATION ${LIB_DESTINATION}/strigi) Modified: branches/lucene2_3_2/src/demo/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -23,6 +23,6 @@ SET_TARGET_PROPERTIES(cl_demo PROPERTIES - DEFINE_SYMBOL CLUCENE_IMPORT_SYMBOLS + DEFINE_SYMBOL "" ) TARGET_LINK_LIBRARIES(cl_demo clucene-core) Modified: branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -116,23 +116,42 @@ //////////////////////////////////////////////////////// // EXPORTS definition //////////////////////////////////////////////////////// -#ifdef MAKE_CLUCENE_CORE_LIB - #ifdef CLUCENE_EXPORT_SYMBOLS - #if defined(_WIN32) || defined(_WIN64) - #define CLUCENE_EXPORT __declspec(dllexport) - #elif defined(_CL_HAVE_GCCVISIBILITYPATCH) - #define CLUCENE_EXPORT __attribute__ ((visibility("default"))) - #define CLUCENE_LOCAL __attribute__ ((visibility("hidden"))) - #endif - #endif +#if defined(_WIN32) || defined(_WIN64) + #define CLUCENE_EXPORT_DECL __declspec(dllexport) + #define CLUCENE_IMPORT_DECL __declspec(dllimport) +#elif defined(_CL_HAVE_GCCVISIBILITYPATCH) + #define CLUCENE_EXPORT_DECL __attribute__ ((visibility("default"))) + #define CLUCENE_LOCAL_DECL __attribute__ ((visibility("hidden"))) +#endif +#ifndef CLUCENE_EXPORT_DECL + #define CLUCENE_EXPORT_DECL +#endif +#ifndef CLUCENE_IMPORT_DECL + #define CLUCENE_IMPORT_DECL +#endif +#ifndef CLUCENE_LOCAL_DECL + #define CLUCENE_LOCAL_DECL +#endif + +//define for the libraries +#if defined(MAKE_CLUCENE_CORE_LIB) + #define CLUCENE_EXPORT CLUCENE_EXPORT_DECL + #define CLUCENE_LOCAL CLUCENE_LOCAL_DECL #else - #if ( defined(_WIN32) || defined(_WIN64)) && defined(CLUCENE_IMPORT_SYMBOLS) - #define CLUCENE_EXPORT __declspec(dllimport) - #endif + #define CLUCENE_EXPORT CLUCENE_IMPORT_DECL #endif -#ifndef CLUCENE_EXPORT - #define CLUCENE_EXPORT +#if defined(MAKE_CLUCENE_CONTRIBS_LIB) + #define CLUCENE_CONTRIBS_EXPORT CLUCENE_EXPORT_DECL + #define CLUCENE_LOCAL CLUCENE_LOCAL_DECL +#else + #define CLUCENE_CONTRIBS_EXPORT CLUCENE_IMPORT_DECL #endif +#if defined(MAKE_CLUCENE_SHARED_LIB) + #define CLUCENE_SHARED_EXPORT CLUCENE_EXPORT_DECL + #define CLUCENE_LOCAL CLUCENE_LOCAL_DECL +#else + #define CLUCENE_SHARED_EXPORT CLUCENE_IMPORT_DECL +#endif #ifndef CLUCENE_LOCAL #define CLUCENE_LOCAL #endif Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_tchar.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_tchar.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_tchar.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -105,10 +105,10 @@ #endif //HAVE_TCHAR_H //new [] based strdup. if we change to using malloc, then we have to free strings (not delete[]) -char* lucenestrdup(const char* v); +CLUCENE_SHARED_EXPORT char* lucenestrdup(const char* v); #ifdef _UCS2 #define stringDuplicate(x) lucenewcsdup(x) - wchar_t* lucenewcsdup(const wchar_t* v); + CLUCENE_SHARED_EXPORT wchar_t* lucenewcsdup(const wchar_t* v); #else #define stringDuplicate(x) lucenestrdup(x) #endif Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -16,41 +16,41 @@ #endif -int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src); -TCHAR* cl_tcscasefold( TCHAR * str, int len=-1 ); +CLUCENE_SHARED_EXPORT int cl_tcscasefoldcmp(const TCHAR * dst, const TCHAR * src); +CLUCENE_SHARED_EXPORT TCHAR* cl_tcscasefold( TCHAR * str, int len=-1 ); //we provide utf8 conversion functions -size_t lucene_utf8towc (wchar_t *ret, const char *s, size_t n); -size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen); -size_t lucene_wctoutf8 (char * ret, const wchar_t str); -size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); -size_t lucene_utf8charlen(const char *p); +CLUCENE_SHARED_EXPORT size_t lucene_utf8towc (wchar_t *ret, const char *s, size_t n); +CLUCENE_SHARED_EXPORT size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen); +CLUCENE_SHARED_EXPORT size_t lucene_wctoutf8 (char * ret, const wchar_t str); +CLUCENE_SHARED_EXPORT size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); +CLUCENE_SHARED_EXPORT size_t lucene_utf8charlen(const char *p); //string function replacements #if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_WCSCASECMP)) || (defined(_ASCII) && !defined(_CL_HAVE_FUNCTION_STRCASECMP)) - int lucene_tcscasecmp(const TCHAR *, const TCHAR *); + CLUCENE_SHARED_EXPORT int lucene_tcscasecmp(const TCHAR *, const TCHAR *); #undef _tcsicmp #define _tcsicmp lucene_tcscasecmp #endif #if defined(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS) || (defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_WCSLWR)) || (defined(_ASCII) && !defined(_CL_HAVE_FUNCTION_STRLWR)) - TCHAR* lucene_tcslwr( TCHAR* str ); + CLUCENE_SHARED_EXPORT TCHAR* lucene_tcslwr( TCHAR* str ); #undef _tcslwr #define _tcslwr lucene_tcslwr #endif //conversion functions #if (defined(_ASCII) && !defined(_CL_HAVE_FUNCTION_LLTOA)) || (defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_LLTOW)) - TCHAR* lucene_i64tot( int64_t value, TCHAR* str, int radix); + CLUCENE_SHARED_EXPORT TCHAR* lucene_i64tot( int64_t value, TCHAR* str, int radix); #undef _i64tot #define _i64tot lucene_i64tot #endif #if (defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_WCSTOLL)) || (defined(_ASCII) && !defined(_CL_HAVE_FUNCTION_STRTOLL)) - int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix); + CLUCENE_SHARED_EXPORT int64_t lucene_tcstoi64(const TCHAR* str, TCHAR**end, int radix); #undef _tcstoi64 #define _tcstoi64 lucene_tcstoi64 #endif #if defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_WCSTOD) - double lucene_tcstod(const TCHAR *value, TCHAR **end); + CLUCENE_SHARED_EXPORT double lucene_tcstod(const TCHAR *value, TCHAR **end); #undef _tcstod #define _tcstod lucene_tcstod #endif @@ -59,17 +59,17 @@ #if (defined(_UCS2) && (!defined(_CL_HAVE_FUNCTION__SNWPRINTF)) || defined(_CL_HAVE_SNWPRINTF_BUG) ) #undef _sntprintf #define _sntprintf lucene_snwprintf - int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...); + CLUCENE_SHARED_EXPORT int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...); #endif #if defined(_UCS2) && !defined(_CL_HAVE_FUNCTION_WPRINTF) #undef _tprintf #define _tprintf lucene_wprintf - void lucene_wprintf(const wchar_t * format, ...); + CLUCENE_SHARED_EXPORT void lucene_wprintf(const wchar_t * format, ...); #endif #if defined(_UCS2) && (!defined(_CL_HAVE_FUNCTION__VSNWPRINTF) || defined(_CL_HAVE_SNWPRINTF_BUG) ) #undef _vsntprintf #define _vsntprintf lucene_vsnwprintf - int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap); + CLUCENE_SHARED_EXPORT int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap); #endif Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_wctype.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_wctype.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_wctype.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -66,11 +66,11 @@ //the methods contained in gunichartables.h typedef unsigned long clunichar; -bool cl_isletter(clunichar c); -bool cl_isalnum(clunichar c); -bool cl_isdigit(clunichar c); -bool cl_isspace (clunichar c); -TCHAR cl_tolower (TCHAR c); -TCHAR cl_toupper (TCHAR c); +CLUCENE_SHARED_EXPORT bool cl_isletter(clunichar c); +CLUCENE_SHARED_EXPORT bool cl_isalnum(clunichar c); +CLUCENE_SHARED_EXPORT bool cl_isdigit(clunichar c); +CLUCENE_SHARED_EXPORT bool cl_isspace (clunichar c); +CLUCENE_SHARED_EXPORT TCHAR cl_tolower (TCHAR c); +CLUCENE_SHARED_EXPORT TCHAR cl_toupper (TCHAR c); #endif Deleted: branches/lucene2_3_2/src/shared/CLucene/debug/lucenebase.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/debug/lucenebase.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/debug/lucenebase.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -1,57 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_debug_lucenebase_ -#define _lucene_debug_lucenebase_ - -#ifdef _LUCENE_PRAGMA_ONCE -# pragma once -#endif - -CL_NS_DEF(debug) - -//Lucenebase is the superclass of all clucene objects. It provides -//memory debugging tracking and/or reference counting -class CLUCENE_EXPORT LuceneBase{ -public: - int __cl_refcount; - LuceneBase(){ - __cl_refcount=1; - } - inline int __cl_getref(){ - return __cl_refcount; - } - inline int __cl_addref(){ - __cl_refcount++; - return __cl_refcount; - } - inline int __cl_decref(){ - __cl_refcount--; - return __cl_refcount; - } - virtual ~LuceneBase(){}; -}; - -class CLUCENE_EXPORT LuceneVoidBase{ - public: - #ifdef _DEBUG - //a compile time check to make sure that _CLDELETE and _CLDECDELETE is being - //used correctly. - int dummy__see_mem_h_for_details; - #endif - virtual ~LuceneVoidBase(){}; -}; - -#if defined(LUCENE_ENABLE_REFCOUNT) - #define LUCENE_BASE public CL_NS(debug)::LuceneBase -#else - #define LUCENE_BASE public CL_NS(debug)::LuceneVoidBase -#endif -#define LUCENE_REFBASE public CL_NS(debug)::LuceneBase //this is the base of classes who *always* need refcounting - - -CL_NS_END -#endif //_lucene_debug_lucenebase_ Deleted: branches/lucene2_3_2/src/shared/CLucene/debug/mem.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/debug/mem.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/debug/mem.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -1,78 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#ifndef _lucene_debug_mem_h -#define _lucene_debug_mem_h - -//todo: this is a hack... -#ifndef CND_PRECONDITION - #define CND_PRECONDITION(x,y) -#endif - -//Macro for creating new objects -#if defined(LUCENE_ENABLE_REFCOUNT) - #define _CLNEW new -#else - #define _CLNEW new - //todo: get this working again... - //#define LUCENE_BASE_CHECK(obj) (obj)->dummy__see_mem_h_for_details -#endif -#define _CL_POINTER(x) (x==NULL?NULL:(x->__cl_addref()>=0?x:x)) //return a add-ref'd object - -#if defined(_DEBUG) - #if !defined(LUCENE_BASE_CHECK) - #define LUCENE_BASE_CHECK(x) - #endif -#else - #undef LUCENE_BASE_CHECK - #define LUCENE_BASE_CHECK(x) -#endif - -#if defined(_MSC_VER) && (_MSC_VER < 1300) -//6.0 - #define _CLDELETE_CARRAY(x) if (x!=NULL){delete[] const_cast<TCHAR*>(x); x=NULL;} - #define _CLDELETE_CaARRAY(x) if (x!=NULL){delete[] const_cast<char*>(x); x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete[] const_cast<TCHAR*>(x);} - #define _CLDELETE_LCaARRAY(x) if (x!=NULL){delete[] const_cast<char*>(x);} -#endif - -//Macro for creating new arrays -#define _CL_NEWARRAY(type,size) new type[size] -#define _CLDELETE_ARRAY(x) if (x!=NULL){delete [] x; x=NULL;} -#define _CLDELETE_LARRAY(x) if (x!=NULL){delete [] x;} -#ifndef _CLDELETE_CARRAY - #define _CLDELETE_CARRAY(x) if (x!=NULL){delete [] x; x=NULL;} - #define _CLDELETE_LCARRAY(x) if (x!=NULL){delete [] x;} -#endif - -//a shortcut for deleting a carray and all its contents -#define _CLDELETE_CARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; -#define _CLDELETE_CaARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE_CaARRAY(x[xcda]);}_CLDELETE_ARRAY(x)}; -#define _CLDELETE_ARRAY_ALL(x) {if ( x!=NULL ){ for(int xcda=0;x[xcda]!=NULL;xcda++)_CLDELETE(x[xcda]);}_CLDELETE_ARRAY(x)}; -#ifndef _CLDELETE_CaARRAY - #define _CLDELETE_CaARRAY _CLDELETE_CARRAY - #define _CLDELETE_LCaARRAY _CLDELETE_LCARRAY -#endif - -//Macro for deleting -#ifdef LUCENE_ENABLE_REFCOUNT - #define _CLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } - #define _CLLDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } -#else - #define _CLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; x=NULL; } - #define _CLLDELETE(x) if (x!=NULL){ LUCENE_BASE_CHECK(x); delete x; } -#endif - -//_CLDECDELETE deletes objects which are *always* refcounted -#define _CLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; x=NULL; } -#define _CLLDECDELETE(x) if (x!=NULL){ CND_PRECONDITION((x)->__cl_refcount>=0,"__cl_refcount was < 0"); if ((x)->__cl_decref() <= 0)delete x; } - -//_VDelete should be used for deleting non-clucene objects. -//when using reference counting, _CLDELETE casts the object -//into a LuceneBase*. -#define _CLVDELETE(x) if(x!=NULL){delete x; x=NULL;} - -#endif //_lucene_debug_lucenebase_ Modified: branches/lucene2_3_2/src/shared/CLucene/util/Misc.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/Misc.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/util/Misc.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -10,7 +10,7 @@ CL_NS_DEF(util) /** A class containing various functions. */ - class Misc{ + class CLUCENE_SHARED_EXPORT Misc{ public: static uint64_t currentTimeMillis(); static const TCHAR* replace_all( const TCHAR* val, const TCHAR* srch, const TCHAR* repl ); Modified: branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -8,7 +8,7 @@ #define _lucene_util_StringBuffer_ CL_NS_DEF(util) - class StringBuffer:LUCENE_BASE{ + class CLUCENE_SHARED_EXPORT StringBuffer:LUCENE_BASE{ public: ///Constructor. Allocates a buffer with the default length. StringBuffer(); Modified: branches/lucene2_3_2/src/shared/CLucene/util/dirent.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-07-29 10:07:29 UTC (rev 2828) @@ -70,18 +70,18 @@ * Returns a pointer to a DIR structure appropriately filled in to begin * searching a directory. */ -DIR* opendir (const char* filespec); +CLUCENE_SHARED_EXPORT DIR* opendir (const char* filespec); /** * Return a pointer to a dirent structure filled with the information on the * next entry in the directory. */ -struct dirent* readdir (DIR* dir); +CLUCENE_SHARED_EXPORT struct dirent* readdir (DIR* dir); /** * Frees up resources allocated by opendir. */ -int32_t closedir (DIR* dir); +CLUCENE_SHARED_EXPORT int32_t closedir (DIR* dir); #elif defined (_CL_HAVE_DIRENT_H) Modified: branches/lucene2_3_2/src/shared/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/shared/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/shared/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -228,29 +228,64 @@ SOURCE_GROUP("util" ./CLucene/util/*) MACRO (GET_SHARED_FILES result) + IF ( "" STREQUAL "${ARGV2}" ) + SET ( rel ${clucene-shared_SOURCE_DIR} ) + ELSE ( "" STREQUAL "${ARGV2}" ) + SET ( rel ${ARGV2} ) + ENDIF ( "" STREQUAL "${ARGV2}" ) + SET(${result} - ${clucene-shared_SOURCE_DIR}/CLucene/SharedHeader.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/gunichartables.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_tcslwr.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_tcstoll.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_tcscasecmp.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_tprintf.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_lltot.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/repl_tcstod.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/utf8.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/config/threads.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/debug/condition.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/debug/error.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/util/StringBuffer.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/util/Misc.cpp - ${clucene-shared_SOURCE_DIR}/CLucene/util/dirent.cpp + ${rel}/CLucene/SharedHeader.cpp + ${rel}/CLucene/debug/error.cpp + ${rel}/CLucene/config/gunichartables.cpp + ${rel}/CLucene/config/repl_tcslwr.cpp + ${rel}/CLucene/config/repl_tcstoll.cpp + ${rel}/CLucene/config/repl_tcscasecmp.cpp + ${rel}/CLucene/config/repl_tprintf.cpp + ${rel}/CLucene/config/repl_lltot.cpp + ${rel}/CLucene/config/repl_tcstod.cpp + ${rel}/CLucene/config/utf8.cpp + ${rel}/CLucene/config/threads.cpp + ${rel}/CLucene/debug/condition.cpp + ${rel}/CLucene/util/StringBuffer.cpp + ${rel}/CLucene/util/Misc.cpp + ${rel}/CLucene/util/dirent.cpp ) ENDMACRO (GET_SHARED_FILES) +GET_SHARED_FILES(clucene_shared_Files ".") + +#find our headers +file(GLOB_RECURSE HEADERS ${clucene-shared_SOURCE_DIR}/*.h) + + +add_library(clucene-shared SHARED + ${clucene_shared_Files} ${HEADERS} +) +add_library(clucene-shared-static STATIC + ${clucene_shared_Files} ${HEADERS} +) + +#set properties on the libraries +SET_TARGET_PROPERTIES(clucene-shared PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + DEFINE_SYMBOL "MAKE_CLUCENE_SHARED_LIB" + COMPILE_DEFINITIONS_DEBUG _DEBUG +) +SET_TARGET_PROPERTIES(clucene-shared-static PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + DEFINE_SYMBOL "MAKE_CLUCENE_SHARED_LIB" + COMPILE_DEFINITIONS_DEBUG _DEBUG +) + #install public headers. install(FILES ${clucene-shared_SOURCE_DIR}/CLucene/SharedHeader.h DESTINATION include/CLucene ) install(FILES ${clucene-shared_SOURCE_DIR}/CLucene/LuceneThreads.h DESTINATION include/CLucene ) -install(FILES ${clucene-shared_SOURCE_DIR}/CLucene/debug/lucenebase.h DESTINATION include/CLucene/debug ) -install(FILES ${clucene-shared_SOURCE_DIR}/CLucene/debug/mem.h DESTINATION include/CLucene/debug ) -install(FILES ${clucene-shared_SOURCE_DIR}/CLucene/debug/error.h DESTINATION include/CLucene/debug ) +IF ( NOT USE_SHARED_OBJECT_FILES ) + IF ( NOT USE_STATIC_SHARED_LIBRARY ) + install(TARGETS clucene-shared DESTINATION lib) + ENDIF ( NOT USE_STATIC_SHARED_LIBRARY ) +ENDIF ( NOT USE_SHARED_OBJECT_FILES ) Modified: branches/lucene2_3_2/src/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/test/CMakeLists.txt 2008-07-27 16:06:19 UTC (rev 2827) +++ branches/lucene2_3_2/src/test/CMakeLists.txt 2008-07-29 10:07:29 UTC (rev 2828) @@ -42,18 +42,22 @@ ./util/English.cpp ${test_HEADERS} ) -GET_SHARED_FILES(clucene_shared_Files) +IF ( USE_SHARED_OBJECT_FILES ) + GET_SHARED_FILES(clucene_shared_Files) +ENDIF ( USE_SHARED_OBJECT_FILES ) #todo: do glob header and include header files for IDE. ADD_EXECUTABLE(cl_test EXCLUDE_FROM_ALL ${clucene_shared_Files} ${test_files} ) +SET_TARGET_PROPERTIES(cl_test PROPERTIES DEFINE_SYMBOL "") -IF (TESTS_USE_SHARED_LIBRARY) - TARGET_LINK_LIBRARIES(cl_test clucene-core) - SET_TARGET_PROPERTIES(cl_test PROPERTIES DEFINE_SYMBOL "CLUCENE_IMPORT_SYMBOLS") -ELSE (TESTS_USE_SHARED_LIBRARY) - TARGET_LINK_LIBRARIES(cl_test clucene-core-static) - SET_TARGET_PROPERTIES(cl_test PROPERTIES DEFINE_SYMBOL "") -ENDIF (TESTS_USE_SHARED_LIBRARY) +#link the executable against the releavent clucene-shared library (if we aren't using the object files) +IF ( NOT USE_SHARED_OBJECT_FILES ) + IF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(cl_test clucene-shared-static) + ELSE ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(cl_test clucene-shared) + ENDIF ( USE_STATIC_SHARED_LIBRARY ) +ENDIF ( NOT USE_SHARED_OBJECT_FILES ) ############################ #special tests: @@ -74,51 +78,53 @@ ENDIF ( GccFlagG ) IF ( GccFlagWall ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wall") ENDIF ( GccFlagWall ) IF ( GccFlagPedantic ) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pedantic") ENDIF ( GccFlagPedantic ) ADD_EXECUTABLE(cl_test-pedantic EXCLUDE_FROM_ALL ${test_monolithic_Files}) SET_TARGET_PROPERTIES(cl_test-pedantic PROPERTIES COMPILE_DEFINITIONS "") ADD_CUSTOM_TARGET(test-pedantic COMMENT "Running cl_test-pedantic" - COMMAND cl_test-pedantic + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-pedantic DEPENDS cl_test-pedantic) ADD_EXECUTABLE(cl_test-ascii EXCLUDE_FROM_ALL ${test_monolithic_Files} ) SET_TARGET_PROPERTIES(cl_test-ascii PROPERTIES COMPILE_DEFINITIONS "_ASCII") ADD_CUSTOM_TARGET(test-ascii COMMENT "Running cl_test-ascii" - COMMAND cl_test-ascii + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-ascii DEPENDS cl_test-ascii) ADD_EXECUTABLE(cl_test-namespace EXCLUDE_FROM_ALL ${test_monolithic_Files} ) SET_TARGET_PROPERTIES(cl_test-namespace PROPERTIES COMPILE_DEFINITIONS "DISABLE_NAMESPACE") ADD_CUSTOM_TARGET(test-namespace COMMENT "Running cl_test-namespace" - COMMAND cl_test-namespace + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-namespace DEPENDS cl_test-namespace) ADD_EXECUTABLE(cl_test-mmap EXCLUDE_FROM_ALL ${test_monolithic_Files} ) SET_TARGET_PROPERTIES(cl_test-mmap PROPERTIES COMPILE_DEFINITIONS "LUCENE_FS_MMAP") ADD_CUSTOM_TARGET(test-mmap COMMENT "Running cl_test-mmap" - COMMAND cl_test-mmap + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-mmap DEPENDS cl_test-mmap) ADD_EXECUTABLE(cl_test-singlethreading EXCLUDE_FROM_ALL ${test_monolithic_Files} ) SET_TARGET_PROPERTIES(cl_test-singlethreading PROPERTIES COMPILE_DEFINITIONS "_CL_DISABLE_MULTITHREADING") ADD_CUSTOM_TARGET(test-singlethreading COMMENT "Running cl_test-singlethreading" - COMMAND cl_test-singlethreading + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-singlethreading DEPENDS cl_test-singlethreading) ADD_EXECUTABLE(cl_test-refcnt EXCLUDE_FROM_ALL ${test_monolithic_Files} ) SET_TARGET_PROPERTIES(cl_test-refcnt PROPERTIES COMPILE_DEFINITIONS "LUCENE_ENABLE_REFCOUNT") ADD_CUSTOM_TARGET(test-refcnt COMMENT "Running cl_test-refcnt" - COMMAND cl_test-refcnt + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-refcnt DEPENDS cl_test-refcnt) ADD_EXECUTABLE(cl_test-platform-charfuncs EXCLUDE_FROM_ALL ${test_monolithic_Files} ) @@ -127,7 +133,7 @@ #internal functions do not produce the exact results expected. ADD_CUSTOM_TARGET(test-platform-charfuncs COMMENT "Running cl_test-platform-charfuncs" - COMMAND cl_test-platform-charfuncs + COMMAND ${EXECUTABLE_OUTPUT_PATH}/cl_test-platform-charfuncs DEPENDS cl_test-platform-charfuncs) SET(CMAKE_CXX_FLAGS_DEBUG) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-07-30 18:19:03
|
Revision: 2833 http://clucene.svn.sourceforge.net/clucene/?rev=2833&view=rev Author: ustramooner Date: 2008-07-30 18:18:57 +0000 (Wed, 30 Jul 2008) Log Message: ----------- * added a uninstall target. * only show ENABLE_GPROF if it is supported by the compiler (currently only gcc) * re-worked the install location for system-dependent files (clucene-config.h). this was a confusing issue, and i think it's better to stick to the standards rather than push the more compatible (in my opinion) way of doing things. this one has been getting so many complaints from downstream. however, LUCENE_SYS_INCLUDES is available to install the clucene-config.h type files into the library directory (or any other place). Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt Added Paths: ----------- branches/lucene2_3_2/cmake/cmake_uninstall.cmake.in Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-07-30 18:15:27 UTC (rev 2832) +++ branches/lucene2_3_2/CMakeLists.txt 2008-07-30 18:18:57 UTC (rev 2833) @@ -53,13 +53,15 @@ OPTION(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS "use internal character functions. required to run tests correctly" ON) -OPTION(ENABLE_GPROF - "turn on gprof profiling support" - OFF) OPTION(ENABLE_PACKAGING "create build scripts for creating clucene packages" OFF) +OPTION(LUCENE_SYS_INCLUDES + "location for non-system independent files. defaults to CMAKE_INSTALL_PREFIX. see INSTALL documentation for further information." + "") + + SET ( ENABLE_COMPILE_TESTS_VALUE ON ) IF ( MSVC_IDE ) #this is annoying... @@ -81,16 +83,21 @@ IF ( GccFlagG ) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") ENDIF ( GccFlagG ) -ENDIF ( CMAKE_COMPILER_IS_GNUCC ) -IF(ENABLE_GPROF) CHECK_CXX_ACCEPTS_FLAG(-pg GccFlagPg) - IF ( GccFlagPg ) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") + OPTION(ENABLE_GPROF + "turn on gprof profiling support" + OFF) + + IF ( ENABLE_GPROF ) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pg") + ENDIF ( ENABLE_GPROF ) ENDIF ( GccFlagPg ) -ENDIF(ENABLE_GPROF) +ENDIF(CMAKE_COMPILER_IS_GNUCC) IF (ENABLE_PACKAGING) INCLUDE(CreateClucenePackages) @@ -120,11 +127,10 @@ ADD_SUBDIRECTORY (src/contribs EXCLUDE_FROM_ALL) #add uninstall command -#CONFIGURE_FILE( -# "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" -# "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" -# IMMEDIATE @ONLY) +CONFIGURE_FILE( + "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) -#ADD_CUSTOM_TARGET(uninstall -# "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") - \ No newline at end of file +ADD_CUSTOM_TARGET(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") Added: branches/lucene2_3_2/cmake/cmake_uninstall.cmake.in =================================================================== --- branches/lucene2_3_2/cmake/cmake_uninstall.cmake.in (rev 0) +++ branches/lucene2_3_2/cmake/cmake_uninstall.cmake.in 2008-07-30 18:18:57 UTC (rev 2833) @@ -0,0 +1,23 @@ +IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling \"${file}\"") + IF(EXISTS "${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF("${rm_retval}" STREQUAL 0) + ELSE("${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") + ENDIF("${rm_retval}" STREQUAL 0) + + #ELSE(EXISTS "${file}") + # MESSAGE(STATUS "File \"${file}\" does not exist.") + ENDIF(EXISTS "${file}") +ENDFOREACH(file) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-08-03 10:03:29
|
Revision: 2853 http://clucene.svn.sourceforge.net/clucene/?rev=2853&view=rev Author: ustramooner Date: 2008-08-03 10:03:19 +0000 (Sun, 03 Aug 2008) Log Message: ----------- fixed discovered by dist-test.sh: non-inline code in headers (moved to cpp files) headers not compiling independently of each other moved Term_Compare and Term_Equals to private created a CLUCENE(_SHARED)_INLINE_EXPORT to work with ming, and to inform tests that something is meant to be inline virtual destructors for safe export fixed licenses Modified Paths: -------------- branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h branches/lucene2_3_2/src/core/CLucene/index/Term.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.h branches/lucene2_3_2/src/core/CLucene/search/Compare.h branches/lucene2_3_2/src/core/CLucene/search/Hits.h branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp branches/lucene2_3_2/src/core/CLucene/search/Sort.h branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp branches/lucene2_3_2/src/core/CLucene/store/Directory.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h branches/lucene2_3_2/src/core/CLucene/util/Equators.h branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h branches/lucene2_3_2/src/core/CLucene/util/Reader.h branches/lucene2_3_2/src/core/CLucene/util/VoidList.h branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h branches/lucene2_3_2/src/core/CLucene/util/stringreader.h branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/util/dirent.h Added Paths: ----------- branches/lucene2_3_2/src/core/CLucene/index/_Term.h Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/dist-test.sh 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,7 +8,7 @@ echo "usage: ../dist-test.sh [all | " echo " <env - creates environment>" echo " <c_all - compile all headers together>" - echo " <t_all - run test-all>" + echo " <compile - compile and test>" echo " <inline - test for inline using doxygen documents>]" echo " <c_header - test that each header compiles independently of each other>]" echo " <license - test that each header has a valid license>]" @@ -20,11 +20,12 @@ t_env=0 t_c_all=0 t_inline=0 -t_t_all=0 +t_compile=0 t_c_h=0 t_license=0 t_ifdefs=0 t_exports=0 +FAIL=0 if [ $# == 0 ]; then usage @@ -38,8 +39,8 @@ t_c_all=1 elif [ "$1" == "inline" ]; then t_inline=1 - elif [ "$1" == "t_all" ]; then - t_t_all=1 + elif [ "$1" == "compile" ]; then + t_compile=1 elif [ "$1" == "c_header" ]; then t_c_h=1 elif [ "$1" == "license" ]; then @@ -60,7 +61,7 @@ t_c_all=1 t_c_h=1 t_inline=1 - t_t_all=1 + t_compile=1 t_license=1 t_ifdefs=1 t_exports=1 @@ -74,7 +75,7 @@ I=`expr $I + 1` if [ $I -gt 1 ]; then echo $1 has invalid ifdef: $line - exit 1 + FAIL=1 fi done } @@ -96,7 +97,7 @@ #move headers somewhere to compile mkdir -p "$TMP/$DH" 2>/dev/null - cp "$H" "$TMP/${H:3}" + ln -s "`realpath $H`" "$TMP/${H:3}" 2>/dev/null #create pub-headers.cpp echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp @@ -108,13 +109,22 @@ echo "int main(){return 0;}" >>$TMP/pub-headers.cpp fi +#find inline code: +if [ $t_inline == 1 ]; then + if [ $t_env == 1 ]; then + make doc + if [ $? != 0 ]; then + exit 1 + fi + fi +fi ################################################ #now the environment is finished being setup... ################################################ echo "Starting tests..." -if [ $t_c_h == 1 ] || [ $t_license == 1 ] || [ $t_ifdefs == 1 ] || [ $t_exports == 1 ]; then +if [ $t_c_h == 1 ] || [ $t_ifdefs == 1 ] || [ $t_exports == 1 ]; then for H in `find $TMP/src | grep "\.h$"`; do BH=`basename "$H"` DH=`dirname "${H:3}"` @@ -124,48 +134,85 @@ fi #check that all classes are exported - if [ $t_exports ]; then - XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_SHARED_EXPORT` + if [ $t_exports == 1 ]; then + XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` if [ "$XX" != "" ]; then echo "$H has unexported class: $XX" echo "" + FAIL=1 fi fi - #check licenses - if [ $t_license == 1 ]; then - if [ "`awk '/Copyright \(C\) 2003-2006 Ben van Klinken and the CLucene Team/ { print $line }' $H`" == "" ]; then - echo "$H has invalid license" - fi - fi - #test that each header compiles independently... if [ $t_c_h == 1 ]; then - echo "Compiling $H" echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-header.cpp echo "#include \"$H"\" >>$TMP/pub-header.cpp echo "int main(){return 0;}" >>$TMP/pub-header.cpp g++ -I. -I$TMP/src/shared -I$TMP/src/core $TMP/pub-header.cpp - if [ $? != 0 ]; then exit 1; fi + if [ $? != 0 ]; then + FAIL=1; + fi fi done fi +#iterate all our code... +if [ $t_license == 1 ]; then + for H in `find ../src`; do + BH=`basename "$H"` + BH_len=${#BH} + + if [ "${BH:BH_len-2}" == ".h" ] || [ "${BH:BH_len-2}" == ".c" ] || [ "${BH:BH_len-4}" == ".cpp" ]; then + if [ "`awk '/\* Copyright \(C\) [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then + echo "$H has invalid license" + FAIL=1 + fi + fi + done + +fi + + #test if headers can compile together by themselves: if [ $t_c_all == 1 ]; then g++ -I$TMP/src -I$TMP/src/shared -I$TMP/src/core $TMP/pub-headers.cpp fi -#find inline code: if [ $t_inline == 1 ]; then - if [ $t_env == 1 ]; then - make DoxygenDoc - fi - echo "These documentation files report inline code. This is not good." - grep -c "\[inline" doc/html/*.html|grep -v ":0$"|grep -v "util"|grep -v "jstreams" | nl + INLINES=0 + grep -c "\[inline" doc/html/*.html|grep -v ":0$"|grep -v "util"|grep -v "jstreams" | while read line; do + + #ignore some actual inlines... + if [ "doc/html/classlucene_1_1index_1_1Term.html:1" == $line ]; then + continue; + fi + + if [ $INLINES == 0 ]; then + echo "These files report inline code:" + INLINES=1 + FAIL=1 + fi + echo $line + done fi -if [ $t_t_all == 1 ]; then - #test pedantically +if [ $t_compile == 1 ]; then + #compile serperately + make cl_test + if [ $? != 0 ]; then + FAIL=1; + fi + + #compile together make test-all + if [ $? != 0 ]; then + FAIL=1; + fi fi + + +if [ $FAIL == 1 ]; then + echo "There were errors, please correct them and re-run" + exit 1 +fi +exit 0 Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -89,10 +89,34 @@ setText(text); } +size_t Token::bufferLength(){ + return bufferTextLen; +} + + +int32_t Token::startOffset() const { + return _startOffset; +} + +void Token::setStartOffset(const int32_t val){ + _startOffset = val; +} +int32_t Token::endOffset() const { + return _endOffset; +} const TCHAR* Token::getDefaultType(){ return _T("word"); } +void Token::setEndOffset(const int32_t val){ + _endOffset = val; +} +const TCHAR* Token::type() const { return _type; } + +void Token::setType(const TCHAR* val) { + _type = val; +} + void Token::set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ){ _startOffset = start; _endOffset = end; @@ -208,7 +232,10 @@ return t; } +TokenStream::~TokenStream(){ +} + TokenFilter::TokenFilter(TokenStream* in, bool deleteTS): input(in), deleteTokenStream(deleteTS) Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,6 +8,7 @@ #define _lucene_analysis_AnalysisHeader_ #include "CLucene/index/Payload.h" +#include "CLucene/util/VoidMapSetDefinitions.h" CL_CLASS_DEF(util,Reader) CL_NS_DEF(analysis) @@ -80,7 +81,7 @@ Token(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=NULL); void set(const TCHAR* text, const int32_t start, const int32_t end, const TCHAR* typ=NULL); - size_t bufferLength(){ return bufferTextLen; } + size_t bufferLength(); void growBuffer(size_t size); /** Set the position increment. This determines the position of this @@ -132,25 +133,25 @@ * equal to termText.length(), as the term text may have been altered by a * stemmer or some other filter. */ - int32_t startOffset() const { return _startOffset; } + int32_t startOffset() const; /** Set the starting offset. @see #startOffset() */ - void setStartOffset(const int32_t val){ _startOffset = val; } + void setStartOffset(const int32_t val); /** * Returns this Token's ending offset, one greater than the position of the * last character corresponding to this token in the source text. */ - int32_t endOffset() const { return _endOffset; } + int32_t endOffset() const; /** Set the ending offset. @see #endOffset() */ - void setEndOffset(const int32_t val){ _endOffset = val; } + void setEndOffset(const int32_t val); /// Returns this Token's lexical type. Defaults to "word". - const TCHAR* type() const { return _type; } ///<returns reference - void setType(const TCHAR* val) { _type = val; } ///<returns reference + const TCHAR* type() const; ///<returns reference + void setType(const TCHAR* val); ///<returns reference /** * Returns this Token's payload. @@ -206,8 +207,7 @@ */ //virtual void reset(CL_NS(util)::Reader* _input=NULL) = 0; - virtual ~TokenStream(){ - } + virtual ~TokenStream(); }; Modified: branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -17,6 +17,7 @@ #include "IndexWriter.h" #include "_FieldsWriter.h" #include "Term.h" +#include "_Term.h" #include "_TermInfo.h" #include "_TermVector.h" #include "_TermInfosWriter.h" Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -367,6 +367,13 @@ return _termPositions; } + void IndexReader::deleteDoc(const int32_t docNum){ + deleteDocument(docNum); + } + int32_t IndexReader::deleteTerm(Term* term){ + return deleteDocuments(term); + } + void IndexReader::deleteDocument(const int32_t docNum) { //Func - Deletes the document numbered docNum. Once a document is deleted it will not appear // in TermDocs or TermPostitions enumerations. Attempts to read its field with the document Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -389,7 +389,7 @@ void deleteDocument(const int32_t docNum); ///@deprecated. Use deleteDocument instead. - _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum){ deleteDocument(docNum); } + _CL_DEPRECATED( deleteDocument ) void deleteDoc(const int32_t docNum); /** Deletes all documents containing <code>term</code>. * This is useful if one uses a document field to hold a unique ID string for @@ -403,7 +403,7 @@ int32_t deleteDocuments(Term* term); ///@deprecated. Use deleteDocuments instead. - _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term){ return deleteDocuments(term); } + _CL_DEPRECATED( deleteDocuments ) int32_t deleteTerm(Term* term); /** * Closes files associated with this index and also saves any new deletions to disk. Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -729,5 +729,29 @@ // delete now unused files of segment writer->deleteFiles(*filesToDelete); } + + + int32_t IndexWriter::getMaxFieldLength() const{ return maxFieldLength; } + void IndexWriter::setMaxFieldLength(int32_t val){ maxFieldLength = val; } + void IndexWriter::setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } + int32_t IndexWriter::getMaxBufferedDocs(){ return minMergeDocs; } + void IndexWriter::setWriteLockTimeout(int64_t writeLockTimeout) { this->writeLockTimeout = writeLockTimeout; } + int64_t IndexWriter::getWriteLockTimeout() { return writeLockTimeout; } + void IndexWriter::setCommitLockTimeout(int64_t commitLockTimeout) { this->commitLockTimeout = commitLockTimeout; } + int64_t IndexWriter::getCommitLockTimeout() { return commitLockTimeout; } + int32_t IndexWriter::getMergeFactor() const{ return mergeFactor; } + void IndexWriter::setMergeFactor(int32_t val){ mergeFactor = val; } + void IndexWriter::setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } + int32_t IndexWriter::getTermIndexInterval() { return termIndexInterval; } + int32_t IndexWriter::getMinMergeDocs() const{ return minMergeDocs; } + void IndexWriter::setMinMergeDocs(int32_t val){ minMergeDocs = val; } + int32_t IndexWriter::getMaxMergeDocs() const{ return maxMergeDocs; } + void IndexWriter::setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } + CL_NS(store)::Directory* IndexWriter::getDirectory() { return directory; } + bool IndexWriter::getUseCompoundFile() { return useCompoundFile; } + void IndexWriter::setUseCompoundFile(bool value) { useCompoundFile = value; } + void IndexWriter::setSimilarity(CL_NS(search)::Similarity* similarity) { this->similarity = similarity; } + CL_NS(search)::Similarity* IndexWriter::getSimilarity() { return this->similarity; } + CL_NS(analysis)::Analyzer* IndexWriter::getAnalyzer() { return analyzer; } CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -112,8 +112,8 @@ */ LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_MAX_FIELD_LENGTH = 10000); LUCENE_STATIC_CONSTANT(int32_t, FIELD_TRUNC_POLICY__WARN = -1); - int32_t getMaxFieldLength() const{ return maxFieldLength; } - void setMaxFieldLength(int32_t val){ maxFieldLength = val; } + int32_t getMaxFieldLength() const; + void setMaxFieldLength(int32_t val); /** * Default value is 10. Change using {@link #setMaxBufferedDocs(int)}. @@ -126,11 +126,11 @@ * the number of files open in a FSDirectory. * * <p> The default value is DEFAULT_MAX_BUFFERED_DOCS.*/ - void setMaxBufferedDocs(int32_t val){ minMergeDocs = val; } + void setMaxBufferedDocs(int32_t val); /** * @see #setMaxBufferedDocs */ - int32_t getMaxBufferedDocs(){ return minMergeDocs; } + int32_t getMaxBufferedDocs(); /** * Default value for the write lock timeout (1,000). @@ -139,11 +139,11 @@ /** * Sets the maximum time to wait for a write lock (in milliseconds). */ - void setWriteLockTimeout(int64_t writeLockTimeout) { this->writeLockTimeout = writeLockTimeout; } + void setWriteLockTimeout(int64_t writeLockTimeout); /** * @see #setWriteLockTimeout */ - int64_t getWriteLockTimeout() { return writeLockTimeout; } + int64_t getWriteLockTimeout(); /** * Default value for the commit lock timeout (10,000). @@ -152,11 +152,11 @@ /** * Sets the maximum time to wait for a commit lock (in milliseconds). */ - void setCommitLockTimeout(int64_t commitLockTimeout) { this->commitLockTimeout = commitLockTimeout; } + void setCommitLockTimeout(int64_t commitLockTimeout); /** * @see #setCommitLockTimeout */ - int64_t getCommitLockTimeout() { return commitLockTimeout; } + int64_t getCommitLockTimeout(); static const char* WRITE_LOCK_NAME; //"write.lock"; static const char* COMMIT_LOCK_NAME; //"commit.lock"; @@ -175,8 +175,8 @@ * * <p>This must never be less than 2. The default value is 10. */ - int32_t getMergeFactor() const{ return mergeFactor; } - void setMergeFactor(int32_t val){ mergeFactor = val; } + int32_t getMergeFactor() const; + void setMergeFactor(int32_t val); /** Expert: The fraction of terms in the "dictionary" which should be stored @@ -207,12 +207,12 @@ * * @see #DEFAULT_TERM_INDEX_INTERVAL */ - void setTermIndexInterval(int32_t interval) { termIndexInterval = interval; } + void setTermIndexInterval(int32_t interval); /** Expert: Return the interval between indexed terms. * * @see #setTermIndexInterval(int) */ - int32_t getTermIndexInterval() { return termIndexInterval; } + int32_t getTermIndexInterval(); /** Determines the minimal number of documents required before the buffered * in-memory documents are merging and a new Segment is created. @@ -221,8 +221,8 @@ * the number of files open in a FSDirectory. * * <p> The default value is 10.*/ - int32_t getMinMergeDocs() const{ return minMergeDocs; } - void setMinMergeDocs(int32_t val){ minMergeDocs = val; } + int32_t getMinMergeDocs() const; + void setMinMergeDocs(int32_t val); /** Determines the largest number of documents ever merged by addDocument(). * Small values (e.g., less than 10,000) are best for interactive indexing, @@ -239,8 +239,8 @@ * * <p>The default value is {@link Integer#MAX_VALUE}. */ - int32_t getMaxMergeDocs() const{ return maxMergeDocs; } - void setMaxMergeDocs(int32_t val){ maxMergeDocs = val; } + int32_t getMaxMergeDocs() const; + void setMaxMergeDocs(int32_t val); /** * Constructs an IndexWriter for the index in <code>path</code>. @@ -316,36 +316,36 @@ /** Returns the directory this index resides in. */ - CL_NS(store)::Directory* getDirectory() { return directory; } + CL_NS(store)::Directory* getDirectory(); /** Get the current setting of whether to use the compound file format. * Note that this just returns the value you set with setUseCompoundFile(boolean) * or the default. You cannot use this to query the status of an existing index. * @see #setUseCompoundFile(boolean) */ - bool getUseCompoundFile() { return useCompoundFile; } + bool getUseCompoundFile(); /** Setting to turn on usage of a compound file. When on, multiple files * for each segment are merged into a single file once the segment creation * is finished. This is done regardless of what directory is in use. */ - void setUseCompoundFile(bool value) { useCompoundFile = value; } + void setUseCompoundFile(bool value); /** Expert: Set the Similarity implementation used by this IndexWriter. * * @see Similarity#setDefault(Similarity) */ - void setSimilarity(CL_NS(search)::Similarity* similarity) { this->similarity = similarity; } + void setSimilarity(CL_NS(search)::Similarity* similarity); /** Expert: Return the Similarity implementation used by this IndexWriter. * * <p>This defaults to the current value of {@link Similarity#getDefault()}. */ - CL_NS(search)::Similarity* getSimilarity() { return this->similarity; } + CL_NS(search)::Similarity* getSimilarity(); /** Returns the analyzer used by this index. */ - CL_NS(analysis)::Analyzer* getAnalyzer() { return analyzer; } + CL_NS(analysis)::Analyzer* getAnalyzer(); private: class LockWith2; Modified: branches/lucene2_3_2/src/core/CLucene/index/Term.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/Term.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/Term.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -206,6 +206,7 @@ return cachedHashCode; } +size_t Term::textLength() const { return textLen; } int32_t Term::compareTo(const Term* other) const { //Func - Compares two terms, to see if this term belongs before,is equal to or after Modified: branches/lucene2_3_2/src/core/CLucene/index/Term.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/Term.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/index/Term.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -7,12 +7,6 @@ #ifndef _lucene_index_Term_ #define _lucene_index_Term_ - -//#include "CLucene/util/Misc.h" -//#include "CLucene/util/StringIntern.h" -#include "CLucene/util/VoidMapSetDefinitions.h" -# include <functional> - CL_NS_DEF(index) /** @@ -103,7 +97,7 @@ bool equals(const Term* other) const; - size_t textLength() const { return textLen; } + size_t textLength() const; ///Forms the contents of Field and term in some kind of tuple notation ///<field:text> @@ -113,24 +107,5 @@ }; -class Term_Equals:public CL_NS_STD(binary_function)<const Term*,const Term*,bool> -{ -public: - bool operator()( const Term* val1, const Term* val2 ) const{ - return val1->equals(val2); - } -}; - -class Term_Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base //<Term*> -{ -public: - bool operator()( Term* t1, Term* t2 ) const{ - return ( t1->compareTo(t2) < 0 ); - } - size_t operator()( Term* t ) const{ - return t->hashCode(); - } -}; - CL_NS_END #endif Added: branches/lucene2_3_2/src/core/CLucene/index/_Term.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/_Term.h (rev 0) +++ branches/lucene2_3_2/src/core/CLucene/index/_Term.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -0,0 +1,37 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#ifndef _lucene_index_internal_Term_ +#define _lucene_index_internal_Term_ + +#include "CLucene/util/VoidMapSetDefinitions.h" +#include "Term.h" +#include <functional> + +CL_NS_DEF(index) + + +class Term_Equals:public CL_NS_STD(binary_function)<const Term*,const Term*,bool> +{ +public: + bool operator()( const Term* val1, const Term* val2 ) const{ + return val1->equals(val2); + } +}; + +class Term_Compare:LUCENE_BASE, public CL_NS(util)::Compare::_base //<Term*> +{ +public: + bool operator()( Term* t1, Term* t2 ) const{ + return ( t1->compareTo(t2) < 0 ); + } + size_t operator()( Term* t ) const{ + return t->hashCode(); + } +}; + +CL_NS_END +#endif Modified: branches/lucene2_3_2/src/core/CLucene/search/Compare.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Compare.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Compare.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -21,14 +21,14 @@ public: ~ScoreDocComparators(); - class Relevance:public ScoreDocComparator { + class CLUCENE_EXPORT Relevance:public ScoreDocComparator { public: int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j); CL_NS(util)::Comparable* sortValue (struct ScoreDoc* i); int32_t sortType(); }; - class IndexOrder:public ScoreDocComparator{ + class CLUCENE_EXPORT IndexOrder:public ScoreDocComparator{ public: IndexOrder(); int32_t compare (struct ScoreDoc* i, struct ScoreDoc* j); @@ -37,7 +37,7 @@ }; - class String: public ScoreDocComparator { + class CLUCENE_EXPORT String: public ScoreDocComparator { FieldCache::StringIndex* index; int32_t length; public: @@ -48,7 +48,7 @@ int32_t sortType(); }; - class Int32:public ScoreDocComparator{ + class CLUCENE_EXPORT Int32:public ScoreDocComparator{ int32_t* fieldOrder; int32_t length; public: @@ -58,7 +58,7 @@ int32_t sortType(); }; - class Float:public ScoreDocComparator { + class CLUCENE_EXPORT Float:public ScoreDocComparator { float_t* fieldOrder; int32_t length; public: Modified: branches/lucene2_3_2/src/core/CLucene/search/Hits.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Hits.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Hits.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -13,7 +13,7 @@ //#include "Filter.h" CL_CLASS_DEF(document,Document) //#include "Sort.h" -//#include "CLucene/util/VoidList.h" +#include "CLucene/util/VoidMapSetDefinitions.h" //#include "Explanation.h" //#include "Similarity.h" Modified: branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -15,6 +15,7 @@ #include "Searchable.h" #include "Explanation.h" +#include "CLucene/index/_Term.h" #include "CLucene/index/Term.h" #include "CLucene/index/Terms.h" #include "CLucene/index/IndexReader.h" Modified: branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #ifndef _lucene_util_ScorerDocQueue_ #define _lucene_util_ScorerDocQueue_ Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -188,6 +188,10 @@ return _T("Searcher"); } + +Weight::~Weight(){ +} + TCHAR* Weight::toString(){ return STRDUP_TtoT(_T("Weight")); } Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -106,8 +106,7 @@ */ class CLUCENE_EXPORT Weight: LUCENE_BASE { public: - virtual ~Weight(){ - }; + virtual ~Weight(); /** The query that this concerns. */ virtual Query* getQuery() = 0; Modified: branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -92,6 +92,19 @@ return _CLNEW SortField(*this); } + const TCHAR* SortField::getField() const { + return field; + } + int32_t SortField::getType() const { + return type; + } + bool SortField::getReverse() const { + return reverse; + } + SortComparatorSource* SortField::getFactory() const { + return factory; + } + /** Creates a sort by terms in the given field sorted * according to the given locale. * @param field Name of field to sort by, cannot be <code>null</code>. Modified: branches/lucene2_3_2/src/core/CLucene/search/Sort.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Sort.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/Sort.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -236,14 +236,14 @@ * if the sort is by SCORE or DOC. * @return Name of field, possibly <code>null</code>. */ - const TCHAR* getField() const { return field; } + const TCHAR* getField() const; SortField* clone() const; /** Returns the type of contents in the field. * @return One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. */ - int32_t getType() const { return type; } + int32_t getType() const; /** Returns the Locale by which term values are interpreted. * May return <code>null</code> if no Locale was specified. @@ -256,9 +256,9 @@ /** Returns whether the sort should be reversed. * @return True if natural order should be reversed. */ - bool getReverse() const { return reverse; } + bool getReverse() const; - SortComparatorSource* getFactory() const { return factory; } + SortComparatorSource* getFactory() const; TCHAR* toString() const; }; Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -74,6 +74,8 @@ bool WildcardTermEnum::endEnum() { return _endEnum; } + const char* WildcardTermEnum::getObjectName(){ return WildcardTermEnum::getClassName(); } + const char* WildcardTermEnum::getClassName(){ return "WildcardTermEnum"; } bool WildcardTermEnum::wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx) { @@ -149,4 +151,5 @@ } } + CL_NS_END Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -58,8 +58,8 @@ void close(); - const char* getObjectName(){ return WildcardTermEnum::getClassName(); } - static const char* getClassName(){ return "WildcardTermEnum"; } + const char* getObjectName(); + static const char* getClassName(); }; CL_NS_END #endif Modified: branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -6,12 +6,15 @@ ------------------------------------------------------------------------------*/ #include "CLucene/_ApiHeader.h" -#include "Directory.h" -#include "LockFactory.h" +#include "Directory.h" +#include "LockFactory.h" #include "CLucene/util/Misc.h" CL_NS_DEF(store) + +Directory::Directory(){ +} Directory::~Directory(){ } Modified: branches/lucene2_3_2/src/core/CLucene/store/Directory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/Directory.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/Directory.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -36,8 +36,7 @@ protected: LockFactory* lockFactory; - Directory(){ - } + Directory(); // Removes an existing file in the directory. virtual bool doDeleteFile(const char* name) = 0; public: Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -403,7 +403,16 @@ _CLDELETE_CaARRAY(directory); _CLDELETE_CaARRAY(lockDir); } + + void FSDirectory::setUseMMap(bool value){ useMMap = value; } + bool FSDirectory::getUseMMap() const{ return useMMap; } + const char* FSDirectory::DirectoryType(){ return "FS"; } + const char* FSDirectory::getDirectoryType() const{ return "FS"; } + void FSDirectory::setDisableLocks(bool doDisableLocks) { disableLocks = doDisableLocks; } + bool FSDirectory::getDisableLocks() { return disableLocks; } + + void FSDirectory::list(vector<string>* names) const{ //todo: fix this, ugly!!! CND_PRECONDITION(directory[0]!=0,"directory is not open"); DIR* dir = opendir(directory); Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -123,29 +123,29 @@ * If MMap is available, this can disable use of * mmap reading. */ - void setUseMMap(bool value){ useMMap = value; } + void setUseMMap(bool value); /** * Gets whether the directory is using MMap for inputstreams. */ - bool getUseMMap() const{ return useMMap; } + bool getUseMMap() const; TCHAR* toString() const; - static const char* DirectoryType(){ return "FS"; } - const char* getDirectoryType() const{ return "FS"; } + static const char* DirectoryType(); + const char* getDirectoryType() const; /** * Set whether Lucene's use of lock files is disabled. By default, * lock files are enabled. They should only be disabled if the index * is on a read-only medium like a CD-ROM. */ - static void setDisableLocks(bool doDisableLocks) { disableLocks = doDisableLocks; } + static void setDisableLocks(bool doDisableLocks); /** * Returns whether Lucene's use of lock files is disabled. * @return true if locks are disabled, false if locks are enabled. */ - static bool getDisableLocks() { return disableLocks; } + static bool getDisableLocks(); }; Modified: branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp 2008-08-03 10:03:19 UTC (rev 2853) @@ -14,6 +14,9 @@ IndexInput::IndexInput() { } + IndexInput::~IndexInput() + { + } IndexInput::IndexInput(const IndexInput& other) { } Modified: branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -25,7 +25,7 @@ IndexInput(); IndexInput(const IndexInput& clone); public: - virtual ~IndexInput(){} + virtual ~IndexInput(); virtual IndexInput* clone() const =0; DEFINE_MUTEX(THIS_LOCK) Modified: branches/lucene2_3_2/src/core/CLucene/util/Equators.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/Equators.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/Equators.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -19,35 +19,35 @@ // Equators //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class Equals{ +class CLUCENE_INLINE_EXPORT Equals{ public: - class Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> + class CLUCENE_INLINE_EXPORT Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> { public: bool operator()( const int32_t val1, const int32_t val2 ) const; }; - class Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> + class CLUCENE_INLINE_EXPORT Char:public CL_NS_STD(binary_function)<const char*,const char*,bool> { public: bool operator()( const char* val1, const char* val2 ) const; }; #ifdef _UCS2 - class WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> + class CLUCENE_INLINE_EXPORT WChar: public CL_NS_STD(binary_function)<const wchar_t*,const wchar_t*,bool> { public: bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; }; - class TChar: public WChar{ + class CLUCENE_INLINE_EXPORT TChar: public WChar{ }; #else - class TChar: public Char{ + class CLUCENE_INLINE_EXPORT TChar: public Char{ }; #endif template<typename _cl> - class Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> + class CLUCENE_INLINE_EXPORT Void:public CL_NS_STD(binary_function)<const void*,const void*,bool> { public: bool operator()( _cl* val1, _cl* val2 ) const{ @@ -61,7 +61,7 @@ // Comparors //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class Comparable:LUCENE_BASE{ +class CLUCENE_INLINE_EXPORT Comparable:LUCENE_BASE{ public: virtual ~Comparable(){ } @@ -70,9 +70,9 @@ }; /** @internal */ -class Compare{ +class CLUCENE_INLINE_EXPORT Compare{ public: - class _base + class CLUCENE_INLINE_EXPORT _base { // traits class for hash containers public: enum @@ -86,7 +86,7 @@ } }; - class Int32:public _base, public Comparable{ + class CLUCENE_INLINE_EXPORT Int32:public _base, public Comparable{ int32_t value; public: int32_t getValue() const; @@ -98,7 +98,7 @@ }; - class Float:public Comparable{ + class CLUCENE_INLINE_EXPORT Float:public Comparable{ float_t value; public: float_t getValue() const; @@ -107,7 +107,7 @@ }; - class Char: public _base //<char*> + class CLUCENE_INLINE_EXPORT Char: public _base //<char*> { public: bool operator()( const char* val1, const char* val2 ) const; @@ -115,7 +115,7 @@ }; #ifdef _UCS2 - class WChar: public _base //<wchar_t*> + class CLUCENE_INLINE_EXPORT WChar: public _base //<wchar_t*> { public: bool operator()( const wchar_t* val1, const wchar_t* val2 ) const; @@ -123,7 +123,7 @@ }; #endif - class TChar: public _base, public Comparable{ + class CLUCENE_INLINE_EXPORT TChar: public _base, public Comparable{ const TCHAR* s; public: const TCHAR* getValue() const; @@ -136,7 +136,7 @@ template<typename _cl> - class Void:public _base //<const void*,const void*,bool> + class CLUCENE_INLINE_EXPORT Void:public _base //<const void*,const void*,bool> { public: int32_t compareTo(_cl* o){ @@ -158,14 +158,14 @@ // allocators //////////////////////////////////////////////////////////////////////////////// /** @internal */ -class AbstractDeletor{ +class CLUCENE_INLINE_EXPORT AbstractDeletor{ public: virtual void Delete(void*) = 0; virtual ~AbstractDeletor(); }; -class Deletor{ +class CLUCENE_INLINE_EXPORT Deletor{ public: - class tcArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT tcArray: public AbstractDeletor{ public: void Delete(void* _arr){ doDelete((const TCHAR*)_arr); @@ -176,7 +176,7 @@ }; template<typename _kt> - class vArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT vArray: public AbstractDeletor{ public: void Delete(void* arr){ doDelete((_kt*)arr); @@ -185,7 +185,7 @@ _CLDELETE_LARRAY(arr); } }; - class acArray: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT acArray: public AbstractDeletor{ public: void Delete(void* arr){ doDelete((const char*)arr); @@ -196,7 +196,7 @@ }; template<typename _kt> - class Object: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Object: public AbstractDeletor{ public: void Delete(void* obj){ doDelete((_kt*)obj); @@ -206,7 +206,7 @@ } }; template<typename _kt> - class Void: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Void: public AbstractDeletor{ public: void Delete(void* obj){ doDelete((_kt*)obj); @@ -215,7 +215,7 @@ _CLVDELETE(obj); } }; - class Dummy: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT Dummy: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const void* nothing){ @@ -223,20 +223,20 @@ //CND_WARNING(false,"Deletor::Dummy::doDelete run, set deleteKey or deleteValue to false"); } }; - class DummyInt32: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT DummyInt32: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const int32_t nothing){ } }; - class DummyFloat: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT DummyFloat: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const float_t nothing){ } }; template <typename _type> - class ConstNullVal: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT ConstNullVal: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(const _type nothing){ @@ -246,7 +246,7 @@ }; template <typename _type> - class NullVal: public AbstractDeletor{ + class CLUCENE_INLINE_EXPORT NullVal: public AbstractDeletor{ public: void Delete(void* nothing){} static void doDelete(_type nothing){ Modified: branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -13,7 +13,7 @@ least element can always be found in constant time. Put()'s and pop()'s require log(size) time. */ template <class _type,typename _valueDeletor> -class PriorityQueue:LUCENE_BASE { +class CLUCENE_INLINE_EXPORT PriorityQueue:LUCENE_BASE { private: size_t _size; bool dk; Modified: branches/lucene2_3_2/src/core/CLucene/util/Reader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/Reader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/Reader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -107,7 +107,7 @@ StringReader ( const TCHAR* value ); StringReader ( const TCHAR* value, const int32_t length ); StringReader ( const TCHAR* value, const int32_t length, bool copyData ); - ~StringReader(); + virtual ~StringReader(); }; /** A very simple inputstreamreader implementation. For a @@ -130,7 +130,7 @@ int32_t fillBuffer(TCHAR* start, int32_t space); public: SimpleInputStreamReader(jstreams::StreamBase<char> *i, const char* encoding); - ~SimpleInputStreamReader(); + virtual ~SimpleInputStreamReader(); }; /** @@ -143,7 +143,7 @@ FileReader ( const char* path, const char* enc, const int32_t cachelen = 13, const int32_t cachebuff = 14 ); //todo: optimise these cache values - ~FileReader (); + virtual ~FileReader (); int32_t read(const TCHAR*& start, int32_t _min, int32_t _max); int64_t mark(int32_t readlimit); Modified: branches/lucene2_3_2/src/core/CLucene/util/VoidList.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/VoidList.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/VoidList.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -7,11 +7,8 @@ #ifndef _lucene_util_VoidList_ #define _lucene_util_VoidList_ -#if defined(_LUCENE_PRAGMA_ONCE) -# pragma once -#endif - #include "Equators.h" +#include "CLucene/LuceneThreads.h" CL_NS_DEF(util) @@ -20,7 +17,7 @@ * @internal */ template<typename _kt,typename _base,typename _valueDeletor> -class __CLList:public _base,LUCENE_BASE { +class CLUCENE_INLINE_EXPORT __CLList:public _base,LUCENE_BASE { private: bool dv; typedef _base base; @@ -113,7 +110,7 @@ //a list, so can contain duplicates //it grows in chunks... todo: check jlucene for initial size of array, and growfactors template<typename _kt, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLVector:public __CLList<_kt, CL_NS_STD(vector)<_kt> , _valueDeletor> { public: CLVector ( const bool deleteValue=true ): @@ -140,7 +137,7 @@ template<typename _kt, typename _Comparator=CL_NS(util)::Compare::TChar, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> { public: CLHashList ( const bool deleteValue=true ): @@ -151,7 +148,7 @@ #endif template<typename _kt, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLLinkedList:public __CLList<_kt, CL_NS_STD(list)<_kt> , _valueDeletor> { public: CLLinkedList ( const bool deleteValue=true ): @@ -162,7 +159,7 @@ template<typename _kt, typename _Comparator=CL_NS(util)::Compare::TChar, typename _valueDeletor=CL_NS(util)::Deletor::Dummy> -class CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> +class CLUCENE_INLINE_EXPORT CLSetList:public __CLList<_kt, CL_NS_STD(set)<_kt,_Comparator> , _valueDeletor> { public: CLSetList ( const bool deleteValue=true ): Modified: branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -8,6 +8,7 @@ #define _lucene_util_VoidMap_ #include "Equators.h" +#include "CLucene/LuceneThreads.h" #if defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) //hashing is all or nothing! @@ -30,7 +31,7 @@ typename _base, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class __CLMap:public _base,LUCENE_BASE { +class CLUCENE_INLINE_EXPORT __CLMap:public _base,LUCENE_BASE { private: bool dk; bool dv; @@ -164,7 +165,7 @@ typename _EqualDummy, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_STD(map)<_kt,_vt, _Compare>, _KeyDeletor,_ValueDeletor> { @@ -186,7 +187,7 @@ typename _Equals, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, _KeyDeletor,_ValueDeletor> { @@ -208,7 +209,7 @@ typename _Equals, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLHashMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLHashMap:public __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, _KeyDeletor,_ValueDeletor> { @@ -229,7 +230,7 @@ typename _Compare, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLSet:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLSet:public __CLMap<_kt,_vt, CL_NS_STD(map)<_kt,_vt, _Compare>, _KeyDeletor,_ValueDeletor> { @@ -250,7 +251,7 @@ typename _Compare, typename _KeyDeletor=CL_NS(util)::Deletor::Dummy, typename _ValueDeletor=CL_NS(util)::Deletor::Dummy> -class CLMultiMap:public __CLMap<_kt,_vt, +class CLUCENE_INLINE_EXPORT CLMultiMap:public __CLMap<_kt,_vt, CL_NS_STD(multimap)<_kt,_vt>, _KeyDeletor,_ValueDeletor> { Modified: branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/fileinputstream.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -1,17 +1,27 @@ -/** - * Copyright 2003-2006 The Apache Software Foundation +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Jos van den Oever +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +/* This file is part of Strigi Desktop Search * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Copyright (C) 2006 Jos van den Oever <jo...@va...> * - * http://www.apache.org/licenses/LICENSE-2.0 + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef FILEINPUTSTREAM_H #define FILEINPUTSTREAM_H Modified: branches/lucene2_3_2/src/core/CLucene/util/stringreader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/stringreader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/stringreader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -37,7 +37,7 @@ namespace jstreams { template <class T> -class StringReader : public StreamBase<T> { +class CLUCENE_INLINE_EXPORT StringReader : public StreamBase<T> { private: int64_t markpt; T* data; Modified: branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/core/CLucene/util/subinputstream.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -31,7 +31,7 @@ namespace jstreams { template<class T> -class SubInputStream : public StreamBase<T> { +class CLUCENE_INLINE_EXPORT SubInputStream : public StreamBase<T> { private: const int64_t offset; StreamBase<T> *input; Modified: branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -158,6 +158,17 @@ #ifndef CLUCENE_LOCAL #define CLUCENE_LOCAL #endif + +//inline definitions +#ifdef __MINGW32__ + #define CLUCENE_SHARED_INLINE_EXPORT + #define CLUCENE_INLINE_EXPORT + #define CLUCENE_CONTRIBS_INLINE_EXPORT +#else + #define CLUCENE_SHARED_INLINE_EXPORT CLUCENE_SHARED_EXPORT + #define CLUCENE_INLINE_EXPORT CLUCENE_EXPORT + #define CLUCENE_CONTRIBS_INLINE_EXPORT CLUCENE_CONTRIBS_EXPORT +#endif //////////////////////////////////////////////////////// Modified: branches/lucene2_3_2/src/shared/CLucene/util/dirent.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-08-03 09:48:34 UTC (rev 2852) +++ branches/lucene2_3_2/src/shared/CLucene/util/dirent.h 2008-08-03 10:03:19 UTC (rev 2853) @@ -10,8 +10,8 @@ #if !defined(_CL_HAVE_DIRENT_H) && !defined(_CL_HAVE_SYS_NDIR_H) && !defined(_CL_HAVE_SYS_DIR_H) && !defined(_CL_HAVE_NDIR_H) -#ifdef _WIN64 - typedef __int64 intptr_t; +#ifdef _WIN64 + typedef __int64 intptr_t; #else typedef int intptr_t; #endif @@ -33,14 +33,14 @@ */ /** dirent structure - used by the dirent.h directory iteration functions */ -struct dirent +struct CLUCENE_SHARED_INLINE_EXPORT dirent { unsigned short d_namlen; /* Length of name in d_name. */ char *d_name; /* File name. */ }; /** DIR structure - used by the dirent.h directory iteration functions*/ -struct DIR +struct CLUCENE_SHARED_INLINE_EXPORT DIR { /** disk transfer area for this dir */ struct _finddata_t dd_dta; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-08-15 13:13:44
|
Revision: 2864 http://clucene.svn.sourceforge.net/clucene/?rev=2864&view=rev Author: ustramooner Date: 2008-08-15 13:13:40 +0000 (Fri, 15 Aug 2008) Log Message: ----------- moved msvc warning suppresions into cmake Modified Paths: -------------- branches/lucene2_3_2/cmake/DefineOptions.cmake branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h Modified: branches/lucene2_3_2/cmake/DefineOptions.cmake =================================================================== --- branches/lucene2_3_2/cmake/DefineOptions.cmake 2008-08-15 13:13:15 UTC (rev 2863) +++ branches/lucene2_3_2/cmake/DefineOptions.cmake 2008-08-15 13:13:40 UTC (rev 2864) @@ -19,7 +19,22 @@ SET (${extraOptions} "${${extraOptions}} -D_UNICODE") ENDIF(ENABLE_ASCII_MODE) - IF ( MSVC80 ) - SET (${extraOptions} "${${extraOptions}} -D_CRT_SECURE_NO_DEPRECATE") - ENDIF ( MSVC80 ) + IF ( MSVC80 OR MSVC90) + #todo: remove this once crt functions are fixed... + SET (${extraOptions} "${${extraOptions}} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE") + ENDIF ( MSVC80 OR MSVC90 ) + + IF(CYGWIN) + ADD_DEFINITIONS(-D__LARGE64_FILES) + ENDIF(CYGWIN) + + IF(MSVC) + # calm mdown msvc + #ADD_DEFINITIONS(-wd4251) # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' + #ADD_DEFINITIONS(-wd4275) # non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' + #ADD_DEFINITIONS(-wd4309) # 'conversion' : truncation of constant value + #ADD_DEFINITIONS(-wd4503) # decorated name length exceeded + ADD_DEFINITIONS(-wd4786) # identifier was truncated to '255' characters in the debug information + ENDIF(MSVC) + ENDMACRO (DEFINE_OPTIONS) Modified: branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-15 13:13:15 UTC (rev 2863) +++ branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2008-08-15 13:13:40 UTC (rev 2864) @@ -18,14 +18,9 @@ #include "CLucene/clucene-config.h" //some early definitions -#if defined(_MSC_VER) - //this has to be included very early, or visual studio will ignore it - #pragma warning(disable : 4786) //ignore: identifier was truncated to '255' characters in the debug information +#if defined(_MSC_VER) || defined(__BORLANDC__) #define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning #endif -#if defined(__BORLANDC__) - #define _LUCENE_PRAGMA_WARNINGS //tell lucene to display warnings using pragmas instead of #warning -#endif //////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-08-15 13:33:53
|
Revision: 2868 http://clucene.svn.sourceforge.net/clucene/?rev=2868&view=rev Author: ustramooner Date: 2008-08-15 13:33:47 +0000 (Fri, 15 Aug 2008) Log Message: ----------- fixed delete macro usage fixed signed/unsigned usage documentation changelog more fixes on dist-test.sh Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/ChangeLog branches/lucene2_3_2/INSTALL branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/doc/coding standards.txt branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp Removed Paths: ------------- branches/lucene2_3_2/HACKING Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/CMakeLists.txt 2008-08-15 13:33:47 UTC (rev 2868) @@ -19,10 +19,12 @@ cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) +#set various platform specific global options if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") endif(WIN32) + # include specific modules set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") Modified: branches/lucene2_3_2/ChangeLog =================================================================== --- branches/lucene2_3_2/ChangeLog 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/ChangeLog 2008-08-15 13:33:47 UTC (rev 2868) @@ -0,0 +1,15 @@ +version 0.9.23: +Changes: +* Static object fields have been changed to method accessors (SortField::FIELDDOC now chould be accessed as SortField::FIELDDOC(), for example). Classes changed: FieldCache, ScoreDocComparator, + This was necessary for creating static libraries work on certain platforms. +* Folders were reorganised, this seems like a good time to do it +* Some deprecated functions were removed. +* moved platform configuration type code and utility code into 'shared' project. This enables tests to be built with a shared library on windows +* Moved moved of the platform specific logic into cmake in order to reduce #ifdefs in code (i love cmake!) +* added contributions code into the trunk. this will hopefully mean more exposure to the contributions. need to make clear about the licensing still, though. +* Deletor::Array was renamed to Deletor::vArray. +* re-worked the install location for system-dependent files (clucene-config.h). this was a confusing issue, and i think it's better to stick to the standards rather than push the more compatible (in my opinion) way of doing things. this one has been getting so many complaints from downstream. however, LUCENE_SYS_INCLUDES is available to install the clucene-config.h type files into the library directory (or any other place). + +Here is a summary of changes that you'll need to look at for this release: +* Action deprecated features. Some features that were deprecated for a long time have now been finally removed. +* fix things that may affect you, such as the LUCENE_SYS_INCLUDES change, and the reorganisation of code (install locations are still the same though). Also autotools removals may affect your work, depending on how you use clucene. Deleted: branches/lucene2_3_2/HACKING =================================================================== --- branches/lucene2_3_2/HACKING 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/HACKING 2008-08-15 13:33:47 UTC (rev 2868) @@ -1,103 +0,0 @@ - -CVS ---- - -CLucene's source repository is in SVN - -For information on CVS, see: -http://sourceforge.net/svn/?group_id=80013 - - -Coding Style ------------- - -CLucene follows a hybrid coding style. Because of the nature of the code being -a java port, there are naturally some java like syntax. - -todo: put the coding standard here - -* Never use CL_NS_USE(x) in a header file (use CL_NS(x):: for each class), it defeats the purpose of namespaces. -* Use CL_NS_USE(x) in .cpp files if there are more than a few usages of that namespace. - -Good development tips ---------------------- -When developing, use the available clucene debugging tools: -* _CND_DEBUG - condition debugging, an 'assert' type system (or configure with --enable-cnddebug) -* LUCENE_ENABLE_MEMLEAKTRACKING - to assist in memory leak tracking (or configure with --enable-debug), - enable this. This keeps track of clucene object creations - and deletions. Always use _CLNEW and _CLDELETE. At the end - of your program, call: - -_lucene_run_objectcheck - -lucene::debug::LuceneBase::__cl_PrintUnclosedObjects(); - which prints all the open clucene objects. Then call -lucene::debug::LuceneBase::__cl_ClearMemory(); - which clears all the clucene memory, so that you can - use other memory tracking tools to further help you - discover memory leaks - -__cl_PrintUnclosedObjects returns a list of objects with -the number that it was created at. If your debugger allows -you to set watches you can add: -_lucene_counter_break -to the watch list and change the value to this number. Then -it will break into CLDebugBreak in the StdHeader.cpp file. - -Another trick is to use set: -_lucene_run_objectcheck - to true. This will check the validity of memory before deleting it. -It can't always help, but may help in some situations. - -Good performance tips: -CLucene has a lot of new changes to help improve performance. -Some of them are still being tuned... - -MSVC profiling tutorial: -http://webserver.tc.cornell.edu/services/edu/topics/Performance/Profiling/more.asp - -For GCC see gprof -you can enable gprof by configuring with --enable-gprof - -Developing ----------- -When developing, please keep in mind cross-platform issues and also -character set issues (unicode/ascii). - -Hint: -To do a quick test to see if the code compiles -run this command from the root directory of clucene. -It will compile all the CLucene code monolithically. - - % cd src; make monolithic; cd ../test; make monolithic; ./cl_test_monolithic - -This will do a quick compile then run all the clucene tests. - -GDB - GNU debugging tool ------------------------- -This is not clucene specific, but useful none the less. - -Because cl_test is a libtool bash script, you can use this command to -run gdb: - -libtool --mode=execute gdb cl_test - -Then type run to start the debug tool. -If a crash occurs, you can type bt to get a backtrace. - -Valgrind - test for memory errors ---------------------------------- -This is not clucene specific, but useful for novices none the less. - -Because cl_test is a libtool bash script, you can use this command to -run valgrind: - -libtool --mode=execute valgrind --leak-check=full cl_test - -If any memory errors occur, they will be printed to the console. - -There are some memory 'errors' which i think are false positives. -This commands supresses those errors: - -libtool --mode=execute valgrind --leak-check=full --suppressions=../valgrind.supp cl_test - Modified: branches/lucene2_3_2/INSTALL =================================================================== --- branches/lucene2_3_2/INSTALL 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/INSTALL 2008-08-15 13:33:47 UTC (rev 2868) @@ -61,6 +61,15 @@ 12.)Now you can develop your own code. This is beyond the scope of this document. Read the README for information about documentation or to get help on the mailinglist. +Other platforms: +---------------- +Some platforms require specific actions to get cmake working. Here are some general tips: + +Solaris: +I had problems when using the standard stl library. Using the -stlport4 switch worked. Had +to specify compiler from the command line: cmake -DCXX_COMPILER=xxx -stlport4 + + Installing: ----------- CLucene is installed in CMAKE_INSTALL_PREFIX by default. @@ -84,6 +93,16 @@ ulimit -n 1024 set rlim_fd_cur=1024 +GDB - GNU debugging tool (linux only) +------------------------ +If you get an error, try doing this. More information on GDB can be found on the internet + +#gdb bin/cl_test +# gdb> run +when gdb shows a crash run +# gdb> bt +a backtrace will be printed. This may help to solve any problems. + Code layout -------------- File locations: @@ -119,14 +138,18 @@ Valgrind reports memory leaks and memory problems. Tests should always pass valgrind before being passed. -#valgrind <program> +#valgrind --leak-check=full <program> Performance with gprof ---------------------- Compile with gprof turned on (ENABLE_GPROF in cmake gui or using ccmake). -Run the program you want using gprof <program>. Various analysis can be -created - see man gprof for these options. +I've found (at least on windows cygwin) that gprof wasn't working over +dll boundaries, running the cl_test-pedantic monolithic build worked better. +This is typically what I use to produce some meaningful output after a -pg +compiled application has exited: +# gprof bin/cl_test-pedantic.exe gmon.out >gprof.txt + Benchmarks ---------- Very little benchmarking has been done on clucene. Andi Vajda posted some Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/dist-test.sh 2008-08-15 13:33:47 UTC (rev 2868) @@ -92,12 +92,13 @@ if [ $t_env == 1 ]; then for H in `find ../src/shared/CLucene| grep "\.h$"` `find ../src/core/CLucene| grep "\.h$"`; do BH=`basename "$H"` + DN=`dirname "$H"` if [ "${BH:0:1}" != "_" ]; then DH=`dirname "${H:3}"` #move headers somewhere to compile mkdir -p "$TMP/$DH" 2>/dev/null - ln -s "`realpath $H`" "$TMP/${H:3}" 2>/dev/null + ln -s "`cd "$DN" && pwd`" "$TMP/${H:3}" 2>/dev/null #create pub-headers.cpp echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp @@ -105,13 +106,14 @@ done fi -if [ $t_env == 1 ]; then +if [ $t_env == 1 ]; then echo "int main(){return 0;}" >>$TMP/pub-headers.cpp fi #find inline code: if [ $t_inline == 1 ]; then if [ $t_env == 1 ]; then + cmake -DENABLE_CLDOCS:BOOLEAN=TRUE . make doc if [ $? != 0 ]; then exit 1 @@ -164,8 +166,10 @@ if [ "${BH:BH_len-2}" == ".h" ] || [ "${BH:BH_len-2}" == ".c" ] || [ "${BH:BH_len-4}" == ".cpp" ]; then if [ "`awk '/\* Copyright \(C\) [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then - echo "$H has invalid license" - FAIL=1 + if [ "`awk '/\* Copyright [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then + echo "$H has invalid license" + FAIL=1 + fi fi fi done Modified: branches/lucene2_3_2/doc/coding standards.txt =================================================================== --- branches/lucene2_3_2/doc/coding standards.txt 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/doc/coding standards.txt 2008-08-15 13:33:47 UTC (rev 2868) @@ -1,4 +1,13 @@ +Coding Style +------------ +CLucene follows a hybrid coding style. Because of the nature of the code being +a java port, there are naturally some java like syntax. + +* Never use CL_NS_USE(x) in a header file (use CL_NS(x):: for each class), it defeats the purpose of namespaces. +* Use CL_NS_USE(x) in .cpp files if there are more than a few usages of that namespace. + + Headers: * _headername.h headers are private, and will not be distributed. Don't include these files from public headers. * The shared library is not distributed, except for: SharedHeader.h and clucene-config.h @@ -72,3 +81,33 @@ { } }; + +Good development tips +--------------------- +When developing, use the available clucene debugging tools: +* _CND_DEBUG - condition debugging, an 'assert' type system (or configure with --enable-cnddebug) + +Good performance tips: +---------------------- +CLucene has a lot of new changes to help improve performance. +Some of them are still being tuned... + +MSVC profiling tutorial: +http://webserver.tc.cornell.edu/services/edu/topics/Performance/Profiling/more.asp + +For GCC see gprof +you can enable gprof by configuring with ENABLE_GPROF + +Developing +---------- +When developing, please keep in mind cross-platform issues and also +character set issues (unicode/ascii). + +Hint: +To do a quick test to see if the code compiles +run this command from the root directory of clucene. +It will compile all the CLucene code monolithically. + + % test-pedantic + +This will do a quick compile then run all the clucene tests. Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp 2008-08-15 13:33:47 UTC (rev 2868) @@ -78,7 +78,7 @@ STRCPY_TtoA(aname, tname, CL_MAX_PATH); name = const_cast<char*>(CLStringIntern::internA( const_cast<const char*>(aname), 1, true)); // Intern string, optimized to reuse the same buffer } - _CLDELETE_CaARRAY(tname); + _CLDELETE_CARRAY(tname); docCount = input->readInt(); if (format <= SegmentInfos::FORMAT_LOCKLESS) { @@ -89,7 +89,7 @@ tname = input->readString(); char* aname = new char[CL_MAX_PATH]; // don't ref-count aname since it will be handled by CLStringIntern STRCPY_TtoA(aname, tname, CL_MAX_PATH); - _CLDELETE_CaARRAY(tname); + _CLDELETE_CARRAY(tname); //todo: possible optimization would be to strcmp(aname, docStoreSegment) and avoid inernA if == 0 @@ -884,14 +884,14 @@ //CL_TRACE("fallback to prior segment file '%s'", prevSegmentFileName); try { void* v = doBody(prevSegmentFileName); - _CLDELETE_LARRAY( prevSegmentFileName ); - _CLDELETE_LARRAY(exc_txt); + _CLDELETE_CaARRAY( prevSegmentFileName ); + _CLDELETE_CARRAY(exc_txt); //if (exc != NULL) { //CL_TRACE("success on fallback %s", prevSegmentFileName); //} return v; } catch (CLuceneError& err2) { - _CLDELETE_LARRAY( prevSegmentFileName ); + _CLDELETE_CaARRAY( prevSegmentFileName ); if (err2.number()!=CL_ERR_IO) { _CLDELETE_LARRAY(exc_txt); throw err2; Modified: branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp 2008-08-15 13:33:47 UTC (rev 2868) @@ -99,7 +99,7 @@ StringIntern_stringaPool[ret] = count; return ret; }else{ - if (use_provided) delete[] str; // delete the provided string if already exists + if (use_provided) _CLDELETE_CaARRAY(str); // delete the provided string if already exists (itr->second) = (itr->second) + count; return itr->first; } Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp 2008-08-15 13:15:17 UTC (rev 2867) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp 2008-08-15 13:33:47 UTC (rev 2868) @@ -113,7 +113,7 @@ _CLDELETE(tmp); } } - + #ifdef _UCS2 //print a list of arguments to a string int lucene_snwprintf(wchar_t* strbuf, size_t count, const wchar_t * format, ...){ @@ -140,8 +140,8 @@ int lucene_vsnwprintf(wchar_t * strbuf, size_t count, const wchar_t * format, va_list& ap){ StringBuffer buffer; lucene_vfnwprintf(&buffer,count,format,ap); - int ret = cl_min((int32_t)count,buffer.length()+1); + int ret = cl_min((size_t)count,buffer.length()+1); wcsncpy(strbuf,buffer.getBuffer(),ret); return ret; } -#endif +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <syn...@us...> - 2008-08-25 14:30:00
|
Revision: 2874 http://clucene.svn.sourceforge.net/clucene/?rev=2874&view=rev Author: synhershko Date: 2008-08-25 14:29:41 +0000 (Mon, 25 Aug 2008) Log Message: ----------- getQueryName and getClassName are now char* (no need for wide version) Fixes several memory leaks in BooleanQuery, and spotted other potential ones (see todo's) Modified Paths: -------------- branches/lucene2_3_2/AUTHORS branches/lucene2_3_2/src/core/CLucene/document/Field.h branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h branches/lucene2_3_2/src/core/CLucene/search/Query.h branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp Modified: branches/lucene2_3_2/AUTHORS =================================================================== --- branches/lucene2_3_2/AUTHORS 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/AUTHORS 2008-08-25 14:29:41 UTC (rev 2874) @@ -20,3 +20,4 @@ Peter Gladkikh ba...@ma... Pedja am...@ma... Peter Hodges hod...@gm... +Itamar Syn-Hershko syn...@us... Modified: branches/lucene2_3_2/src/core/CLucene/document/Field.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/document/Field.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/document/Field.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -50,7 +50,8 @@ * value is stored in its original form, i.e. no analyzer is used before it is * stored. */ - STORE_YES=1, + STORE_YES=1, + /** Do not store the field value in the index. */ STORE_NO=2, Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -106,11 +106,11 @@ return ret; } - const TCHAR* BooleanQuery::getQueryName() const{ + const char* BooleanQuery::getQueryName() const{ return getClassName(); } - const TCHAR* BooleanQuery::getClassName(){ - return _T("BooleanQuery"); + const char* BooleanQuery::getClassName(){ + return "BooleanQuery"; } /** @@ -356,8 +356,10 @@ for (uint32_t i = 0 ; i < weights.size(); i++) { Weight* w = weights[i]; Scorer* subScorer = w->scorer(reader); - if (subScorer == NULL) - return NULL; + if (subScorer == NULL) { + _CLDELETE(result); + return NULL; + } result->add(subScorer); } return result; @@ -373,8 +375,10 @@ Scorer* subScorer = w->scorer(reader); if (subScorer != NULL) result->add(subScorer, c->required, c->prohibited); - else if (c->required) - return NULL; + else if (c->required) { + _CLDELETE(result); + return NULL; + } } } @@ -404,16 +408,18 @@ _CLDELETE(sumExpl); result->setValue(0.0f); result->setDescription(_T("match prohibited")); + //todo: _CLDELETE(e); ? return; } } else if (c->required) { _CLDELETE(sumExpl); result->setValue(0.0f); result->setDescription(_T("match prohibited")); + //todo: _CLDELETE(e); ? return; } - _CLDELETE(e); + _CLDELETE(e); //todo: if above todo's are right, this is irrelevant here } sumExpl->setValue(sum); @@ -464,17 +470,14 @@ if ( subScorer != NULL ) { result->add( subScorer, c->required, c->prohibited ); } else if ( c->required ) { + _CLDELETE(result); return NULL; } } return result; + } - } - - - - BooleanClause::BooleanClause(Query* q, const bool DeleteQuery,const bool req, const bool p): query(q), occur(SHOULD), Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -47,8 +47,8 @@ BooleanQuery( bool disableCoord = false ); ~BooleanQuery(); - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); + const char* getQueryName() const; + static const char* getClassName(); /** Return the maximum number of clauses permitted, 1024 by default. * Attempts to add more than the permitted number of clauses cause {@link Modified: branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -287,19 +287,19 @@ return buffer.toString(); } - const TCHAR* FuzzyQuery::getQueryName() const{ + const char* FuzzyQuery::getQueryName() const{ //Func - Returns the name of the query //Pre - true //post - The string FuzzyQuery has been returned return getClassName(); } - const TCHAR* FuzzyQuery::getClassName(){ + const char* FuzzyQuery::getClassName(){ //Func - Returns the name of the query //Pre - true //post - The string FuzzyQuery has been returned - return _T("FuzzyQuery"); + return "FuzzyQuery"; } Modified: branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -50,9 +50,9 @@ TCHAR* toString(const TCHAR* field) const; - //Returns the name "FuzzyQuery" - static const TCHAR* getClassName(); - const TCHAR* getQueryName() const; + //Returns the name "FuzzyQuery" + static const char* getClassName(); + const char* getQueryName() const; Query* clone() const; bool equals(Query * other) const; Modified: branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -146,10 +146,10 @@ return ret; } - const TCHAR* PhraseQuery::getClassName(){ - return _T("PhraseQuery"); + const char* PhraseQuery::getClassName(){ + return "PhraseQuery"; } - const TCHAR* PhraseQuery::getQueryName() const{ + const char* PhraseQuery::getQueryName() const{ //Func - Returns the string "PhraseQuery" //Pre - true //Post - The string "PhraseQuery" has been returned Modified: branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -47,8 +47,8 @@ ~PhraseQuery(); //Returns the string "PhraseQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); + const char* getQueryName() const; + static const char* getClassName(); //Sets the number of other words permitted between words in query phrase. //If zero, then this is an exact phrase search. For larger values this works Modified: branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -59,19 +59,19 @@ return Similarity::floatToByte(getBoost()) ^ prefix->hashCode(); } - const TCHAR* PrefixQuery::getQueryName()const{ + const char* PrefixQuery::getQueryName()const{ //Func - Returns the name "PrefixQuery" //Pre - true //Post - The string "PrefixQuery" has been returned return getClassName(); } - const TCHAR* PrefixQuery::getClassName(){ + const char* PrefixQuery::getClassName(){ //Func - Returns the name "PrefixQuery" //Pre - true //Post - The string "PrefixQuery" has been returned - return _T("PrefixQuery"); + return "PrefixQuery"; } bool PrefixQuery::equals(Query * other) const{ Modified: branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -34,8 +34,8 @@ ~PrefixQuery(); //Returns the name "PrefixQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); + const char* getQueryName() const; + static const char* getClassName(); /** Returns the prefix of this query. */ CL_NS(index)::Term* getPrefix(bool pointer=true); Modified: branches/lucene2_3_2/src/core/CLucene/search/Query.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/Query.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/Query.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -90,8 +90,8 @@ /** Returns a clone of this query. */ virtual Query* clone() const = 0; - virtual const TCHAR* getQueryName() const = 0; - bool instanceOf(const TCHAR* other) const; + virtual const char* getQueryName() const = 0; + bool instanceOf(const char* other) const; /** Prints a query to a string, with <code>field</code> assumed to be the * default field and omitted. Modified: branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -75,11 +75,11 @@ (this->inclusive ? 1 : 0); } - const TCHAR* RangeQuery::getQueryName() const{ + const char* RangeQuery::getQueryName() const{ return getClassName(); } - const TCHAR* RangeQuery::getClassName(){ - return _T("RangeQuery"); + const char* RangeQuery::getClassName(){ + return "RangeQuery"; } Query* RangeQuery::combine(Query** queries) { Modified: branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -43,8 +43,8 @@ RangeQuery(CL_NS(index)::Term* LowerTerm, CL_NS(index)::Term* UpperTerm, const bool Inclusive); ~RangeQuery(); - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); + const char* getQueryName() const; + static const char* getClassName(); Query* rewrite(CL_NS(index)::IndexReader* reader); Modified: branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -81,9 +81,9 @@ Similarity* Query::getSimilarity(Searcher* searcher) { return searcher->getSimilarity(); } -bool Query::instanceOf(const TCHAR* other) const{ - const TCHAR* t = getQueryName(); - if ( t==other || _tcscmp( t, other )==0 ) +bool Query::instanceOf(const char* other) const{ + const char* t = getQueryName(); + if ( t==other || strcmp( t, other )==0 ) return true; else return false; Modified: branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -64,10 +64,10 @@ return _CLNEW TermQuery(*this); } - const TCHAR* TermQuery::getClassName(){ - return _T("TermQuery"); + const char* TermQuery::getClassName(){ + return "TermQuery"; } - const TCHAR* TermQuery::getQueryName() const{ + const char* TermQuery::getQueryName() const{ return getClassName(); } size_t TermQuery::hashCode() const { @@ -125,9 +125,9 @@ //return a *new* string describing this object TCHAR* TermWeight::toString() { - int32_t size=_tcslen(_this->getQueryName()) + 10; + int32_t size=strlen(_this->getQueryName()) + 10; TCHAR* tmp = _CL_NEWARRAY(TCHAR, size);//_tcslen(weight()) - _sntprintf(tmp,size,_T("weight(%s)"),_this->getQueryName()); + _sntprintf(tmp,size,_T("weight(%S)"),_this->getQueryName()); return tmp; } Modified: branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -34,8 +34,8 @@ TermQuery(CL_NS(index)::Term* t); ~TermQuery(); - static const TCHAR* getClassName(); - const TCHAR* getQueryName() const; + static const char* getClassName(); + const char* getQueryName() const; //added by search highlighter CL_NS(index)::Term* getTerm(bool pointer=true) const; Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -34,15 +34,15 @@ } -const TCHAR* WildcardQuery::getQueryName() const{ +const char* WildcardQuery::getQueryName() const{ //Func - Returns the string "WildcardQuery" //Pre - true //Post - The string "WildcardQuery" has been returned return getClassName(); } -const TCHAR* WildcardQuery::getClassName(){ - return _T("WildcardQuery"); +const char* WildcardQuery::getClassName(){ + return "WildcardQuery"; } Modified: branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h 2008-08-25 14:29:41 UTC (rev 2874) @@ -33,8 +33,8 @@ ~WildcardQuery(); //Returns the string "WildcardQuery" - const TCHAR* getQueryName() const; - static const TCHAR* getClassName(); + const char* getQueryName() const; + static const char* getClassName(); size_t hashCode() const; bool equals(Query* other) const; Modified: branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp =================================================================== --- branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp 2008-08-22 11:10:56 UTC (rev 2873) +++ branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp 2008-08-25 14:29:41 UTC (rev 2874) @@ -95,7 +95,7 @@ } -void assertTrue(CuTest *tc,const TCHAR* query, Analyzer* a, const TCHAR* inst, const TCHAR* msg){ +void assertTrue(CuTest *tc,const TCHAR* query, Analyzer* a, const char* inst, const TCHAR* msg){ Query* q = getQuery(tc,query,a); bool success = q->instanceOf(inst); _CLDELETE(q); @@ -144,9 +144,9 @@ _T("+term +\"phrase phrase\"") ); assertQueryEquals(tc,_T("\"hello there\""), NULL, _T("\"hello there\"") ); - assertTrue(tc, _T("a AND b"), NULL,_T("BooleanQuery"),_T("a AND b") ); - assertTrue(tc, _T("hello"), NULL,_T("TermQuery"), _T("hello")); - assertTrue(tc, _T("\"hello there\""), NULL,_T("PhraseQuery"), _T("\"hello there\"")); + assertTrue(tc, _T("a AND b"), NULL,"BooleanQuery",_T("a AND b") ); + assertTrue(tc, _T("hello"), NULL,"TermQuery", _T("hello")); + assertTrue(tc, _T("\"hello there\""), NULL,"PhraseQuery", _T("\"hello there\"")); assertQueryEquals(tc,_T("germ term^2.0"), NULL, _T("germ term^2.0")); assertQueryEquals(tc,_T("term^2.0"), NULL, _T("term^2.0")); @@ -230,15 +230,15 @@ assertQueryEquals(tc,_T("term~0.5"), NULL, _T("term")); assertQueryEquals(tc,_T("term~^2"), NULL, _T("term^2.0~0.5")); assertQueryEquals(tc,_T("term^2~"), NULL, _T("term^2.0~0.5")); - assertTrue(tc, _T("term~"), NULL,_T("FuzzyQuery"), _T("term~0.5")); + assertTrue(tc, _T("term~"), NULL,"FuzzyQuery", _T("term~0.5")); assertQueryEquals(tc,_T("term*germ"), NULL, _T("term*germ")); assertQueryEquals(tc,_T("term*germ^3"), NULL, _T("term*germ^3.0")); - assertTrue(tc, _T("term*"), NULL,_T("PrefixQuery"), _T("term*")); - assertTrue(tc, _T("term*^2"), NULL,_T("PrefixQuery"), _T("term*^2.0")); - assertTrue(tc, _T("t*"), NULL,_T("PrefixQuery"), _T("t*")); - assertTrue(tc, _T("term*germ"), NULL,_T("WildcardQuery"), _T("term*germ")); + assertTrue(tc, _T("term*"), NULL,"PrefixQuery", _T("term*")); + assertTrue(tc, _T("term*^2"), NULL,"PrefixQuery", _T("term*^2.0")); + assertTrue(tc, _T("t*"), NULL,"PrefixQuery", _T("t*")); + assertTrue(tc, _T("term*germ"), NULL,"WildcardQuery", _T("term*germ")); } void testQPA(CuTest *tc) { @@ -252,15 +252,15 @@ assertQueryEquals(tc,_T("term AND NOT phrase term"), &qpAnalyzer, _T("+term -\"phrase1 phrase2\" term") ); assertQueryEquals(tc,_T("stop"), &qpAnalyzer, _T("") ); - assertTrue(tc, _T("term term term"), &qpAnalyzer,_T("BooleanQuery"), _T("term term term")); - assertTrue(tc, _T("term +stop"), &qpAnalyzer,_T("TermQuery"), _T("term +stop")); + assertTrue(tc, _T("term term term"), &qpAnalyzer,"BooleanQuery", _T("term term term")); + assertTrue(tc, _T("term +stop"), &qpAnalyzer,"TermQuery", _T("term +stop")); } void testRange(CuTest *tc) { StandardAnalyzer a; assertQueryEquals(tc,_T("[ a z]"), NULL, _T("[a TO z]")); - assertTrue(tc, _T("[ a z]"), NULL, _T("RangeQuery"), _T("[ a z]") ); + assertTrue(tc, _T("[ a z]"), NULL, "RangeQuery", _T("[ a z]") ); assertQueryEquals(tc,_T("[ a z ]"), NULL, _T("[a TO z]")); assertQueryEquals(tc,_T("{ a z}"), NULL, _T("{a TO z}")); assertQueryEquals(tc,_T("{ a z }"), NULL, _T("{a TO z}")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-09-10 15:29:02
|
Revision: 2892 http://clucene.svn.sourceforge.net/clucene/?rev=2892&view=rev Author: ustramooner Date: 2008-09-10 15:28:58 +0000 (Wed, 10 Sep 2008) Log Message: ----------- link pthread library Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/test/CMakeLists.txt Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-09-10 15:18:33 UTC (rev 2891) +++ branches/lucene2_3_2/CMakeLists.txt 2008-09-10 15:28:58 UTC (rev 2892) @@ -31,6 +31,7 @@ #define options... Include (CLuceneDocs) +Include (FindThreads) IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-10 15:18:33 UTC (rev 2891) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-10 15:28:58 UTC (rev 2892) @@ -150,9 +150,9 @@ #link the clucene-core library against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) IF ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-core clucene-shared-static) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared-static} ) ELSE ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-core clucene-shared) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared ${CMAKE_THREAD_LIBS_INIT}) ENDIF ( USE_STATIC_SHARED_LIBRARY ) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) Modified: branches/lucene2_3_2/src/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/test/CMakeLists.txt 2008-09-10 15:18:33 UTC (rev 2891) +++ branches/lucene2_3_2/src/test/CMakeLists.txt 2008-09-10 15:28:58 UTC (rev 2892) @@ -73,7 +73,7 @@ SET (TESTS_CXX_FLAGS ) -SET (TESTS_EXE_LINKER_FLAGS "") +SET (TESTS_EXE_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}") IF ( GccFlagG ) SET(TESTS_CXX_FLAGS "${TESTS_CXX_FLAGS} -g") ENDIF ( GccFlagG ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-09-27 09:50:31
|
Revision: 2900 http://clucene.svn.sourceforge.net/clucene/?rev=2900&view=rev Author: ustramooner Date: 2008-09-27 09:50:21 +0000 (Sat, 27 Sep 2008) Log Message: ----------- removed linking against static shared library. this is a corner case requirement, in my opinion Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/src/contribs/CMakeLists.txt branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/src/shared/CLucene/CLSharedMonolithic.cpp branches/lucene2_3_2/src/test/CMakeLists.txt Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/CMakeLists.txt 2008-09-27 09:50:21 UTC (rev 2900) @@ -75,10 +75,6 @@ "enable various projects that test alternative build switches" ${ENABLE_COMPILE_TESTS_VALUE}) -OPTION(USE_STATIC_SHARED_LIBRARY - "Link libraries and executables against the static linked clucene-shared library instead of shared" - OFF) - #check flags... INCLUDE (TestCXXAcceptsFlag) IF ( CMAKE_COMPILER_IS_GNUCC ) Modified: branches/lucene2_3_2/src/contribs/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-09-27 09:50:21 UTC (rev 2900) @@ -137,11 +137,7 @@ ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} ) IF ( NOT USE_SHARED_OBJECT_FILES ) - IF ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared-static) - ELSE ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared) - ENDIF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) add_library(clucene-contribs-static STATIC Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-27 09:50:21 UTC (rev 2900) @@ -19,6 +19,7 @@ SET(clucene_core_Files ./CLucene/StdHeader.cpp + ./CLucene/debug/error.cpp ./CLucene/util/ThreadLocal.cpp ./CLucene/util/Reader.cpp ./CLucene/util/Equators.cpp @@ -26,6 +27,7 @@ ./CLucene/util/fileinputstream.cpp ./CLucene/util/MD5Digester.cpp ./CLucene/util/StringIntern.cpp + ./CLucene/util/subinputstream.cpp ./CLucene/util/BitSet.cpp ./CLucene/queryParser/Lexer.cpp ./CLucene/queryParser/MultiFieldQueryParser.cpp @@ -149,11 +151,7 @@ #link the clucene-core library against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) - IF ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-core clucene-shared-static} ) - ELSE ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(clucene-core clucene-shared ${CMAKE_THREAD_LIBS_INIT}) - ENDIF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) SET_TARGET_PROPERTIES(clucene-core-static PROPERTIES Modified: branches/lucene2_3_2/src/demo/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-09-27 09:50:21 UTC (rev 2900) @@ -21,8 +21,4 @@ ${demo_HEADERS} ) -IF ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(cl_demo clucene-core clucene-shared-static) -ELSE ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(cl_demo clucene-core clucene-shared) -ENDIF ( USE_STATIC_SHARED_LIBRARY ) +TARGET_LINK_LIBRARIES(cl_demo clucene-core clucene-shared) Modified: branches/lucene2_3_2/src/shared/CLucene/CLSharedMonolithic.cpp =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/CLSharedMonolithic.cpp 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/src/shared/CLucene/CLSharedMonolithic.cpp 2008-09-27 09:50:21 UTC (rev 2900) @@ -21,7 +21,6 @@ #include "CLucene/config/threads.cpp" #include "CLucene/config/utf8.cpp" #include "CLucene/debug/condition.cpp" -#include "CLucene/debug/error.cpp" #include "CLucene/util/Misc.cpp" #include "CLucene/util/dirent.cpp" #include "CLucene/util/StringBuffer.cpp" Modified: branches/lucene2_3_2/src/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/test/CMakeLists.txt 2008-09-27 09:47:28 UTC (rev 2899) +++ branches/lucene2_3_2/src/test/CMakeLists.txt 2008-09-27 09:50:21 UTC (rev 2900) @@ -51,11 +51,7 @@ #link the executable against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) - IF ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(cl_test clucene-core clucene-shared-static) - ELSE ( USE_STATIC_SHARED_LIBRARY ) - TARGET_LINK_LIBRARIES(cl_test clucene-core clucene-shared) - ENDIF ( USE_STATIC_SHARED_LIBRARY ) + TARGET_LINK_LIBRARIES(cl_test clucene-core clucene-shared) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) ############################ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2008-09-30 14:55:21
|
Revision: 2906 http://clucene.svn.sourceforge.net/clucene/?rev=2906&view=rev Author: ustramooner Date: 2008-09-30 14:54:57 +0000 (Tue, 30 Sep 2008) Log Message: ----------- don't build static libraries by default. this is probably not necessary by default. Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/src/contribs/CMakeLists.txt branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/shared/CMakeLists.txt Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2008-09-27 11:05:20 UTC (rev 2905) +++ branches/lucene2_3_2/CMakeLists.txt 2008-09-30 14:54:57 UTC (rev 2906) @@ -59,6 +59,9 @@ OPTION(ENABLE_PACKAGING "create build scripts for creating clucene packages" OFF) +OPTION(BUILD_STATIC_LIBRARIES + "create targets for building static libraries" + OFF) OPTION(LUCENE_SYS_INCLUDES "location for non-system independent files. defaults to CMAKE_INSTALL_PREFIX. see INSTALL documentation for further information." Modified: branches/lucene2_3_2/src/contribs/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-09-27 11:05:20 UTC (rev 2905) +++ branches/lucene2_3_2/src/contribs/CMakeLists.txt 2008-09-30 14:54:57 UTC (rev 2906) @@ -37,7 +37,6 @@ ./CLucene/jstreams/fileinputstream.cpp ./CLucene/jstreams/subinputstream.cpp ./CLucene/jstreams/tarinputstream.cpp - ./CLucene/jstreams/zipinputstream.cpp ./CLucene/highlighter/Encoder.cpp ./CLucene/highlighter/Formatter.cpp @@ -104,6 +103,7 @@ SET ( clucene_contribs_Files ${clucene_contribs_Files} ./CLucene/jstreams/gzipcompressstream.cpp ./CLucene/jstreams/gzipinputstream.cpp + ./CLucene/jstreams/zipinputstream.cpp ) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) SET ( clucene-contrib-libs "${clucene-contrib-libs} ${ZLIB_LIBRARIES}" ) @@ -130,8 +130,8 @@ #create the libraries INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/core ) -INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/contribs ) -INCLUDE_DIRECTORIES( ${clucene_BINARY_DIR}/src/contribs ) +INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/contribs-lib ) +INCLUDE_DIRECTORIES( ${clucene_BINARY_DIR}/src/contribs-lib ) add_library(clucene-contribs SHARED ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} @@ -140,11 +140,6 @@ TARGET_LINK_LIBRARIES(clucene-contribs clucene-shared) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) -add_library(clucene-contribs-static STATIC - ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} -) - - #set properties on the libraries SET_TARGET_PROPERTIES(clucene-contribs PROPERTIES VERSION ${CLUCENE_VERSION} @@ -152,8 +147,14 @@ COMPILE_DEFINITIONS_DEBUG _DEBUG ) -SET_TARGET_PROPERTIES(clucene-contribs-static PROPERTIES - VERSION ${CLUCENE_VERSION} - SOVERSION ${CLUCENE_SOVERSION} - COMPILE_DEFINITIONS_DEBUG _DEBUG -) +IF ( BUILD_STATIC_LIBRARIES ) + add_library(clucene-contribs-static STATIC + ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} + ) + + SET_TARGET_PROPERTIES(clucene-contribs-static PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + COMPILE_DEFINITIONS_DEBUG _DEBUG + ) +ENDIF ( BUILD_STATIC_LIBRARIES ) Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-27 11:05:20 UTC (rev 2905) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2008-09-30 14:54:57 UTC (rev 2906) @@ -27,7 +27,7 @@ ./CLucene/util/fileinputstream.cpp ./CLucene/util/MD5Digester.cpp ./CLucene/util/StringIntern.cpp - ./CLucene/util/subinputstream.cpp +# ./CLucene/util/subinputstream.cpp ./CLucene/util/BitSet.cpp ./CLucene/queryParser/Lexer.cpp ./CLucene/queryParser/MultiFieldQueryParser.cpp @@ -138,10 +138,6 @@ ${clucene_core_Files} ${clucene_shared_Files} ${HEADERS} ) -add_library(clucene-core-static STATIC - ${clucene_core_Files} ${clucene_shared_Files} ${HEADERS} -) - #set properties on the libraries SET_TARGET_PROPERTIES(clucene-core PROPERTIES VERSION ${CLUCENE_VERSION} @@ -154,12 +150,24 @@ TARGET_LINK_LIBRARIES(clucene-core clucene-shared) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) -SET_TARGET_PROPERTIES(clucene-core-static PROPERTIES - VERSION ${CLUCENE_VERSION} - SOVERSION ${CLUCENE_SOVERSION} - COMPILE_DEFINITIONS_DEBUG _DEBUG -) +IF ( BUILD_STATIC_LIBRARIES ) + add_library(clucene-core-static STATIC + ${clucene_core_Files} ${clucene_shared_Files} ${HEADERS} + ) + + SET_TARGET_PROPERTIES(clucene-core-static PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + COMPILE_DEFINITIONS_DEBUG _DEBUG + ) + + #and install library + install(TARGETS clucene-core-static + DESTINATION lib + COMPONENT runtime ) +ENDIF ( BUILD_STATIC_LIBRARIES ) + #install public headers. FOREACH(file ${HEADERS}) get_filename_component(apath ${file} PATH) @@ -209,10 +217,8 @@ COMPONENT development) ENDIF ( LUCENE_SYS_INCLUDES ) -#and install libraries + +#and install library install(TARGETS clucene-core DESTINATION lib COMPONENT runtime ) -install(TARGETS clucene-core-static - DESTINATION lib - COMPONENT runtime ) Modified: branches/lucene2_3_2/src/shared/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/shared/CMakeLists.txt 2008-09-27 11:05:20 UTC (rev 2905) +++ branches/lucene2_3_2/src/shared/CMakeLists.txt 2008-09-30 14:54:57 UTC (rev 2906) @@ -291,9 +291,6 @@ add_library(clucene-shared SHARED ${clucene_shared_Files} ${HEADERS} ) -add_library(clucene-shared-static STATIC - ${clucene_shared_Files} ${HEADERS} -) #set properties on the libraries SET_TARGET_PROPERTIES(clucene-shared PROPERTIES @@ -301,15 +298,23 @@ SOVERSION ${CLUCENE_SOVERSION} COMPILE_DEFINITIONS_DEBUG _DEBUG ) -SET_TARGET_PROPERTIES(clucene-shared-static PROPERTIES - VERSION ${CLUCENE_VERSION} - SOVERSION ${CLUCENE_SOVERSION} - COMPILE_DEFINITIONS_DEBUG _DEBUG -) install(TARGETS clucene-shared DESTINATION lib COMPONENT development ) -install(TARGETS clucene-shared-static - DESTINATION lib - COMPONENT runtime ) + + +IF ( BUILD_STATIC_LIBRARIES ) + add_library(clucene-shared-static STATIC + ${clucene_shared_Files} ${HEADERS} + ) + + SET_TARGET_PROPERTIES(clucene-shared-static PROPERTIES + VERSION ${CLUCENE_VERSION} + SOVERSION ${CLUCENE_SOVERSION} + COMPILE_DEFINITIONS_DEBUG _DEBUG + ) + install(TARGETS clucene-shared-static + DESTINATION lib + COMPONENT runtime ) +ENDIF ( BUILD_STATIC_LIBRARIES ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2009-03-29 13:48:01
|
Revision: 2968 http://clucene.svn.sourceforge.net/clucene/?rev=2968&view=rev Author: ustramooner Date: 2009-03-29 13:47:59 +0000 (Sun, 29 Mar 2009) Log Message: ----------- fixes for problems discovered by the dist-test.sh script Modified Paths: -------------- branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/core/CLucene/search/FieldSortedHitQueue.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h branches/lucene2_3_2/src/test/test.h Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/dist-test.sh 2009-03-29 13:47:59 UTC (rev 2968) @@ -71,7 +71,7 @@ #check to see that no #ifdefs exist in headers that don't belong function checkForIfdefs { I=0 - grep "#if" $1| while read line; do + grep "#if" $1| grep -v "_UCS2" |grep -v "_CL_HAVE_" |grep -v "_ASCII" |grep -v "_WIN32" |grep -v "_WIN64" | while read line; do I=`expr $I + 1` if [ $I -gt 1 ]; then echo $1 has invalid ifdef: $line @@ -102,7 +102,9 @@ ln -s "`cd "$DN" && pwd`/$BH" "$TMP/${H:3}" 2>/dev/null #create pub-headers.cpp - echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp + if [ "${H:7}" != "core/CLucene/util/Reader.h" ]; then + echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp + fi fi done fi @@ -147,11 +149,12 @@ fi #test that each header compiles independently... - if [ $t_c_h == 1 ]; then + if [ $t_c_h == 1 ] && [ "${H:7}" != "disttest/src/core/CLucene/util/Reader.h" ]; then + echo "Test that $H compiles seperately..." echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-header.cpp echo "#include \"$H"\" >>$TMP/pub-header.cpp echo "int main(){return 0;}" >>$TMP/pub-header.cpp - g++ -I. -I$TMP/src/shared -I$TMP/src/core $TMP/pub-header.cpp + g++ -I. -I$TMP/src/shared -I./src/shared -I$TMP/src/core $TMP/pub-header.cpp if [ $? != 0 ]; then FAIL=1; fi Modified: branches/lucene2_3_2/src/core/CLucene/search/FieldSortedHitQueue.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/FieldSortedHitQueue.h 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/src/core/CLucene/search/FieldSortedHitQueue.h 2009-03-29 13:47:59 UTC (rev 2968) @@ -11,14 +11,10 @@ CL_CLASS_DEF(search,FieldDoc) CL_CLASS_DEF(search,SortComparatorSource) CL_CLASS_DEF(search,SortField) -//#include "FieldCache.h" -//#include "Sort.h" -//#include "FieldDocSortedHitQueue.h" #include "FieldDoc.h" //required to expose destructor -//#include "SearchHeader.h" -//#include "FieldCacheImpl.h" #include "CLucene/util/PriorityQueue.h" #include "CLucene/util/Equators.h" +#include "CLucene/LuceneThreads.h" CL_CLASS_DEF(index,IndexReader) Modified: branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp 2009-03-29 13:47:59 UTC (rev 2968) @@ -577,7 +577,7 @@ #endif } - bool FSDirectory::openInput(const char * name, lucene::store::IndexInput *& ret, CLuceneError& error, int32_t bufferSize) + bool FSDirectory::openInput(const char * name, IndexInput *& ret, CLuceneError& error, int32_t bufferSize) { CND_PRECONDITION(directory[0]!=0,"directory is not open") char fl[CL_MAX_DIR]; Modified: branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h 2009-03-29 13:47:59 UTC (rev 2968) @@ -7,9 +7,8 @@ #ifndef _lucene_store_LockFactory_ #define _lucene_store_LockFactory_ -//#include "Lock.h" +#include "CLucene/LuceneThreads.h" - CL_CLASS_DEF(store,LuceneLock) CL_CLASS_DEF(store,NoLock) Modified: branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h 2009-03-29 13:47:59 UTC (rev 2968) @@ -8,6 +8,7 @@ #define _lucene_repl_wchar_h #include <stdarg.h> +#include "repl_tchar.h" #ifdef _CL_HAVE_STRING_H #include <string.h> #endif Modified: branches/lucene2_3_2/src/test/test.h =================================================================== --- branches/lucene2_3_2/src/test/test.h 2009-03-29 10:57:30 UTC (rev 2967) +++ branches/lucene2_3_2/src/test/test.h 2009-03-29 13:47:59 UTC (rev 2968) @@ -18,6 +18,7 @@ #include "CLucene/store/Lock.h" #include "CLucene/index/TermVector.h" #include "CLucene/queryParser/MultiFieldQueryParser.h" +#include <string.h> #define LUCENE_INT64_MAX_SHOULDBE _ILONGLONG(0x7FFFFFFFFFFFFFFF) #define LUCENE_INT64_MIN_SHOULDBE (-LUCENE_INT64_MAX_SHOULDBE - _ILONGLONG(1) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2009-04-20 12:54:21
|
Revision: 2996 http://clucene.svn.sourceforge.net/clucene/?rev=2996&view=rev Author: ustramooner Date: 2009-04-20 12:54:17 +0000 (Mon, 20 Apr 2009) Log Message: ----------- support dmalloc. a few linux fixes Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/INSTALL branches/lucene2_3_2/cmake/DefineOptions.cmake branches/lucene2_3_2/src/contribs/benchmarker/CMakeLists.txt branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h branches/lucene2_3_2/src/shared/CMakeLists.txt branches/lucene2_3_2/src/test/CMakeLists.txt branches/lucene2_3_2/src/test/testall.cpp Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -50,6 +50,9 @@ OPTION(DISABLE_MULTITHREADING "disable multithreading - remove all locking code" OFF) +OPTION(ENABLE_DMALLOC + "enable dmalloc memory leak checker" + OFF) OPTION(ENABLE_ASCII_MODE "enable ascii support" OFF) Modified: branches/lucene2_3_2/INSTALL =================================================================== --- branches/lucene2_3_2/INSTALL 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/INSTALL 2009-04-20 12:54:17 UTC (rev 2996) @@ -140,6 +140,21 @@ #valgrind --leak-check=full <program> +Memory leak tracking with dmalloc +--------------------------------- +dmalloc (http://dmalloc.com/) is also a nice tool for finding memory leaks. +To enable, set the ENABLE_DMALLOC flag to ON in cmake. You will of course +have to have the dmalloc lib installed for this to work. + +The cl_test file will by default print a low number of errors and leaks into +the dmalloc.log.txt file (however, this has a tendency to print false positives). +You can override this by setting your environment variable DMALLOC_OPTIONS. +See http://dmalloc.com/ or dmalloc --usage for more information on how to use dmalloc + +For example: +# DMALLOC_OPTIONS=medium,log=dmalloc.log.txt +# export DMALLOC_OPTIONS + Performance with gprof ---------------------- Compile with gprof turned on (ENABLE_GPROF in cmake gui or using ccmake). Modified: branches/lucene2_3_2/cmake/DefineOptions.cmake =================================================================== --- branches/lucene2_3_2/cmake/DefineOptions.cmake 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/cmake/DefineOptions.cmake 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,26 +1,35 @@ #define global options, this makes it easy to use ccmake, or the cmake gui -MACRO (DEFINE_OPTIONS extraOptions) - IF(ENABLE_DEBUG) - SET (${extraOptions} "${${extraOptions}} -D_DEBUG") - ENDIF(ENABLE_DEBUG) - - IF(ENABLE_MMAP) - SET (${extraOptions} "${${extraOptions}} -DLUCENE_FS_MMAP") - ENDIF(ENABLE_MMAP) - - IF(DISABLE_MULTITHREADING) - SET (${extraOptions} "${${extraOptions}} -D_CL_DISABLE_MULTITHREADING") - ELSE(DISABLE_MULTITHREADING) - SET(${extraOptions} "${${extraOptions}} -D_REENTRANT") - ENDIF(DISABLE_MULTITHREADING) - - IF(ENABLE_ASCII_MODE) - SET (${extraOptions} "${${extraOptions}} -D_ASCII") - ELSE(ENABLE_ASCII_MODE) - SET (${extraOptions} "${${extraOptions}} -D_UCS2") - SET (${extraOptions} "${${extraOptions}} -D_UNICODE") - ENDIF(ENABLE_ASCII_MODE) +MACRO (DEFINE_OPTIONS extraOptions extraLibs) + IF(ENABLE_DEBUG) + SET (${extraOptions} "${${extraOptions}} -D_DEBUG") + ENDIF(ENABLE_DEBUG) + IF(ENABLE_MMAP) + SET (${extraOptions} "${${extraOptions}} -DLUCENE_FS_MMAP") + ENDIF(ENABLE_MMAP) + + IF(ENABLE_DMALLOC) + SET (${extraOptions} "${${extraOptions}} -DDMALLOC") + IF ( DISABLE_MULTITHREADING ) + SET (${extraLibs} ${${extraLibs}} "dmalloccxx") + ELSE( DISABLE_MULTITHREADING ) + SET (${extraLibs} ${${extraLibs}} "dmallocthcxx") + ENDIF ( DISABLE_MULTITHREADING ) + ENDIF(ENABLE_DMALLOC) + + IF(DISABLE_MULTITHREADING) + SET (${extraOptions} "${${extraOptions}} -D_CL_DISABLE_MULTITHREADING") + ELSE(DISABLE_MULTITHREADING) + SET(${extraOptions} "${${extraOptions}} -D_REENTRANT") + ENDIF(DISABLE_MULTITHREADING) + + IF(ENABLE_ASCII_MODE) + SET (${extraOptions} "${${extraOptions}} -D_ASCII") + ELSE(ENABLE_ASCII_MODE) + SET (${extraOptions} "${${extraOptions}} -D_UCS2") + SET (${extraOptions} "${${extraOptions}} -D_UNICODE") + ENDIF(ENABLE_ASCII_MODE) + IF ( MSVC80 OR MSVC90) #todo: remove this once crt functions are fixed... SET (${extraOptions} "${${extraOptions}} -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE") Modified: branches/lucene2_3_2/src/contribs/benchmarker/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/contribs/benchmarker/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,7 +1,7 @@ PROJECT(clucene-benchmarker) INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS}) file(GLOB_RECURSE benchmarker_HEADERS ${clucene-benchmarker_SOURCE_DIR}/*.h) @@ -17,4 +17,4 @@ ) ADD_EXECUTABLE(cl_benchmarker EXCLUDE_FROM_ALL ${benchmarker_files} ) -TARGET_LINK_LIBRARIES(cl_benchmarker clucene-core clucene-shared) +TARGET_LINK_LIBRARIES(cl_benchmarker clucene-core clucene-shared ${EXTRA_LIBS}) Modified: branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,7 +1,7 @@ PROJECT(clucene-contribs-lib-test) INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS}) INCLUDE_DIRECTORIES( ${clucene-contribs-lib-test_SOURCE_DIR} ) @@ -29,5 +29,5 @@ #link the executable against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) - TARGET_LINK_LIBRARIES(cl_contribs-lib-test clucene-core clucene-shared clucene-contribs-lib) + TARGET_LINK_LIBRARIES(cl_contribs-lib-test clucene-core clucene-shared clucene-contribs-lib ${EXTRA_LIBS}) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) Modified: branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,7 +1,7 @@ PROJECT(clucene-contribs-lib) INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_CONTRIBS_LIB) set(CMAKE_MODULE_PATH "${clucene-contribs-lib_SOURCE_DIR}/cmake") @@ -71,7 +71,7 @@ ./CLucene/snowball/src_c/stem_UTF_8_spanish.c ./CLucene/snowball/src_c/stem_UTF_8_swedish.c ) -SET ( clucene_contrib_extras clucene-core clucene-shared ) +SET ( clucene_contrib_extra_libs clucene-core clucene-shared ${EXTRA_LIBS}) #find our headers file(GLOB_RECURSE HEADERS ${clucene-contribs-lib_SOURCE_DIR}/*.h) @@ -82,7 +82,7 @@ MESSAGE ( FATAL "ZLib not found" ) ENDIF ( NOT ZLIB_FOUND ) INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} ) -SET ( clucene_contrib_extras "${clucene_contrib_extras}" ${ZLIB_LIBRARIES} ) +SET ( clucene_contrib_extra_libs "${clucene_contrib_extra_libs}" ${ZLIB_LIBRARIES} ) find_package(Iconv) #find_package(Strigi) @@ -99,7 +99,7 @@ add_library(clucene-contribs-lib SHARED ${clucene_contribs_Files} ${clucene_shared_Files} ${HEADERS} ) -TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extras}) +TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs}) #set properties on the libraries SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES Modified: branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp 2009-04-20 12:54:17 UTC (rev 2996) @@ -137,7 +137,7 @@ //Delete the buffer if necessary - free(buffer); + if ( buffer != NULL ) free(buffer); //Delete termInfo if necessary _CLDELETE(termInfo); Modified: branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h 2009-04-20 12:54:17 UTC (rev 2996) @@ -330,7 +330,7 @@ * @throws IOException */ //bool getTermFreqVectors(int32_t docNumber, CL_NS(util)::ObjectArray<TermFreqVector>& result); - CL_NS(util)::ObjectArray<TermFreqVector>* SegmentReader::getTermFreqVectors(int32_t docNumber); + CL_NS(util)::ObjectArray<TermFreqVector>* getTermFreqVectors(int32_t docNumber); private: //Open all norms files for all fields void openNorms(CL_NS(store)::Directory* cfsDir); Modified: branches/lucene2_3_2/src/core/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/core/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/core/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -2,7 +2,7 @@ #define command line options INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_CORE_LIB) #add the files to our groups and core @@ -148,7 +148,7 @@ #link the clucene-core library against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) - TARGET_LINK_LIBRARIES(clucene-core clucene-shared) + TARGET_LINK_LIBRARIES(clucene-core clucene-shared ${EXTRA_LIBS}) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) Modified: branches/lucene2_3_2/src/demo/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/demo/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/demo/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,7 +1,7 @@ PROJECT(cl_demo) INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS}) INCLUDE_DIRECTORIES( ${clucene-demo_SOURCE_DIR} ) @@ -21,4 +21,4 @@ ${demo_HEADERS} ) -TARGET_LINK_LIBRARIES(cl_demo clucene-core clucene-shared) +TARGET_LINK_LIBRARIES(cl_demo clucene-core clucene-shared ${EXTRA_LIBS}) Modified: branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h 2009-04-20 12:54:17 UTC (rev 2996) @@ -87,7 +87,7 @@ #define CL_CLASS_DEF(sub,clazz) namespace lucene { namespace sub{ class clazz; } } #define CL_CLASS_DEF2(sub,sub2, clazz) namespace lucene { namespace sub{ namespace sub2{ class clazz; } } } - #define CL_TEMPATE_DEF(sub, clazz, typedefs) namespace lucene { namespace sub{ template<typedefs> class clazz; }} + #define CL_TEMPATE_DEF(sub, clazz, typedefs) namespace lucene { namespace sub{ template<typedefs> class clazz; }} #define CL_TYPE_DEF(sub, clazz, def) namespace lucene { namespace sub{ typedef def clazz; }} #else #define CL_NS_DEF(sub) @@ -170,14 +170,14 @@ //////////////////////////////////////////////////////// -//todo: put this logic in cmake +//todo: put this logic in cmake #if defined(_MSC_VER) #if _MSC_FULL_VER >= 140050320 #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) #elif _MSC_VER >= 1300 #define _CL_DEPRECATE_TEXT(_Text) __declspec(deprecated) #else - #define _CL_DEPRECATE_TEXT(_Text) + #define _CL_DEPRECATE_TEXT(_Text) #endif #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) #define _CL_DEPRECATE_TEXT(_Text) __attribute__((__deprecated__)) @@ -196,4 +196,10 @@ //memory handling macros/functions #include "CLucene/debug/mem.h" +#ifdef DMALLOC + #include <stdlib.h> + #include <string.h> + #include <dmalloc.h> +#endif + #endif //lucene_sharedheader_h Modified: branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h =================================================================== --- branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h 2009-04-20 12:54:17 UTC (rev 2996) @@ -24,6 +24,7 @@ #include "CLucene/LuceneThreads.h" #include "CLucene/config/repl_tchar.h" #include "CLucene/config/repl_wchar.h" +#include "CLucene/config/repl_wctype.h" //replacements for functions #define cl_min(a,b) ((a)>(b) ? (b) : (a)) #define cl_min3(a,b,c) ((a)<(b) ? ((a)<(c) ? (a) : (c)) : ((b)<(c) ? (b) : (c))) @@ -56,9 +57,6 @@ //if a wide character is being converted to a ascii character and it //cannot fit, this character is used instead. #define LUCENE_OOR_CHAR(c) ((char)(((unsigned short)c)&0xFF)) + - -#include "CLucene/config/repl_tchar.h" //replacements for functions -#include "CLucene/config/repl_wctype.h" //replacements for functions - #endif //lucene_internal_sharedheader_h Modified: branches/lucene2_3_2/src/shared/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/shared/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/shared/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -2,7 +2,7 @@ #define command line options INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS} -DMAKE_CLUCENE_SHARED_LIB) # include specific modules @@ -302,6 +302,9 @@ SOVERSION ${CLUCENE_SOVERSION} COMPILE_DEFINITIONS_DEBUG _DEBUG ) +IF ( ${EXTRA_LIBS} ) + TARGET_LINK_LIBRARIES(clucene-shared ${EXTRA_LIBS}) +ENDIF ( ${EXTRA_LIBS} ) install(TARGETS clucene-shared DESTINATION lib Modified: branches/lucene2_3_2/src/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/test/CMakeLists.txt 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/test/CMakeLists.txt 2009-04-20 12:54:17 UTC (rev 2996) @@ -1,7 +1,7 @@ PROJECT(clucene-test) INCLUDE (DefineOptions) -DEFINE_OPTIONS(EXTRA_OPTIONS) +DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS}) INCLUDE_DIRECTORIES( ${clucene-test_SOURCE_DIR} ) @@ -53,7 +53,7 @@ #link the executable against the releavent clucene-shared library (if we aren't using the object files) IF ( NOT USE_SHARED_OBJECT_FILES ) - TARGET_LINK_LIBRARIES(cl_test clucene-core clucene-shared) + TARGET_LINK_LIBRARIES(cl_test clucene-core clucene-shared ${EXTRA_LIBS}) ENDIF ( NOT USE_SHARED_OBJECT_FILES ) ############################ Modified: branches/lucene2_3_2/src/test/testall.cpp =================================================================== --- branches/lucene2_3_2/src/test/testall.cpp 2009-04-16 17:00:05 UTC (rev 2995) +++ branches/lucene2_3_2/src/test/testall.cpp 2009-04-20 12:54:17 UTC (rev 2996) @@ -39,6 +39,17 @@ _crtBreakAlloc=-1; #endif #endif + + #ifdef DMALLOC + if ( getenv("DMALLOC_OPTIONS") == NULL ){ + dmalloc_debug_setup("low,log=dmalloc.log.txt"); + }else{ + //apparently cygwin has to have this code.... + dmalloc_debug_setup(getenv("DMALLOC_OPTIONS")); + } + #endif + + int ret_result = 0; int i=0; int exclude = 0; @@ -203,8 +214,7 @@ _CLDELETE_CaARRAY(cl_tempDir) _lucene_shutdown(); //clears all static memory - //print lucenebase debug - + if ( ret_result != 0 ) return ret_result; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2009-06-11 17:34:30
|
Revision: 3009 http://clucene.svn.sourceforge.net/clucene/?rev=3009&view=rev Author: ustramooner Date: 2009-06-11 17:34:23 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Merge branch 'master' into svn Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/COPYING branches/lucene2_3_2/INSTALL branches/lucene2_3_2/cmake/CreateClucenePackages.cmake branches/lucene2_3_2/configure branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/contribs/contribs-lib-test/TestSnowball.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballFilter.h branches/lucene2_3_2/src/core/CLucene/CLConfig.h branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp branches/lucene2_3_2/src/core/CLucene/StdHeader.cpp branches/lucene2_3_2/src/core/CLucene/StdHeader.h branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardFilter.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.h branches/lucene2_3_2/src/core/CLucene/debug/error.cpp branches/lucene2_3_2/src/core/CLucene/debug/error.h branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h branches/lucene2_3_2/src/core/CLucene/debug/mem.h branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp branches/lucene2_3_2/src/core/CLucene/document/DateTools.h branches/lucene2_3_2/src/core/CLucene/document/Document.cpp branches/lucene2_3_2/src/core/CLucene/document/Document.h branches/lucene2_3_2/src/core/CLucene/document/Field.cpp branches/lucene2_3_2/src/core/CLucene/document/Field.h branches/lucene2_3_2/src/core/CLucene/document/FieldSelector.cpp branches/lucene2_3_2/src/core/CLucene/document/NumberTools.cpp branches/lucene2_3_2/src/core/CLucene/index/CompoundFile.cpp branches/lucene2_3_2/src/core/CLucene/index/FieldInfos.cpp branches/lucene2_3_2/src/core/CLucene/index/FieldsReader.cpp branches/lucene2_3_2/src/core/CLucene/index/FieldsWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexFileNames.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexModifier.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexModifier.h branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h branches/lucene2_3_2/src/core/CLucene/index/MultiReader.cpp branches/lucene2_3_2/src/core/CLucene/index/MultiReader.h branches/lucene2_3_2/src/core/CLucene/index/Payload.cpp branches/lucene2_3_2/src/core/CLucene/index/Payload.h branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermDocs.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermVector.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.h branches/lucene2_3_2/src/core/CLucene/index/TermInfosReader.cpp branches/lucene2_3_2/src/core/CLucene/index/TermInfosWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/TermVector.h branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp branches/lucene2_3_2/src/core/CLucene/index/TermVectorWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/Terms.h branches/lucene2_3_2/src/core/CLucene/index/_CompoundFile.h branches/lucene2_3_2/src/core/CLucene/index/_FieldInfo.h branches/lucene2_3_2/src/core/CLucene/index/_FieldInfos.h branches/lucene2_3_2/src/core/CLucene/index/_FieldsReader.h branches/lucene2_3_2/src/core/CLucene/index/_FieldsWriter.h branches/lucene2_3_2/src/core/CLucene/index/_IndexFileNames.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentInfos.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentMergeInfo.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentMergeQueue.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentMerger.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentTermEnum.h branches/lucene2_3_2/src/core/CLucene/index/_Term.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosReader.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosWriter.h branches/lucene2_3_2/src/core/CLucene/index/_TermVector.h branches/lucene2_3_2/src/core/CLucene/queryParser/MultiFieldQueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/MultiFieldQueryParser.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserTokenManager.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserTokenManager.h branches/lucene2_3_2/src/core/CLucene/queryParser/_FastCharStream.h branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/MultiFieldQueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/MultiFieldQueryParser.h branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/QueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/QueryParser.h branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/QueryParserBase.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanClause.h branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp branches/lucene2_3_2/src/core/CLucene/search/Compare.h branches/lucene2_3_2/src/core/CLucene/search/ConjunctionScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/DisjunctionSumScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/ExactPhraseScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/Explanation.cpp branches/lucene2_3_2/src/core/CLucene/search/Explanation.h branches/lucene2_3_2/src/core/CLucene/search/FieldCacheImpl.cpp branches/lucene2_3_2/src/core/CLucene/search/Filter.h branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h branches/lucene2_3_2/src/core/CLucene/search/HitQueue.cpp branches/lucene2_3_2/src/core/CLucene/search/Hits.h branches/lucene2_3_2/src/core/CLucene/search/IndexSearcher.cpp branches/lucene2_3_2/src/core/CLucene/search/IndexSearcher.h branches/lucene2_3_2/src/core/CLucene/search/MultiSearcher.cpp branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h branches/lucene2_3_2/src/core/CLucene/search/PhraseScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h branches/lucene2_3_2/src/core/CLucene/search/Query.h branches/lucene2_3_2/src/core/CLucene/search/RangeFilter.h branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h branches/lucene2_3_2/src/core/CLucene/search/Scorer.cpp branches/lucene2_3_2/src/core/CLucene/search/Scorer.h branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.h branches/lucene2_3_2/src/core/CLucene/search/Searchable.h branches/lucene2_3_2/src/core/CLucene/search/Similarity.h branches/lucene2_3_2/src/core/CLucene/search/SloppyPhraseScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/Sort.cpp branches/lucene2_3_2/src/core/CLucene/search/Sort.h branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h branches/lucene2_3_2/src/core/CLucene/search/TermScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h branches/lucene2_3_2/src/core/CLucene/search/_BooleanScorer.h branches/lucene2_3_2/src/core/CLucene/search/_BooleanScorer2.h branches/lucene2_3_2/src/core/CLucene/search/_ConjunctionScorer.h branches/lucene2_3_2/src/core/CLucene/search/_DisjunctionSumScorer.h branches/lucene2_3_2/src/core/CLucene/search/_ExactPhraseScorer.h branches/lucene2_3_2/src/core/CLucene/search/_FieldCacheImpl.h branches/lucene2_3_2/src/core/CLucene/search/_PhraseQueue.h branches/lucene2_3_2/src/core/CLucene/search/_PhraseScorer.h branches/lucene2_3_2/src/core/CLucene/search/_SloppyPhraseScorer.h branches/lucene2_3_2/src/core/CLucene/search/_TermScorer.h branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp branches/lucene2_3_2/src/core/CLucene/store/Directory.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.h branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp branches/lucene2_3_2/src/core/CLucene/store/Lock.h branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.h branches/lucene2_3_2/src/core/CLucene/store/TransactionalRAMDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/_Lock.h branches/lucene2_3_2/src/core/CLucene/store/_MMap.h branches/lucene2_3_2/src/core/CLucene/store/_RAMDirectory.h branches/lucene2_3_2/src/core/CLucene/store/_TransactionalRAMDirectory.h branches/lucene2_3_2/src/core/CLucene/util/Array.h branches/lucene2_3_2/src/core/CLucene/util/BitSet.h branches/lucene2_3_2/src/core/CLucene/util/CLStreams.h branches/lucene2_3_2/src/core/CLucene/util/Equators.cpp branches/lucene2_3_2/src/core/CLucene/util/Equators.h branches/lucene2_3_2/src/core/CLucene/util/MD5Digester.cpp branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h branches/lucene2_3_2/src/core/CLucene/util/Reader.cpp branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp branches/lucene2_3_2/src/core/CLucene/util/ThreadLocal.cpp branches/lucene2_3_2/src/core/CLucene/util/VoidList.h branches/lucene2_3_2/src/core/CLucene/util/VoidMap.h branches/lucene2_3_2/src/core/CLucene/util/_Arrays.h branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/src/demo/IndexFiles.cpp branches/lucene2_3_2/src/demo/Main.cpp branches/lucene2_3_2/src/demo/SearchFiles.cpp branches/lucene2_3_2/src/demo/Statistics.cpp branches/lucene2_3_2/src/shared/CLucene/LuceneThreads.h branches/lucene2_3_2/src/shared/CLucene/SharedHeader.cpp branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/config/_threads.h branches/lucene2_3_2/src/shared/CLucene/config/repl_lltot.cpp branches/lucene2_3_2/src/shared/CLucene/config/repl_tchar.h branches/lucene2_3_2/src/shared/CLucene/config/repl_wchar.h branches/lucene2_3_2/src/shared/CLucene/config/threads.cpp branches/lucene2_3_2/src/shared/CLucene/config/utf8.cpp branches/lucene2_3_2/src/shared/CLucene/debug/_condition.h branches/lucene2_3_2/src/shared/CLucene/debug/condition.cpp branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp branches/lucene2_3_2/src/shared/CLucene/util/Misc.h branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h branches/lucene2_3_2/src/shared/CMakeLists.txt branches/lucene2_3_2/src/test/CLMonolithic_Test.cpp branches/lucene2_3_2/src/test/CMakeLists.txt branches/lucene2_3_2/src/test/CuTest.cpp branches/lucene2_3_2/src/test/CuTest.h branches/lucene2_3_2/src/test/analysis/TestAnalysis.cpp branches/lucene2_3_2/src/test/analysis/TestAnalyzers.cpp branches/lucene2_3_2/src/test/data/readme.txt branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.f0 branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.f1 branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.fdt branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.fdx branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.frq branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.prx branches/lucene2_3_2/src/test/data/reuters-21578-index/_z.tis branches/lucene2_3_2/src/test/data/reuters-21578-index/segments branches/lucene2_3_2/src/test/debug/TestError.cpp branches/lucene2_3_2/src/test/document/TestDocument.cpp branches/lucene2_3_2/src/test/index/TestIndexWriter.cpp branches/lucene2_3_2/src/test/index/TestReuters.cpp branches/lucene2_3_2/src/test/index/TestUtf8.cpp branches/lucene2_3_2/src/test/queryParser/TestMultiFieldQueryParser.cpp branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp branches/lucene2_3_2/src/test/search/TestForDuplicates.cpp branches/lucene2_3_2/src/test/search/TestQueries.cpp branches/lucene2_3_2/src/test/search/TestSearch.cpp branches/lucene2_3_2/src/test/search/TestSort.cpp branches/lucene2_3_2/src/test/search/TestTermVector.cpp branches/lucene2_3_2/src/test/store/TestStore.cpp branches/lucene2_3_2/src/test/test.h branches/lucene2_3_2/src/test/testall.cpp branches/lucene2_3_2/src/test/tests.cpp Added Paths: ----------- branches/lucene2_3_2/README.PACKAGE branches/lucene2_3_2/src/core/CLucene/document/FieldSelector.h branches/lucene2_3_2/src/core/CLucene/index/DirectoryIndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/DirectoryIndexReader.h branches/lucene2_3_2/src/core/CLucene/index/DocumentsWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/DocumentsWriterThreadState.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexDeletionPolicy.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexDeletionPolicy.h branches/lucene2_3_2/src/core/CLucene/index/IndexFileDeleter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexFileNameFilter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexFileNameFilter.h branches/lucene2_3_2/src/core/CLucene/index/MergePolicy.cpp branches/lucene2_3_2/src/core/CLucene/index/MergePolicy.h branches/lucene2_3_2/src/core/CLucene/index/MergeScheduler.cpp branches/lucene2_3_2/src/core/CLucene/index/MergeScheduler.h branches/lucene2_3_2/src/core/CLucene/index/MultiSegmentReader.cpp branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.h branches/lucene2_3_2/src/core/CLucene/index/SkipListReader.cpp branches/lucene2_3_2/src/core/CLucene/index/SkipListWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/_DocumentsWriter.h branches/lucene2_3_2/src/core/CLucene/index/_IndexFileDeleter.h branches/lucene2_3_2/src/core/CLucene/index/_MultiSegmentReader.h branches/lucene2_3_2/src/core/CLucene/index/_SkipListReader.h branches/lucene2_3_2/src/core/CLucene/index/_SkipListWriter.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryToken.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryToken.h branches/lucene2_3_2/src/core/CLucene/search/MatchAllDocsQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MatchAllDocsQuery.h branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.h branches/lucene2_3_2/src/core/files_list.txt branches/lucene2_3_2/src/core/libclucene.pc.cmake branches/lucene2_3_2/src/shared/CLucene/util/deflate.cpp branches/lucene2_3_2/src/shared/CLucene/util/zlib/ branches/lucene2_3_2/src/shared/CLucene/util/zlib/adler32.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/compress.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/crc32.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/crc32.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/deflate.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/deflate.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/gzio.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffast.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffast.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffixed.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inflate.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inflate.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inftrees.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inftrees.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/trees.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/trees.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zconf.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zlib.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zutil.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/zutil.h branches/lucene2_3_2/src/test/index/TestIndexReader.cpp branches/lucene2_3_2/src/test/index/TestThreading.cpp Removed Paths: ------------- branches/lucene2_3_2/src/core/CLucene/document/_FieldSelector.h branches/lucene2_3_2/src/core/CLucene/files_list.txt branches/lucene2_3_2/src/core/CLucene/index/DefaultSkipListReader.cpp branches/lucene2_3_2/src/core/CLucene/index/DefaultSkipListReader.h branches/lucene2_3_2/src/core/CLucene/index/DocumentWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/MultiLevelSkipListReader.cpp branches/lucene2_3_2/src/core/CLucene/index/MultiLevelSkipListReader.h branches/lucene2_3_2/src/core/CLucene/index/_DocumentWriter.h branches/lucene2_3_2/src/core/CLucene/index/_MultiReader.h branches/lucene2_3_2/src/core/CLucene/queryParser/CharStream.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/Token.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/Token.h branches/lucene2_3_2/src/core/CLucene/util/VoidMapSetDefinitions.h Property Changed: ---------------- branches/lucene2_3_2/src/core/CLucene/index/IndexFileNames.cpp branches/lucene2_3_2/src/core/CLucene/index/_IndexFileNames.h branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp branches/lucene2_3_2/src/core/CLucene/search/DisjunctionSumScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.h branches/lucene2_3_2/src/core/CLucene/search/_BooleanScorer2.h branches/lucene2_3_2/src/core/CLucene/search/_DisjunctionSumScorer.h branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/CMakeLists.txt 2009-06-11 17:34:23 UTC (rev 3009) @@ -9,6 +9,7 @@ SET(CLUCENE_VERSION_MINOR "9") SET(CLUCENE_VERSION_REVISION "23") SET(CLUCENE_VERSION_PATCH "0") +SET(CLUCENE_INT_VERSION 92300) SET(CLUCENE_VERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}.${CLUCENE_VERSION_PATCH}") SET(CLUCENE_SOVERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}") @@ -74,6 +75,9 @@ SET(LUCENE_SYS_INCLUDES "" CACHE PATH "location for non-system independent files. defaults to CMAKE_INSTALL_PREFIX. see INSTALL documentation for further information." ) +#install path options +SET(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) +SET(LIB_DESTINATION "lib${LIB_SUFFIX}") SET ( ENABLE_COMPILE_TESTS_VALUE ON ) @@ -89,11 +93,6 @@ #check flags... INCLUDE (TestCXXAcceptsFlag) IF ( CMAKE_COMPILER_IS_GNUCC ) - CHECK_CXX_ACCEPTS_FLAG(-g GccFlagG) - IF ( GccFlagG ) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") - ENDIF ( GccFlagG ) - CHECK_CXX_ACCEPTS_FLAG(-pg GccFlagPg) IF ( GccFlagPg ) OPTION(ENABLE_GPROF @@ -115,18 +114,11 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) -IF (ENABLE_PACKAGING) - INCLUDE(CreateClucenePackages) - CREATE_CLUCENE_PACKAGES() -ENDIF ( ENABLE_PACKAGING) - - #Single output directory for building all executables and libraries. SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executable Output Directory" FORCE) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Library Output Directory" FORCE) #add tests -#todo: why does 'make test' not work??? ENABLE_TESTING() ADD_TEST(SimpleTest ${EXECUTABLE_OUTPUT_PATH}/cl_test ) @@ -142,6 +134,7 @@ ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL) IF ( BUILD_CONTRIBS ) ADD_SUBDIRECTORY (src/contribs EXCLUDE_FROM_ALL) + SET(BUILD_CONTRIBS_LIB 1) ENDIF ( BUILD_CONTRIBS ) IF ( BUILD_CONTRIBS_LIB ) ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL) @@ -155,3 +148,8 @@ ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + +#this must go last... +IF (ENABLE_PACKAGING) + INCLUDE(CreateClucenePackages) +ENDIF ( ENABLE_PACKAGING) Modified: branches/lucene2_3_2/COPYING =================================================================== --- branches/lucene2_3_2/COPYING 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/COPYING 2009-06-11 17:34:23 UTC (rev 3009) @@ -90,9 +90,35 @@ # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. +the src/core/util/Compress.cpp component: +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly jl...@gz... + Mark Adler ma...@al... + +*/ + + + CLUCENE CONTRIBUTIONS CODE: PorterStemmer code: couldn't find license. This component is deprecated and will be removed very soon. Modified: branches/lucene2_3_2/INSTALL =================================================================== --- branches/lucene2_3_2/INSTALL 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/INSTALL 2009-06-11 17:34:23 UTC (rev 3009) @@ -155,8 +155,22 @@ # DMALLOC_OPTIONS=medium,log=dmalloc.log.txt # export DMALLOC_OPTIONS +UPDATE: when i upgrade my machine to Ubuntu 9.04, dmalloc stopped working (caused +clucene to crash). + +Performance with callgrind +-------------------------- +Really simple + +valgrind --tool=callgrind <command: e.g. bin/cl_test> +this will create a file like callgrind.out.12345. you can open this with kcachegrind or some +tool like that. + + Performance with gprof ---------------------- +Note: I recommend callgrind, it works much better. + Compile with gprof turned on (ENABLE_GPROF in cmake gui or using ccmake). I've found (at least on windows cygwin) that gprof wasn't working over dll boundaries, running the cl_test-pedantic monolithic build worked better. @@ -165,6 +179,32 @@ compiled application has exited: # gprof bin/cl_test-pedantic.exe gmon.out >gprof.txt +Code coverage with gcov +----------------------- +To create a code coverage report of the test, you can use gcov. Here are the +steps I followed to create a nice html report. You'll need the lcov package +installed to generate html. Also, I recommend using an out-of-source build +directory as there are lots of files that will be generated. + +NOTE: you must have lcov installed for this to work + +* It is normally recommended to compile with no optimisations, so change CMAKE_BUILD_TYPE +to Debug. + +* I have created a cl_test-gcov target which contains the necessary gcc switches +already. So all you need to do is +# make test-gcov + +If everything goes well, there will be a directory called code-coverage containing the report. + +If you want to do this process manually, then: +# lcov --directory ./src/test/CMakeFiles/cl_test-gcov.dir/__/core/CLucene -c -o clucene-coverage.info +# lcov --remove clucene-coverage.info "/usr/*" > clucene-coverage.clean +# genhtml -o clucene-coverage clucene-coverage.clean + +If both those commands pass, then there will be a clucene coverage report in the +clucene-coverage directory. + Benchmarks ---------- Very little benchmarking has been done on clucene. Andi Vajda posted some Added: branches/lucene2_3_2/README.PACKAGE =================================================================== --- branches/lucene2_3_2/README.PACKAGE (rev 0) +++ branches/lucene2_3_2/README.PACKAGE 2009-06-11 17:34:23 UTC (rev 3009) @@ -0,0 +1,11 @@ +CLucene is a C++ port of the popular Apache Lucene search engine +(http://lucene.apache.org/java). It is released under LGPL or the Apache +License. + +CLucene aims to be a high-speed alternative to Java Lucene, its API is very +similar to that of the Java version. CLucene has recently been brought up to +date with Lucene 2.3.2. It contains most of the same functionality as the +Java version. + +This package contains the files necessary for running applications that +use the libclucene library. Modified: branches/lucene2_3_2/cmake/CreateClucenePackages.cmake =================================================================== --- branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2009-06-11 17:34:23 UTC (rev 3009) @@ -1,7 +1,5 @@ #Creates all the relevant packages -MACRO( CREATE_CLUCENE_PACKAGES ) - #Rules for version: #MAJOR and MINOR versions are purely political #REVISION version MUST be revised if the headers or compatibility change @@ -15,15 +13,23 @@ SET(CPACK_PACKAGE_VERSION ${CLUCENE_VERSION}) SET(CPACK_PACKAGE_SOVERSION ${CLUCENE_SOVERSION}) -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "library for full-featured text search engine (runtime)") SET(CPACK_PACKAGE_VENDOR "Ben van Klinken") +SET(CPACK_PACKAGE_CONTACT "clu...@li...") +SET(CPACK_PACKAGE_NAME "libclucene1") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene - a C++ search engine, ported from the popular Apache Lucene") SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README.PACKAGE") +#so, what are we going to install? +SET(CPACK_INSTALL_CMAKE_PROJECTS + "${CMAKE_BINARY_DIR};clucene-core;ALL;/" + "${CMAKE_BINARY_DIR};clucene-shared;ALL;/") +SET(CPACK_COMPONENTS_ALL development runtime) SET(CPACK_GENERATOR "TGZ") SET(CPACK_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}") @@ -34,9 +40,22 @@ ENDIF(WIN32 AND NOT UNIX) SET(CPACK_SOURCE_PACKAGE_FILE_NAME "clucene-core-${CPACK_PACKAGE_VERSION}-Source") +#specific packaging requirements: +SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), libgcc1 (>= 1:4.1.1-21), libstdc++6 (>= 4.1.1-21)") + + #don't include the current binary dir. get_filename_component(clucene_BINARY_DIR_name ${clucene_BINARY_DIR} NAME) -SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;.*\\\\.tmp;/${clucene_BINARY_DIR_name}/") +SET(CPACK_SOURCE_IGNORE_FILES + "/\\\\.svn/" + "/\\\\.git/" + "\\\\.swp$" + "\\\\.#;/#" + ".*~" + ".*\\\\.tmp" + ".*\\\\.save" + "/${clucene_BINARY_DIR_name}/" +) IF(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make @@ -55,9 +74,7 @@ ENDIF(WIN32 AND NOT UNIX) #SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable") -INCLUDE(CPack) - ADD_CUSTOM_TARGET(dist-package COMMAND rsync -avP -e ssh ${CPACK_PACKAGE_FILE_NAME}.* ust...@fr...:uploads/ # DEPENDS package @@ -66,4 +83,6 @@ COMMAND rsync -avP -e ssh ${CPACK_SOURCE_PACKAGE_FILE_NAME}.* ust...@fr...:uploads/ # DEPENDS package_source ) -ENDMACRO( CREATE_CLUCENE_PACKAGES ) + +#this must be last +INCLUDE(CPack) Modified: branches/lucene2_3_2/configure =================================================================== --- branches/lucene2_3_2/configure 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/configure 2009-06-11 17:34:23 UTC (rev 3009) @@ -1,2 +1,6 @@ -cmake . +#!/bin/bash +PWD=`dirname $0` +PWD=`cd $PWD && pwd` + +cmake $PWD $@ Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/dist-test.sh 2009-06-11 17:34:23 UTC (rev 3009) @@ -27,7 +27,7 @@ t_exports=0 FAIL=0 -if [ $# == 0 ]; then +if [ $# -eq 0 ]; then usage else while [ "$1" != "" ]; do @@ -56,7 +56,7 @@ done fi -if [ $t_all == 1 ]; then +if [ $t_all -eq 1 ]; then t_env=1 t_c_all=1 t_c_h=1 @@ -81,16 +81,14 @@ } -if [ $t_env == 1 ]; then +if [ $t_env -eq 1 ]; then rm -fdr $TMP 2>/dev/null mkdir $TMP #create header file for testing of symbols in headers. echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-headers.cpp -fi -#iterate all headers -if [ $t_env == 1 ]; then + #iterate all headers for H in `find ../src/shared/CLucene| grep "\.h$"` `find ../src/core/CLucene| grep "\.h$"`; do BH=`basename "$H"` DN=`dirname "$H"` @@ -107,63 +105,60 @@ fi fi done -fi - -if [ $t_env == 1 ]; then + echo "int main(){return 0;}" >>$TMP/pub-headers.cpp fi -#find inline code: -if [ $t_inline == 1 ]; then - if [ $t_env == 1 ]; then - cmake -DENABLE_CLDOCS:BOOLEAN=TRUE . - make doc - if [ $? != 0 ]; then - exit 1 - fi - fi -fi ################################################ #now the environment is finished being setup... ################################################ echo "Starting tests..." -if [ $t_c_h == 1 ] || [ $t_ifdefs == 1 ] || [ $t_exports == 1 ]; then +if [ $t_c_h -eq 1 ] || [ $t_ifdefs -eq 1 ] || [ $t_exports -eq 1 ]; then for H in `find $TMP/src | grep "\.h$"`; do BH=`basename "$H"` DH=`dirname "${H:3}"` - if [ $t_ifdefs == 1 ]; then + if [ $t_ifdefs -eq 1 ]; then checkForIfdefs $H fi #check that all classes are exported - if [ $t_exports == 1 ]; then - XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` - if [ "$XX" != "" ]; then - echo "$H has unexported class: $XX" - echo "" - FAIL=1 - fi + if [ $t_exports -eq 1 ]; then + if [ "${H:0:1}" == "_" ]; then + #internal headers... none must be exported + XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` + if [ "$XX" == "" ]; then + echo "$H has exported class: $XX" + echo "" + FAIL=1 + fi + else + #external headers... all must be exported + XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` + if [ "$XX" != "" ]; then + echo "$H has unexported class: $XX" + echo "" + FAIL=1 + fi + fi fi #test that each header compiles independently... - if [ $t_c_h == 1 ] && [ "${H:7}" != "disttest/src/core/CLucene/util/Reader.h" ]; then + if [ $t_c_h -eq 1 ] && [ "${H:7}" != "disttest/src/core/CLucene/util/Reader.h" ]; then echo "Test that $H compiles seperately..." echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-header.cpp echo "#include \"$H"\" >>$TMP/pub-header.cpp - echo "int main(){return 0;}" >>$TMP/pub-header.cpp + echo "int main(){ return 0; }" >>"$TMP/pub-header.cpp" g++ -I. -I$TMP/src/shared -I./src/shared -I$TMP/src/core $TMP/pub-header.cpp - if [ $? != 0 ]; then - FAIL=1; - fi + if [ $? -ne 0 ]; then FAIL=1; fi fi done fi #iterate all our code... -if [ $t_license == 1 ]; then +if [ $t_license -eq 1 ]; then for H in `find ../src`; do BH=`basename "$H"` BH_len=${#BH} @@ -182,11 +177,19 @@ #test if headers can compile together by themselves: -if [ $t_c_all == 1 ]; then +if [ $t_c_all -eq 1 ]; then g++ -I$TMP/src -I$TMP/src/shared -I$TMP/src/core $TMP/pub-headers.cpp -I./src/shared fi -if [ $t_inline == 1 ]; then +if [ $t_inline -eq 1 ]; then + if [ ! -f "./doc" ]; then + echo "Couldn't find docs, run:" + echo "# cmake -DENABLE_CLDOCS:BOOLEAN=TRUE ." + echo "# make doc" + echo "and then try again" + exit 1 + fi + INLINES=0 grep -c "\[inline" doc/html/*.html|grep -v ":0$"|grep -v "util"|grep -v "jstreams" | while read line; do @@ -195,7 +198,7 @@ continue; fi - if [ $INLINES == 0 ]; then + if [ $INLINES -eq 0 ]; then echo "These files report inline code:" INLINES=1 FAIL=1 @@ -204,16 +207,16 @@ done fi -if [ $t_compile == 1 ]; then +if [ $t_compile -eq 1 ]; then #compile serperately make cl_test - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then FAIL=1; fi #compile together make test-all - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then FAIL=1; fi fi Modified: branches/lucene2_3_2/src/contribs/contribs-lib-test/TestSnowball.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/contribs-lib-test/TestSnowball.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs/contribs-lib-test/TestSnowball.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -10,14 +10,14 @@ TokenStream* ts = an.tokenStream(_T("test"), &reader); Token t; - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t)!=NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("he")) == 0); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t)!=NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("abhor")) == 0); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t)!=NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("accent")) == 0); - CLUCENE_ASSERT(ts->next(&t) == false); + CLUCENE_ASSERT(ts->next(&t) == NULL); _CLDELETE(ts); } Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -21,7 +21,7 @@ ignoreSurrogates = true; } -bool CJKTokenizer::next(Token* token){ +CL_NS(analysis)::Token* CJKTokenizer::next(Token* token){ /** how many character(s) has been stored in buffer */ int32_t length = 0; @@ -31,7 +31,7 @@ while (true) { /** current character */ clunichar c; - int charlen = 1; + int charlen = 1; offset++; @@ -49,7 +49,7 @@ break; } else { - return false; + return NULL; } } else { //get current character @@ -178,7 +178,7 @@ buffer[length]='\0'; token->set(buffer,start, start+length, tokenType); - return true; + return token; } CL_NS_END2 Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -91,7 +91,7 @@ * hanppened in the InputStream * */ - bool next(CL_NS(analysis)::Token* token); + CL_NS(analysis)::Token* next(CL_NS(analysis)::Token* token); bool getIgnoreSurrogates(){ return ignoreSurrogates; }; void setIgnoreSurrogates(bool ignoreSurrogates){ this->ignoreSurrogates = ignoreSurrogates; }; Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -233,7 +233,7 @@ substringBuffer[endOffset-startOffset]=_T('\0'); TCHAR* encoded = _encoder->encodeText(substringBuffer); - const TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup); + TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup); _CLDELETE_CARRAY(encoded); //store any whitespace etc from between this and last group @@ -291,7 +291,7 @@ substringBuffer[endOffset-startOffset]=_T('\0'); TCHAR* encoded = _encoder->encodeText(substringBuffer); - const TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup); + TCHAR* markedUpText=_formatter->highlightTerm(encoded, tokenGroup); _CLDELETE_CARRAY(encoded); //store any whitespace etc from between this and last group Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -91,7 +91,7 @@ return 0; } //found a query term - is it unique in this doc? - if(_uniqueTermsInFragment.find(termText)==_uniqueTermsInFragment.end()) + if(_uniqueTermsInFragment.find((TCHAR*)termText)==_uniqueTermsInFragment.end()) { _totalScore+=queryTerm->getWeight(); TCHAR* owned_term = stringDuplicate(termText); Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -43,7 +43,7 @@ { private: TextFragment * _currentTextFragment; - CL_NS(util)::CLHashSet<const TCHAR*, + CL_NS(util)::CLHashSet<TCHAR*, CL_NS(util)::Compare::TChar, CL_NS(util)::Deletor::tcArray> _uniqueTermsInFragment; float_t _totalScore; @@ -51,7 +51,7 @@ CL_NS(util)::CLHashMap<const TCHAR*, const WeightedTerm *, CL_NS(util)::Compare::TChar, CL_NS(util)::Equals::TChar, - CL_NS(util)::Deletor::tcArray, + CL_NS(util)::Deletor::Dummy, CL_NS(util)::Deletor::Object<const WeightedTerm> > _termsToFind; public: Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -29,8 +29,8 @@ class CLUCENE_CONTRIBS_EXPORT SimpleHTMLFormatter :public Formatter { private: - const TCHAR* _preTag; - const TCHAR* _postTag; + TCHAR* _preTag; + TCHAR* _postTag; public: ~SimpleHTMLFormatter(); Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -26,11 +26,12 @@ numTokens=0; startOffset=0; endOffset=0; - tokens = _CL_NEWARRAY(Token, MAX_NUM_TOKENS_PER_GROUP); + tokens = new Token[MAX_NUM_TOKENS_PER_GROUP]; } TokenGroup::~TokenGroup(void) { + delete[] tokens; } void TokenGroup::addToken(Token* token, float_t score) Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -17,7 +17,7 @@ #include "CLucene/_ApiHeader.h" #include "TokenSources.h" -#include "CLucene/util/VoidList.h" +#include "CLucene/util/VoidList.h" #include "CLucene/util/CLStreams.h" #include "CLucene/index/IndexReader.h" #include "CLucene/index/TermVector.h" @@ -108,7 +108,7 @@ CLSetList<Token*,TokenOrderCompare>* unsortedTokens = NULL; for (int32_t t = 0; t < freq->length; t++) { - ObjectArray<TermVectorOffsetInfo>* offsets=tpv->getOffsets(t); + ArrayBase<TermVectorOffsetInfo*>* offsets=tpv->getOffsets(t); if(offsets==NULL) return NULL; @@ -211,16 +211,16 @@ this->tokens=tokens; this->length = len; } -bool TokenSources::StoredTokenStream::next(CL_NS(analysis)::Token* token) +CL_NS(analysis)::Token* TokenSources::StoredTokenStream::next(CL_NS(analysis)::Token* token) { if(currentToken>=length) { - return false; + return NULL; } Token* t = tokens[currentToken++]; token->set(t->termBuffer(),t->startOffset(),t->endOffset(),t->type());; - return true; + return token; } void TokenSources::StoredTokenStream::close(){ Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -26,7 +26,7 @@ size_t length; int32_t currentToken; StoredTokenStream(CL_NS(analysis)::Token** tokens, size_t len); - bool next(CL_NS(analysis)::Token* token); + CL_NS(analysis)::Token* next(CL_NS(analysis)::Token* token); void close(); }; public: Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -30,7 +30,7 @@ SnowballAnalyzer::SnowballAnalyzer(const TCHAR* language, const TCHAR** stopWords) { this->language = STRDUP_TtoT(language); - stopSet = _CLNEW CLTCSetList; + stopSet = _CLNEW CLTCSetList(true); StopFilter::fillStopTable(stopSet,stopWords); } @@ -89,9 +89,9 @@ } /** Returns the next input Token, after being stemmed */ - bool SnowballFilter::next(Token* token){ - if (!input->next(token)) - return false; + Token* SnowballFilter::next(Token* token){ + if (input->next(token) == NULL) + return NULL; unsigned char uctext[LUCENE_MAX_WORD_LEN]; TCHAR tchartext[LUCENE_MAX_WORD_LEN]; @@ -124,7 +124,7 @@ tchartext[i]=stemmed[i]; #endif token->set(tchartext,token->startOffset(), token->endOffset(), token->type()); - return true; + return token; } Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -14,7 +14,7 @@ * {@link EnglishStemmer} is named "English". */ class CLUCENE_CONTRIBS_EXPORT SnowballAnalyzer: public Analyzer { - const TCHAR* language; + TCHAR* language; CLTCSetList* stopSet; public: Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballFilter.h =================================================================== --- branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballFilter.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballFilter.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -28,7 +28,7 @@ ~SnowballFilter(); /** Returns the next input Token, after being stemmed */ - bool next(Token* token); + Token* next(Token* token); }; CL_NS_END2 Modified: branches/lucene2_3_2/src/core/CLucene/CLConfig.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/CLConfig.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/core/CLucene/CLConfig.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -18,7 +18,7 @@ // //define this if you want condition debugging to be enabled #if defined(_DEBUG) && !defined(_CL__CND_DEBUG) - //#define _CL__CND_DEBUG + #define _CL__CND_DEBUG #endif // //define this to print out lots of information about merges, etc @@ -41,12 +41,6 @@ // Your application //////////////////////////////////////////////////////////////////// // -//define this to force the build into ascii mode -//#define _ASCII -// -//define this to force the build into ucs2 mode -//#define _UCS2 -// //define this to enable mmap support in the fsdirectory IndexInput //EXPERIMENTAL //#define LUCENE_FS_MMAP @@ -112,40 +106,14 @@ // application //////////////////////////////////////////////////////////////////// // -//define this to your own setting if you would like to implement your own -//threading locking code. it should have the same sort of functions as -//mutex_default. If not defined, clucene will try and use posix,win32 critical -//sections, or a timer based mutex hack. -//#define _LUCENE_THREADMUTEX CL_NS(util)::mutex_default -// //define this if you want to implement the _Cnd_OutDebug routine yourself //you can then easily customise in your own application how to handle debug messages //#define _CND_DEBUG_DONTIMPLEMENT_OUTDEBUG // -//define this if you want to implement your own namespace macros -//#define _LUCENE_DONTIMPLEMENT_NS_MACROS -// -//define this if you do not want clucene to include any standard libraries. -//this could be useful if you want to use alternate libraries -//#define LUCENE_DISABLE_INCLUDES -// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -// These options will be changed depending on your compiler/platform -// but can also be changed here if required -//////////////////////////////////////////////////////////////////// -// -//if you want to define your own default file encoding. specify it -//here - normally defined in the platform specific headers -//#define PLATFORM_DEFAULT_READER_ENCODING CL_NS(util)::FileReader::ENCODING_ASCII -// -//////////////////////////////////////////////////////////////////// - - - -//////////////////////////////////////////////////////////////////// // These options should not be changed. But you can experiment with // them to optimize performance //////////////////////////////////////////////////////////////////// @@ -190,13 +158,6 @@ #define LUCENE_DEFAULT_TOKEN_BUFFER_SIZE 32 //todo: should implement a similar strategy in analysis/token // -//Expert: The fraction of {@link TermDocs} entries stored in skip tables, -//used to accellerate {@link TermDocs#skipTo(int)}. Larger values result in -//smaller indices, greater acceleration, but fewer accelerable cases, while -//smaller values result in bigger indices, less acceleration and more -//accelerable cases. More detailed experiments would be useful here. */ -#define LUCENE_DEFAULT_TERMDOCS_SKIP_INTERVAL 16 -// //Size of TermScore cache. Required. #define LUCENE_SCORE_CACHE_SIZE 32 // @@ -239,9 +200,6 @@ //Size of the CharTokenizer buffersize. Required. #define LUCENE_IO_BUFFER_SIZE 1024 // -//the minimum amount the segment term enum should grow by. Must be at least 1 -#define LUCENE_SEGMENTTERMENUM_GROWSIZE 8 -// //////////////////////////////////////////////////////////////////// #endif Modified: branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -1,13 +1,13 @@ /*------------------------------------------------------------------------------ * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or +* +* Distributable under the terms of either the Apache License (Version 2.0) or * the GNU Lesser General Public License, as specified in the COPYING file. ------------------------------------------------------------------------------*/ /* * this is a monolithic file that can be used to compile clucene using one source file. * it simplifies some build processes by avoiding static & dynamic compalation pitfalls. -* +* * note: when creating a project add either this file, or all the other .cpp files, not both! */ #include "CLucene/StdHeader.cpp" @@ -20,17 +20,27 @@ #include "CLucene/document/DateField.cpp" #include "CLucene/document/DateTools.cpp" #include "CLucene/document/Document.cpp" +#include "CLucene/document/FieldSelector.cpp" #include "CLucene/document/NumberTools.cpp" #include "CLucene/document/Field.cpp" #include "CLucene/index/CompoundFile.cpp" -#include "CLucene/index/DocumentWriter.cpp" +#include "CLucene/index/DirectoryIndexReader.cpp" +#include "CLucene/index/DocumentsWriter.cpp" +#include "CLucene/index/DocumentsWriterThreadState.cpp" #include "CLucene/index/FieldInfos.cpp" #include "CLucene/index/FieldsReader.cpp" #include "CLucene/index/FieldsWriter.cpp" +#include "CLucene/index/IndexFileDeleter.cpp" +#include "CLucene/index/IndexFileNameFilter.cpp" #include "CLucene/index/IndexFileNames.cpp" +#include "CLucene/index/IndexModifier.cpp" #include "CLucene/index/IndexWriter.cpp" #include "CLucene/index/IndexReader.cpp" +#include "CLucene/index/MergePolicy.cpp" +#include "CLucene/index/MergeScheduler.cpp" #include "CLucene/index/MultiReader.cpp" +#include "CLucene/index/MultiSegmentReader.cpp" +#include "CLucene/index/Payload.cpp" #include "CLucene/index/SegmentInfos.cpp" #include "CLucene/index/SegmentMergeInfo.cpp" #include "CLucene/index/SegmentMergeQueue.cpp" @@ -40,6 +50,8 @@ #include "CLucene/index/SegmentTermEnum.cpp" #include "CLucene/index/SegmentTermPositions.cpp" #include "CLucene/index/SegmentTermVector.cpp" +#include "CLucene/index/SkipListReader.cpp" +#include "CLucene/index/SkipListWriter.cpp" #include "CLucene/index/Term.cpp" #include "CLucene/index/Terms.cpp" #include "CLucene/index/TermInfo.cpp" @@ -47,12 +59,11 @@ #include "CLucene/index/TermInfosWriter.cpp" #include "CLucene/index/TermVectorReader.cpp" #include "CLucene/index/TermVectorWriter.cpp" -#include "CLucene/queryParser/Lexer.cpp" +#include "CLucene/queryParser/FastCharStream.cpp" +#include "CLucene/queryParser/QueryParserTokenManager.cpp" #include "CLucene/queryParser/MultiFieldQueryParser.cpp" #include "CLucene/queryParser/QueryParser.cpp" -#include "CLucene/queryParser/QueryParserBase.cpp" #include "CLucene/queryParser/QueryToken.cpp" -#include "CLucene/queryParser/TokenList.cpp" #include "CLucene/search/BooleanQuery.cpp" #include "CLucene/search/BooleanScorer.cpp" #include "CLucene/search/BooleanScorer2.cpp" @@ -73,6 +84,7 @@ #include "CLucene/search/Hits.cpp" #include "CLucene/search/HitQueue.cpp" #include "CLucene/search/IndexSearcher.cpp" +#include "CLucene/search/MatchAllDocsQuery.cpp" #include "CLucene/search/MultiSearcher.cpp" #include "CLucene/search/MultiTermQuery.cpp" #include "CLucene/search/PhrasePositions.cpp" @@ -100,7 +112,7 @@ #include "CLucene/store/IndexOutput.cpp" #include "CLucene/store/Directory.cpp" #include "CLucene/store/RAMDirectory.cpp" -#include "CLucene/store/TransactionalRAMDirectory.cpp" +//#include "CLucene/store/TransactionalRAMDirectory.cpp" #include "CLucene/util/BitSet.cpp" #include "CLucene/util/Equators.cpp" #include "CLucene/util/FastCharStream.cpp" Modified: branches/lucene2_3_2/src/core/CLucene/StdHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/StdHeader.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/core/CLucene/StdHeader.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -10,6 +10,8 @@ #include "CLucene/search/Sort.h" #include "CLucene/search/Similarity.h" #include "CLucene/search/FieldCache.h" +#include "CLucene/index/TermVector.h" +#include "CLucene/index/IndexFileNameFilter.h" #include "CLucene/search/FieldSortedHitQueue.h" #include "CLucene/store/LockFactory.h" #include "CLucene/util/_StringIntern.h" @@ -22,20 +24,21 @@ CL_NS_USE(util) CL_NS_USE(search) +CL_NS_USE(index) CL_NS_USE(store) //clears all static memory. do not attempt to do anything else //in clucene after calling this function void _lucene_shutdown(){ - FieldSortedHitQueue::_shutdown(); - Sort::_shutdown(); - ScoreDocComparator::_shutdown(); - SortField::_shutdown(); - FieldCache::_shutdown(); - Similarity::_shutdown(); - - CLStringIntern::_shutdown(); - NoLockFactory::_shutdown(); - -_ThreadLocal::_shutdown(); + FieldSortedHitQueue::_shutdown(); + Sort::_shutdown(); + ScoreDocComparator::_shutdown(); + SortField::_shutdown(); + FieldCache::_shutdown(); + Similarity::_shutdown(); + CLStringIntern::_shutdown(); + NoLockFactory::_shutdown(); + _ThreadLocal::_shutdown(); + IndexFileNameFilter::_shutdown(); + _CLDELETE (TermVectorOffsetInfo_EMPTY_OFFSET_INFO); } Modified: branches/lucene2_3_2/src/core/CLucene/StdHeader.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/StdHeader.h 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/core/CLucene/StdHeader.h 2009-06-11 17:34:23 UTC (rev 3009) @@ -27,12 +27,12 @@ #define StringArray std::vector<TCHAR*> #define StringArrayWithDeletor CL_NS(util)::CLVector<TCHAR*, CL_NS(util)::Deletor::tcArray > #define StringArrayConst std::vector<const TCHAR*> -#define StringArrayConstWithDeletor CL_NS(util)::CLVector<const TCHAR*, CL_NS(util)::Deletor::tcArray > +//#define StringArrayConstWithDeletor CL_NS(util)::CLVector<const TCHAR*, CL_NS(util)::Deletor::tcArray > #define AStringArray std::vector<char*> #define AStringArrayWithDeletor CL_NS(util)::CLVector<char*, CL_NS(util)::Deletor::acArray > #define AStringArrayConst std::vector<const char*> -#define AStringArrayConstWithDeletor CL_NS(util)::CLVector<const char*, CL_NS(util)::Deletor::acArray > +//#define AStringArrayConstWithDeletor CL_NS(util)::CLVector<const char*, CL_NS(util)::Deletor::acArray > //call this at the end of running to clean up memory. extern CLUCENE_EXPORT void _lucene_shutdown(); Modified: branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2009-06-11 16:19:00 UTC (rev 3008) +++ branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp 2009-06-11 17:34:23 UTC (rev 3009) @@ -1,13 +1,14 @@ /*------------------------------------------------------------------------------ * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or +* +* Distributable under the terms of either the Apache License (Version 2.0) or * the GNU Lesser General Public License, as specified in the COPYING file. ------------------------------------------------------------------------------*/ #include "CLucene/_ApiHeader.h" #include "AnalysisHeader.h" #include "CLucene/util/StringBuffer.h" #include "CLucene/util/_ThreadLocal.h" +#include <assert.h> CL_NS_USE(util) ... [truncated message content] |
From: <ust...@us...> - 2009-09-27 11:33:58
|
Revision: 3024 http://clucene.svn.sourceforge.net/clucene/?rev=3024&view=rev Author: ustramooner Date: 2009-09-27 11:33:44 +0000 (Sun, 27 Sep 2009) Log Message: ----------- svn merge fix for master/svn Modified Paths: -------------- branches/lucene2_3_2/ChangeLog branches/lucene2_3_2/LGPL.license branches/lucene2_3_2/cmake/CLuceneDocs.cmake branches/lucene2_3_2/cmake/CreateClucenePackages.cmake branches/lucene2_3_2/cmake/DefineOptions.cmake branches/lucene2_3_2/doc/coding standards.txt branches/lucene2_3_2/doc/doxygen.css.cmake branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.cpp branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.h branches/lucene2_3_2/src/contribs/benchmarker/Main.cpp branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.cpp branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.h branches/lucene2_3_2/src/contribs/benchmarker/Timer.h branches/lucene2_3_2/src/contribs/benchmarker/Unit.cpp branches/lucene2_3_2/src/contribs/benchmarker/Unit.h branches/lucene2_3_2/src/contribs/benchmarker/stdafx.cpp branches/lucene2_3_2/src/contribs/benchmarker/stdafx.h branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/PorterStemmer.h branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/debug/error.cpp branches/lucene2_3_2/src/core/CLucene/debug/error.h branches/lucene2_3_2/src/core/CLucene/document/DateField.cpp branches/lucene2_3_2/src/core/CLucene/document/Document.cpp branches/lucene2_3_2/src/core/CLucene/index/DocumentsWriterThreadState.cpp branches/lucene2_3_2/src/core/CLucene/index/FieldInfos.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexDeletionPolicy.h branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.h branches/lucene2_3_2/src/core/CLucene/index/Payload.h branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/SkipListReader.cpp branches/lucene2_3_2/src/core/CLucene/index/_SkipListReader.h branches/lucene2_3_2/src/core/CLucene/index/_Term.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosReader.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosWriter.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/QueryParserBase.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp branches/lucene2_3_2/src/core/CLucene/search/CachingWrapperFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/CachingWrapperFilter.h branches/lucene2_3_2/src/core/CLucene/search/ConjunctionScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/IndexSearcher.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.h branches/lucene2_3_2/src/core/CLucene/search/Query.h branches/lucene2_3_2/src/core/CLucene/search/ScorerDocQueue.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/Similarity.cpp branches/lucene2_3_2/src/core/CLucene/search/_BooleanScorer2.h branches/lucene2_3_2/src/core/CLucene/search/_ConjunctionScorer.h branches/lucene2_3_2/src/core/CLucene/search/_DisjunctionSumScorer.h branches/lucene2_3_2/src/core/CLucene/search/_PhrasePositions.h branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.h branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp branches/lucene2_3_2/src/core/CLucene/store/_MMap.h branches/lucene2_3_2/src/core/CLucene/store/_RAMDirectory.h branches/lucene2_3_2/src/core/CLucene/util/CLStreams.h branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h branches/lucene2_3_2/src/core/CLucene/util/Reader.cpp branches/lucene2_3_2/src/core/CLucene/util/ThreadLocal.cpp branches/lucene2_3_2/src/core/CLucene/util/VoidList.h branches/lucene2_3_2/src/core/CLucene/util/_ThreadLocal.h branches/lucene2_3_2/src/core/files_list.txt branches/lucene2_3_2/src/shared/CLucene/SharedHeader.cpp branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/config/_threads.h branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp branches/lucene2_3_2/src/shared/CLucene/config/repl_wctype.h branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.h branches/lucene2_3_2/src/shared/README branches/lucene2_3_2/src/shared/cmake/CheckErrorHandling.cmake branches/lucene2_3_2/src/shared/cmake/CheckFloatByte.cmake branches/lucene2_3_2/src/shared/cmake/CheckFloatByte.cpp.in branches/lucene2_3_2/src/shared/cmake/CheckHashmaps.cmake branches/lucene2_3_2/src/shared/cmake/CheckNamespace.cmake branches/lucene2_3_2/src/shared/cmake/CheckPthread.cmake branches/lucene2_3_2/src/shared/cmake/CheckSnprintf.cmake branches/lucene2_3_2/src/shared/cmake/CheckStdCallFunctionExists.cmake branches/lucene2_3_2/src/shared/cmake/CheckStdCallFunctionExists.cpp.in branches/lucene2_3_2/src/shared/cmake/DefineDword.cmake branches/lucene2_3_2/src/shared/cmake/DefineFloat.cmake branches/lucene2_3_2/src/shared/cmake/DefineLongLongSyntax.cmake branches/lucene2_3_2/src/shared/cmake/DefineMAXPATHValue.cmake branches/lucene2_3_2/src/shared/cmake/DefineStaticSyntax.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseFunction.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseMisc.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseSymbol.cmake branches/lucene2_3_2/src/shared/cmake/MacroChooseType.cmake branches/lucene2_3_2/src/shared/cmake/MacroGetVariableValue.c.in branches/lucene2_3_2/src/shared/cmake/MacroGetVariableValue.cmake branches/lucene2_3_2/src/shared/cmake/Macro_ChooseStatus.cmake branches/lucene2_3_2/src/test/analysis/TestAnalysis.cpp branches/lucene2_3_2/src/test/data/StopWords.test branches/lucene2_3_2/src/test/document/TestDocument.cpp branches/lucene2_3_2/src/test/index/TestIndexWriter.cpp branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp branches/lucene2_3_2/src/test/search/TestForDuplicates.cpp branches/lucene2_3_2/src/test/search/TestQueries.cpp branches/lucene2_3_2/src/test/search/TestSearch.cpp branches/lucene2_3_2/src/test/search/TestTermVector.cpp branches/lucene2_3_2/src/test/util/TestPriorityQueue.cpp Modified: branches/lucene2_3_2/ChangeLog =================================================================== --- branches/lucene2_3_2/ChangeLog 2009-09-27 08:59:45 UTC (rev 3023) +++ branches/lucene2_3_2/ChangeLog 2009-09-27 11:33:44 UTC (rev 3024) @@ -1,17 +1,17 @@ -Removed jstreams namespace. Sorry, I couldn't think of a way to nicely deprecate jstreams. - -version 0.9.23: -Changes: -* Static object fields have been changed to method accessors (SortField::FIELDDOC now chould be accessed as SortField::FIELDDOC(), for example). Classes changed: FieldCache, ScoreDocComparator, - This was necessary for creating static libraries work on certain platforms. -* Folders were reorganised, this seems like a good time to do it -* Some deprecated functions were removed. -* moved platform configuration type code and utility code into 'shared' project. This enables tests to be built with a shared library on windows -* Moved moved of the platform specific logic into cmake in order to reduce #ifdefs in code (i love cmake!) -* added contributions code into the trunk. this will hopefully mean more exposure to the contributions. need to make clear about the licensing still, though. -* Deletor::Array was renamed to Deletor::vArray. -* re-worked the install location for system-dependent files (clucene-config.h). this was a confusing issue, and i think it's better to stick to the standards rather than push the more compatible (in my opinion) way of doing things. this one has been getting so many complaints from downstream. however, LUCENE_SYS_INCLUDES is available to install the clucene-config.h type files into the library directory (or any other place). - -Here is a summary of changes that you'll need to look at for this release: -* Action deprecated features. Some features that were deprecated for a long time have now been finally removed. -* fix things that may affect you, such as the LUCENE_SYS_INCLUDES change, and the reorganisation of code (install locations are still the same though). Also autotools removals may affect your work, depending on how you use clucene. +Removed jstreams namespace. Sorry, I couldn't think of a way to nicely deprecate jstreams. + +version 0.9.23: +Changes: +* Static object fields have been changed to method accessors (SortField::FIELDDOC now chould be accessed as SortField::FIELDDOC(), for example). Classes changed: FieldCache, ScoreDocComparator, + This was necessary for creating static libraries work on certain platforms. +* Folders were reorganised, this seems like a good time to do it +* Some deprecated functions were removed. +* moved platform configuration type code and utility code into 'shared' project. This enables tests to be built with a shared library on windows +* Moved moved of the platform specific logic into cmake in order to reduce #ifdefs in code (i love cmake!) +* added contributions code into the trunk. this will hopefully mean more exposure to the contributions. need to make clear about the licensing still, though. +* Deletor::Array was renamed to Deletor::vArray. +* re-worked the install location for system-dependent files (clucene-config.h). this was a confusing issue, and i think it's better to stick to the standards rather than push the more compatible (in my opinion) way of doing things. this one has been getting so many complaints from downstream. however, LUCENE_SYS_INCLUDES is available to install the clucene-config.h type files into the library directory (or any other place). + +Here is a summary of changes that you'll need to look at for this release: +* Action deprecated features. Some features that were deprecated for a long time have now been finally removed. +* fix things that may affect you, such as the LUCENE_SYS_INCLUDES change, and the reorganisation of code (install locations are still the same though). Also autotools removals may affect your work, depending on how you use clucene. Modified: branches/lucene2_3_2/LGPL.license =================================================================== --- branches/lucene2_3_2/LGPL.license 2009-09-27 08:59:45 UTC (rev 3023) +++ branches/lucene2_3_2/LGPL.license 2009-09-27 11:33:44 UTC (rev 3024) @@ -1,475 +1,475 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - -------------------------------------------------------------------------------- - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - -------------------------------------------------------------------------------- - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - -------------------------------------------------------------------------------- - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - -------------------------------------------------------------------------------- - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - -------------------------------------------------------------------------------- - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - -------------------------------------------------------------------------------- - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - -------------------------------------------------------------------------------- - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - -------------------------------------------------------------------------------- - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + +------------------------------------------------------------------------------- + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + +------------------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + +------------------------------------------------------------------------------- + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + +------------------------------------------------------------------------------- + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + +------------------------------------------------------------------------------- + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + +------------------------------------------------------------------------------- + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + +------------------------------------------------------------------------------- + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an... [truncated message content] |
From: <ust...@us...> - 2009-09-27 13:29:45
|
Revision: 3025 http://clucene.svn.sourceforge.net/clucene/?rev=3025&view=rev Author: ustramooner Date: 2009-09-27 13:29:39 +0000 (Sun, 27 Sep 2009) Log Message: ----------- Merge commit 'origin/master' Modified Paths: -------------- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/test/CMakeLists.txt branches/lucene2_3_2/src/test/test.h branches/lucene2_3_2/src/test/tests.cpp Added Paths: ----------- branches/lucene2_3_2/.gitignore branches/lucene2_3_2/src/test/search/TestBoolean.cpp Added: branches/lucene2_3_2/.gitignore =================================================================== --- branches/lucene2_3_2/.gitignore (rev 0) +++ branches/lucene2_3_2/.gitignore 2009-09-27 13:29:39 UTC (rev 3025) @@ -0,0 +1,11 @@ +# git-ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +obj +bin +msvc +build +~$* \ No newline at end of file Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2009-09-27 11:33:44 UTC (rev 3024) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp 2009-09-27 13:29:39 UTC (rev 3025) @@ -109,7 +109,9 @@ return maxClauseCount; } - void BooleanQuery::setMaxClauseCount(size_t maxClauseCount){ + void BooleanQuery::setMaxClauseCount(const size_t maxClauseCount){ + if (maxClauseCount < 1) + _CLTHROWA(CL_ERR_IllegalArgument, "maxClauseCount must be >= 1"); BooleanQuery::maxClauseCount = maxClauseCount; } Modified: branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h =================================================================== --- branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2009-09-27 11:33:44 UTC (rev 3024) +++ branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h 2009-09-27 13:29:39 UTC (rev 3025) @@ -51,7 +51,7 @@ static size_t getMaxClauseCount(); /** Set the maximum number of clauses permitted. */ - static void setMaxClauseCount(size_t maxClauseCount); + static void setMaxClauseCount(const size_t maxClauseCount); /** Adds a clause to a boolean query. Clauses may be: * <ul> Modified: branches/lucene2_3_2/src/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/test/CMakeLists.txt 2009-09-27 11:33:44 UTC (rev 3024) +++ branches/lucene2_3_2/src/test/CMakeLists.txt 2009-09-27 13:29:39 UTC (rev 3025) @@ -29,6 +29,7 @@ ./document/TestDocument.cpp ./document/TestNumberTools.cpp ./store/TestStore.cpp +./search/TestBoolean.cpp ./search/TestDateFilter.cpp ./search/TestForDuplicates.cpp ./search/TestQueries.cpp Added: branches/lucene2_3_2/src/test/search/TestBoolean.cpp =================================================================== --- branches/lucene2_3_2/src/test/search/TestBoolean.cpp (rev 0) +++ branches/lucene2_3_2/src/test/search/TestBoolean.cpp 2009-09-27 13:29:39 UTC (rev 3025) @@ -0,0 +1,181 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ +#include "test.h" + +/// TestBooleanQuery.java, ported 5/9/2009 +void testEquality(CuTest *tc) { + BooleanQuery* bq1 = _CLNEW BooleanQuery(); + Term* t = _CLNEW Term(_T("field"), _T("value1")); + bq1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + t = _CLNEW Term(_T("field"), _T("value2")); + bq1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + BooleanQuery* nested1 = _CLNEW BooleanQuery(); + t = _CLNEW Term(_T("field"), _T("nestedvalue1")); + nested1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + t = _CLNEW Term(_T("field"), _T("nestedvalue2")); + nested1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + bq1->add(nested1, true, BooleanClause::SHOULD); + + BooleanQuery* bq2 = _CLNEW BooleanQuery(); + t = _CLNEW Term(_T("field"), _T("value1")); + bq2->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + t = _CLNEW Term(_T("field"), _T("value2")); + bq2->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + BooleanQuery* nested2 = _CLNEW BooleanQuery(); + t = _CLNEW Term(_T("field"), _T("nestedvalue1")); + nested2->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + t = _CLNEW Term(_T("field"), _T("nestedvalue2")); + nested2->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + bq2->add(nested2, true, BooleanClause::SHOULD); + + CLUCENE_ASSERT(bq1->equals(bq2)); + + _CLLDELETE(bq1); + _CLLDELETE(bq2); +} +void testException(CuTest *tc) { + try { + BooleanQuery::setMaxClauseCount(0); + CuFail(tc, _T("setMaxClauseCount(0) did not throw an exception")); + } catch (CLuceneError&) { + // okay + } +} + +/// TestBooleanScorer.java, ported 5/9/2009 +void testBooleanScorer(CuTest *tc) { + const TCHAR* FIELD = _T("category"); + RAMDirectory directory; + + TCHAR* values[] = { _T("1"), _T("2"), _T("3"), _T("4"), NULL}; + + try { + WhitespaceAnalyzer a; + IndexWriter* writer = _CLNEW IndexWriter(&directory, &a, true); + for (size_t i = 0; values[i]!=NULL; i++) { + Document* doc = _CLNEW Document(); + doc->add(*_CLNEW Field(FIELD, values[i], Field::STORE_YES | Field::INDEX_TOKENIZED)); + writer->addDocument(doc); + _CLLDELETE(doc); + } + writer->close(); + _CLLDELETE(writer); + + BooleanQuery* booleanQuery1 = _CLNEW BooleanQuery(); + Term *t = _CLNEW Term(FIELD, _T("1")); + booleanQuery1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + t = _CLNEW Term(FIELD, _T("2")); + booleanQuery1->add(_CLNEW TermQuery(t), true, BooleanClause::SHOULD); + _CLDECDELETE(t); + + BooleanQuery* query = _CLNEW BooleanQuery(); + query->add(booleanQuery1, true, BooleanClause::MUST); + t = _CLNEW Term(FIELD, _T("9")); + query->add(_CLNEW TermQuery(t), true, BooleanClause::MUST_NOT); + _CLDECDELETE(t); + + IndexSearcher *indexSearcher = _CLNEW IndexSearcher(&directory); + Hits *hits = indexSearcher->search(query); + CLUCENE_ASSERT(2 == hits->length()); // Number of matched documents + _CLLDELETE(hits); + _CLLDELETE(indexSearcher); + + _CLLDELETE(query); + } + catch (CLuceneError& e) { + CuFail(tc, e.twhat()); + } +} + +/// TestBooleanPrefixQuery.java, ported 5/9/2009 +void testBooleanPrefixQuery(CuTest* tc) { + RAMDirectory directory; + WhitespaceAnalyzer a; + + TCHAR* categories[] = {_T("food"), _T("foodanddrink"), + _T("foodanddrinkandgoodtimes"), _T("food and drink"), NULL}; + + Query* rw1 = NULL; + Query* rw2 = NULL; + try { + IndexWriter* writer = _CLNEW IndexWriter(&directory, &a, true); + for (size_t i = 0; categories[i]!=NULL; i++) { + Document* doc = new Document(); + doc->add(*_CLNEW Field(_T("category"), categories[i], Field::STORE_YES | Field::INDEX_UNTOKENIZED)); + writer->addDocument(doc); + _CLLDELETE(doc); + } + writer->close(); + _CLLDELETE(writer); + + IndexReader* reader = IndexReader::open(&directory); + Term* t = _CLNEW Term(_T("category"), _T("foo")); + PrefixQuery* query = _CLNEW PrefixQuery(t); + _CLDECDELETE(t); + + rw1 = query->rewrite(reader); + + BooleanQuery* bq = _CLNEW BooleanQuery(); + bq->add(query, true, BooleanClause::MUST); + + rw2 = bq->rewrite(reader); + + reader->close(); // TODO: check necessity (_CLLDELETE(reader) alone will not do the same cleanup) + + _CLLDELETE(reader); + _CLLDELETE(bq); + } catch (CLuceneError& e) { + CuFail(tc, e.twhat()); + } + + BooleanQuery* bq1 = NULL; + if (rw1->instanceOf(BooleanQuery::getClassName())) { + bq1 = (BooleanQuery*) rw1; + } + + BooleanQuery* bq2 = NULL; + if (rw2->instanceOf(BooleanQuery::getClassName())) { + bq2 = (BooleanQuery*) rw2; + } else { + CuFail(tc, _T("Rewrite")); + } + + bool bClausesMatch = bq1->getClauseCount() == bq2->getClauseCount(); + + _CLLDELETE(rw1); + _CLLDELETE(rw2); + + if (!bClausesMatch) { + CuFail(tc, _T("Number of Clauses Mismatch")); + } +} + +CuSuite *testBoolean(void) +{ + CuSuite *suite = CuSuiteNew(_T("CLucene Boolean Tests")); + + SUITE_ADD_TEST(suite, testEquality); + SUITE_ADD_TEST(suite, testException); + + SUITE_ADD_TEST(suite, testBooleanScorer); + + SUITE_ADD_TEST(suite, testBooleanPrefixQuery); + + //_CrtSetBreakAlloc(1179); + + return suite; +} +// EOF Modified: branches/lucene2_3_2/src/test/test.h =================================================================== --- branches/lucene2_3_2/src/test/test.h 2009-09-27 11:33:44 UTC (rev 3024) +++ branches/lucene2_3_2/src/test/test.h 2009-09-27 13:29:39 UTC (rev 3025) @@ -57,6 +57,8 @@ CuSuite *testreuters(void); CuSuite *testdocument(void); CuSuite *testNumberTools(void); +CuSuite *testDateTools(void); +CuSuite *testBoolean(void); class English{ public: Modified: branches/lucene2_3_2/src/test/tests.cpp =================================================================== --- branches/lucene2_3_2/src/test/tests.cpp 2009-09-27 11:33:44 UTC (rev 3024) +++ branches/lucene2_3_2/src/test/tests.cpp 2009-09-27 13:29:39 UTC (rev 3025) @@ -20,6 +20,7 @@ {"priorityqueue", testpriorityqueue}, {"queryparser", testQueryParser}, {"mfqueryparser", testMultiFieldQueryParser}, + {"boolean", testBoolean}, {"search", testsearch}, {"queries", testqueries}, {"termvector",testtermvector}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ust...@us...> - 2010-08-24 15:01:10
|
Revision: 3027 http://clucene.svn.sourceforge.net/clucene/?rev=3027&view=rev Author: ustramooner Date: 2010-08-24 15:00:54 +0000 (Tue, 24 Aug 2010) Log Message: ----------- merged git master Modified Paths: -------------- branches/lucene2_3_2/CMakeLists.txt branches/lucene2_3_2/COPYING branches/lucene2_3_2/INSTALL branches/lucene2_3_2/cmake/CreateClucenePackages.cmake branches/lucene2_3_2/dist-test.sh branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.cpp branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.h branches/lucene2_3_2/src/contribs/benchmarker/Main.cpp branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.cpp branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.h branches/lucene2_3_2/src/contribs/benchmarker/Timer.h branches/lucene2_3_2/src/contribs/benchmarker/Unit.cpp branches/lucene2_3_2/src/contribs/benchmarker/Unit.h branches/lucene2_3_2/src/contribs/benchmarker/stdafx.cpp branches/lucene2_3_2/src/contribs/benchmarker/stdafx.h branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt branches/lucene2_3_2/src/contribs/contribs-lib-test/TestAnalysis.cpp branches/lucene2_3_2/src/contribs/contribs-lib-test/TestHighlight.cpp branches/lucene2_3_2/src/contribs/contribs-lib-test/TestSnowball.cpp branches/lucene2_3_2/src/contribs/contribs-lib-test/TestUtf8.cpp branches/lucene2_3_2/src/contribs/contribs-lib-test/contribTests.cpp branches/lucene2_3_2/src/contribs/contribs-lib-test/test.h branches/lucene2_3_2/src/contribs/contribs-lib-test/testall.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/LanguageBasedAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/analysis/cjk/CJKAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/Snowball.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballFilter.h branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt branches/lucene2_3_2/src/core/CLucene/CLConfig.h branches/lucene2_3_2/src/core/CLucene/CLMonolithic.cpp branches/lucene2_3_2/src/core/CLucene/StdHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.cpp branches/lucene2_3_2/src/core/CLucene/analysis/AnalysisHeader.h branches/lucene2_3_2/src/core/CLucene/analysis/Analyzers.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardAnalyzer.h branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.cpp branches/lucene2_3_2/src/core/CLucene/analysis/standard/StandardTokenizer.h branches/lucene2_3_2/src/core/CLucene/debug/error.cpp branches/lucene2_3_2/src/core/CLucene/debug/error.h branches/lucene2_3_2/src/core/CLucene/debug/lucenebase.h branches/lucene2_3_2/src/core/CLucene/debug/mem.h branches/lucene2_3_2/src/core/CLucene/document/DateTools.cpp branches/lucene2_3_2/src/core/CLucene/document/DateTools.h branches/lucene2_3_2/src/core/CLucene/document/Document.h branches/lucene2_3_2/src/core/CLucene/document/Field.cpp branches/lucene2_3_2/src/core/CLucene/document/Field.h branches/lucene2_3_2/src/core/CLucene/document/FieldSelector.cpp branches/lucene2_3_2/src/core/CLucene/document/FieldSelector.h branches/lucene2_3_2/src/core/CLucene/document/NumberTools.cpp branches/lucene2_3_2/src/core/CLucene/document/NumberTools.h branches/lucene2_3_2/src/core/CLucene/index/CompoundFile.cpp branches/lucene2_3_2/src/core/CLucene/index/DirectoryIndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/DirectoryIndexReader.h branches/lucene2_3_2/src/core/CLucene/index/DocumentsWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/DocumentsWriterThreadState.cpp branches/lucene2_3_2/src/core/CLucene/index/FieldsReader.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexDeletionPolicy.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexDeletionPolicy.h branches/lucene2_3_2/src/core/CLucene/index/IndexFileDeleter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexFileNameFilter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexFileNames.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexModifier.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexModifier.h branches/lucene2_3_2/src/core/CLucene/index/IndexReader.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexReader.h branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/IndexWriter.h branches/lucene2_3_2/src/core/CLucene/index/MergePolicy.cpp branches/lucene2_3_2/src/core/CLucene/index/MergePolicy.h branches/lucene2_3_2/src/core/CLucene/index/MergeScheduler.h branches/lucene2_3_2/src/core/CLucene/index/MultiReader.cpp branches/lucene2_3_2/src/core/CLucene/index/MultiReader.h branches/lucene2_3_2/src/core/CLucene/index/MultiSegmentReader.cpp branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/MultipleTermPositions.h branches/lucene2_3_2/src/core/CLucene/index/SegmentInfos.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeInfo.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMergeQueue.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentMerger.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentReader.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermDocs.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermPositions.cpp branches/lucene2_3_2/src/core/CLucene/index/SegmentTermVector.cpp branches/lucene2_3_2/src/core/CLucene/index/SkipListReader.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.cpp branches/lucene2_3_2/src/core/CLucene/index/Term.h branches/lucene2_3_2/src/core/CLucene/index/TermInfosReader.cpp branches/lucene2_3_2/src/core/CLucene/index/TermInfosWriter.cpp branches/lucene2_3_2/src/core/CLucene/index/TermVectorReader.cpp branches/lucene2_3_2/src/core/CLucene/index/Terms.cpp branches/lucene2_3_2/src/core/CLucene/index/Terms.h branches/lucene2_3_2/src/core/CLucene/index/_CompoundFile.h branches/lucene2_3_2/src/core/CLucene/index/_DocumentsWriter.h branches/lucene2_3_2/src/core/CLucene/index/_FieldsReader.h branches/lucene2_3_2/src/core/CLucene/index/_FieldsWriter.h branches/lucene2_3_2/src/core/CLucene/index/_IndexFileNames.h branches/lucene2_3_2/src/core/CLucene/index/_MultiSegmentReader.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentHeader.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentInfos.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentMergeInfo.h branches/lucene2_3_2/src/core/CLucene/index/_SegmentTermEnum.h branches/lucene2_3_2/src/core/CLucene/index/_Term.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosReader.h branches/lucene2_3_2/src/core/CLucene/index/_TermInfosWriter.h branches/lucene2_3_2/src/core/CLucene/queryParser/FastCharStream.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/MultiFieldQueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParser.h branches/lucene2_3_2/src/core/CLucene/queryParser/QueryParserTokenManager.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/QueryToken.cpp branches/lucene2_3_2/src/core/CLucene/queryParser/legacy/QueryParserBase.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanQuery.h branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/BooleanScorer2.cpp branches/lucene2_3_2/src/core/CLucene/search/CachingWrapperFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/CachingWrapperFilter.h branches/lucene2_3_2/src/core/CLucene/search/ChainedFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/ConjunctionScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/ConstantScoreQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/ConstantScoreQuery.h branches/lucene2_3_2/src/core/CLucene/search/DateFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/DateFilter.h branches/lucene2_3_2/src/core/CLucene/search/DisjunctionSumScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/Explanation.cpp branches/lucene2_3_2/src/core/CLucene/search/Explanation.h branches/lucene2_3_2/src/core/CLucene/search/FieldCacheImpl.cpp branches/lucene2_3_2/src/core/CLucene/search/FilteredTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/search/FilteredTermEnum.h branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/FuzzyQuery.h branches/lucene2_3_2/src/core/CLucene/search/Hits.h branches/lucene2_3_2/src/core/CLucene/search/IndexSearcher.cpp branches/lucene2_3_2/src/core/CLucene/search/IndexSearcher.h branches/lucene2_3_2/src/core/CLucene/search/MatchAllDocsQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MatchAllDocsQuery.h branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiPhraseQuery.h branches/lucene2_3_2/src/core/CLucene/search/MultiSearcher.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiSearcher.h branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/MultiTermQuery.h branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PhraseQuery.h branches/lucene2_3_2/src/core/CLucene/search/PhraseScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/PrefixQuery.h branches/lucene2_3_2/src/core/CLucene/search/Query.h branches/lucene2_3_2/src/core/CLucene/search/QueryFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/RangeFilter.cpp branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/RangeQuery.h branches/lucene2_3_2/src/core/CLucene/search/Scorer.cpp branches/lucene2_3_2/src/core/CLucene/search/SearchHeader.cpp branches/lucene2_3_2/src/core/CLucene/search/Searchable.h branches/lucene2_3_2/src/core/CLucene/search/Similarity.cpp branches/lucene2_3_2/src/core/CLucene/search/Similarity.h branches/lucene2_3_2/src/core/CLucene/search/TermQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/TermQuery.h branches/lucene2_3_2/src/core/CLucene/search/TermScorer.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardQuery.h branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.cpp branches/lucene2_3_2/src/core/CLucene/search/WildcardTermEnum.h branches/lucene2_3_2/src/core/CLucene/search/_DisjunctionSumScorer.h branches/lucene2_3_2/src/core/CLucene/store/Directory.cpp branches/lucene2_3_2/src/core/CLucene/store/Directory.h branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/IndexInput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexInput.h branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.cpp branches/lucene2_3_2/src/core/CLucene/store/IndexOutput.h branches/lucene2_3_2/src/core/CLucene/store/Lock.cpp branches/lucene2_3_2/src/core/CLucene/store/Lock.h branches/lucene2_3_2/src/core/CLucene/store/LockFactory.cpp branches/lucene2_3_2/src/core/CLucene/store/LockFactory.h branches/lucene2_3_2/src/core/CLucene/store/MMapInput.cpp branches/lucene2_3_2/src/core/CLucene/store/RAMDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/_Lock.h branches/lucene2_3_2/src/core/CLucene/store/_RAMDirectory.h branches/lucene2_3_2/src/core/CLucene/util/Array.h branches/lucene2_3_2/src/core/CLucene/util/BitSet.cpp branches/lucene2_3_2/src/core/CLucene/util/CLStreams.h branches/lucene2_3_2/src/core/CLucene/util/Equators.h branches/lucene2_3_2/src/core/CLucene/util/PriorityQueue.h branches/lucene2_3_2/src/core/CLucene/util/Reader.cpp branches/lucene2_3_2/src/core/CLucene/util/StringIntern.cpp branches/lucene2_3_2/src/core/CLucene/util/ThreadLocal.cpp branches/lucene2_3_2/src/core/CLucene/util/VoidList.h branches/lucene2_3_2/src/core/CLucene/util/_bufferedstream.h branches/lucene2_3_2/src/core/CLucene/util/_streambase.h branches/lucene2_3_2/src/core/CLucene/util/_streambuffer.h branches/lucene2_3_2/src/core/CMakeLists.txt branches/lucene2_3_2/src/core/files_list.txt branches/lucene2_3_2/src/shared/CLucene/LuceneThreads.h branches/lucene2_3_2/src/shared/CLucene/SharedHeader.cpp branches/lucene2_3_2/src/shared/CLucene/SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/_SharedHeader.h branches/lucene2_3_2/src/shared/CLucene/clucene-config.h.cmake branches/lucene2_3_2/src/shared/CLucene/config/_threads.h branches/lucene2_3_2/src/shared/CLucene/config/repl_tprintf.cpp branches/lucene2_3_2/src/shared/CLucene/config/threads.cpp branches/lucene2_3_2/src/shared/CLucene/config/utf8.cpp branches/lucene2_3_2/src/shared/CLucene/util/Misc.cpp branches/lucene2_3_2/src/shared/CLucene/util/Misc.h branches/lucene2_3_2/src/shared/CLucene/util/StringBuffer.cpp branches/lucene2_3_2/src/shared/CMakeLists.txt branches/lucene2_3_2/src/shared/README branches/lucene2_3_2/src/shared/cmake/MacroCheckGccVisibility.cmake branches/lucene2_3_2/src/test/CLMonolithic_Test.cpp branches/lucene2_3_2/src/test/CMakeLists.txt branches/lucene2_3_2/src/test/analysis/TestAnalyzers.cpp branches/lucene2_3_2/src/test/document/TestDateTools.cpp branches/lucene2_3_2/src/test/index/TestHighFreqTerms.cpp branches/lucene2_3_2/src/test/index/TestIndexModifier.cpp branches/lucene2_3_2/src/test/index/TestIndexReader.cpp branches/lucene2_3_2/src/test/index/TestIndexWriter.cpp branches/lucene2_3_2/src/test/index/TestReuters.cpp branches/lucene2_3_2/src/test/index/TestThreading.cpp branches/lucene2_3_2/src/test/index/TestUtf8.cpp branches/lucene2_3_2/src/test/queryParser/TestMultiFieldQueryParser.cpp branches/lucene2_3_2/src/test/queryParser/TestQueryParser.cpp branches/lucene2_3_2/src/test/search/TestBoolean.cpp branches/lucene2_3_2/src/test/search/TestDateFilter.cpp branches/lucene2_3_2/src/test/search/TestQueries.cpp branches/lucene2_3_2/src/test/search/TestRangeFilter.cpp branches/lucene2_3_2/src/test/search/TestSearch.cpp branches/lucene2_3_2/src/test/search/TestSort.cpp branches/lucene2_3_2/src/test/search/TestTermVector.cpp branches/lucene2_3_2/src/test/search/TestWildcard.cpp branches/lucene2_3_2/src/test/store/TestStore.cpp branches/lucene2_3_2/src/test/test.h branches/lucene2_3_2/src/test/testall.cpp branches/lucene2_3_2/src/test/tests.cpp Added Paths: ----------- branches/lucene2_3_2/cmake/CLuceneBoost.cmake branches/lucene2_3_2/src/core/CLucene/index/_IndexFileNameFilter.h branches/lucene2_3_2/src/core/CLucene/store/BufferedIndexInput.cpp branches/lucene2_3_2/src/core/CLucene/store/BufferedIndexInput.h branches/lucene2_3_2/src/core/CLucene/store/BufferedIndexOutput.cpp branches/lucene2_3_2/src/core/CLucene/store/BufferedIndexOutput.h branches/lucene2_3_2/src/core/CLucene/store/MMapDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/SharedHandle.cpp branches/lucene2_3_2/src/core/CLucene/store/_FSDirectory.h branches/lucene2_3_2/src/core/CLucene/store/_MMapDirectory.h branches/lucene2_3_2/src/core/CLucene/store/_MMapIndexInput.h branches/lucene2_3_2/src/core/CLucene/store/_SharedHandle.h branches/lucene2_3_2/src/core/libclucene-core.pc.cmake branches/lucene2_3_2/src/ext/ branches/lucene2_3_2/src/ext/CMakeLists.txt branches/lucene2_3_2/src/ext/boost/ branches/lucene2_3_2/src/ext/boost/assert.hpp branches/lucene2_3_2/src/ext/boost/checked_delete.hpp branches/lucene2_3_2/src/ext/boost/config/ branches/lucene2_3_2/src/ext/boost/config/abi/ branches/lucene2_3_2/src/ext/boost/config/abi/borland_prefix.hpp branches/lucene2_3_2/src/ext/boost/config/abi/borland_suffix.hpp branches/lucene2_3_2/src/ext/boost/config/abi/msvc_prefix.hpp branches/lucene2_3_2/src/ext/boost/config/abi/msvc_suffix.hpp branches/lucene2_3_2/src/ext/boost/config/abi_prefix.hpp branches/lucene2_3_2/src/ext/boost/config/abi_suffix.hpp branches/lucene2_3_2/src/ext/boost/config/auto_link.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/ branches/lucene2_3_2/src/ext/boost/config/compiler/borland.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/codegear.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/comeau.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/common_edg.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/compaq_cxx.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/digitalmars.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/gcc.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/gcc_xml.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/greenhills.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/hp_acc.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/intel.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/kai.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/metrowerks.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/mpw.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/pgi.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/sgi_mipspro.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/sunpro_cc.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/vacpp.hpp branches/lucene2_3_2/src/ext/boost/config/compiler/visualc.hpp branches/lucene2_3_2/src/ext/boost/config/no_tr1/ branches/lucene2_3_2/src/ext/boost/config/no_tr1/cmath.hpp branches/lucene2_3_2/src/ext/boost/config/no_tr1/complex.hpp branches/lucene2_3_2/src/ext/boost/config/no_tr1/functional.hpp branches/lucene2_3_2/src/ext/boost/config/no_tr1/memory.hpp branches/lucene2_3_2/src/ext/boost/config/no_tr1/utility.hpp branches/lucene2_3_2/src/ext/boost/config/platform/ branches/lucene2_3_2/src/ext/boost/config/platform/aix.hpp branches/lucene2_3_2/src/ext/boost/config/platform/amigaos.hpp branches/lucene2_3_2/src/ext/boost/config/platform/beos.hpp branches/lucene2_3_2/src/ext/boost/config/platform/bsd.hpp branches/lucene2_3_2/src/ext/boost/config/platform/cygwin.hpp branches/lucene2_3_2/src/ext/boost/config/platform/hpux.hpp branches/lucene2_3_2/src/ext/boost/config/platform/irix.hpp branches/lucene2_3_2/src/ext/boost/config/platform/linux.hpp branches/lucene2_3_2/src/ext/boost/config/platform/macos.hpp branches/lucene2_3_2/src/ext/boost/config/platform/qnxnto.hpp branches/lucene2_3_2/src/ext/boost/config/platform/solaris.hpp branches/lucene2_3_2/src/ext/boost/config/platform/vxworks.hpp branches/lucene2_3_2/src/ext/boost/config/platform/win32.hpp branches/lucene2_3_2/src/ext/boost/config/posix_features.hpp branches/lucene2_3_2/src/ext/boost/config/requires_threads.hpp branches/lucene2_3_2/src/ext/boost/config/select_compiler_config.hpp branches/lucene2_3_2/src/ext/boost/config/select_platform_config.hpp branches/lucene2_3_2/src/ext/boost/config/select_stdlib_config.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/ branches/lucene2_3_2/src/ext/boost/config/stdlib/dinkumware.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/libcomo.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/libstdcpp3.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/modena.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/msl.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/roguewave.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/sgi.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/stlport.hpp branches/lucene2_3_2/src/ext/boost/config/stdlib/vacpp.hpp branches/lucene2_3_2/src/ext/boost/config/suffix.hpp branches/lucene2_3_2/src/ext/boost/config/user.hpp branches/lucene2_3_2/src/ext/boost/config/warning_disable.hpp branches/lucene2_3_2/src/ext/boost/config.hpp branches/lucene2_3_2/src/ext/boost/current_function.hpp branches/lucene2_3_2/src/ext/boost/detail/ branches/lucene2_3_2/src/ext/boost/detail/algorithm.hpp branches/lucene2_3_2/src/ext/boost/detail/allocator_utilities.hpp branches/lucene2_3_2/src/ext/boost/detail/atomic_count.hpp branches/lucene2_3_2/src/ext/boost/detail/binary_search.hpp branches/lucene2_3_2/src/ext/boost/detail/call_traits.hpp branches/lucene2_3_2/src/ext/boost/detail/catch_exceptions.hpp branches/lucene2_3_2/src/ext/boost/detail/compressed_pair.hpp branches/lucene2_3_2/src/ext/boost/detail/container_fwd.hpp branches/lucene2_3_2/src/ext/boost/detail/dynamic_bitset.hpp branches/lucene2_3_2/src/ext/boost/detail/endian.hpp branches/lucene2_3_2/src/ext/boost/detail/has_default_constructor.hpp branches/lucene2_3_2/src/ext/boost/detail/identifier.hpp branches/lucene2_3_2/src/ext/boost/detail/indirect_traits.hpp branches/lucene2_3_2/src/ext/boost/detail/interlocked.hpp branches/lucene2_3_2/src/ext/boost/detail/is_function_ref_tester.hpp branches/lucene2_3_2/src/ext/boost/detail/is_incrementable.hpp branches/lucene2_3_2/src/ext/boost/detail/is_xxx.hpp branches/lucene2_3_2/src/ext/boost/detail/iterator.hpp branches/lucene2_3_2/src/ext/boost/detail/lcast_precision.hpp branches/lucene2_3_2/src/ext/boost/detail/lightweight_mutex.hpp branches/lucene2_3_2/src/ext/boost/detail/lightweight_test.hpp branches/lucene2_3_2/src/ext/boost/detail/lightweight_thread.hpp branches/lucene2_3_2/src/ext/boost/detail/limits.hpp branches/lucene2_3_2/src/ext/boost/detail/named_template_params.hpp branches/lucene2_3_2/src/ext/boost/detail/no_exceptions_support.hpp branches/lucene2_3_2/src/ext/boost/detail/none_t.hpp branches/lucene2_3_2/src/ext/boost/detail/numeric_traits.hpp branches/lucene2_3_2/src/ext/boost/detail/ob_call_traits.hpp branches/lucene2_3_2/src/ext/boost/detail/ob_compressed_pair.hpp branches/lucene2_3_2/src/ext/boost/detail/quick_allocator.hpp branches/lucene2_3_2/src/ext/boost/detail/reference_content.hpp branches/lucene2_3_2/src/ext/boost/detail/scoped_enum_emulation.hpp branches/lucene2_3_2/src/ext/boost/detail/select_type.hpp branches/lucene2_3_2/src/ext/boost/detail/sp_typeinfo.hpp branches/lucene2_3_2/src/ext/boost/detail/templated_streams.hpp branches/lucene2_3_2/src/ext/boost/detail/utf8_codecvt_facet.hpp branches/lucene2_3_2/src/ext/boost/detail/workaround.hpp branches/lucene2_3_2/src/ext/boost/exception/ branches/lucene2_3_2/src/ext/boost/exception/all.hpp branches/lucene2_3_2/src/ext/boost/exception/current_exception_cast.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/ branches/lucene2_3_2/src/ext/boost/exception/detail/attribute_noreturn.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/error_info_impl.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/exception_ptr.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/is_output_streamable.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/object_hex_dump.hpp branches/lucene2_3_2/src/ext/boost/exception/detail/type_info.hpp branches/lucene2_3_2/src/ext/boost/exception/diagnostic_information.hpp branches/lucene2_3_2/src/ext/boost/exception/enable_current_exception.hpp branches/lucene2_3_2/src/ext/boost/exception/enable_error_info.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_api_function.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_at_line.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_errno.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_file_handle.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_file_name.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_file_open_mode.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_nested_exception.hpp branches/lucene2_3_2/src/ext/boost/exception/errinfo_type_info_name.hpp branches/lucene2_3_2/src/ext/boost/exception/error_info.hpp branches/lucene2_3_2/src/ext/boost/exception/exception.hpp branches/lucene2_3_2/src/ext/boost/exception/get_error_info.hpp branches/lucene2_3_2/src/ext/boost/exception/info.hpp branches/lucene2_3_2/src/ext/boost/exception/info_tuple.hpp branches/lucene2_3_2/src/ext/boost/exception/to_string.hpp branches/lucene2_3_2/src/ext/boost/exception/to_string_stub.hpp branches/lucene2_3_2/src/ext/boost/memory_order.hpp branches/lucene2_3_2/src/ext/boost/shared_ptr.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/ branches/lucene2_3_2/src/ext/boost/smart_ptr/bad_weak_ptr.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/ branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_gcc.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_pthreads.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_solaris.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_sync.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/atomic_count_win32.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/lightweight_mutex.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/lwm_nop.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/lwm_pthreads.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/lwm_win32_cs.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/operator_bool.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/quick_allocator.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/shared_array_nmt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/shared_count.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/shared_ptr_nmt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_convertible.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_nt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_pt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_solaris.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_spin.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_sync.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_base_w32.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_counted_impl.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/sp_has_sync.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_gcc_arm.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_nt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_pool.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_pt.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_sync.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/spinlock_w32.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/detail/yield_k.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/enable_shared_from_this.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/enable_shared_from_this2.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/intrusive_ptr.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/make_shared.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/scoped_array.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/scoped_ptr.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/shared_array.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/shared_ptr.hpp branches/lucene2_3_2/src/ext/boost/smart_ptr/weak_ptr.hpp branches/lucene2_3_2/src/ext/boost/throw_exception.hpp branches/lucene2_3_2/src/ext/boost/version.hpp branches/lucene2_3_2/src/ext/zlib/ branches/lucene2_3_2/src/ext/zlib/ChangeLog branches/lucene2_3_2/src/ext/zlib/FAQ branches/lucene2_3_2/src/ext/zlib/INDEX branches/lucene2_3_2/src/ext/zlib/README branches/lucene2_3_2/src/ext/zlib/adler32.c branches/lucene2_3_2/src/ext/zlib/algorithm.txt branches/lucene2_3_2/src/ext/zlib/compress.c branches/lucene2_3_2/src/ext/zlib/crc32.c branches/lucene2_3_2/src/ext/zlib/crc32.h branches/lucene2_3_2/src/ext/zlib/deflate.c branches/lucene2_3_2/src/ext/zlib/deflate.h branches/lucene2_3_2/src/ext/zlib/gzio.c branches/lucene2_3_2/src/ext/zlib/inffast.c branches/lucene2_3_2/src/ext/zlib/inffast.h branches/lucene2_3_2/src/ext/zlib/inffixed.h branches/lucene2_3_2/src/ext/zlib/inflate.c branches/lucene2_3_2/src/ext/zlib/inflate.h branches/lucene2_3_2/src/ext/zlib/inftrees.c branches/lucene2_3_2/src/ext/zlib/inftrees.h branches/lucene2_3_2/src/ext/zlib/trees.c branches/lucene2_3_2/src/ext/zlib/trees.h branches/lucene2_3_2/src/ext/zlib/zconf.h branches/lucene2_3_2/src/ext/zlib/zlib.h branches/lucene2_3_2/src/ext/zlib/zutil.c branches/lucene2_3_2/src/ext/zlib/zutil.h branches/lucene2_3_2/src/htdocs/ branches/lucene2_3_2/src/htdocs/README branches/lucene2_3_2/src/htdocs/_footer.html branches/lucene2_3_2/src/htdocs/_header.html branches/lucene2_3_2/src/htdocs/_index.php branches/lucene2_3_2/src/htdocs/clucene.jpg branches/lucene2_3_2/src/htdocs/contribute.shtml branches/lucene2_3_2/src/htdocs/download.shtml branches/lucene2_3_2/src/htdocs/images/ branches/lucene2_3_2/src/htdocs/images/disk.png branches/lucene2_3_2/src/htdocs/images/img01.gif branches/lucene2_3_2/src/htdocs/images/img02.gif branches/lucene2_3_2/src/htdocs/images/img03.gif branches/lucene2_3_2/src/htdocs/images/img04.jpg branches/lucene2_3_2/src/htdocs/images/img05.jpg branches/lucene2_3_2/src/htdocs/images/img06.jpg branches/lucene2_3_2/src/htdocs/images/img07.gif branches/lucene2_3_2/src/htdocs/images/img08.jpg branches/lucene2_3_2/src/htdocs/images/img09.jpg branches/lucene2_3_2/src/htdocs/images/img10.jpg branches/lucene2_3_2/src/htdocs/images/img11.gif branches/lucene2_3_2/src/htdocs/images/spacer.gif branches/lucene2_3_2/src/htdocs/index.shtml branches/lucene2_3_2/src/htdocs/style.css branches/lucene2_3_2/src/shared/cmake/CheckAtomicFunctions.cmake Removed Paths: ------------- branches/lucene2_3_2/src/contribs/contribs-lib-test/TestStreams.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h branches/lucene2_3_2/src/core/CLucene/index/IndexFileNameFilter.h branches/lucene2_3_2/src/core/CLucene/store/TransactionalRAMDirectory.cpp branches/lucene2_3_2/src/core/CLucene/store/_MMap.h branches/lucene2_3_2/src/core/CLucene/store/_TransactionalRAMDirectory.h branches/lucene2_3_2/src/core/libclucene.pc.cmake branches/lucene2_3_2/src/shared/CLucene/util/zlib/adler32.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/compress.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/crc32.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/crc32.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/deflate.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/deflate.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/gzio.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffast.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffast.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inffixed.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inflate.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inflate.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/inftrees.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/inftrees.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/trees.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/trees.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zconf.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zlib.h branches/lucene2_3_2/src/shared/CLucene/util/zlib/zutil.c branches/lucene2_3_2/src/shared/CLucene/util/zlib/zutil.h Modified: branches/lucene2_3_2/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/CMakeLists.txt 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/CMakeLists.txt 2010-08-24 15:00:54 UTC (rev 3027) @@ -5,16 +5,17 @@ #REVISION version MUST be revised if the headers or compatibility change #PATCH should be 0 unless a patch is made that doesn't affect the public signature (i.e. clients don't need to re-compile). -SET(CLUCENE_VERSION_MAJOR "0") -SET(CLUCENE_VERSION_MINOR "9") -SET(CLUCENE_VERSION_REVISION "23") +SET(CLUCENE_VERSION_MAJOR "1") +SET(CLUCENE_VERSION_MINOR "0") +SET(CLUCENE_VERSION_REVISION "0") SET(CLUCENE_VERSION_PATCH "0") -SET(CLUCENE_INT_VERSION 92300) +SET(CLUCENE_INT_VERSION 1000000) SET(CLUCENE_VERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}.${CLUCENE_VERSION_PATCH}") SET(CLUCENE_SOVERSION "${CLUCENE_VERSION_MAJOR}.${CLUCENE_VERSION_MINOR}.${CLUCENE_VERSION_REVISION}") -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2 FATAL_ERROR) +#CMake 2.6+ is recommended to an improved Boost module +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) @@ -25,13 +26,13 @@ set(CMAKE_DEBUG_POSTFIX "d") endif(WIN32) - # include specific modules set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") #define options... Include (CLuceneDocs) +Include (CLuceneBoost) Include (FindThreads) IF(NOT CMAKE_BUILD_TYPE) @@ -57,6 +58,20 @@ OPTION(ENABLE_ASCII_MODE "enable ascii support" OFF) + +SET(ENABLE_ANSI_MODE OFF) +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(ENABLE_ANSI_MODE ON) + + #exceptions: + IF(MINGW OR CYGWIN) + SET(ENABLE_ANSI_MODE OFF) + ENDIF(MINGW OR CYGWIN) +ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +OPTION(ENABLE_ANSI_MODE + "compile with -ansi flag" + ${ENABLE_ANSI_MODE}) OPTION(LUCENE_USE_INTERNAL_CHAR_FUNCTIONS "use internal character functions. required to run tests correctly" ON) @@ -107,10 +122,14 @@ ENDIF ( ENABLE_GPROF ) ENDIF ( GccFlagPg ) - IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) - ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + #cmake should handle this automatically + # IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) + # ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + IF( ENABLE_ANSI_MODE ) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi") + ENDIF ( ENABLE_ANSI_MODE ) ENDIF(CMAKE_COMPILER_IS_GNUCC) @@ -127,7 +146,13 @@ INCLUDE_DIRECTORIES( ${clucene_BINARY_DIR}/src/shared ) INCLUDE_DIRECTORIES( ${clucene_SOURCE_DIR}/src/core ) +#set boost path. we need src/ext to be defined before this works... +Include (CLuceneBoost) +GET_BOOST_INCLUDE_PATH(_CL_BOOST_INCLUDE_PATH) +INCLUDE_DIRECTORIES( ${_CL_BOOST_INCLUDE_PATH} ) + #include the projects +ADD_SUBDIRECTORY (src/ext) ADD_SUBDIRECTORY (src/shared) ADD_SUBDIRECTORY (src/core) ADD_SUBDIRECTORY (src/test) @@ -140,6 +165,7 @@ ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL) ENDIF ( BUILD_CONTRIBS_LIB ) + #add uninstall command CONFIGURE_FILE( "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" Modified: branches/lucene2_3_2/COPYING =================================================================== --- branches/lucene2_3_2/COPYING 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/COPYING 2010-08-24 15:00:54 UTC (rev 3027) @@ -124,7 +124,3 @@ PorterStemmer code: couldn't find license. This component is deprecated and will be removed very soon. Snowball code: needs to be researched. - -Jstreams: needs to be researched - -All code needs to be clearly marked with license headers... Modified: branches/lucene2_3_2/INSTALL =================================================================== --- branches/lucene2_3_2/INSTALL 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/INSTALL 2010-08-24 15:00:54 UTC (rev 3027) @@ -9,7 +9,8 @@ -------------------- Dependencies: -* CMake version 2.4.2 or later. +* CMake version 2.4.2 or later (2.6 or later recommended due to an improved FindBoost module) +* Boost libs (http://www.boost.org/), latest version recommended * A functioning and fairly new C++ compiler. We test mostly on GCC and Visual Studio 6+. Anything other than that may not work. * Something to unzip/untar the source code. @@ -28,6 +29,13 @@ create different types of builds in the same source-tree.] # mkdir <clucene>/build-name # cd <clucene>/build-name +5*.) Windows users: make sure Boost environment variables are defined at least for the current + command prompt session. You can check this by typing "set" (no quotes). If you have any doubts, + just type the following 3 commands to set those variables, as follows (boost_1_40_0 being the current + Boost version): + set BOOST_BUILD_PATH=C:\{parent directory for boost}\boost_1_40_0\tools\build\v2 + set BOOST_PATH=C:\{parent directory for boost} + set BOOST_ROOT=C:\{parent directory for boost}\boost_1_40_0 6.) Configure using cmake. This can be done many different ways, but the basic syntax is # cmake [-G "Script name"] .. [Where "Script name" is the name of the scripts to build (e.g. Visual Studio 8 2005). Added: branches/lucene2_3_2/cmake/CLuceneBoost.cmake =================================================================== --- branches/lucene2_3_2/cmake/CLuceneBoost.cmake (rev 0) +++ branches/lucene2_3_2/cmake/CLuceneBoost.cmake 2010-08-24 15:00:54 UTC (rev 3027) @@ -0,0 +1,22 @@ +#Locate Boost libs. Windows users: make sure BOOST_ROOT and BOOST_PATH are set correctly on your environment. +#See the site FAQ for more details. + +MACRO (GET_BOOST_INCLUDE_PATH path) + #todo: allow this to fall back on a local distributed copy, so user doesn't have to d/l Boost seperately + SET(Boost_USE_MULTITHREAD ON) + FIND_PACKAGE( Boost ) + + #todo: limit Boost version? + #todo: use COMPONENTS threads to locate boost_threads without breaking the current support + IF(Boost_FOUND) + IF (NOT _boost_IN_CACHE) + MESSAGE( "Boost found" ) + message(STATUS "Boost_INCLUDE_DIR : ${Boost_INCLUDE_DIR}") + ENDIF (NOT _boost_IN_CACHE) + SET(${path} ${Boost_INCLUDE_DIRS} ) + ELSE() + MESSAGE( "Boost not found, using local: ${clucene_SOURCE_DIR}/src/ext" ) + SET(${path} ${clucene_SOURCE_DIR}/src/ext ) + ENDIF() +ENDMACRO (GET_BOOST_INCLUDE_PATH path) + Modified: branches/lucene2_3_2/cmake/CreateClucenePackages.cmake =================================================================== --- branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/cmake/CreateClucenePackages.cmake 2010-08-24 15:00:54 UTC (rev 3027) @@ -13,17 +13,16 @@ SET(CPACK_PACKAGE_VERSION ${CLUCENE_VERSION}) SET(CPACK_PACKAGE_SOVERSION ${CLUCENE_SOVERSION}) -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "library for full-featured text search engine (runtime)") SET(CPACK_PACKAGE_VENDOR "Ben van Klinken") SET(CPACK_PACKAGE_CONTACT "clu...@li...") -SET(CPACK_PACKAGE_NAME "libclucene1") +SET(CPACK_PACKAGE_NAME "libclucene2") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CLucene - a C++ search engine, ported from the popular Apache Lucene") SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") -SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README.PACKAGE") +#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/README.PACKAGE") #so, what are we going to install? SET(CPACK_INSTALL_CMAKE_PROJECTS @@ -42,8 +41,8 @@ #specific packaging requirements: SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.4), libgcc1 (>= 1:4.1.1-21), libstdc++6 (>= 4.1.1-21)") +SET(CPACK_DEBIAN_PACKAGE_SECTION "libs") - #don't include the current binary dir. get_filename_component(clucene_BINARY_DIR_name ${clucene_BINARY_DIR} NAME) SET(CPACK_SOURCE_IGNORE_FILES Modified: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/dist-test.sh 2010-08-24 15:00:54 UTC (rev 3027) @@ -71,11 +71,10 @@ #check to see that no #ifdefs exist in headers that don't belong function checkForIfdefs { I=0 - grep "#if" $1| grep -v "_UCS2" |grep -v "_CL_HAVE_" |grep -v "_ASCII" |grep -v "_WIN32" |grep -v "_WIN64" | while read line; do + grep "#if" $1| grep -v "_UCS2" |grep -v "_CL_HAVE_" |grep -v "_ASCII" |grep -v "_WIN32"|grep -v "_MSC_"|grep -v "__MINGW32__" |grep -v "_WIN64" | while read line; do I=`expr $I + 1` if [ $I -gt 1 ]; then - echo $1 has invalid ifdef: $line - FAIL=1 + echo $1 might have invalid ifdef: $line fi done } @@ -95,12 +94,12 @@ if [ "${BH:0:1}" != "_" ]; then DH=`dirname "${H:3}"` - #move headers somewhere to compile - mkdir -p "$TMP/$DH" 2>/dev/null - ln -s "`cd "$DN" && pwd`/$BH" "$TMP/${H:3}" 2>/dev/null - - #create pub-headers.cpp if [ "${H:7}" != "core/CLucene/util/Reader.h" ]; then + #move headers somewhere to compile + mkdir -p "$TMP/$DH" 2>/dev/null + ln -s "`cd "$DN" && pwd`/$BH" "$TMP/${H:3}" 2>/dev/null + + #create pub-headers.cpp echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp fi fi @@ -130,7 +129,7 @@ #internal headers... none must be exported XX=`awk '/^[ \t]*(class|struct)/ { print $line }' $H| grep -v ";$"| grep -v CLUCENE_EXPORT| grep -v CLUCENE_INLINE_EXPORT| grep -v CLUCENE_SHARED_EXPORT| grep -v CLUCENE_SHARED_INLINE_EXPORT` if [ "$XX" == "" ]; then - echo "$H has exported class: $XX" + echo "$H is internal but has exported class: $XX" echo "" FAIL=1 fi @@ -146,15 +145,33 @@ fi #test that each header compiles independently... - if [ $t_c_h -eq 1 ] && [ "${H:7}" != "disttest/src/core/CLucene/util/Reader.h" ]; then - echo "Test that $H compiles seperately..." + if [ $t_c_h -eq 1 ]; then echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-header.cpp echo "#include \"$H"\" >>$TMP/pub-header.cpp echo "int main(){ return 0; }" >>"$TMP/pub-header.cpp" - g++ -I. -I$TMP/src/shared -I./src/shared -I$TMP/src/core $TMP/pub-header.cpp - if [ $? -ne 0 ]; then FAIL=1; fi + ERROR=`g++ -I. -I$TMP/src/shared -I./src/shared -I../src/ext -I$TMP/src/core $TMP/pub-header.cpp` + if [ $? -ne 0 ]; then + echo "" + echo "$H doesn't compile seperately..." + echo $ERROR + FAIL=1; + fi fi done + + + if [ $t_ifdefs -eq 1 ]; then + echo "Not all ifdefs are invalid, you have to figure it out for yourself :-)" + echo "If defs in classes which change depending on a user setting can cause big problems due to offset changes" + echo "for example:" + echo "class X {" + echo " #ifdef _DEBUG" + echo " int x;" + echo " #endif" + echo " int y;" + echo "}" + echo "If the library is compiled with _DEBUG, and then a user calls y without _DEBUG defined, unexpected behaviour will occur" + fi fi #iterate all our code... @@ -164,25 +181,38 @@ BH_len=${#BH} if [ "${BH:BH_len-2}" == ".h" ] || [ "${BH:BH_len-2}" == ".c" ] || [ "${BH:BH_len-4}" == ".cpp" ]; then + + #snowball has its own license... + if [ "echo $H|grep 'snowball/src_c'" != "" ]; then + continue + fi + #snowball has its own license... + if [ "echo $H|grep 'libstemmer'" != "" ]; then + continue + fi + #zlib has its own license... + if [ "echo $H|grep 'CLucene/util/zlib'" != "" ]; then + continue + fi + if [ "`awk '/\* Copyright \(C\) [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then if [ "`awk '/\* Copyright [0-9]*-[0-9]* .*$/ { print $line }' $H`" == "" ]; then - echo "$H has invalid license" + echo "$H ($BH) has invalid license" FAIL=1 fi fi fi done - fi #test if headers can compile together by themselves: if [ $t_c_all -eq 1 ]; then - g++ -I$TMP/src -I$TMP/src/shared -I$TMP/src/core $TMP/pub-headers.cpp -I./src/shared + g++ -I$TMP/src -I../src/ext -I$TMP/src/shared -I$TMP/src/core $TMP/pub-headers.cpp -I./src/shared fi if [ $t_inline -eq 1 ]; then - if [ ! -f "./doc" ]; then + if [ ! -d "./doc" ]; then echo "Couldn't find docs, run:" echo "# cmake -DENABLE_CLDOCS:BOOLEAN=TRUE ." echo "# make doc" @@ -197,7 +227,13 @@ if [ "doc/html/classlucene_1_1index_1_1Term.html:1" == $line ]; then continue; fi - + if [ "doc/html/classlucene_1_1search_1_1Similarity.html:1" == $line ]; then + continue; + fi + if [ "doc/html/classlucene_1_1store_1_1BufferedIndexInput.html:1" == $line ]; then + continue; + fi + if [ $INLINES -eq 0 ]; then echo "These files report inline code:" INLINES=1 @@ -214,11 +250,18 @@ FAIL=1; fi + echo "Undefines for shared lib:" + nm -u --demangle bin/libclucene-shared.so |grep -E "lucene::" + echo "Undefines for core lib:" + nm -u --demangle bin/libclucene-core.so |grep -E "lucene::"|grep -v "lucene::util::Misc" |grep -v "lucene::util::mutex" |grep -v "lucene::util::StringBuffer"|grep -v "lucene::util::shared_condition" + #compile together make test-all if [ $? -ne 0 ]; then FAIL=1; fi + + fi Modified: branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #include "stdafx.h" #include "Benchmarker.h" #include "Unit.h" Modified: branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.h =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.h 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Benchmarker.h 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #pragma once class Benchmarker Modified: branches/lucene2_3_2/src/contribs/benchmarker/Main.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Main.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Main.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #include "stdafx.h" #include "TestCLString.h" Modified: branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #include "stdafx.h" using namespace lucene::util; Modified: branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.h =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.h 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/TestCLString.h 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #pragma once int BenchmarkDocumentWriter(Timer*); Modified: branches/lucene2_3_2/src/contribs/benchmarker/Timer.h =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Timer.h 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Timer.h 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #pragma once class Timer{ Modified: branches/lucene2_3_2/src/contribs/benchmarker/Unit.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Unit.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Unit.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #include "stdafx.h" #include "Unit.h" Modified: branches/lucene2_3_2/src/contribs/benchmarker/Unit.h =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/Unit.h 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/Unit.h 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #pragma once #include "CLucene/util/Misc.h" Modified: branches/lucene2_3_2/src/contribs/benchmarker/stdafx.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/stdafx.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/stdafx.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ // stdafx.cpp : source file that includes just the standard includes // demo.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information Modified: branches/lucene2_3_2/src/contribs/benchmarker/stdafx.h =================================================================== --- branches/lucene2_3_2/src/contribs/benchmarker/stdafx.h 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/benchmarker/stdafx.h 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,3 +1,9 @@ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently Modified: branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/contribs-lib-test/CMakeLists.txt 2010-08-24 15:00:54 UTC (rev 3027) @@ -4,6 +4,7 @@ DEFINE_OPTIONS(EXTRA_OPTIONS EXTRA_LIBS) ADD_DEFINITIONS(${EXTRA_OPTIONS}) +INCLUDE_DIRECTORIES( ${_CL_BOOST_INCLUDE_PATH} ) INCLUDE_DIRECTORIES( ${clucene-contribs-lib-test_SOURCE_DIR} ) INCLUDE_DIRECTORIES( ${clucene-contribs-lib_SOURCE_DIR} ) @@ -13,7 +14,6 @@ ./contribTests.cpp ./TestHighlight.cpp ./TestSnowball.cpp - ./TestStreams.cpp ./TestUtf8.cpp ./TestAnalysis.cpp ./CuTest.cpp Modified: branches/lucene2_3_2/src/contribs/contribs-lib-test/TestAnalysis.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/contribs-lib-test/TestAnalysis.cpp 2010-08-24 13:42:35 UTC (rev 3026) +++ branches/lucene2_3_2/src/contribs/contribs-lib-test/TestAnalysis.cpp 2010-08-24 15:00:54 UTC (rev 3027) @@ -1,18 +1,9 @@ -/** - * Copyright 2003-2006 The Apache Software Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/*------------------------------------------------------------------------------ +* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team +* +* Distributable under the terms of either the Apache License (Version 2.0) or +* the GNU Lesser General Public License, as specified in the COPYING file. +------------------------------------------------------------------------------*/ #include "test.h" #include "CLucene/analysis/cjk/CJKAnalyzer.h" #include "CLucene/analysis/LanguageBasedAnalyzer.h" @@ -128,7 +119,7 @@ TCHAR tres[LUCENE_MAX_WORD_LEN]; while (results[pos] != NULL) { - CLUCENE_ASSERT(tokenizer->next(&tok) == true); + CLUCENE_ASSERT(tokenizer->next(&tok) != NULL); lucene_utf8towcs(tres, results[pos], LUCENE_MAX_WORD_LEN); CuAssertStrEquals(tc, _T("unexpected token value"), tres, tok.termBuffer()); @@ -166,9 +157,9 @@ a.setStem(false); ts = a.tokenStream(_T("contents"), &reader); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t) != NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("he")) == 0); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t) != NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("abhorred")) == 0); _CLDELETE(ts); @@ -178,11 +169,11 @@ a.setStem(true); ts = a.tokenStream(_T("contents"), &reader); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t) != NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("he")) == 0); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t) != NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("abhorred")) == 0); - CLUCENE_ASSERT(ts->next(&t)); + CLUCENE_ASSERT(ts->next(&t) != NULL); CLUCENE_ASSERT(_tcscmp(t.termBuffer(), _T("accentuer")) == 0); _CLDELETE(ts); } Modified: branches/lucene2_3_2/src/contribs/contribs-lib-test/TestHighlight.cpp =================================================================== --- branches/lucene2_3_2/src/contribs/contribs-lib-test/Tes... [truncated message content] |