diff --git a/src/bincimapmime/mime-parsefull.cc b/src/bincimapmime/mime-parsefull.cc index 050cf498..037119c2 100644 --- a/src/bincimapmime/mime-parsefull.cc +++ b/src/bincimapmime/mime-parsefull.cc @@ -80,7 +80,7 @@ void Binc::MimeDocument::parseFull(int fd) const int bsize = 0; string bound; - MimePart::parseFull(bound, bsize); + doParseFull(bound, bsize); // eat any trailing junk to get the correct size char c; @@ -109,7 +109,7 @@ void Binc::MimeDocument::parseFull(istream& s) const int bsize = 0; string bound; - MimePart::parseFull(bound, bsize); + doParseFull(bound, bsize); // eat any trailing junk to get the correct size char c; @@ -286,7 +286,7 @@ static void parseMessageRFC822(vector *members, // parsefull returns the number of bytes that need to be removed // from the body because of the terminating boundary string. int bsize = 0; - if (m.parseFull(toboundary, bsize)) + if (m.doParseFull(toboundary, bsize)) *foundendofpart = true; // make sure bodylength doesn't overflow @@ -468,7 +468,7 @@ static void parseMultipart(const string &boundary, // If parseFull returns != 0, then it encountered the multipart's // final boundary. int bsize = 0; - if (m.parseFull(boundary, bsize)) { + if (m.doParseFull(boundary, bsize)) { quit = true; *boundarysize = bsize; } @@ -591,10 +591,10 @@ static void parseSinglePart(const string &toboundary, } //------------------------------------------------------------------------ -int Binc::MimePart::parseFull(const string &toboundary, +int Binc::MimePart::doParseFull(const string &toboundary, int &boundarysize) const { - MPFDEB((stderr, "BINC: parsefull, toboundary[%s]\n", toboundary.c_str())); + MPFDEB((stderr, "BINC: doParsefull, toboundary[%s]\n", toboundary.c_str())); headerstartoffsetcrlf = mimeSource->getOffset(); // Parse the header of this mime part. @@ -626,6 +626,6 @@ int Binc::MimePart::parseFull(const string &toboundary, &eof, &foundendofpart, &bodylength); } - MPFDEB((stderr, "BINC: parsefull ret, toboundary[%s]\n", toboundary.c_str())); + MPFDEB((stderr, "BINC: doParsefull ret, toboundary[%s]\n", toboundary.c_str())); return (eof || foundendofpart) ? 1 : 0; } diff --git a/src/bincimapmime/mime-parseonlyheader.cc b/src/bincimapmime/mime-parseonlyheader.cc index f4726b55..330e8c32 100644 --- a/src/bincimapmime/mime-parseonlyheader.cc +++ b/src/bincimapmime/mime-parseonlyheader.cc @@ -72,7 +72,7 @@ void Binc::MimeDocument::parseOnlyHeader(int fd) const nlines = 0; nbodylines = 0; - MimePart::parseOnlyHeader(""); + doParseOnlyHeader(""); } void Binc::MimeDocument::parseOnlyHeader(istream& s) const @@ -95,11 +95,11 @@ void Binc::MimeDocument::parseOnlyHeader(istream& s) const nlines = 0; nbodylines = 0; - MimePart::parseOnlyHeader(""); + doParseOnlyHeader(""); } //------------------------------------------------------------------------ -int Binc::MimePart::parseOnlyHeader(const string &toboundary) const +int Binc::MimePart::doParseOnlyHeader(const string &toboundary) const { string name; string content; diff --git a/src/bincimapmime/mime.h b/src/bincimapmime/mime.h index df12227b..c46f4707 100644 --- a/src/bincimapmime/mime.h +++ b/src/bincimapmime/mime.h @@ -114,8 +114,8 @@ namespace Binc { virtual void clear(void) const; const MimePart *getPart(const std::string &findpart, std::string genpart, FetchType fetchType = FetchBody) const; - virtual int parseOnlyHeader(const std::string &toboundary) const; - virtual int parseFull(const std::string &toboundary, int &boundarysize) const; + virtual int doParseOnlyHeader(const std::string &toboundary) const; + virtual int doParseFull(const std::string &toboundary, int &boundarysize) const; MimePart(void); virtual ~MimePart(void); diff --git a/src/lib/Makefile b/src/lib/Makefile index 6d831a67..22d9a89d 100644 --- a/src/lib/Makefile +++ b/src/lib/Makefile @@ -6,15 +6,15 @@ LIBS = librcl.a all: $(LIBS) -OBJS = rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o myhtmlparse.o mimehandler.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o rcldb.o rcldoc.o rclquery.o searchdata.o stemdb.o stoplist.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-getpart.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime-printdoc.o mime-printheader.o mime.o convert.o iodevice.o iofactory.o -DEPS = rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp myhtmlparse.dep.stamp mimehandler.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp stemdb.dep.stamp stoplist.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-getpart.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime-printdoc.dep.stamp mime-printheader.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp +OBJS = unac.o rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o myhtmlparse.o mimehandler.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o rcldb.o rcldoc.o rclquery.o searchdata.o stemdb.o stoplist.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-getpart.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime-printdoc.o mime-printheader.o mime.o convert.o iodevice.o iofactory.o +DEPS = unac.dep.stamp rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp myhtmlparse.dep.stamp mimehandler.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp stemdb.dep.stamp stoplist.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-getpart.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime-printdoc.dep.stamp mime-printheader.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp -librcl.a : $(DEPS) $(OBJS) unac.o - ar ru librcl.a $(OBJS) unac.o +librcl.a : $(DEPS) $(OBJS) + ar ru librcl.a $(OBJS) $(RANLIB) librcl.a -unac.o : $(depth)/unac/unac.c $(depth)/unac/unac.h $(depth)/mk/localdefs - $(CXX) $(ALL_CXXFLAGS) -c $(depth)/unac/unac.c +unac.o : ../unac/unac.cpp $(depth)/mk/localdefs + $(CXX) $(ALL_CXXFLAGS) -c ../unac/unac.cpp rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs $(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp beaglequeuecache.o : ../common/beaglequeuecache.cpp $(depth)/mk/localdefs @@ -165,6 +165,9 @@ clean: for i in *.dep;do test -f $$i && cp /dev/null $$i;done distclean: clean rm -f *.dep +unac.dep.stamp : ../unac/unac.cpp $(depth)/mk/localdefs + $(CXX) -M $(ALL_CXXFLAGS) ../unac/unac.cpp > unac.dep + touch unac.dep.stamp rclaspell.dep.stamp : ../aspell/rclaspell.cpp $(depth)/mk/localdefs $(CXX) -M $(ALL_CXXFLAGS) ../aspell/rclaspell.cpp > rclaspell.dep touch rclaspell.dep.stamp @@ -351,6 +354,7 @@ wipedir.dep.stamp : ../utils/wipedir.cpp $(depth)/mk/localdefs x11mon.dep.stamp : ../utils/x11mon.cpp $(depth)/mk/localdefs $(CXX) -M $(ALL_CXXFLAGS) ../utils/x11mon.cpp > x11mon.dep touch x11mon.dep.stamp +include unac.dep include rclaspell.dep include beaglequeuecache.dep include cstr.dep diff --git a/src/lib/mkMake b/src/lib/mkMake index 98c2079a..15821191 100755 --- a/src/lib/mkMake +++ b/src/lib/mkMake @@ -44,6 +44,7 @@ ${depth}/rcldb/rclquery.cpp \ ${depth}/rcldb/searchdata.cpp \ ${depth}/rcldb/stemdb.cpp \ ${depth}/rcldb/stoplist.cpp \ +${depth}/unac/unac.cpp \ ${depth}/utils/base64.cpp \ ${depth}/utils/circache.cpp \ ${depth}/utils/closefrom.cpp \ @@ -116,12 +117,10 @@ all: \$(LIBS) OBJS = $OBJS DEPS = $DEPS -librcl.a : \$(DEPS) \$(OBJS) unac.o - ar ru librcl.a \$(OBJS) unac.o +librcl.a : \$(DEPS) \$(OBJS) + ar ru librcl.a \$(OBJS) \$(RANLIB) librcl.a -unac.o : \$(depth)/unac/unac.c \$(depth)/unac/unac.h $defs - \$(CXX) \$(ALL_CXXFLAGS) -c \$(depth)/unac/unac.c EOF for c in $SRC_CPP;do @@ -138,7 +137,7 @@ done cat >> $mk < iseq, setFiltSpec(filtspec); } -bool DocSeqFiltered::setFiltSpec(DocSeqFiltSpec &filtspec) +bool DocSeqFiltered::setFiltSpec(const DocSeqFiltSpec &filtspec) { LOGDEB0(("DocSeqFiltered::setFiltSpec\n")); for (unsigned int i = 0; i < filtspec.crits.size(); i++) { diff --git a/src/query/filtseq.h b/src/query/filtseq.h index 11282810..c9ef771c 100644 --- a/src/query/filtseq.h +++ b/src/query/filtseq.h @@ -37,7 +37,7 @@ public: DocSeqFiltSpec &filtspec); virtual ~DocSeqFiltered() {} virtual bool canFilter() {return true;} - virtual bool setFiltSpec(DocSeqFiltSpec &filtspec); + virtual bool setFiltSpec(const DocSeqFiltSpec &filtspec); virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0); virtual int getResCnt() {return m_seq->getResCnt();} private: diff --git a/src/query/reslistpager.h b/src/query/reslistpager.h index 48570a40..d13b1d34 100644 --- a/src/query/reslistpager.h +++ b/src/query/reslistpager.h @@ -26,7 +26,7 @@ using std::vector; class RclConfig; class PlainToRich; -class HiliteData; +struct HiliteData; /** * Manage a paged HTML result list. diff --git a/src/query/sortseq.cpp b/src/query/sortseq.cpp index 945bd333..6624338b 100644 --- a/src/query/sortseq.cpp +++ b/src/query/sortseq.cpp @@ -41,7 +41,7 @@ public: } }; -bool DocSeqSorted::setSortSpec(DocSeqSortSpec &sortspec) +bool DocSeqSorted::setSortSpec(const DocSeqSortSpec &sortspec) { LOGDEB(("DocSeqSorted::setSortSpec\n")); m_spec = sortspec; diff --git a/src/query/sortseq.h b/src/query/sortseq.h index 4d4f4b81..96d76143 100644 --- a/src/query/sortseq.h +++ b/src/query/sortseq.h @@ -36,7 +36,7 @@ class DocSeqSorted : public DocSeqModifier { } virtual ~DocSeqSorted() {} virtual bool canSort() {return true;} - virtual bool setSortSpec(DocSeqSortSpec &sortspec); + virtual bool setSortSpec(const DocSeqSortSpec &sortspec); virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0); virtual int getResCnt() {return m_docsp.size();} private: diff --git a/src/rcldb/rclquery.cpp b/src/rcldb/rclquery.cpp index eb2edf0c..b86d8e0d 100644 --- a/src/rcldb/rclquery.cpp +++ b/src/rcldb/rclquery.cpp @@ -57,14 +57,21 @@ static const string& docfToDatf(const string& df) // special processing for special fields like dates and sizes. User // custom field data will have to be processed before insertion to // achieve equivalent results. +#if XAPIAN_MAJOR_VERSION == 1 && XAPIAN_MINOR_VERSION < 2 class QSorter : public Xapian::Sorter { +#else +class QSorter : public Xapian::KeyMaker { +#endif public: QSorter(const string& f) : m_fld(docfToDatf(f) + "=") { m_ismtime = !m_fld.compare("dmtime="); - m_issize = !m_fld.compare("fbytes=") || !m_fld.compare("dbytes=") || - !m_fld.compare("pcbytes="); + if (m_ismtime) + m_issize = false; + else + m_issize = !m_fld.compare("fbytes=") || !m_fld.compare("dbytes=") || + !m_fld.compare("pcbytes="); } virtual std::string operator()(const Xapian::Document& xdoc) const diff --git a/src/unac/unac.cpp b/src/unac/unac.cpp new file mode 120000 index 00000000..874fe657 --- /dev/null +++ b/src/unac/unac.cpp @@ -0,0 +1 @@ +unac.c \ No newline at end of file