Mailing list archives: August 2003

Site index · List index
Message listThread · Author · Date
zer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info _swigt__p_jdbtxn[] = {{"_p_jdbtxn", 0, "jdbtxn *", 0},{"_p_jdbtxn"},{0}}; static swig_type_info *swig_types_initial[] = { @@ -2185,6 +2253,8 @@ _swigt__p_jstring, _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer, _swigt__p_org__apache__lucene__search__Query, +_swigt__p_jreader, +_swigt__p_java__io__Reader, _swigt__p_org__apache__lucene__index__IndexWriter, _swigt__p_org__apache__lucene__store__db__DbDirectory, _swigt__p_org__apache__lucene__store__Directory, Index: osaf/chandler/persistence/PyLucene/Makefile.mingw diff -u osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 osaf/chandler/persistence/PyLucene/Makefile.mingw:1.3 --- osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.mingw Tue Jan 13 21:48:50 2004 @@ -35,6 +35,8 @@ PYTHON_INC = $(RELDIR)\bin\include PYTHON_SITE = $(RELDIR)\bin\Lib\site-packages +OBJS = $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(BINDIR)\reader.java.o $(BINDIR)\reader.cpp.o + $(BINDIR)\lucene.o: if not exist $(BINDIR) mkdir $(BINDIR)\classes $(JCC) -C -d $(CLASSES) @lucene.lst @@ -56,7 +58,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) @store.lst $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)\store.o --classpath=$(CLASSES) @store.lst -$(BINDIR)\_PyLucene$(_dbg).pyd: $(BINDIR)\store.o $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\lucene.o +$(BINDIR)\reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)\reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)\_PyLucene$(_dbg).pyd: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -73,8 +83,8 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -Dalloca=__builtin_alloca -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx - $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 + $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx + $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(OBJS) $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 all: $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\libdb_java42$(dbg).dll echo build of $(BINDIR)\_PyLucene$(_dbg).pyd complete Index: osaf/chandler/persistence/PyLucene/Makefile diff -u osaf/chandler/persistence/PyLucene/Makefile:1.1 osaf/chandler/persistence/PyLucene/Makefile:1.2 --- osaf/chandler/persistence/PyLucene/Makefile:1.1 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile Tue Jan 13 21:48:50 2004 @@ -9,8 +9,8 @@ else -CCFLAGS = -O2 -LDFLAGS = +CCFLAGS = -g +LDFLAGS = -g mode = release endif @@ -56,7 +56,16 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -PyLucene_wrap.cxx: PyLucene.i +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +PyLucene_wrap.cxx: PyLucene.i $(BINDIR)/reader.java.o $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -72,10 +81,11 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader swig -modern -I$(BINDIR)/classes -c++ -python PyLucene.i -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress +$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o -lgcj -liconv -flat_namespace -multiply_defined suppress -undefined warning all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/Makefile.osx diff -u osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 osaf/chandler/persistence/PyLucene/Makefile.osx:1.4 --- osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.osx Tue Jan 13 21:48:50 2004 @@ -34,6 +34,8 @@ DB_SRCS = `find $(DB)/java/src/com/sleepycat/db -regex '.*/db/[^/]*java'` STORE_SRCS = `find store -name '*.java' -print` +OBJS = $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(BINDIR)/lucene.o: if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi @@ -58,7 +60,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)/_PyLucene.so: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -74,7 +84,7 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(OBJS) -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/PyLucene.i diff -u osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 osaf/chandler/persistence/PyLucene/PyLucene.i:1.3 --- osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/PyLucene.i Tue Jan 13 21:48:50 2004 @@ -15,6 +15,7 @@ #include <gcj/cni.h> #include <java/lang/Object.h> #include <java/lang/Throwable.h> +#include <java/io/Reader.h> #include "com/sleepycat/db/DbEnv.h" #include "com/sleepycat/db/Db.h" @@ -32,6 +33,7 @@ #include "org/apache/lucene/search/Query.h" #include "org/apache/lucene/search/Hits.h" #include "org/apache/lucene/search/IndexSearcher.h" +#include "org/osafoundation/io/PythonReader.h" #include <db.h> @@ -54,6 +56,7 @@ typedef ::com::sleepycat::db::DbEnv *jdbenv; typedef ::com::sleepycat::db::Db *jdb; typedef ::com::sleepycat::db::DbTxn *jdbtxn; +typedef ::java::io::Reader *jreader; %} @@ -72,7 +75,7 @@ else { jint len = JvGetStringUTFLength($1); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion($1, 0, len, buf); buf[len] = '\0'; @@ -125,6 +128,19 @@ $1 = PyObject_IsTrue($input); } +%typemap(in) jreader { + + if ($input == Py_None) + $1 = NULL; + else + { + jlong ptr; + + *(PyObject **) &ptr = (PyObject *) $input; + $1 = new org::osafoundation::io::PythonReader(ptr); + } +} + typedef int jint; typedef float jfloat; @@ -136,7 +152,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -152,6 +168,12 @@ virtual jstring toString(); }; } + namespace io { +%nodefault; + class Reader : public ::java::lang::Object { + }; +%makedefault; + } } namespace org { @@ -183,6 +205,7 @@ class Field : public ::java::lang::Object { public: Field(jstring, jstring, jboolean, jboolean, jboolean); + static Field *Text(jstring, jreader); static Field *UnIndexed(jstring, jstring); static Field *UnStored(jstring, jstring); };
ker   zer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info _swigt__p_jdbtxn[] = {{"_p_jdbtxn", 0, "jdbtxn *", 0},{"_p_jdbtxn"},{0}}; static swig_type_info *swig_types_initial[] = { @@ -2185,6 +2253,8 @@ _swigt__p_jstring, _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer, _swigt__p_org__apache__lucene__search__Query, +_swigt__p_jreader, +_swigt__p_java__io__Reader, _swigt__p_org__apache__lucene__index__IndexWriter, _swigt__p_org__apache__lucene__store__db__DbDirectory, _swigt__p_org__apache__lucene__store__Directory, Index: osaf/chandler/persistence/PyLucene/Makefile.mingw diff -u osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 osaf/chandler/persistence/PyLucene/Makefile.mingw:1.3 --- osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.mingw Tue Jan 13 21:48:50 2004 @@ -35,6 +35,8 @@ PYTHON_INC = $(RELDIR)\bin\include PYTHON_SITE = $(RELDIR)\bin\Lib\site-packages +OBJS = $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(BINDIR)\reader.java.o $(BINDIR)\reader.cpp.o + $(BINDIR)\lucene.o: if not exist $(BINDIR) mkdir $(BINDIR)\classes $(JCC) -C -d $(CLASSES) @lucene.lst @@ -56,7 +58,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) @store.lst $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)\store.o --classpath=$(CLASSES) @store.lst -$(BINDIR)\_PyLucene$(_dbg).pyd: $(BINDIR)\store.o $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\lucene.o +$(BINDIR)\reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)\reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)\_PyLucene$(_dbg).pyd: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -73,8 +83,8 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -Dalloca=__builtin_alloca -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx - $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 + $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx + $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(OBJS) $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 all: $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\libdb_java42$(dbg).dll echo build of $(BINDIR)\_PyLucene$(_dbg).pyd complete Index: osaf/chandler/persistence/PyLucene/Makefile diff -u osaf/chandler/persistence/PyLucene/Makefile:1.1 osaf/chandler/persistence/PyLucene/Makefile:1.2 --- osaf/chandler/persistence/PyLucene/Makefile:1.1 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile Tue Jan 13 21:48:50 2004 @@ -9,8 +9,8 @@ else -CCFLAGS = -O2 -LDFLAGS = +CCFLAGS = -g +LDFLAGS = -g mode = release endif @@ -56,7 +56,16 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -PyLucene_wrap.cxx: PyLucene.i +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +PyLucene_wrap.cxx: PyLucene.i $(BINDIR)/reader.java.o $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -72,10 +81,11 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader swig -modern -I$(BINDIR)/classes -c++ -python PyLucene.i -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress +$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o -lgcj -liconv -flat_namespace -multiply_defined suppress -undefined warning all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/Makefile.osx diff -u osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 osaf/chandler/persistence/PyLucene/Makefile.osx:1.4 --- osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.osx Tue Jan 13 21:48:50 2004 @@ -34,6 +34,8 @@ DB_SRCS = `find $(DB)/java/src/com/sleepycat/db -regex '.*/db/[^/]*java'` STORE_SRCS = `find store -name '*.java' -print` +OBJS = $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(BINDIR)/lucene.o: if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi @@ -58,7 +60,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)/_PyLucene.so: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -74,7 +84,7 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(OBJS) -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/PyLucene.i diff -u osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 osaf/chandler/persistence/PyLucene/PyLucene.i:1.3 --- osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/PyLucene.i Tue Jan 13 21:48:50 2004 @@ -15,6 +15,7 @@ #include <gcj/cni.h> #include <java/lang/Object.h> #include <java/lang/Throwable.h> +#include <java/io/Reader.h> #include "com/sleepycat/db/DbEnv.h" #include "com/sleepycat/db/Db.h" @@ -32,6 +33,7 @@ #include "org/apache/lucene/search/Query.h" #include "org/apache/lucene/search/Hits.h" #include "org/apache/lucene/search/IndexSearcher.h" +#include "org/osafoundation/io/PythonReader.h" #include <db.h> @@ -54,6 +56,7 @@ typedef ::com::sleepycat::db::DbEnv *jdbenv; typedef ::com::sleepycat::db::Db *jdb; typedef ::com::sleepycat::db::DbTxn *jdbtxn; +typedef ::java::io::Reader *jreader; %} @@ -72,7 +75,7 @@ else { jint len = JvGetStringUTFLength($1); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion($1, 0, len, buf); buf[len] = '\0'; @@ -125,6 +128,19 @@ $1 = PyObject_IsTrue($input); } +%typemap(in) jreader { + + if ($input == Py_None) + $1 = NULL; + else + { + jlong ptr; + + *(PyObject **) &ptr = (PyObject *) $input; + $1 = new org::osafoundation::io::PythonReader(ptr); + } +} + typedef int jint; typedef float jfloat; @@ -136,7 +152,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -152,6 +168,12 @@ virtual jstring toString(); }; } + namespace io { +%nodefault; + class Reader : public ::java::lang::Object { + }; +%makedefault; + } } namespace org { @@ -183,6 +205,7 @@ class Field : public ::java::lang::Object { public: Field(jstring, jstring, jboolean, jboolean, jboolean); + static Field *Text(jstring, jreader); static Field *UnIndexed(jstring, jstring); static Field *UnStored(jstring, jstring); }; Fri, 10 Sep, 19:04
ker   zer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info _swigt__p_jdbtxn[] = {{"_p_jdbtxn", 0, "jdbtxn *", 0},{"_p_jdbtxn"},{0}}; static swig_type_info *swig_types_initial[] = { @@ -2185,6 +2253,8 @@ _swigt__p_jstring, _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer, _swigt__p_org__apache__lucene__search__Query, +_swigt__p_jreader, +_swigt__p_java__io__Reader, _swigt__p_org__apache__lucene__index__IndexWriter, _swigt__p_org__apache__lucene__store__db__DbDirectory, _swigt__p_org__apache__lucene__store__Directory, Index: osaf/chandler/persistence/PyLucene/Makefile.mingw diff -u osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 osaf/chandler/persistence/PyLucene/Makefile.mingw:1.3 --- osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.mingw Tue Jan 13 21:48:50 2004 @@ -35,6 +35,8 @@ PYTHON_INC = $(RELDIR)\bin\include PYTHON_SITE = $(RELDIR)\bin\Lib\site-packages +OBJS = $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(BINDIR)\reader.java.o $(BINDIR)\reader.cpp.o + $(BINDIR)\lucene.o: if not exist $(BINDIR) mkdir $(BINDIR)\classes $(JCC) -C -d $(CLASSES) @lucene.lst @@ -56,7 +58,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) @store.lst $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)\store.o --classpath=$(CLASSES) @store.lst -$(BINDIR)\_PyLucene$(_dbg).pyd: $(BINDIR)\store.o $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\lucene.o +$(BINDIR)\reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)\reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)\_PyLucene$(_dbg).pyd: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -73,8 +83,8 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -Dalloca=__builtin_alloca -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx - $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 + $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx + $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(OBJS) $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 all: $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\libdb_java42$(dbg).dll echo build of $(BINDIR)\_PyLucene$(_dbg).pyd complete Index: osaf/chandler/persistence/PyLucene/Makefile diff -u osaf/chandler/persistence/PyLucene/Makefile:1.1 osaf/chandler/persistence/PyLucene/Makefile:1.2 --- osaf/chandler/persistence/PyLucene/Makefile:1.1 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile Tue Jan 13 21:48:50 2004 @@ -9,8 +9,8 @@ else -CCFLAGS = -O2 -LDFLAGS = +CCFLAGS = -g +LDFLAGS = -g mode = release endif @@ -56,7 +56,16 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -PyLucene_wrap.cxx: PyLucene.i +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +PyLucene_wrap.cxx: PyLucene.i $(BINDIR)/reader.java.o $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -72,10 +81,11 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader swig -modern -I$(BINDIR)/classes -c++ -python PyLucene.i -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress +$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o -lgcj -liconv -flat_namespace -multiply_defined suppress -undefined warning all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/Makefile.osx diff -u osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 osaf/chandler/persistence/PyLucene/Makefile.osx:1.4 --- osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.osx Tue Jan 13 21:48:50 2004 @@ -34,6 +34,8 @@ DB_SRCS = `find $(DB)/java/src/com/sleepycat/db -regex '.*/db/[^/]*java'` STORE_SRCS = `find store -name '*.java' -print` +OBJS = $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(BINDIR)/lucene.o: if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi @@ -58,7 +60,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)/_PyLucene.so: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -74,7 +84,7 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(OBJS) -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/PyLucene.i diff -u osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 osaf/chandler/persistence/PyLucene/PyLucene.i:1.3 --- osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/PyLucene.i Tue Jan 13 21:48:50 2004 @@ -15,6 +15,7 @@ #include <gcj/cni.h> #include <java/lang/Object.h> #include <java/lang/Throwable.h> +#include <java/io/Reader.h> #include "com/sleepycat/db/DbEnv.h" #include "com/sleepycat/db/Db.h" @@ -32,6 +33,7 @@ #include "org/apache/lucene/search/Query.h" #include "org/apache/lucene/search/Hits.h" #include "org/apache/lucene/search/IndexSearcher.h" +#include "org/osafoundation/io/PythonReader.h" #include <db.h> @@ -54,6 +56,7 @@ typedef ::com::sleepycat::db::DbEnv *jdbenv; typedef ::com::sleepycat::db::Db *jdb; typedef ::com::sleepycat::db::DbTxn *jdbtxn; +typedef ::java::io::Reader *jreader; %} @@ -72,7 +75,7 @@ else { jint len = JvGetStringUTFLength($1); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion($1, 0, len, buf); buf[len] = '\0'; @@ -125,6 +128,19 @@ $1 = PyObject_IsTrue($input); } +%typemap(in) jreader { + + if ($input == Py_None) + $1 = NULL; + else + { + jlong ptr; + + *(PyObject **) &ptr = (PyObject *) $input; + $1 = new org::osafoundation::io::PythonReader(ptr); + } +} + typedef int jint; typedef float jfloat; @@ -136,7 +152,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -152,6 +168,12 @@ virtual jstring toString(); }; } + namespace io { +%nodefault; + class Reader : public ::java::lang::Object { + }; +%makedefault; + } } namespace org { @@ -183,6 +205,7 @@ class Field : public ::java::lang::Object { public: Field(jstring, jstring, jboolean, jboolean, jboolean); + static Field *Text(jstring, jreader); static Field *UnIndexed(jstring, jstring); static Field *UnStored(jstring, jstring); }; Fri, 10 Sep, 19:04
  zer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info _swigt__p_jdbtxn[] = {{"_p_jdbtxn", 0, "jdbtxn *", 0},{"_p_jdbtxn"},{0}}; static swig_type_info *swig_types_initial[] = { @@ -2185,6 +2253,8 @@ _swigt__p_jstring, _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer, _swigt__p_org__apache__lucene__search__Query, +_swigt__p_jreader, +_swigt__p_java__io__Reader, _swigt__p_org__apache__lucene__index__IndexWriter, _swigt__p_org__apache__lucene__store__db__DbDirectory, _swigt__p_org__apache__lucene__store__Directory, Index: osaf/chandler/persistence/PyLucene/Makefile.mingw diff -u osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 osaf/chandler/persistence/PyLucene/Makefile.mingw:1.3 --- osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.mingw Tue Jan 13 21:48:50 2004 @@ -35,6 +35,8 @@ PYTHON_INC = $(RELDIR)\bin\include PYTHON_SITE = $(RELDIR)\bin\Lib\site-packages +OBJS = $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(BINDIR)\reader.java.o $(BINDIR)\reader.cpp.o + $(BINDIR)\lucene.o: if not exist $(BINDIR) mkdir $(BINDIR)\classes $(JCC) -C -d $(CLASSES) @lucene.lst @@ -56,7 +58,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) @store.lst $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)\store.o --classpath=$(CLASSES) @store.lst -$(BINDIR)\_PyLucene$(_dbg).pyd: $(BINDIR)\store.o $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\lucene.o +$(BINDIR)\reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)\reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)\_PyLucene$(_dbg).pyd: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -73,8 +83,8 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -Dalloca=__builtin_alloca -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx - $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 + $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx + $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(OBJS) $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 all: $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\libdb_java42$(dbg).dll echo build of $(BINDIR)\_PyLucene$(_dbg).pyd complete Index: osaf/chandler/persistence/PyLucene/Makefile diff -u osaf/chandler/persistence/PyLucene/Makefile:1.1 osaf/chandler/persistence/PyLucene/Makefile:1.2 --- osaf/chandler/persistence/PyLucene/Makefile:1.1 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile Tue Jan 13 21:48:50 2004 @@ -9,8 +9,8 @@ else -CCFLAGS = -O2 -LDFLAGS = +CCFLAGS = -g +LDFLAGS = -g mode = release endif @@ -56,7 +56,16 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -PyLucene_wrap.cxx: PyLucene.i +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +PyLucene_wrap.cxx: PyLucene.i $(BINDIR)/reader.java.o $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -72,10 +81,11 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader swig -modern -I$(BINDIR)/classes -c++ -python PyLucene.i -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress +$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o -lgcj -liconv -flat_namespace -multiply_defined suppress -undefined warning all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/Makefile.osx diff -u osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 osaf/chandler/persistence/PyLucene/Makefile.osx:1.4 --- osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.osx Tue Jan 13 21:48:50 2004 @@ -34,6 +34,8 @@ DB_SRCS = `find $(DB)/java/src/com/sleepycat/db -regex '.*/db/[^/]*java'` STORE_SRCS = `find store -name '*.java' -print` +OBJS = $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(BINDIR)/lucene.o: if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi @@ -58,7 +60,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)/_PyLucene.so: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -74,7 +84,7 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(OBJS) -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/PyLucene.i diff -u osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 osaf/chandler/persistence/PyLucene/PyLucene.i:1.3 --- osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/PyLucene.i Tue Jan 13 21:48:50 2004 @@ -15,6 +15,7 @@ #include <gcj/cni.h> #include <java/lang/Object.h> #include <java/lang/Throwable.h> +#include <java/io/Reader.h> #include "com/sleepycat/db/DbEnv.h" #include "com/sleepycat/db/Db.h" @@ -32,6 +33,7 @@ #include "org/apache/lucene/search/Query.h" #include "org/apache/lucene/search/Hits.h" #include "org/apache/lucene/search/IndexSearcher.h" +#include "org/osafoundation/io/PythonReader.h" #include <db.h> @@ -54,6 +56,7 @@ typedef ::com::sleepycat::db::DbEnv *jdbenv; typedef ::com::sleepycat::db::Db *jdb; typedef ::com::sleepycat::db::DbTxn *jdbtxn; +typedef ::java::io::Reader *jreader; %} @@ -72,7 +75,7 @@ else { jint len = JvGetStringUTFLength($1); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion($1, 0, len, buf); buf[len] = '\0'; @@ -125,6 +128,19 @@ $1 = PyObject_IsTrue($input); } +%typemap(in) jreader { + + if ($input == Py_None) + $1 = NULL; + else + { + jlong ptr; + + *(PyObject **) &ptr = (PyObject *) $input; + $1 = new org::osafoundation::io::PythonReader(ptr); + } +} + typedef int jint; typedef float jfloat; @@ -136,7 +152,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -152,6 +168,12 @@ virtual jstring toString(); }; } + namespace io { +%nodefault; + class Reader : public ::java::lang::Object { + }; +%makedefault; + } } namespace org { @@ -183,6 +205,7 @@ class Field : public ::java::lang::Object { public: Field(jstring, jstring, jboolean, jboolean, jboolean); + static Field *Text(jstring, jreader); static Field *UnIndexed(jstring, jstring); static Field *UnStored(jstring, jstring); }; Tue, 20 Dec, 12:56
