checkpoint after long pause
This commit is contained in:
parent
670d7c2630
commit
6f66d9cb37
@ -1,7 +1,9 @@
|
|||||||
include ../mk/sysconf
|
include ../mk/sysconf
|
||||||
|
|
||||||
LIBS = libmime.a
|
LIBS = libmime.a
|
||||||
all: $(LIBS)
|
PROGS = trbinc
|
||||||
|
|
||||||
|
all: $(LIBS) $(PROGS)
|
||||||
|
|
||||||
SRCS = mime-getpart.cc mime-parsefull.cc mime-parseonlyheader.cc \
|
SRCS = mime-getpart.cc mime-parsefull.cc mime-parseonlyheader.cc \
|
||||||
mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime.cc \
|
mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime.cc \
|
||||||
@ -18,6 +20,9 @@ libmime.a : $(OBJS)
|
|||||||
.cc .o :
|
.cc .o :
|
||||||
$(CXX) $(CXXFLAGS) -c $<
|
$(CXX) $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
|
TRBINCOBJS = trbinc.o
|
||||||
|
trbinc: trbinc.o
|
||||||
|
$(CXX) -o trbinc trbinc.o libmime.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o $(LIBS)
|
rm -f *.o $(LIBS)
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "iodevice.h"
|
#include "iodevice.h"
|
||||||
#include "convert.h" // BincStream
|
#include "convert.h" // BincStream
|
||||||
#include "session.h" // getEnv/hasEnv
|
//#include "session.h" // getEnv/hasEnv
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -306,6 +306,7 @@ unsigned int IODevice::getWriteCount(void) const
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
void IODevice::enableProtocolDumping(void)
|
void IODevice::enableProtocolDumping(void)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
BincStream ss;
|
BincStream ss;
|
||||||
ss << "/tmp/bincimap-dump-" << (int) time(0) << "-"
|
ss << "/tmp/bincimap-dump-" << (int) time(0) << "-"
|
||||||
<< Session::getInstance().getIP() << "-XXXXXX";
|
<< Session::getInstance().getIP() << "-XXXXXX";
|
||||||
@ -314,4 +315,5 @@ void IODevice::enableProtocolDumping(void)
|
|||||||
if (dumpfd == -1)
|
if (dumpfd == -1)
|
||||||
dumpfd = 0;
|
dumpfd = 0;
|
||||||
delete safename;
|
delete safename;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.6 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.7 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -139,7 +139,7 @@ DbIndexer::processone(const std::string &fn, const struct stat *stp,
|
|||||||
|
|
||||||
// Set up common fields:
|
// Set up common fields:
|
||||||
char ascdate[20];
|
char ascdate[20];
|
||||||
sprintf(ascdate, "%ld", long(stp->st_mtime));
|
sprintf(ascdate, "%ld", long(stp->st_ctime));
|
||||||
doc.mtime = ascdate;
|
doc.mtime = ascdate;
|
||||||
|
|
||||||
// Do database-specific work to update document data
|
// Do database-specific work to update document data
|
||||||
|
|||||||
@ -31,6 +31,7 @@ using std::pair;
|
|||||||
#include "internfile.h"
|
#include "internfile.h"
|
||||||
#include "textsplit.h"
|
#include "textsplit.h"
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
|
#include "utf8iter.h"
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
||||||
@ -49,7 +50,7 @@ void RecollMain::checkExit()
|
|||||||
if (indexingstatus) {
|
if (indexingstatus) {
|
||||||
indexingstatus = false;
|
indexingstatus = false;
|
||||||
// Make sure we reopen the db to get the results.
|
// Make sure we reopen the db to get the results.
|
||||||
fprintf(stderr, "Indexing done: closing query database\n");
|
LOGINFO(("Indexing done: closing query database\n"));
|
||||||
rcldb->close();
|
rcldb->close();
|
||||||
}
|
}
|
||||||
if (recollNeedsExit)
|
if (recollNeedsExit)
|
||||||
@ -91,6 +92,7 @@ static string plaintorich(const string &in, const list<string>& terms,
|
|||||||
myTextSplitCB cb(terms);
|
myTextSplitCB cb(terms);
|
||||||
TextSplit splitter(&cb, true);
|
TextSplit splitter(&cb, true);
|
||||||
splitter.text_to_words(in);
|
splitter.text_to_words(in);
|
||||||
|
bool ateol = false;
|
||||||
string out = "<qt><head><title></title></head><body><p>";
|
string out = "<qt><head><title></title></head><body><p>";
|
||||||
list<pair<int, int> >::iterator it = cb.tboffs.begin();
|
list<pair<int, int> >::iterator it = cb.tboffs.begin();
|
||||||
for (unsigned int i = 0; i < in.length(); i++) {
|
for (unsigned int i = 0; i < in.length(); i++) {
|
||||||
@ -104,8 +106,11 @@ static string plaintorich(const string &in, const list<string>& terms,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (in[i] == '\n') {
|
if (in[i] == '\n') {
|
||||||
out += "<br>\n";
|
if (!ateol)
|
||||||
|
out += "<br>";
|
||||||
|
ateol = true;
|
||||||
} else {
|
} else {
|
||||||
|
ateol = false;
|
||||||
out += in[i];
|
out += in[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,9 +154,9 @@ void RecollMain::reslistTE_doubleClicked(int par, int)
|
|||||||
if (*it1 == '%')
|
if (*it1 == '%')
|
||||||
ncmd += '%';
|
ncmd += '%';
|
||||||
if (*it1 == 'u')
|
if (*it1 == 'u')
|
||||||
ncmd += doc.url;
|
ncmd += "'" + doc.url + "'";
|
||||||
if (*it1 == 'f')
|
if (*it1 == 'f')
|
||||||
ncmd += fn;
|
ncmd += "'" + fn + "'";
|
||||||
} else {
|
} else {
|
||||||
ncmd += *it1;
|
ncmd += *it1;
|
||||||
}
|
}
|
||||||
@ -170,10 +175,6 @@ void RecollMain::reslistTE_clicked(int par, int car)
|
|||||||
if (reslist_winfirst == -1)
|
if (reslist_winfirst == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If same doc, don't bother redisplaying
|
|
||||||
if (reslist_current == par - 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Rcl::Doc doc;
|
Rcl::Doc doc;
|
||||||
if (reslist_current != -1) {
|
if (reslist_current != -1) {
|
||||||
QColor color("white");
|
QColor color("white");
|
||||||
@ -217,13 +218,23 @@ void RecollMain::reslistTE_clicked(int par, int car)
|
|||||||
int para = 0, index = 1;
|
int para = 0, index = 1;
|
||||||
if (!termoffsets.empty()) {
|
if (!termoffsets.empty()) {
|
||||||
index = (termoffsets.begin())->first;
|
index = (termoffsets.begin())->first;
|
||||||
LOGDEB1(("Setting cursor position to para %d, index %d\n",para,index));
|
LOGDEB(("Byte index: %d\n", index));
|
||||||
|
// Translate byte to character offset
|
||||||
|
string::size_type pos = 0;
|
||||||
|
Utf8Iter it(rich);
|
||||||
|
for (; pos != string::npos && (int)pos < index; it++) {
|
||||||
|
pos = it.getBpos();
|
||||||
|
}
|
||||||
|
index = pos == string::npos ? 0 : it.getCpos();
|
||||||
|
LOGDEB(("Setting cursor position to para %d, charindex %d\n",
|
||||||
|
para,index));
|
||||||
previewTextEdit->setCursorPosition(0, index);
|
previewTextEdit->setCursorPosition(0, index);
|
||||||
}
|
}
|
||||||
previewTextEdit->ensureCursorVisible();
|
previewTextEdit->ensureCursorVisible();
|
||||||
previewTextEdit->getCursorPosition(¶, &index);
|
previewTextEdit->getCursorPosition(¶, &index);
|
||||||
LOGDEB1(("PREVIEW Paragraphs: %d. Cpos: %d %d\n",
|
LOGDEB(("PREVIEW len %d paragraphs: %d. Cpos: %d %d\n",
|
||||||
previewTextEdit->paragraphs(), para, index));
|
previewTextEdit->length(), previewTextEdit->paragraphs(),
|
||||||
|
para, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# @(#$Id: mimeconf,v 1.3 2005-02-09 12:07:30 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: mimeconf,v 1.4 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
|
|
||||||
# Recoll : associations of mime types to processing filters.
|
# Recoll : associations of mime types to processing filters.
|
||||||
# There are different sections for decompression, 'interning' for indexing
|
# There are different sections for decompression, 'interning' for indexing
|
||||||
@ -49,8 +49,7 @@ text/plain = xemacs %f
|
|||||||
text/html = firefox -a firefox -remote "openFile(%u)"
|
text/html = firefox -a firefox -remote "openFile(%u)"
|
||||||
application/pdf = xpdf %f
|
application/pdf = xpdf %f
|
||||||
application/postscript = gv %f
|
application/postscript = gv %f
|
||||||
application/msword = openoffice-1.1.3-swriter
|
application/msword = openoffice-1.1.3-swriter %f
|
||||||
|
|
||||||
application/vnd.sun.xml.calc = openoffice-1.1.3 %f
|
application/vnd.sun.xml.calc = openoffice-1.1.3 %f
|
||||||
application/vnd.sun.xml.calc.template = openoffice-1.1.3 %f
|
application/vnd.sun.xml.calc.template = openoffice-1.1.3 %f
|
||||||
application/vnd.sun.xml.draw = openoffice-1.1.3 %f
|
application/vnd.sun.xml.draw = openoffice-1.1.3 %f
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.5 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.6 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
#ifndef TEST_EXECMD
|
#ifndef TEST_EXECMD
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -22,7 +22,7 @@ using namespace std;
|
|||||||
#define MAX(A,B) (A>B?A:B)
|
#define MAX(A,B) (A>B?A:B)
|
||||||
|
|
||||||
int
|
int
|
||||||
ExecCmd::doexec(const string &cmd, const list<string> args,
|
ExecCmd::doexec(const string &cmd, const list<string>& args,
|
||||||
const string *input, string *output)
|
const string *input, string *output)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _EXECMD_H_INCLUDED_
|
#ifndef _EXECMD_H_INCLUDED_
|
||||||
#define _EXECMD_H_INCLUDED_
|
#define _EXECMD_H_INCLUDED_
|
||||||
/* @(#$Id: execmd.h,v 1.1 2004-12-12 08:58:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
/* @(#$Id: execmd.h,v 1.2 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -9,7 +9,7 @@ class ExecCmd {
|
|||||||
public:
|
public:
|
||||||
// ExecCmd() : argv(0) {};
|
// ExecCmd() : argv(0) {};
|
||||||
// ~ExeCmd() {delete [] argv;}
|
// ~ExeCmd() {delete [] argv;}
|
||||||
int doexec(const std::string &cmd, const std::list<std::string> a,
|
int doexec(const std::string &cmd, const std::list<std::string>& a,
|
||||||
const std::string *input = 0,
|
const std::string *input = 0,
|
||||||
std::string *output = 0);
|
std::string *output = 0);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.1 2005-01-26 11:45:55 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.2 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TEST_MIMEPARSE
|
#ifndef TEST_MIMEPARSE
|
||||||
@ -36,7 +36,7 @@ MimeHeaderValue parseMimeHeaderValue(const string &ein)
|
|||||||
{
|
{
|
||||||
string in = ein;
|
string in = ein;
|
||||||
MimeHeaderValue out;
|
MimeHeaderValue out;
|
||||||
string::size_type pos, pos1;
|
string::size_type pos;
|
||||||
|
|
||||||
pos = in.find_first_not_of(WHITE);
|
pos = in.find_first_not_of(WHITE);
|
||||||
if (pos == string::npos)
|
if (pos == string::npos)
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.4 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
#ifndef TEST_SMALLUT
|
#ifndef TEST_SMALLUT
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
@ -12,6 +14,8 @@ static char rcsid[] = "@(#$Id: smallut.cpp,v 1.4 2005-02-10 15:21:12 dockes Exp
|
|||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
#define MIN(A,B) ((A)<(B)?(A):(B))
|
#define MIN(A,B) ((A)<(B)?(A):(B))
|
||||||
|
|
||||||
bool maketmpdir(string& tdir)
|
bool maketmpdir(string& tdir)
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
#ifndef _SMALLUT_H_INCLUDED_
|
#ifndef _SMALLUT_H_INCLUDED_
|
||||||
#define _SMALLUT_H_INCLUDED_
|
#define _SMALLUT_H_INCLUDED_
|
||||||
/* @(#$Id: smallut.h,v 1.4 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
/* @(#$Id: smallut.h,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <ostream>
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::list;
|
using std::list;
|
||||||
|
using std::ostream;
|
||||||
extern int stringicmp(const string& s1, const string& s2);
|
extern int stringicmp(const string& s1, const string& s2);
|
||||||
extern int stringlowercmp(const string& alreadylower, const string& s2);
|
extern int stringlowercmp(const string& alreadylower, const string& s2);
|
||||||
extern int stringuppercmp(const string& alreadyupper, const string& s2);
|
extern int stringuppercmp(const string& alreadyupper, const string& s2);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _UTF8ITER_H_INCLUDED_
|
#ifndef _UTF8ITER_H_INCLUDED_
|
||||||
#define _UTF8ITER_H_INCLUDED_
|
#define _UTF8ITER_H_INCLUDED_
|
||||||
/* @(#$Id: utf8iter.h,v 1.2 2005-02-11 11:20:02 dockes Exp $ (C) 2004 J.F.Dockes */
|
/* @(#$Id: utf8iter.h,v 1.3 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A small helper class to iterate over utf8 strings. This is not an
|
* A small helper class to iterate over utf8 strings. This is not an
|
||||||
@ -117,9 +117,10 @@ class Utf8Iter {
|
|||||||
return (unsigned int)-1;
|
return (unsigned int)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set current position before next utf-8 character */
|
||||||
string::size_type operator++(int) {
|
string::size_type operator++(int) {
|
||||||
if (bad || (!cl && compute_cl() < 0)) {
|
if (bad || (!cl && compute_cl() < 0)) {
|
||||||
return string::npos;
|
return pos = string::npos;
|
||||||
}
|
}
|
||||||
pos += cl;
|
pos += cl;
|
||||||
m_charpos++;
|
m_charpos++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user