kdesupport/strigi/src
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Tue Mar 6 17:13:19 GMT 2007
SVN commit 640036 by chehrlic:
some more win32 related fixes - don't know if it really makes sense to port this to windows
CCMAIL: kde-core-devel at kde.org
M +4 -1 CMakeLists.txt
M +4 -0 luceneindexer/cluceneindexreader.cpp
M +52 -20 streamindexer/CMakeLists.txt
M +5 -0 streamindexer/filelister.h
M +3 -0 streamindexer/helperendanalyzer.cpp
M +5 -1 streamindexer/streamindexer.cpp
--- trunk/kdesupport/strigi/src/CMakeLists.txt #640035:640036
@@ -1,5 +1,8 @@
-set(DIRS streams streams/compat streamindexer dummyindexer archivereader xmlindexer)
+set(DIRS streams streams/compat streamindexer archivereader)
+if(NOT WIN32)
+set(DIRS ${DIRS} dummyindexer xmlindexer)
+endif(NOT WIN32)
if (CLucene_FOUND)
set(DIRS ${DIRS} luceneindexer)
endif (CLucene_FOUND)
--- trunk/kdesupport/strigi/src/luceneindexer/cluceneindexreader.cpp #640035:640036
@@ -427,7 +427,11 @@
struct tm t;
for (i = v.begin(); i < v.end(); ++i) {
time_t ti = *i;
+#ifdef _WIN32
+ t = *localtime( &ti ); // is thread-safe on win32
+#else
localtime_r(&ti, &t);
+#endif
int32_t c = 10000*t.tm_year + 100*t.tm_mon + t.tm_mday;
m[c]++;
}
--- trunk/kdesupport/strigi/src/streamindexer/CMakeLists.txt #640035:640036
@@ -6,15 +6,42 @@
${strigi_BINARY_DIR}/src/streams/compat
${strigi_SOURCE_DIR}/src/streams/compat ${CMAKE_BINARY_DIR} )
-set(streamindexer_SRCS bz2endanalyzer.cpp digestthroughanalyzer.cpp
- textendanalyzer.cpp streamendanalyzer.cpp zipendanalyzer.cpp
- tarendanalyzer.cpp streamindexer.cpp pngendanalyzer.cpp query.cpp
- mailendanalyzer.cpp gzipendanalyzer.cpp filelister.cpp
- analyzerloader.cpp oggthroughanalyzer.cpp cpioendanalyzer.cpp
- arendanalyzer.cpp indexwriter.cpp rpmendanalyzer.cpp indexable.cpp
- helperendanalyzer.cpp id3v2throughanalyzer.cpp indexerconfiguration.cpp
- bmpendanalyzer.cpp cnstr.cpp fieldtypes.cpp)
+set(streamindexer_SRCS
+ bz2endanalyzer.cpp
+ digestthroughanalyzer.cpp
+ textendanalyzer.cpp
+ streamendanalyzer.cpp
+ zipendanalyzer.cpp
+ tarendanalyzer.cpp
+ pngendanalyzer.cpp
+ query.cpp
+ mailendanalyzer.cpp
+ gzipendanalyzer.cpp
+ analyzerloader.cpp
+ oggthroughanalyzer.cpp
+ cpioendanalyzer.cpp
+ arendanalyzer.cpp
+ indexwriter.cpp
+ rpmendanalyzer.cpp
+ indexable.cpp
+ helperendanalyzer.cpp
+ id3v2throughanalyzer.cpp
+ indexerconfiguration.cpp
+ bmpendanalyzer.cpp
+ cnstr.cpp
+ fieldtypes.cpp
+ streamindexer.cpp
+)
+if(NOT WIN32)
+set(streamindexer_SRCS
+ ${streamindexer_SRCS}
+ filelister.cpp
+)
+
+endif(NOT WIN32)
+
+
if (Expat_FOUND)
set(streamindexer_SRCS ${streamindexer_SRCS} expatsaxendanalyzer.cpp)
set(streamindex_LIBS ${streamindex_LIBS} ${EXPAT_LIBRARY})
@@ -27,21 +54,25 @@
# endif (Libxml2_FOUND)
endif(Expat_FOUND)
-IF(WIN32)
- #not enough api exposed to make this a dll
- add_library(streamindexer ifilterendanalyzer.cpp ${streamindexer_SRCS})
- install(TARGETS streamindexer ARCHIVE DESTINATION ${LIB_DESTINATION})
- #add ifilter library
- set(streamindex_LIBS ${streamindex_LIBS} ntquery)
-ELSE(WIN32)
+#IF(WIN32)
+# #not enough api exposed to make this a dll
+# add_library(streamindexer ifilterendanalyzer.cpp ${streamindexer_SRCS})
+# install(TARGETS streamindexer ARCHIVE DESTINATION ${LIB_DESTINATION})
+# #add ifilter library
+# set(streamindex_LIBS ${streamindex_LIBS} ntquery)
+#ELSE(WIN32)
add_library(streamindexer SHARED ${streamindexer_SRCS})
install(TARGETS streamindexer LIBRARY DESTINATION ${LIB_DESTINATION})
-ENDIF(WIN32)
+#ENDIF(WIN32)
set_target_properties(streamindexer PROPERTIES
VERSION ${STRIGI_VERSION}
SOVERSION ${STRIGI_VERSION_MAJOR})
-target_link_libraries(streamindexer streams ${streamindex_LIBS} dl)
+set(streamindexer_libs streams ${streamindex_LIBS})
+if(NOT WIN32)
+ set(streamindexer_libs ${streamindexer_libs} dl)
+endif(NOT WIN32)
+target_link_libraries(streamindexer ${streamindexer_libs})
install(FILES indexeddocument.h indexable.h analyzerplugin.h streamindexer.h
streamthroughanalyzer.h streamendanalyzer.h analyzerfactoryfactory.h
@@ -50,6 +81,7 @@
# test executable
-add_executable(filelister filelistertest.cpp)
-
-target_link_libraries(filelister streamindexer)
+if(NOT WIN32)
+ add_executable(filelister filelistertest.cpp)
+ target_link_libraries(filelister streamindexer)
+endif(NOT WIN32)
\ No newline at end of file
--- trunk/kdesupport/strigi/src/streamindexer/filelister.h #640035:640036
@@ -35,6 +35,11 @@
#include <sys/types.h>
#include <string>
+#ifdef _WIN32
+typedef unsigned int uid_t;
+typedef unsigned int gid_t;
+#endif
+
namespace jstreams {
class IndexerConfiguration;
}
--- trunk/kdesupport/strigi/src/streamindexer/helperendanalyzer.cpp #640035:640036
@@ -148,6 +148,8 @@
if (h) {
// fprintf(stderr, "calling %s on %s\n", h->arguments[0].c_str(),
// idx.getPath().c_str());
+#ifndef _WIN32
+#warning this does not work on windows because processinputstream does not compile!
if (h->readfromstdin) {
ProcessInputStream pis(h->arguments, in);
TextEndAnalyzer t;
@@ -173,6 +175,7 @@
unlink(filepath.c_str());
}
}
+#endif
}
}
if (in->getStatus() == Error) {
--- trunk/kdesupport/strigi/src/streamindexer/streamindexer.cpp #640035:640036
@@ -184,8 +184,12 @@
addFactory(new PngEndAnalyzerFactory());
addFactory(new BmpEndAnalyzerFactory());
// addFactory(new PdfEndAnalyzerFactory());
+#ifdef __GNUC__
+#warnign FIXME - IFilterEndAnalyzerFactory is pure virtual!
+#warnign FIXME - SaxEndAnalyzerFactory needs some love too
+#endif
#ifdef WIN32
- addFactory(new IFilterEndAnalyzerFactory());
+// addFactory(new IFilterEndAnalyzerFactory());
#else
//temporary only, i just haven't got expat.h working yet
addFactory(new SaxEndAnalyzerFactory());
More information about the kde-core-devel
mailing list