uri buf[len] = '\0'; @@ -1919,7 +1980,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -1949,7 +2010,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -1979,7 +2040,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -2033,7 +2094,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -2060,6 +2121,7 @@ { (char *)"new_Object", _wrap_new_Object, METH_VARARGS }, { (char *)"delete_Object", _wrap_delete_Object, METH_VARARGS }, { (char *)"Object_swigregister", Object_swigregister, METH_VARARGS }, + { (char *)"Reader_swigregister", Reader_swigregister, METH_VARARGS }, { (char *)"delete_Directory", _wrap_delete_Directory, METH_VARARGS }, { (char *)"Directory_swigregister", Directory_swigregister, METH_VARARGS }, { (char *)"new_DbDirectory", _wrap_new_DbDirectory, METH_VARARGS }, @@ -2072,6 +2134,7 @@ { (char *)"delete_StandardAnalyzer", _wrap_delete_StandardAnalyzer, METH_VARARGS }, { (char *)"StandardAnalyzer_swigregister", StandardAnalyzer_swigregister, METH_VARARGS }, { (char *)"new_Field", _wrap_new_Field, METH_VARARGS }, + { (char *)"Field_Text", _wrap_Field_Text, METH_VARARGS }, { (char *)"Field_UnIndexed", _wrap_Field_UnIndexed, METH_VARARGS }, { (char *)"Field_UnStored", _wrap_Field_UnStored, METH_VARARGS }, { (char *)"delete_Field", _wrap_delete_Field, METH_VARARGS }, @@ -2113,6 +2176,9 @@ static void *_p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object(void *x) { return (void *)((java::lang::Object *) (org::apache::lucene::analysis::Analyzer *) ((org::apache::lucene::analysis::standard::StandardAnalyzer *) x)); } +static void *_p_java__io__ReaderTo_p_java__lang__Object(void *x) { + return (void *)((java::lang::Object *) ((java::io::Reader *) x)); +} static void *_p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object(void *x) { return (void *)((java::lang::Object *) ((org::apache::lucene::analysis::Analyzer *) x)); } @@ -2166,11 +2232,13 @@ static swig_type_info _swigt__p_jstring[] = {{"_p_jstring", 0, "jstring *", 0},{"_p_jstring"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info alecf@osafoundation.org> Wed, 24 Mar, 10:40
er alysis__standard__StandardAnalyzerTo_p_java__lang__Object(void *x) { return (void *)((java::lang::Object *) (org::apache::lucene::analysis::Analyzer *) ((org::apache::lucene::analysis::standard::StandardAnalyzer *) x)); } +static void *_p_java__io__ReaderTo_p_java__lang__Object(void *x) { + return (void *)((java::lang::Object *) ((java::io::Reader *) x)); +} static void *_p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object(void *x) { return (void *)((java::lang::Object *) ((org::apache::lucene::analysis::Analyzer *) x)); } @@ -2166,11 +2232,13 @@ static swig_type_info _swigt__p_jstring[] = {{"_p_jstring", 0, "jstring *", 0},{"_p_jstring"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer[] = {{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", 0, "org::apache::lucene::analysis::standard::StandardAnalyzer *", 0},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__search__Query[] = {{"_p_org__apache__lucene__search__Query", 0, "org::apache::lucene::search::Query *", 0},{"_p_org__apache__lucene__search__Query"},{0}}; +static swig_type_info _swigt__p_jreader[] = {{"_p_jreader", 0, "jreader *", 0},{"_p_jreader"},{0}}; +static swig_type_info _swigt__p_java__io__Reader[] = {{"_p_java__io__Reader", 0, "java::io::Reader *", 0},{"_p_java__io__Reader"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__index__IndexWriter[] = {{"_p_org__apache__lucene__index__IndexWriter", 0, "org::apache::lucene::index::IndexWriter *", 0},{"_p_org__apache__lucene__index__IndexWriter"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__db__DbDirectory[] = {{"_p_org__apache__lucene__store__db__DbDirectory", 0, "org::apache::lucene::store::db::DbDirectory *", 0},{"_p_org__apache__lucene__store__db__DbDirectory"},{0}}; static swig_type_info _swigt__p_org__apache__lucene__store__Directory[] = {{"_p_org__apache__lucene__store__Directory", 0, "org::apache::lucene::store::Directory *", 0},{"_p_org__apache__lucene__store__Directory"},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_org__apache__lucene__store__Directory},{0}}; static swig_type_info _swigt__p_org__apache__lucene__document__Document[] = {{"_p_org__apache__lucene__document__Document", 0, "org::apache::lucene::document::Document *", 0},{"_p_org__apache__lucene__document__Document"},{0}}; -static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Query", _p_org__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_java__lang__Object"},{"_p_org__apache__lucene! __document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{0}}; +static swig_type_info _swigt__p_java__lang__Object[] = {{"_p_java__lang__Object", 0, "java::lang::Object *", 0},{"_p_org__apache__lucene__search__Hits", _p_org__apache__lucene__search__HitsTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__Analyzer", _p_org__apache__lucene__analysis__AnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Searcher", _p_org__apache__lucene__search__SearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__search__IndexSearcher", _p_org__apache__lucene__search__IndexSearcherTo_p_java__lang__Object},{"_p_org__apache__lucene__queryParser__QueryParser", _p_org__apache__lucene__queryParser__QueryParserTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Field", _p_org__apache__lucene__document__FieldTo_p_java__lang__Object},{"_p_org__apache__lucene__analysis__standard__StandardAnalyzer", _p_org__apache__lucene__analysis__standard__StandardAnalyzerTo_p_java__lang__Object},{"_p_org__apache__lucene__search__Query", _p_o! rg__apache__lucene__search__QueryTo_p_java__lang__Object},{"_p_java__io__Reader", _p_java__io__ReaderTo_p_java__lang__Object},{"_p_org__apache__lucene__index__IndexWriter", _p_org__apache__lucene__index__IndexWriterTo_p_java__lang__Object},{"_p_org__apache__lucene__store__Directory", _p_org__apache__lucene__store__DirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__store__db__DbDirectory", _p_org__apache__lucene__store__db__DbDirectoryTo_p_java__lang__Object},{"_p_org__apache__lucene__document__Document", _p_org__apache__lucene__document__DocumentTo_p_java__lang__Object},{"_p_java__lang__Object"},{0}}; static swig_type_info _swigt__p_jdbtxn[] = {{"_p_jdbtxn", 0, "jdbtxn *", 0},{"_p_jdbtxn"},{0}}; static swig_type_info *swig_types_initial[] = { @@ -2185,6 +2253,8 @@ _swigt__p_jstring, _swigt__p_org__apache__lucene__analysis__standard__StandardAnalyzer, _swigt__p_org__apache__lucene__search__Query, +_swigt__p_jreader, +_swigt__p_java__io__Reader, _swigt__p_org__apache__lucene__index__IndexWriter, _swigt__p_org__apache__lucene__store__db__DbDirectory, _swigt__p_org__apache__lucene__store__Directory, Index: osaf/chandler/persistence/PyLucene/Makefile.mingw diff -u osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 osaf/chandler/persistence/PyLucene/Makefile.mingw:1.3 --- osaf/chandler/persistence/PyLucene/Makefile.mingw:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.mingw Tue Jan 13 21:48:50 2004 @@ -35,6 +35,8 @@ PYTHON_INC = $(RELDIR)\bin\include PYTHON_SITE = $(RELDIR)\bin\Lib\site-packages +OBJS = $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(BINDIR)\reader.java.o $(BINDIR)\reader.cpp.o + $(BINDIR)\lucene.o: if not exist $(BINDIR) mkdir $(BINDIR)\classes $(JCC) -C -d $(CLASSES) @lucene.lst @@ -56,7 +58,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) @store.lst $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)\store.o --classpath=$(CLASSES) @store.lst -$(BINDIR)\_PyLucene$(_dbg).pyd: $(BINDIR)\store.o $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\lucene.o +$(BINDIR)\reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)\reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)\_PyLucene$(_dbg).pyd: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -73,8 +83,8 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -Dalloca=__builtin_alloca -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx - $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\db_const.o $(BINDIR)\db.o $(BINDIR)\store.o $(BINDIR)\lucene.o $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 + $(CXX) -c $(CCFLAGS) $(PYDBG) -D_NO_OLDNAMES -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)\include\db -o $(BINDIR)\PyLucene_wrap.o PyLucene_wrap.cxx + $(CXX) -shared $(LDFLAGS) -o $(BINDIR)\_PyLucene$(_dbg).pyd $(OBJS) $(RELDIR)\bin\python23$(_dbg).dll $(BINDIR)\PyLucene_wrap.o -lgcj -lwin32k -lws2_32 all: $(BINDIR)\_PyLucene$(_dbg).pyd $(BINDIR)\libdb_java42$(dbg).dll echo build of $(BINDIR)\_PyLucene$(_dbg).pyd complete Index: osaf/chandler/persistence/PyLucene/Makefile diff -u osaf/chandler/persistence/PyLucene/Makefile:1.1 osaf/chandler/persistence/PyLucene/Makefile:1.2 --- osaf/chandler/persistence/PyLucene/Makefile:1.1 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile Tue Jan 13 21:48:50 2004 @@ -9,8 +9,8 @@ else -CCFLAGS = -O2 -LDFLAGS = +CCFLAGS = -g +LDFLAGS = -g mode = release endif @@ -56,7 +56,16 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -PyLucene_wrap.cxx: PyLucene.i +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp + if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +PyLucene_wrap.cxx: PyLucene.i $(BINDIR)/reader.java.o $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -72,10 +81,11 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader swig -modern -I$(BINDIR)/classes -c++ -python PyLucene.i -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress +$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o PyLucene_wrap.cxx $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I/usr/local/BerkeleyDB.4.2/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o -lgcj -liconv -flat_namespace -multiply_defined suppress -undefined warning all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/Makefile.osx diff -u osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 osaf/chandler/persistence/PyLucene/Makefile.osx:1.4 --- osaf/chandler/persistence/PyLucene/Makefile.osx:1.3 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/Makefile.osx Tue Jan 13 21:48:50 2004 @@ -34,6 +34,8 @@ DB_SRCS = `find $(DB)/java/src/com/sleepycat/db -regex '.*/db/[^/]*java'` STORE_SRCS = `find store -name '*.java' -print` +OBJS = $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o $(BINDIR)/reader.java.o $(BINDIR)/reader.cpp.o + $(BINDIR)/lucene.o: if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR)/classes; fi @@ -58,7 +60,15 @@ $(JCC) -C -d $(CLASSES) --classpath=$(CLASSES) $(STORE_SRCS) $(JCC) -fjni $(CCFLAGS) -c -o $(BINDIR)/store.o --classpath=$(CLASSES) $(STORE_SRCS) -$(BINDIR)/_PyLucene.so: $(BINDIR)/store.o $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/lucene.o +$(BINDIR)/reader.java.o: java/org/osafoundation/io/PythonReader.java + $(JCC) -C -d $(CLASSES) java/org/osafoundation/io/PythonReader.java + $(JCC) $(CCFLAGS) -c -o $(BINDIR)/reader.java.o java/org/osafoundation/io/PythonReader.java + $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.osafoundation.io.PythonReader + +$(BINDIR)/reader.cpp.o: cpp/PythonReader.cpp $(BINDIR)/reader.java.o + $(JCC) -I$(PYTHON_INC) -I$(CLASSES) $(CCFLAGS) -c -o $(BINDIR)/reader.cpp.o cpp/PythonReader.cpp + +$(BINDIR)/_PyLucene.so: $(OBJS) $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbEnv $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.Db $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) com.sleepycat.db.DbTxn @@ -74,7 +84,7 @@ $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.Hits $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.search.IndexSearcher $(JCCH) -d $(CLASSES) --classpath=$(CLASSES) org.apache.lucene.queryParser.QueryParser - $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(BINDIR)/db_const.o $(BINDIR)/db.o $(BINDIR)/store.o $(BINDIR)/lucene.o -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress + $(CXX) -shared -bundle -o $(BINDIR)/_PyLucene.so $(CCFLAGS) -I$(CLASSES) -I$(PYTHON_INC) -I$(RELDIR)/db/include PyLucene_wrap.cxx $(OBJS) -lgcj -liconv -undefined suppress -flat_namespace -multiply_defined suppress all: $(BINDIR)/_PyLucene.so $(BINDIR)/libdb_java-4.2.jnilib echo build of $(BINDIR)/_PyLucene.so complete Index: osaf/chandler/persistence/PyLucene/PyLucene.i diff -u osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 osaf/chandler/persistence/PyLucene/PyLucene.i:1.3 --- osaf/chandler/persistence/PyLucene/PyLucene.i:1.2 Sat Jan 10 19:08:03 2004 +++ osaf/chandler/persistence/PyLucene/PyLucene.i Tue Jan 13 21:48:50 2004 @@ -15,6 +15,7 @@ #include <gcj/cni.h> #include <java/lang/Object.h> #include <java/lang/Throwable.h> +#include <java/io/Reader.h> #include "com/sleepycat/db/DbEnv.h" #include "com/sleepycat/db/Db.h" @@ -32,6 +33,7 @@ #include "org/apache/lucene/search/Query.h" #include "org/apache/lucene/search/Hits.h" #include "org/apache/lucene/search/IndexSearcher.h" +#include "org/osafoundation/io/PythonReader.h" #include <db.h> @@ -54,6 +56,7 @@ typedef ::com::sleepycat::db::DbEnv *jdbenv; typedef ::com::sleepycat::db::Db *jdb; typedef ::com::sleepycat::db::DbTxn *jdbtxn; +typedef ::java::io::Reader *jreader; %} @@ -72,7 +75,7 @@ else { jint len = JvGetStringUTFLength($1); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion($1, 0, len, buf); buf[len] = '\0'; @@ -125,6 +128,19 @@ $1 = PyObject_IsTrue($input); } +%typemap(in) jreader { + + if ($input == Py_None) + $1 = NULL; + else + { + jlong ptr; + + *(PyObject **) &ptr = (PyObject *) $input; + $1 = new org::osafoundation::io::PythonReader(ptr); + } +} + typedef int jint; typedef float jfloat; @@ -136,7 +152,7 @@ } catch (java::lang::Throwable *e) { jstring message = e->toString(); jint len = JvGetStringUTFLength(message); - char *buf = (char *) alloca(len + 1); + char buf[len + 1]; JvGetStringUTFRegion(message, 0, len, buf); buf[len] = '\0'; @@ -152,6 +168,12 @@ virtual jstring toString(); }; } + namespace io { +%nodefault; + class Reader : public ::java::lang::Object { + }; +%makedefault; + } } namespace org { @@ -183,6 +205,7 @@ class Field : public ::java::lang::Object { public: Field(jstring, jstring, jboolean, jboolean, jboolean); + static Field *Text(jstring, jreader); static Field *UnIndexed(jstring, jstring); static Field *UnStored(jstring, jstring); }; Mon, 11 Apr, 12:09
0], self.reconnect) </span><span class="cx"> </span><span class="add">+ waitForDeferred(d) + </span><span class="cx"> return result except Exception, e: # There is a bug in the M2Crypto code which needs </span><span class="lines">@@ -331,11 +324,12 @@ </span><span class="cx"> # the progress dialog will also kill the SSL error dialog. # Weird, huh? Welcome to the world of wx... callMethodInUIThread(self.callback, result) </span><span class="rem">- ssl.askIgnoreSSLError( err.pem, - messages.SSL_HOST_MISMATCH % \ - {'expectedHost': err.expectedHost, - 'actualHost': err.actualHost}, Tue, 20 Dec, 12:56
Message listThread · Author · Date
Box list
Jul 20081
Mar 20081
Jan 20085
Dec 200715
Nov 20078
Oct 200749
Sep 200725
Aug 2007137
Jul 2007246
Jun 200761
May 200710
Apr 200744
Mar 200716
Feb 20076
Jan 200721
Dec 20065
Nov 200613
Oct 200613
Sep 200623
Aug 200643
Jul 200621
Jun 200652
May 200652
Apr 200629
Mar 200639
Feb 200677
Jan 200620
Dec 200510
Sep 20058
Jun 20052
Apr 20051
Mar 20052
Feb 20054
Dec 20045
Nov 20042
Sep 20041
Aug 20045
Jun 20047
Apr 20041
Feb 20042
Jan 20042
Dec 20031
Nov 20039
Aug 20036
Jun 20033
Mar 20031
Feb 20031
Jan 20033
Dec 20021
Nov 20022
Oct 20024