1st mods to get a build under windows. Does not build yet, far from it
--HG-- branch : WINDOWSPORT
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "xapian.h"
|
||||
#include <xapian.h>
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "rclconfig.h"
|
||||
|
||||
+4
-3
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <unistd.h>
|
||||
#include "safeunistd.h"
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -1420,10 +1420,11 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
|
||||
time_t mtime = atoll(doc.dmtime.empty() ? doc.fmtime.c_str() :
|
||||
doc.dmtime.c_str());
|
||||
struct tm tmb;
|
||||
localtime_r(&mtime, &tmb);
|
||||
struct tm *tmbp = &tmb;
|
||||
tmbp = localtime_r(&mtime, &tmb);
|
||||
char buf[9];
|
||||
snprintf(buf, 9, "%04d%02d%02d",
|
||||
tmb.tm_year+1900, tmb.tm_mon + 1, tmb.tm_mday);
|
||||
tmbp->tm_year+1900, tmbp->tm_mon + 1, tmbp->tm_mday);
|
||||
// Date (YYYYMMDD)
|
||||
newdocument.add_boolean_term(wrap_prefix(xapday_prefix) + string(buf));
|
||||
// Month (YYYYMM)
|
||||
|
||||
@@ -401,10 +401,14 @@ bool Db::idxTermMatch(int typ_sens, const string &lang, const string &root,
|
||||
// first wildcard character. We only scan the part of the
|
||||
// index where this matches
|
||||
string is;
|
||||
switch (es) {
|
||||
case string::npos: is = prefix + root; break;
|
||||
case 0: is = prefix; break;
|
||||
default: is = prefix + root.substr(0, es); break;
|
||||
if (es == string::npos) {
|
||||
is = prefix + root;
|
||||
}
|
||||
else if (es == 0) {
|
||||
is = prefix;
|
||||
|
||||
} else {
|
||||
is = prefix + root.substr(0, es);
|
||||
}
|
||||
LOGDEB2(("termMatch: initsec: [%s]\n", is.c_str()));
|
||||
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include "safeunistd.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#include <xapian.h>
|
||||
|
||||
Reference in New Issue
Block a user