1st mods to get a build under windows. Does not build yet, far from it
This commit is contained in:
parent
2c7f4f8a83
commit
ca55c34b28
48 changed files with 1855 additions and 71 deletions
|
@ -122,7 +122,7 @@ namespace Binc {
|
|||
for (std::string::const_iterator i = s_in.begin(); i != s_in.end(); ++i) {
|
||||
unsigned char c = (unsigned char)*i;
|
||||
if (c <= 31 || c >= 127 || c == '\"' || c == '\\')
|
||||
return "{" + toString(s_in.length()) + "}\r\n" + s_in;
|
||||
return "{" + toString((unsigned long)s_in.length()) + "}\r\n" + s_in;
|
||||
}
|
||||
|
||||
return "\"" + s_in + "\"";
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
#ifndef mime_inputsource_h_included
|
||||
#define mime_inputsource_h_included
|
||||
|
||||
#include "autoconfig.h"
|
||||
// Data source for MIME parser
|
||||
|
||||
// Note about large files: we might want to change the unsigned int
|
||||
|
|
|
@ -26,3 +26,37 @@
|
|||
# define STD_SHARED_PTR RefCntr
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "safewindows.h"
|
||||
typedef int pid_t;
|
||||
inline int readlink(const char *cp, void *buf, int cnt) {
|
||||
return -1;
|
||||
}
|
||||
#define HAVE_STRUCT_TIMESPEC
|
||||
#define strdup _strdup
|
||||
#define timegm _mkgmtime
|
||||
// gmtime is supposedly thread-safe on windows
|
||||
#define gmtime_r(A, B) gmtime(A)
|
||||
#define localtime_r(A,B) localtime(A)
|
||||
|
||||
typedef DWORD32 u_int32_t;
|
||||
typedef DWORD64 u_int64_t;
|
||||
typedef unsigned __int8 u_int8_t;
|
||||
typedef int mode_t;
|
||||
typedef int ssize_t;
|
||||
#define strncasecmp _strnicmp
|
||||
#define ftruncate _chsize
|
||||
#define PATH_MAX MAX_PATH
|
||||
#define MAXPATHLEN PATH_MAX
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 4
|
||||
#define RECOLL_DATADIR "C:\\recoll\\"
|
||||
#define S_ISLNK(X) false
|
||||
#define lstat stat
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -19,11 +19,13 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef _WIN32
|
||||
#include <langinfo.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include "safesysstat.h"
|
||||
#include "safeunistd.h"
|
||||
#include <sys/param.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <osreldate.h>
|
||||
#endif
|
||||
|
@ -200,6 +202,7 @@ RclConfig::RclConfig(const string *argcnf)
|
|||
// is called from the main thread at once, by constructing a config
|
||||
// from recollinit
|
||||
if (o_localecharset.empty()) {
|
||||
#ifndef _WIN32
|
||||
const char *cp;
|
||||
cp = nl_langinfo(CODESET);
|
||||
// We don't keep US-ASCII. It's better to use a superset
|
||||
|
@ -217,6 +220,9 @@ RclConfig::RclConfig(const string *argcnf)
|
|||
// Use cp1252 instead of iso-8859-1, it's a superset.
|
||||
o_localecharset = string(cstr_cp1252);
|
||||
}
|
||||
#else
|
||||
o_localecharset = "UTF-8";
|
||||
#endif
|
||||
LOGDEB1(("RclConfig::getDefCharset: localecharset [%s]\n",
|
||||
o_localecharset.c_str()));
|
||||
}
|
||||
|
|
|
@ -31,9 +31,13 @@
|
|||
#include "pathut.h"
|
||||
#include "unac.h"
|
||||
#include "smallut.h"
|
||||
#ifndef _WIN32
|
||||
#include "execmd.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
static const int catchedSigs[] = {SIGINT, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2};
|
||||
#endif
|
||||
|
||||
static pthread_t mainthread_id;
|
||||
|
||||
|
@ -52,7 +56,9 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
|
||||
// We ignore SIGPIPE always. All pieces of code which can write to a pipe
|
||||
// must check write() return values.
|
||||
#ifndef _WIN32
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
// Make sure the locale is set. This is only for converting file names
|
||||
// to utf8 for indexing.
|
||||
|
@ -63,6 +69,7 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
|
||||
// Install app signal handler
|
||||
if (sigcleanup) {
|
||||
#ifndef _WIN32
|
||||
struct sigaction action;
|
||||
action.sa_handler = sigcleanup;
|
||||
action.sa_flags = 0;
|
||||
|
@ -73,8 +80,8 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
perror("Sigaction failed");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
||||
DebugLog::setfilename("stderr");
|
||||
if (getenv("RECOLL_LOGDATE"))
|
||||
|
@ -116,6 +123,7 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
DebugLog::getdbl()->setloglevel(lev);
|
||||
}
|
||||
// Install log rotate sig handler
|
||||
#ifndef _WIN32
|
||||
{
|
||||
struct sigaction action;
|
||||
action.sa_handler = siglogreopen;
|
||||
|
@ -127,6 +135,7 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Make sure the locale charset is initialized (so that multiple
|
||||
// threads don't try to do it at once).
|
||||
|
@ -146,7 +155,9 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
unac_set_except_translations(unacex.c_str());
|
||||
|
||||
#ifndef IDX_THREADS
|
||||
#ifndef _WIN32
|
||||
ExecCmd::useVfork(true);
|
||||
#endif
|
||||
#else
|
||||
// Keep threads init behind log init, but make sure it's done before
|
||||
// we do the vfork choice ! The latter is not used any more actually,
|
||||
|
@ -156,11 +167,15 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
bool novfork;
|
||||
config->getConfParam("novfork", &novfork);
|
||||
if (novfork) {
|
||||
#ifndef _WIN32
|
||||
LOGDEB0(("rclinit: will use fork() for starting commands\n"));
|
||||
ExecCmd::useVfork(false);
|
||||
#endif
|
||||
} else {
|
||||
#ifndef _WIN32
|
||||
LOGDEB0(("rclinit: will use vfork() for starting commands\n"));
|
||||
ExecCmd::useVfork(true);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -183,6 +198,7 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||
// to block possible signals
|
||||
void recoll_threadinit()
|
||||
{
|
||||
#ifndef _WIN32
|
||||
sigset_t sset;
|
||||
sigemptyset(&sset);
|
||||
|
||||
|
@ -190,6 +206,7 @@ void recoll_threadinit()
|
|||
sigaddset(&sset, catchedSigs[i]);
|
||||
sigaddset(&sset, SIGHUP);
|
||||
pthread_sigmask(SIG_BLOCK, &sset, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool recoll_ismainthread()
|
||||
|
|
|
@ -110,7 +110,7 @@ bool SynGroups::setfile(const string& fn)
|
|||
lnum++;
|
||||
|
||||
{
|
||||
int ll = strlen(cline);
|
||||
size_t ll = strlen(cline);
|
||||
while (ll > 0 && (cline[ll-1] == '\n' || cline[ll-1] == '\r')) {
|
||||
cline[ll-1] = 0;
|
||||
ll--;
|
||||
|
|
|
@ -14,9 +14,8 @@
|
|||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "autoconfig.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "debuglog.h"
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "fileudi.h"
|
||||
#include "cancelcheck.h"
|
||||
#include "rclinit.h"
|
||||
#include "execmd.h"
|
||||
#include "extrameta.h"
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -27,7 +27,9 @@ using namespace std;
|
|||
|
||||
#include "mimetype.h"
|
||||
#include "debuglog.h"
|
||||
#ifndef _WIN32
|
||||
#include "execmd.h"
|
||||
#endif
|
||||
#include "rclconfig.h"
|
||||
#include "smallut.h"
|
||||
#include "idfile.h"
|
||||
|
|
|
@ -14,16 +14,16 @@
|
|||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "autoconfig.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include "safefcntl.h"
|
||||
#include "safeunistd.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@ -45,7 +45,9 @@ using namespace std;
|
|||
#include "beaglequeue.h"
|
||||
#include "recollindex.h"
|
||||
#include "fsindexer.h"
|
||||
#ifndef _WIN32
|
||||
#include "rclionice.h"
|
||||
#endif
|
||||
#include "execmd.h"
|
||||
#include "checkretryfailed.h"
|
||||
|
||||
|
@ -177,11 +179,13 @@ static void makeIndexerOrExit(RclConfig *config, bool inPlaceReset)
|
|||
|
||||
void rclIxIonice(const RclConfig *config)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
string clss, classdata;
|
||||
if (!config->getConfParam("monioniceclass", clss) || clss.empty())
|
||||
clss = "3";
|
||||
config->getConfParam("monioniceclassdata", classdata);
|
||||
rclionice(clss, classdata);
|
||||
#endif
|
||||
}
|
||||
|
||||
class MakeListWalkerCB : public FsTreeWalkerCB {
|
||||
|
@ -393,8 +397,10 @@ int main(int argc, char **argv)
|
|||
// The reexec struct is used by the daemon to shed memory after
|
||||
// the initial indexing pass and to restart when the configuration
|
||||
// changes
|
||||
#ifndef _WIN32
|
||||
o_reexec = new ReExec;
|
||||
o_reexec->init(argc, argv);
|
||||
#endif
|
||||
|
||||
thisprog = argv[0];
|
||||
argc--; argv++;
|
||||
|
@ -463,7 +469,9 @@ int main(int argc, char **argv)
|
|||
cerr << "Configuration problem: " << reason << endl;
|
||||
exit(1);
|
||||
}
|
||||
#ifndef _WIN32
|
||||
o_reexec->atexit(cleanup);
|
||||
#endif
|
||||
|
||||
vector<string> nonexist;
|
||||
if (!checktopdirs(config, nonexist))
|
||||
|
@ -483,7 +491,7 @@ int main(int argc, char **argv)
|
|||
if ((op_flags & OPT_E)) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
string rundir;
|
||||
config->getConfParam("idxrundir", rundir);
|
||||
if (!rundir.compare("tmp")) {
|
||||
|
@ -501,6 +509,7 @@ int main(int argc, char **argv)
|
|||
rundir.c_str(), errno));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rezero((op_flags & OPT_z) != 0);
|
||||
bool inPlaceReset((op_flags & OPT_Z) != 0);
|
||||
|
@ -522,12 +531,13 @@ int main(int argc, char **argv)
|
|||
// Log something at LOGINFO to reset the trace file. Else at level
|
||||
// 3 it's not even truncated if all docs are up to date.
|
||||
LOGINFO(("recollindex: starting up\n"));
|
||||
|
||||
#ifndef _WIN32
|
||||
if (setpriority(PRIO_PROCESS, 0, 20) != 0) {
|
||||
LOGINFO(("recollindex: can't setpriority(), errno %d\n", errno));
|
||||
}
|
||||
// Try to ionice. This does not work on all platforms
|
||||
rclIxIonice(config);
|
||||
#endif
|
||||
|
||||
if (op_flags & (OPT_i|OPT_e)) {
|
||||
lockorexit(&pidfile);
|
||||
|
@ -596,15 +606,17 @@ int main(int argc, char **argv)
|
|||
lockorexit(&pidfile);
|
||||
if (!(op_flags&OPT_D)) {
|
||||
LOGDEB(("recollindex: daemonizing\n"));
|
||||
#ifndef _WIN32
|
||||
if (daemon(0,0) != 0) {
|
||||
fprintf(stderr, "daemon() failed, errno %d\n", errno);
|
||||
LOGERR(("daemon() failed, errno %d\n", errno));
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Need to rewrite pid, it changed
|
||||
pidfile.write_pid();
|
||||
|
||||
#ifndef _WIN32
|
||||
// Not too sure if I have to redo the nice thing after daemon(),
|
||||
// can't hurt anyway (easier than testing on all platforms...)
|
||||
if (setpriority(PRIO_PROCESS, 0, 20) != 0) {
|
||||
|
@ -612,6 +624,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
// Try to ionice. This does not work on all platforms
|
||||
rclIxIonice(config);
|
||||
#endif
|
||||
|
||||
if (sleepsecs > 0) {
|
||||
LOGDEB(("recollindex: sleeping %d\n", sleepsecs));
|
||||
|
@ -639,6 +652,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
deleteZ(confindexer);
|
||||
#ifndef _WIN32
|
||||
o_reexec->insertArgs(vector<string>(1, "-n"));
|
||||
LOGINFO(("recollindex: reexecuting with -n after initial full pass\n"));
|
||||
// Note that -n will be inside the reexec when we come
|
||||
|
@ -646,6 +660,7 @@ int main(int argc, char **argv)
|
|||
// starting a config change exec to ensure that we do a
|
||||
// purging pass in this case.
|
||||
o_reexec->reexec();
|
||||
#endif
|
||||
}
|
||||
if (updater) {
|
||||
updater->status.phase = DbIxStatus::DBIXS_MONITOR;
|
||||
|
|
|
@ -93,6 +93,7 @@ void docFieldsFromXattrs(RclConfig *cfg, const map<string, string>& xfields,
|
|||
void reapMetaCmds(RclConfig* cfg, const string& path,
|
||||
map<string, string>& cfields)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
const vector<MDReaper>& reapers = cfg->getMDReapers();
|
||||
if (reapers.empty())
|
||||
return;
|
||||
|
@ -111,6 +112,7 @@ void reapMetaCmds(RclConfig* cfg, const string& path,
|
|||
cfields[rp->fieldname] = output;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set fields from external commands
|
||||
|
|
|
@ -216,7 +216,7 @@ void FileInterner::init(const string &f, const struct stat *stp, RclConfig *cnf,
|
|||
m_mimetype = l_mime;
|
||||
RecollFilter *df = getMimeHandler(l_mime, m_cfg, !m_forPreview);
|
||||
|
||||
if (!df or df->is_unknown()) {
|
||||
if (!df || df->is_unknown()) {
|
||||
// No real handler for this type, for now :(
|
||||
LOGDEB(("FileInterner:: unprocessed mime: [%s] [%s]\n",
|
||||
l_mime.c_str(), f.c_str()));
|
||||
|
|
|
@ -98,7 +98,9 @@ text/plainData: 10
|
|||
class MimeHandlerExecMultiple : public MimeHandlerExec {
|
||||
/////////
|
||||
// Things not reset by "clear()", additionally to those in MimeHandlerExec
|
||||
#ifndef _WIN32
|
||||
ExecCmd m_cmd;
|
||||
#endif
|
||||
/////// End un-cleared stuff.
|
||||
|
||||
public:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include "safeunistd.h"
|
||||
#include <time.h>
|
||||
#include <cstdlib>
|
||||
|
||||
|
|
|
@ -22,7 +22,11 @@
|
|||
#include <sys/types.h>
|
||||
#include "safesysstat.h"
|
||||
#include <time.h>
|
||||
#ifndef _WIN32
|
||||
#include <regex.h>
|
||||
#else
|
||||
#include <regex>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
|
@ -70,6 +74,14 @@ static PTMutexInit o_mcache_mutex;
|
|||
* offsets for all message "From_" lines follow. The format is purely
|
||||
* binary, values are not even byte-swapped to be proc-idependant.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
// vc++ does not let define an array of size o_b1size because non-const??
|
||||
#define M_o_b1size 1024
|
||||
#else
|
||||
#define M_o_b1size o_b1size;
|
||||
#endif
|
||||
|
||||
class MboxCache {
|
||||
public:
|
||||
typedef MimeHandlerMbox::mbhoff_type mbhoff_type;
|
||||
|
@ -98,7 +110,7 @@ public:
|
|||
}
|
||||
FpKeeper keeper(&fp);
|
||||
|
||||
char blk1[o_b1size];
|
||||
char blk1[M_o_b1size];
|
||||
if (fread(blk1, 1, o_b1size, fp) != o_b1size) {
|
||||
LOGDEB0(("MboxCache::get_offsets: read blk1 errno %d\n", errno));
|
||||
return -1;
|
||||
|
@ -226,7 +238,6 @@ private:
|
|||
};
|
||||
|
||||
const size_t MboxCache::o_b1size = 1024;
|
||||
|
||||
static class MboxCache o_mcache;
|
||||
|
||||
static const string cstr_keyquirks("mhmboxquirks");
|
||||
|
@ -376,9 +387,20 @@ static const char *frompat =
|
|||
// exactly like: From ^M (From followed by space and eol). We only
|
||||
// test for this if QUIRKS_TBIRD is set
|
||||
static const char *miniTbirdFrom = "^From $";
|
||||
|
||||
#ifndef _WIN32
|
||||
static regex_t fromregex;
|
||||
static regex_t minifromregex;
|
||||
#define M_regexec(A,B,C,D,E) regexec(&(A),B,C,D,E)
|
||||
#else
|
||||
basic_regex<char> fromregex;
|
||||
basic_regex<char> minifromregex;
|
||||
#define REG_ICASE std::regex_constants::icase
|
||||
#define REG_NOSUB std::regex_constants::nosubs
|
||||
#define REG_EXTENDED std::regex_constants::extended
|
||||
#define M_regexec(A, B, C, D, E) regex_match(B,A)
|
||||
|
||||
#endif
|
||||
|
||||
static bool regcompiled;
|
||||
static PTMutexInit o_regex_mutex;
|
||||
|
||||
|
@ -390,8 +412,13 @@ static void compileregexes()
|
|||
// that we are alone.
|
||||
if (regcompiled)
|
||||
return;
|
||||
#ifndef _WIN32
|
||||
regcomp(&fromregex, frompat, REG_NOSUB|REG_EXTENDED);
|
||||
regcomp(&minifromregex, miniTbirdFrom, REG_NOSUB|REG_EXTENDED);
|
||||
#else
|
||||
fromregex = basic_regex<char>(frompat, REG_NOSUB | REG_EXTENDED);
|
||||
minifromregex = basic_regex<char>(miniTbirdFrom, REG_NOSUB | REG_EXTENDED);
|
||||
#endif
|
||||
regcompiled = true;
|
||||
}
|
||||
|
||||
|
@ -440,9 +467,9 @@ bool MimeHandlerMbox::next_document()
|
|||
(off = o_mcache.get_offset(m_config, m_udi, mtarg)) >= 0 &&
|
||||
fseeko(fp, (off_t)off, SEEK_SET) >= 0 &&
|
||||
fgets(line, LL, fp) &&
|
||||
(!regexec(&fromregex, line, 0, 0, 0) ||
|
||||
(!M_regexec(fromregex, line, 0, 0, 0) ||
|
||||
((m_quirks & MBOXQUIRK_TBIRD) &&
|
||||
!regexec(&minifromregex, line, 0, 0, 0))) ) {
|
||||
!M_regexec(minifromregex, line, 0, 0, 0))) ) {
|
||||
LOGDEB0(("MimeHandlerMbox: Cache: From_ Ok\n"));
|
||||
fseeko(fp, (off_t)off, SEEK_SET);
|
||||
m_msgnum = mtarg -1;
|
||||
|
@ -485,9 +512,9 @@ bool MimeHandlerMbox::next_document()
|
|||
/* The 'F' compare is redundant but it improves performance
|
||||
A LOT */
|
||||
if (line[0] == 'F' && (
|
||||
!regexec(&fromregex, line, 0, 0, 0) ||
|
||||
!M_regexec(fromregex, line, 0, 0, 0) ||
|
||||
((m_quirks & MBOXQUIRK_TBIRD) &&
|
||||
!regexec(&minifromregex, line, 0, 0, 0)))
|
||||
!M_regexec(minifromregex, line, 0, 0, 0)))
|
||||
) {
|
||||
LOGDEB1(("MimeHandlerMbox: msgnum %d, "
|
||||
"From_ at line %d: [%s]\n", m_msgnum, m_lineno, line));
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#define _MH_SYMLINK_H_INCLUDED_
|
||||
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include "safeunistd.h"
|
||||
#include <errno.h>
|
||||
|
||||
#include "cstr.h"
|
||||
|
|
|
@ -31,7 +31,6 @@ using namespace std;
|
|||
#include "rclconfig.h"
|
||||
#include "smallut.h"
|
||||
#include "md5ut.h"
|
||||
|
||||
#include "mh_exec.h"
|
||||
#include "mh_execm.h"
|
||||
#include "mh_html.h"
|
||||
|
|
|
@ -108,8 +108,12 @@ bool Uncomp::uncompressfile(const string& ifn,
|
|||
}
|
||||
|
||||
// Execute command and retrieve output file name, check that it exists
|
||||
#ifndef _WIN32
|
||||
ExecCmd ex;
|
||||
int status = ex.doexec(cmd, args, 0, &tfile);
|
||||
#else
|
||||
int status = -1;
|
||||
#endif
|
||||
if (status || tfile.empty()) {
|
||||
LOGERR(("uncompressfile: doexec: failed for [%s] status 0x%x\n",
|
||||
ifn.c_str(), status));
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "xapian.h"
|
||||
#include <xapian.h>
|
||||
|
||||
#include "debuglog.h"
|
||||
#include "rclconfig.h"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -184,7 +184,7 @@ public:
|
|||
// Offset of last write (newest header)
|
||||
off_t m_nheadoffs;
|
||||
// Pad size for newest entry.
|
||||
int m_npadsize;
|
||||
off_t m_npadsize;
|
||||
// Keep history or only last entry
|
||||
bool m_uniquentries;
|
||||
///////////////////// End header entries
|
||||
|
@ -1009,7 +1009,7 @@ bool CirCache::put(const string& udi, const ConfSimple *iconf,
|
|||
|
||||
// Data compression ?
|
||||
const char *datap = data.c_str();
|
||||
unsigned int datalen = data.size();
|
||||
size_t datalen = data.size();
|
||||
unsigned short flags = 0;
|
||||
TempBuf compbuf;
|
||||
if (!(iflags & NoCompHint)) {
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "autoconfig.h"
|
||||
|
||||
#ifndef TEST_CONFTREE
|
||||
|
||||
|
|
|
@ -15,14 +15,18 @@
|
|||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef TEST_COPYFILE
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "safefcntl.h"
|
||||
#include <sys/types.h>
|
||||
#include "safesysstat.h"
|
||||
#include "safeunistd.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
@ -43,7 +47,7 @@ bool copyfile(const char *src, const char *dst, string &reason, int flags)
|
|||
|
||||
LOGDEB(("copyfile: %s to %s\n", src, dst));
|
||||
|
||||
if ((sfd = ::open(src, O_RDONLY)) < 0) {
|
||||
if ((sfd = ::open(src, O_RDONLY, 0)) < 0) {
|
||||
reason += string("open ") + src + ": " + strerror(errno);
|
||||
goto out;
|
||||
}
|
||||
|
@ -149,6 +153,7 @@ bool renameormove(const char *src, const char *dst, string &reason)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
// Try to preserve modes, owner, times. This may fail for a number
|
||||
// of reasons
|
||||
if ((st1.st_mode & 0777) != (st.st_mode & 0777)) {
|
||||
|
@ -167,7 +172,7 @@ bool renameormove(const char *src, const char *dst, string &reason)
|
|||
times[1].tv_sec = st.st_mtime;
|
||||
times[1].tv_usec = 0;
|
||||
utimes(dst, times);
|
||||
|
||||
#endif
|
||||
// All ok, get rid of origin
|
||||
if (unlink(src) < 0) {
|
||||
reason += string("Can't unlink ") + src + "Error : " + strerror(errno);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
#ifndef _EXECMD_H_INCLUDED_
|
||||
#define _EXECMD_H_INCLUDED_
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <signal.h>
|
||||
|
||||
#include <string>
|
||||
|
@ -279,5 +279,5 @@ private:
|
|||
std::string m_reason;
|
||||
std::stack<void (*)(void)> m_atexitfuncs;
|
||||
};
|
||||
|
||||
#endif /* !_WIN32 */
|
||||
#endif /* _EXECMD_H_INCLUDED_ */
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef TEST_FILEUDI
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
|
|
|
@ -14,9 +14,8 @@
|
|||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
#include "autoconfig.h"
|
||||
#endif
|
||||
|
||||
#ifndef TEST_FSTREEWALK
|
||||
|
||||
|
@ -25,6 +24,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include "safesysstat.h"
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef TEST_IDFILE
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <cstring>
|
||||
|
@ -82,11 +84,11 @@ static string idFileInternal(istream& input, const char *fn)
|
|||
}
|
||||
|
||||
// gcount includes the \n
|
||||
int ll = input.gcount() - 1;
|
||||
std::streamsize ll = input.gcount() - 1;
|
||||
if (ll > 0)
|
||||
gotnonempty = true;
|
||||
|
||||
LOGDEB2(("idfile: lnum %d ll %d: [%s]\n", lnum, ll, cline));
|
||||
LOGDEB2(("idfile: lnum %d ll %u: [%s]\n", lnum, (unsigned int)ll, cline));
|
||||
|
||||
// Check for a few things that can't be found in a mail file,
|
||||
// (optimization to get a quick negative)
|
||||
|
|
|
@ -19,17 +19,19 @@
|
|||
#include "autoconfig.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include "safefcntl.h"
|
||||
#include "safeunistd.h"
|
||||
#include "dirent.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/param.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/file.h>
|
||||
#include <glob.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h>
|
||||
#include "safesysstat.h"
|
||||
#include <glob.h>
|
||||
|
||||
// Let's include all files where statfs can be defined and hope for no
|
||||
// conflict...
|
||||
|
@ -61,6 +63,9 @@ using namespace std;
|
|||
|
||||
bool fsocc(const string &path, int *pc, long long *blocks)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return false;
|
||||
#else
|
||||
#ifdef sun
|
||||
struct statvfs buf;
|
||||
if (statvfs(path.c_str(), &buf) != 0) {
|
||||
|
@ -94,6 +99,7 @@ bool fsocc(const string &path, int *pc, long long *blocks)
|
|||
}
|
||||
}
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
const string& tmplocation()
|
||||
|
@ -112,6 +118,7 @@ const string& tmplocation()
|
|||
|
||||
bool maketmpdir(string& tdir, string& reason)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
tdir = path_cat(tmplocation(), "rcltmpXXXXXX");
|
||||
|
||||
char *cp = strdup(tdir.c_str());
|
||||
|
@ -146,11 +153,15 @@ bool maketmpdir(string& tdir, string& reason)
|
|||
#endif
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
TempFileInternal::TempFileInternal(const string& suffix)
|
||||
: m_noremove(false)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
string filename = path_cat(tmplocation(), "rcltmpfXXXXXX");
|
||||
char *cp = strdup(filename.c_str());
|
||||
if (!cp) {
|
||||
|
@ -177,6 +188,7 @@ TempFileInternal::TempFileInternal(const string& suffix)
|
|||
m_reason = string("Could not open/create") + m_filename;
|
||||
m_filename.erase();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
TempFileInternal::~TempFileInternal()
|
||||
|
@ -285,6 +297,9 @@ string path_suffix(const string& s)
|
|||
|
||||
string path_home()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return "c:\\";
|
||||
#else
|
||||
uid_t uid = getuid();
|
||||
|
||||
struct passwd *entry = getpwuid(uid);
|
||||
|
@ -299,10 +314,14 @@ string path_home()
|
|||
string homedir = entry->pw_dir;
|
||||
path_catslash(homedir);
|
||||
return homedir;
|
||||
#endif
|
||||
}
|
||||
|
||||
string path_tildexpand(const string &s)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return s;
|
||||
#else
|
||||
if (s.empty() || s[0] != '~')
|
||||
return s;
|
||||
string o = s;
|
||||
|
@ -318,6 +337,7 @@ string path_tildexpand(const string &s)
|
|||
o.replace(0, l+1, entry->pw_dir);
|
||||
}
|
||||
return o;
|
||||
#endif
|
||||
}
|
||||
|
||||
string path_absolute(const string &is)
|
||||
|
@ -402,6 +422,9 @@ bool makepath(const string& ipath)
|
|||
|
||||
vector<string> path_dirglob(const string &dir, const string pattern)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return vector<string>();
|
||||
#else
|
||||
vector<string> res;
|
||||
glob_t mglob;
|
||||
string mypat=path_cat(dir, pattern);
|
||||
|
@ -413,6 +436,7 @@ vector<string> path_dirglob(const string &dir, const string pattern)
|
|||
}
|
||||
globfree(&mglob);
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool path_isdir(const string& path)
|
||||
|
@ -679,6 +703,9 @@ int Pidfile::flopen()
|
|||
m_reason = "fcntl lock failed";
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
#ifdef _WIN32
|
||||
return 0;
|
||||
#else
|
||||
int operation = LOCK_EX | LOCK_NB;
|
||||
if (flock(m_fd, operation) == -1) {
|
||||
|
@ -688,6 +715,7 @@ int Pidfile::flopen()
|
|||
m_reason = "flock failed";
|
||||
return -1;
|
||||
}
|
||||
#endif // ! win32
|
||||
#endif // ! sun
|
||||
|
||||
if (ftruncate(m_fd, 0) != 0) {
|
||||
|
|
|
@ -708,10 +708,80 @@ typedef int clockid_t;
|
|||
#undef USE_CLOCK_GETTIME
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include "safewindows.h"
|
||||
// Note: struct timespec is defined by pthread.h (from pthreads-w32)
|
||||
#ifndef CLOCK_REALTIME
|
||||
#define CLOCK_REALTIME 0
|
||||
#endif
|
||||
|
||||
LARGE_INTEGER getFILETIMEoffset()
|
||||
{
|
||||
SYSTEMTIME s;
|
||||
FILETIME f;
|
||||
LARGE_INTEGER t;
|
||||
|
||||
s.wYear = 1970;
|
||||
s.wMonth = 1;
|
||||
s.wDay = 1;
|
||||
s.wHour = 0;
|
||||
s.wMinute = 0;
|
||||
s.wSecond = 0;
|
||||
s.wMilliseconds = 0;
|
||||
SystemTimeToFileTime(&s, &f);
|
||||
t.QuadPart = f.dwHighDateTime;
|
||||
t.QuadPart <<= 32;
|
||||
t.QuadPart |= f.dwLowDateTime;
|
||||
return (t);
|
||||
}
|
||||
|
||||
int clock_gettime(int X, struct timespec *tv)
|
||||
{
|
||||
LARGE_INTEGER t;
|
||||
FILETIME f;
|
||||
double microseconds;
|
||||
static LARGE_INTEGER offset;
|
||||
static double frequencyToMicroseconds;
|
||||
static int initialized = 0;
|
||||
static BOOL usePerformanceCounter = 0;
|
||||
|
||||
if (!initialized) {
|
||||
LARGE_INTEGER performanceFrequency;
|
||||
initialized = 1;
|
||||
usePerformanceCounter = QueryPerformanceFrequency(&performanceFrequency);
|
||||
if (usePerformanceCounter) {
|
||||
QueryPerformanceCounter(&offset);
|
||||
frequencyToMicroseconds = (double)performanceFrequency.QuadPart / 1000000.;
|
||||
}
|
||||
else {
|
||||
offset = getFILETIMEoffset();
|
||||
frequencyToMicroseconds = 10.;
|
||||
}
|
||||
}
|
||||
if (usePerformanceCounter) QueryPerformanceCounter(&t);
|
||||
else {
|
||||
GetSystemTimeAsFileTime(&f);
|
||||
t.QuadPart = f.dwHighDateTime;
|
||||
t.QuadPart <<= 32;
|
||||
t.QuadPart |= f.dwLowDateTime;
|
||||
}
|
||||
|
||||
t.QuadPart -= offset.QuadPart;
|
||||
microseconds = (double)t.QuadPart / frequencyToMicroseconds;
|
||||
t.QuadPart = (long long)microseconds;
|
||||
tv->tv_sec = t.QuadPart / 1000000;
|
||||
tv->tv_nsec = (t.QuadPart % 1000000) * 1000;
|
||||
return (0);
|
||||
}
|
||||
#define USE_CLOCK_GETTIME
|
||||
#else /* -> !_WIN32 */
|
||||
|
||||
#ifndef USE_CLOCK_GETTIME
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
static void gettime(clockid_t clk_id, struct timespec *ts)
|
||||
{
|
||||
#ifndef USE_CLOCK_GETTIME
|
||||
|
@ -740,29 +810,29 @@ Chrono::Chrono()
|
|||
}
|
||||
|
||||
// Reset and return value before rest in milliseconds
|
||||
long Chrono::restart()
|
||||
time_t Chrono::restart()
|
||||
{
|
||||
struct timespec tv;
|
||||
gettime(CLOCK_REALTIME, &tv);
|
||||
long ret = MILLIS(tv);
|
||||
time_t ret = MILLIS(tv);
|
||||
m_secs = tv.tv_sec;
|
||||
m_nsecs = tv.tv_nsec;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get current timer value, milliseconds
|
||||
long Chrono::millis(int frozen)
|
||||
time_t Chrono::millis(int frozen)
|
||||
{
|
||||
return nanos() / 1000000;
|
||||
}
|
||||
|
||||
//
|
||||
long Chrono::micros(int frozen)
|
||||
time_t Chrono::micros(int frozen)
|
||||
{
|
||||
return nanos() / 1000;
|
||||
}
|
||||
|
||||
long long Chrono::nanos(int frozen)
|
||||
time_t Chrono::nanos(int frozen)
|
||||
{
|
||||
if (frozen) {
|
||||
return NANOS(frozen_tv);
|
||||
|
@ -773,12 +843,12 @@ long long Chrono::nanos(int frozen)
|
|||
}
|
||||
}
|
||||
|
||||
float Chrono::secs(int frozen)
|
||||
double Chrono::secs(int frozen)
|
||||
{
|
||||
struct timespec tv;
|
||||
gettime(CLOCK_REALTIME, &tv);
|
||||
float secs = (float)(frozen?frozen_tv.tv_sec:tv.tv_sec - m_secs);
|
||||
float nsecs = (float)(frozen?frozen_tv.tv_nsec:tv.tv_nsec - m_nsecs);
|
||||
double secs = (double)(frozen?frozen_tv.tv_sec:tv.tv_sec - m_secs);
|
||||
double nsecs = (double)(frozen?frozen_tv.tv_nsec:tv.tv_nsec - m_nsecs);
|
||||
return secs + nsecs * 1e-9;
|
||||
}
|
||||
|
||||
|
@ -818,7 +888,7 @@ static bool parsedate(vector<string>::const_iterator& it,
|
|||
return false;
|
||||
}
|
||||
if (it == end || sscanf(it++->c_str(), "%d", &dip->d1) != 1) {
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1062,7 +1132,7 @@ void catstrerror(string *reason, const char *what, int _errno)
|
|||
|
||||
reason->append(" : ");
|
||||
|
||||
#ifdef sun
|
||||
#if defined(sun) || defined(_WIN32)
|
||||
// Note: sun strerror is noted mt-safe ??
|
||||
reason->append(strerror(_errno));
|
||||
#else
|
||||
|
|
|
@ -153,7 +153,7 @@ class Chrono {
|
|||
public:
|
||||
Chrono();
|
||||
/** Reset origin */
|
||||
long restart();
|
||||
time_t restart();
|
||||
/** Snapshot current time */
|
||||
static void refnow();
|
||||
/** Get current elapsed since creation or restart
|
||||
|
@ -162,14 +162,14 @@ class Chrono {
|
|||
* allow for using one actual system call to get values from many
|
||||
* chrono objects, like when examining timeouts in a queue)
|
||||
*/
|
||||
long millis(int frozen = 0);
|
||||
long ms() {return millis();}
|
||||
long micros(int frozen = 0);
|
||||
long long nanos(int frozen = 0);
|
||||
float secs(int frozen = 0);
|
||||
time_t millis(int frozen = 0);
|
||||
time_t ms() {return millis();}
|
||||
time_t micros(int frozen = 0);
|
||||
time_t nanos(int frozen = 0);
|
||||
double secs(int frozen = 0);
|
||||
private:
|
||||
long m_secs;
|
||||
long m_nsecs;
|
||||
time_t m_secs;
|
||||
time_t m_nsecs;
|
||||
};
|
||||
|
||||
/** Temp buffer with automatic deallocation */
|
||||
|
|
41
src/windows/Win32ProjectRecoll.sln
Normal file
41
src/windows/Win32ProjectRecoll.sln
Normal file
|
@ -0,0 +1,41 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Win32ProjectRecoll", "Win32ProjectRecoll.vcxproj", "{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recollindex", "recollindex\recollindex.vcxproj", "{A513D65F-798C-4166-B66E-49F69ADA4F59}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D} = {23FF40E1-BA87-4E5F-9B22-2EB760FF403D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Debug|x64.Build.0 = Debug|Win32
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Release|x64.ActiveCfg = Release|x64
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Release|x64.Build.0 = Release|x64
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}.Release|x86.Build.0 = Release|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Debug|x64.Build.0 = Debug|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Release|x64.ActiveCfg = Release|x64
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Release|x64.Build.0 = Release|x64
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A513D65F-798C-4166-B66E-49F69ADA4F59}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
216
src/windows/Win32ProjectRecoll.vcxproj
Normal file
216
src/windows/Win32ProjectRecoll.vcxproj
Normal file
|
@ -0,0 +1,216 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{23FF40E1-BA87-4E5F-9B22-2EB760FF403D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>Win32ProjectRecoll</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;__WIN32__;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>C:\xapian\xapian-core-1.2.8\include;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\bincimapmime;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\windows;C:\zlib\include;C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\common;C:\Users\Bill\recoll\src\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<AdditionalIncludeDirectories>C:\xapian\xapian-core-1.2.8\include;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\bincimapmime;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\windows;C:\zlib\include;C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\common;C:\Users\Bill\recoll\src\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4800</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common\autoconfig.h" />
|
||||
<ClInclude Include="..\common\conf_post.h" />
|
||||
<ClInclude Include="..\internfile\mh_symlink.h" />
|
||||
<ClInclude Include="..\utils\debuglog.h" />
|
||||
<ClInclude Include="..\utils\execmd.h" />
|
||||
<ClInclude Include="..\utils\pathut.h" />
|
||||
<ClInclude Include="..\utils\smallut.h" />
|
||||
<ClInclude Include="..\xaposix\safefcntl.h" />
|
||||
<ClInclude Include="..\xaposix\safesysstat.h" />
|
||||
<ClInclude Include="..\xaposix\safeunistd.h" />
|
||||
<ClInclude Include="..\xaposix\safewindows.h" />
|
||||
<ClInclude Include="fnmatch.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\bincimapmime\convert.cc" />
|
||||
<ClCompile Include="..\bincimapmime\mime-parsefull.cc" />
|
||||
<ClCompile Include="..\bincimapmime\mime-parseonlyheader.cc" />
|
||||
<ClCompile Include="..\bincimapmime\mime-printbody.cc" />
|
||||
<ClCompile Include="..\bincimapmime\mime.cc" />
|
||||
<ClCompile Include="..\common\cstr.cpp" />
|
||||
<ClCompile Include="..\common\rclconfig.cpp" />
|
||||
<ClCompile Include="..\common\rclinit.cpp" />
|
||||
<ClCompile Include="..\common\syngroups.cpp" />
|
||||
<ClCompile Include="..\common\textsplit.cpp" />
|
||||
<ClCompile Include="..\common\unacpp.cpp" />
|
||||
<ClCompile Include="..\index\fetcher.cpp" />
|
||||
<ClCompile Include="..\index\fsfetcher.cpp" />
|
||||
<ClCompile Include="..\index\fsindexer.cpp" />
|
||||
<ClCompile Include="..\index\indexer.cpp" />
|
||||
<ClCompile Include="..\index\mimetype.cpp" />
|
||||
<ClCompile Include="..\index\subtreelist.cpp" />
|
||||
<ClCompile Include="..\internfile\extrameta.cpp" />
|
||||
<ClCompile Include="..\internfile\htmlparse.cpp" />
|
||||
<ClCompile Include="..\internfile\internfile.cpp" />
|
||||
<ClCompile Include="..\internfile\mh_html.cpp" />
|
||||
<ClCompile Include="..\internfile\mh_mail.cpp" />
|
||||
<ClCompile Include="..\internfile\mh_mbox.cpp" />
|
||||
<ClCompile Include="..\internfile\mh_text.cpp" />
|
||||
<ClCompile Include="..\internfile\mimehandler.cpp" />
|
||||
<ClCompile Include="..\internfile\txtdcode.cpp" />
|
||||
<ClCompile Include="..\internfile\uncomp.cpp" />
|
||||
<ClCompile Include="..\rcldb\daterange.cpp" />
|
||||
<ClCompile Include="..\rcldb\expansiondbs.cpp" />
|
||||
<ClCompile Include="..\rcldb\rclabstract.cpp" />
|
||||
<ClCompile Include="..\rcldb\rcldb.cpp" />
|
||||
<ClCompile Include="..\rcldb\rcldoc.cpp" />
|
||||
<ClCompile Include="..\rcldb\rcldups.cpp" />
|
||||
<ClCompile Include="..\rcldb\rclquery.cpp" />
|
||||
<ClCompile Include="..\rcldb\rclterms.cpp" />
|
||||
<ClCompile Include="..\rcldb\searchdata.cpp" />
|
||||
<ClCompile Include="..\rcldb\searchdatatox.cpp" />
|
||||
<ClCompile Include="..\rcldb\searchdataxml.cpp" />
|
||||
<ClCompile Include="..\rcldb\stemdb.cpp" />
|
||||
<ClCompile Include="..\rcldb\stoplist.cpp" />
|
||||
<ClCompile Include="..\rcldb\synfamily.cpp" />
|
||||
<ClCompile Include="..\unac\unac.c" />
|
||||
<ClCompile Include="..\utils\appformime.cpp" />
|
||||
<ClCompile Include="..\utils\base64.cpp" />
|
||||
<ClCompile Include="..\utils\circache.cpp" />
|
||||
<ClCompile Include="..\utils\conftree.cpp" />
|
||||
<ClCompile Include="..\utils\copyfile.cpp" />
|
||||
<ClCompile Include="..\utils\debuglog.cpp" />
|
||||
<ClCompile Include="..\utils\fileudi.cpp" />
|
||||
<ClCompile Include="..\utils\fstreewalk.cpp" />
|
||||
<ClCompile Include="..\utils\idfile.cpp" />
|
||||
<ClCompile Include="..\utils\md5.cpp" />
|
||||
<ClCompile Include="..\utils\pathut.cpp" />
|
||||
<ClCompile Include="..\utils\smallut.cpp" />
|
||||
<ClCompile Include="..\xaposix\safe.cc" />
|
||||
<ClCompile Include="dirent.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
231
src/windows/Win32ProjectRecoll.vcxproj.filters
Normal file
231
src/windows/Win32ProjectRecoll.vcxproj.filters
Normal file
|
@ -0,0 +1,231 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\utils\smallut.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\utils\debuglog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\utils\pathut.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\conf_post.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xaposix\safefcntl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xaposix\safesysstat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xaposix\safeunistd.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\xaposix\safewindows.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fnmatch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\autoconfig.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\internfile\mh_symlink.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\utils\execmd.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\utils\smallut.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\debuglog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\cstr.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\appformime.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\base64.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\circache.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\conftree.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\copyfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\fileudi.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\fstreewalk.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\idfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\md5.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\rclconfig.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\rclinit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\syngroups.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\textsplit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\common\unacpp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dirent.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bincimapmime\convert.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bincimapmime\mime.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bincimapmime\mime-parsefull.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bincimapmime\mime-parseonlyheader.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bincimapmime\mime-printbody.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\fetcher.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\fsfetcher.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\fsindexer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\indexer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\mimetype.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\index\subtreelist.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\extrameta.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\htmlparse.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\internfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\mh_html.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\mh_mail.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\mh_mbox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\mh_text.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\mimehandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\daterange.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\expansiondbs.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rclabstract.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rcldb.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rcldoc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rcldups.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rclquery.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\rclterms.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\searchdata.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\searchdatatox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\searchdataxml.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\stemdb.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\stoplist.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\rcldb\synfamily.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\xaposix\safe.cc">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\txtdcode.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\internfile\uncomp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\utils\pathut.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\unac\unac.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
148
src/windows/dirent.c
Normal file
148
src/windows/dirent.c
Normal file
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
|
||||
Implementation of POSIX directory browsing functions and types for Win32.
|
||||
|
||||
Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com)
|
||||
History: Created March 1997. Updated June 2003 and July 2012.
|
||||
Rights: See end of file.
|
||||
|
||||
*/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <io.h> /* _findfirst and _findnext set errno iff they return -1 */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef ptrdiff_t handle_type; /* C99's intptr_t not sufficiently portable */
|
||||
|
||||
struct DIR
|
||||
{
|
||||
handle_type handle; /* -1 for failed rewind */
|
||||
struct _finddata_t info;
|
||||
struct dirent result; /* d_name null iff first time */
|
||||
char *name; /* null-terminated char string */
|
||||
};
|
||||
|
||||
DIR *opendir(const char *name)
|
||||
{
|
||||
DIR *dir = 0;
|
||||
|
||||
if(name && name[0])
|
||||
{
|
||||
size_t base_length = strlen(name);
|
||||
const char *all = /* search pattern must end with suitable wildcard */
|
||||
strchr("/\\", name[base_length - 1]) ? "*" : "/*";
|
||||
|
||||
if((dir = (DIR *) malloc(sizeof *dir)) != 0 &&
|
||||
(dir->name = (char *) malloc(base_length + strlen(all) + 1)) != 0)
|
||||
{
|
||||
strcat(strcpy(dir->name, name), all);
|
||||
|
||||
if((dir->handle =
|
||||
(handle_type) _findfirst(dir->name, &dir->info)) != -1)
|
||||
{
|
||||
dir->result.d_name = 0;
|
||||
}
|
||||
else /* rollback */
|
||||
{
|
||||
free(dir->name);
|
||||
free(dir);
|
||||
dir = 0;
|
||||
}
|
||||
}
|
||||
else /* rollback */
|
||||
{
|
||||
free(dir);
|
||||
dir = 0;
|
||||
errno = ENOMEM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = EINVAL;
|
||||
}
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
int closedir(DIR *dir)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
if(dir)
|
||||
{
|
||||
if(dir->handle != -1)
|
||||
{
|
||||
result = _findclose(dir->handle);
|
||||
}
|
||||
|
||||
free(dir->name);
|
||||
free(dir);
|
||||
}
|
||||
|
||||
if(result == -1) /* map all errors to EBADF */
|
||||
{
|
||||
errno = EBADF;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
struct dirent *readdir(DIR *dir)
|
||||
{
|
||||
struct dirent *result = 0;
|
||||
|
||||
if(dir && dir->handle != -1)
|
||||
{
|
||||
if(!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1)
|
||||
{
|
||||
result = &dir->result;
|
||||
result->d_name = dir->info.name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = EBADF;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void rewinddir(DIR *dir)
|
||||
{
|
||||
if(dir && dir->handle != -1)
|
||||
{
|
||||
_findclose(dir->handle);
|
||||
dir->handle = (handle_type) _findfirst(dir->name, &dir->info);
|
||||
dir->result.d_name = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = EBADF;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided
|
||||
that this copyright and permissions notice appear in all copies and
|
||||
derivatives.
|
||||
|
||||
This software is supplied "as is" without express or implied warranty.
|
||||
|
||||
But that said, if there are any problems please get in touch.
|
||||
|
||||
*/
|
50
src/windows/dirent.h
Normal file
50
src/windows/dirent.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef DIRENT_INCLUDED
|
||||
#define DIRENT_INCLUDED
|
||||
|
||||
/*
|
||||
|
||||
Declaration of POSIX directory browsing functions and types for Win32.
|
||||
|
||||
Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com)
|
||||
History: Created March 1997. Updated June 2003.
|
||||
Rights: See end of file.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct DIR DIR;
|
||||
|
||||
struct dirent
|
||||
{
|
||||
char *d_name;
|
||||
};
|
||||
|
||||
DIR *opendir(const char *);
|
||||
int closedir(DIR *);
|
||||
struct dirent *readdir(DIR *);
|
||||
void rewinddir(DIR *);
|
||||
|
||||
/*
|
||||
|
||||
Copyright Kevlin Henney, 1997, 2003. All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided
|
||||
that this copyright and permissions notice appear in all copies and
|
||||
derivatives.
|
||||
|
||||
This software is supplied "as is" without express or implied warranty.
|
||||
|
||||
But that said, if there are any problems please get in touch.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
188
src/windows/fnmatch.c
Normal file
188
src/windows/fnmatch.c
Normal file
|
@ -0,0 +1,188 @@
|
|||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details. */
|
||||
|
||||
/* Modified slightly by Brian Berliner <berliner@sun.com> and
|
||||
Jim Blandy <jimb@cyclic.com> for CVS use */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* Some file systems are case-insensitive. If FOLD_FN_CHAR is
|
||||
#defined, it maps the character C onto its "canonical" form. In a
|
||||
case-insensitive system, it would map all alphanumeric characters
|
||||
to lower case. Under Windows NT, / and \ are both path component
|
||||
separators, so FOLD_FN_CHAR would map them both to /. */
|
||||
#ifndef FOLD_FN_CHAR
|
||||
#define FOLD_FN_CHAR(c) (c)
|
||||
#endif
|
||||
|
||||
/* IGNORE(@ */
|
||||
/* #include <ansidecl.h> */
|
||||
/* @) */
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
int
|
||||
#if __STDC__
|
||||
fnmatch (const char *pattern, const char *string, int flags)
|
||||
#else
|
||||
fnmatch (pattern, string, flags)
|
||||
char *pattern;
|
||||
char *string;
|
||||
int flags;
|
||||
#endif
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register char c;
|
||||
|
||||
if ((flags & ~__FNM_FLAGS) != 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '?':
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_PATHNAME) && *n == '/')
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
c = *p++;
|
||||
if (*n != c)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_PATHNAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
|
||||
{
|
||||
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||
for (--p; *n != '\0'; ++n)
|
||||
if ((c == '[' || *n == c1) &&
|
||||
fnmatch(p, n, flags & ~FNM_PERIOD) == 0)
|
||||
return 0;
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
case '[':
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
register int not;
|
||||
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_PATHNAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || *p == '^');
|
||||
if (not)
|
||||
++p;
|
||||
|
||||
c = *p++;
|
||||
for (;;)
|
||||
{
|
||||
register char cstart = c, cend = c;
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
|
||||
if (c == '\0')
|
||||
/* [ (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
|
||||
if ((flags & FNM_PATHNAME) && c == '/')
|
||||
/* [/] can never match. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (c == '-' && *p != ']')
|
||||
{
|
||||
cend = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||
cend = *p++;
|
||||
if (cend == '\0')
|
||||
return FNM_NOMATCH;
|
||||
c = *p++;
|
||||
}
|
||||
|
||||
if (*n >= cstart && *n <= cend)
|
||||
goto matched;
|
||||
|
||||
if (c == ']')
|
||||
break;
|
||||
}
|
||||
if (!not)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
matched:;
|
||||
/* Skip the rest of the [...] that already matched. */
|
||||
while (c != ']')
|
||||
{
|
||||
if (c == '\0')
|
||||
/* [... (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* 1003.2d11 is unclear if this is right. %%% */
|
||||
++p;
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (FOLD_FN_CHAR (c) != FOLD_FN_CHAR (*n))
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
++n;
|
||||
}
|
||||
|
||||
if (*n == '\0')
|
||||
return 0;
|
||||
|
||||
return FNM_NOMATCH;
|
||||
}
|
38
src/windows/fnmatch.h
Normal file
38
src/windows/fnmatch.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
|
||||
#define _FNMATCH_H 1
|
||||
|
||||
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||
#undef FNM_PATHNAME
|
||||
#define FNM_PATHNAME (1 << 0)/* No wildcard can ever match `/'. */
|
||||
#undef FNM_NOESCAPE
|
||||
#define FNM_NOESCAPE (1 << 1)/* Backslashes don't quote special chars. */
|
||||
#undef FNM_PERIOD
|
||||
#define FNM_PERIOD (1 << 2)/* Leading `.' is matched only explicitly. */
|
||||
#undef __FNM_FLAGS
|
||||
#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
#undef FNM_NOMATCH
|
||||
#define FNM_NOMATCH 1
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch (const char *pattern, const char *string, int flags);
|
||||
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
|
156
src/windows/recollindex/recollindex.vcxproj
Normal file
156
src/windows/recollindex/recollindex.vcxproj
Normal file
|
@ -0,0 +1,156 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A513D65F-798C-4166-B66E-49F69ADA4F59}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>recollindex</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>__WIN32__;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\utils;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>C:\xapian\xapian-core-1.2.8\win32\Debug;C:\Users\Bill\recoll\src\windows\Debug;C:\pthreads-w32\Pre-built.2\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>C:\Users\Bill\recoll\src\windows\Debug\Win32ProjectRecoll.lib;C:\xapian\xapian-core-1.2.8\win32\Debug\xapian-core.lib;C:\zlib\lib\zdll.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\pthreads-w32\Pre-built.2\include;C:\Users\Bill\recoll\src\xaposix;C:\Users\Bill\recoll\src\utils;C:\Users\Bill\recoll\src\unac;C:\Users\Bill\recoll\src\rcldb;C:\Users\Bill\recoll\src\internfile;C:\Users\Bill\recoll\src\index;C:\Users\Bill\recoll\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>C:\xapian\xapian-core-1.2.8\win32\Debug;C:\Users\Bill\recoll\src\windows\x64\Debug;C:\pthreads-w32\Pre-built.2\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>pthreadVC2.lib;Win32ProjectRecoll.lib;xapian-core.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\index\recollindex.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
src/windows/recollindex/recollindex.vcxproj.filters
Normal file
22
src/windows/recollindex/recollindex.vcxproj.filters
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\index\recollindex.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
8
src/windows/targetver.h
Normal file
8
src/windows/targetver.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
// Including SDKDDKVer.h defines the highest available Windows platform.
|
||||
|
||||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||
|
||||
#include <SDKDDKVer.h>
|
249
src/xaposix/config.h
Normal file
249
src/xaposix/config.h
Normal file
|
@ -0,0 +1,249 @@
|
|||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if ftime returns void */
|
||||
/* #undef FTIME_RETURNS_VOID */
|
||||
|
||||
/* Define to 1 if you have the `closefrom' function. */
|
||||
/* #undef HAVE_CLOSEFROM */
|
||||
|
||||
/* Define to 1 if you have the `dirfd' function. */
|
||||
#define HAVE_DIRFD 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#define HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if you have the `fsync' function. */
|
||||
#define HAVE_FSYNC 1
|
||||
|
||||
/* Define to 1 if you have the `ftime' function. */
|
||||
#define HAVE_FTIME 1
|
||||
|
||||
/* Define to 1 if you have the `gethostname' function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
#define HAVE_GETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the `getrusage' function. */
|
||||
#define HAVE_GETRUSAGE 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `hstrerror' function. */
|
||||
#define HAVE_HSTRERROR 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the `link' function. */
|
||||
#define HAVE_LINK 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if pread is available on this system */
|
||||
#define HAVE_PREAD 1
|
||||
|
||||
/* Define if pwrite is available on this system */
|
||||
#define HAVE_PWRITE 1
|
||||
|
||||
/* Define to 1 if you have the `setenv' function. */
|
||||
#define HAVE_SETENV 1
|
||||
|
||||
/* Define to 1 if you have the `sigaction' function. */
|
||||
#define HAVE_SIGACTION 1
|
||||
|
||||
/* Define to 1 if you have the `sigsetjmp' function */
|
||||
#define HAVE_SIGSETJMP 1
|
||||
|
||||
/* Define to 1 if you have the 'socketpair' function. */
|
||||
#define HAVE_SOCKETPAIR 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `sysconf' function. */
|
||||
#define HAVE_SYSCONF 1
|
||||
|
||||
/* Define to 1 if you have the <sys/errno.h> header file. */
|
||||
#define HAVE_SYS_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
#define HAVE_SYS_RESOURCE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#define HAVE_SYS_UTSNAME_H 1
|
||||
|
||||
/* Define to 1 if you have the `times' function. */
|
||||
#define HAVE_TIMES 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <uuid.h> header file. */
|
||||
/* #undef HAVE_UUID_H */
|
||||
|
||||
/* Define to 1 if you have the 'uuid_unparse_lower' function. */
|
||||
#define HAVE_UUID_UNPARSE_LOWER 1
|
||||
|
||||
/* Define to 1 if you have the <uuid/uuid.h> header file. */
|
||||
#define HAVE_UUID_UUID_H 1
|
||||
|
||||
/* Define if a suitable valgrind is installed */
|
||||
#define HAVE_VALGRIND 1
|
||||
|
||||
/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
|
||||
#define HAVE_VALGRIND_MEMCHECK_H 1
|
||||
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
#define HAVE_ZLIB_H 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "xapian-core"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "http://xapian.org/bugs"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "xapian-core"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "xapian-core 1.2.14"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "xapian-core"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.2.14"
|
||||
|
||||
/* explicit prototype needed for pread (if any) */
|
||||
/* #undef PREAD_PROTOTYPE */
|
||||
|
||||
/* explicit prototype needed for pwrite (if any) */
|
||||
/* #undef PWRITE_PROTOTYPE */
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 8
|
||||
|
||||
/* Define to the name of a function implementing snprintf but not caring about
|
||||
ISO C99 return value semantics (if one exists) */
|
||||
#define SNPRINTF snprintf
|
||||
|
||||
/* Define to the name of a function implementing snprintf with ISO C99
|
||||
semantics (if one exists) */
|
||||
#define SNPRINTF_ISO snprintf
|
||||
|
||||
/* type to use for 5th parameter to getsockopt */
|
||||
#define SOCKLEN_T socklen_t
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if the testsuite should use RTTI */
|
||||
#define USE_RTTI 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.2.14"
|
||||
|
||||
/* Define if you want assertions (causes some slow-down) */
|
||||
/* #undef XAPIAN_ASSERTIONS */
|
||||
|
||||
/* Define if you want paranoid assertions (causes significant slow-down) */
|
||||
/* #undef XAPIAN_ASSERTIONS_PARANOID */
|
||||
|
||||
/* Define if you want a log of methods called and other debug messages */
|
||||
/* #undef XAPIAN_DEBUG_LOG */
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define on mingw to the minimum msvcrt version to assume */
|
||||
/* #undef __MSVCRT_VERSION__ */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* #undef mode_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* #undef ssize_t */
|
||||
|
||||
/* Disable stupid MSVC "performance" warning for converting int to bool. */
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4800)
|
||||
#endif
|
||||
|
||||
/* _FORTIFY_SOURCE is only supported by GCC >= 4.1 and glibc >= 2.3.4, but it
|
||||
* shouldn't cause a problem to define it where it's not supported and some
|
||||
* distros may have backported support, so hardcoding version checks is
|
||||
* counter-productive.
|
||||
*
|
||||
* Check if _FORTIFY_SOURCE is already defined to allow the user to override
|
||||
* our choice with "./configure CPPFLAGS=-D_FORTIFY_SOURCE=0" or "...=1".
|
||||
*/
|
||||
#if defined __GNUC__ && !defined _FORTIFY_SOURCE
|
||||
# define _FORTIFY_SOURCE 2
|
||||
#endif
|
||||
|
||||
/* For GCC >= 3.0 (and Intel's C++ compiler, which also defines __GNUC__),
|
||||
* we can use __builtin_expect to give the compiler hints about branch
|
||||
* prediction. See HACKING for how to use these.
|
||||
*/
|
||||
#if defined __GNUC__
|
||||
/* The arguments of __builtin_expect() are both long, so use !! to ensure that
|
||||
* the first argument is always an integer expression, and always 0 or 1, but
|
||||
* still has the same truth value for the if or while it is used in.
|
||||
*/
|
||||
# define rare(COND) __builtin_expect(!!(COND), 0)
|
||||
# define usual(COND) __builtin_expect(!!(COND), 1)
|
||||
#else
|
||||
# define rare(COND) (COND)
|
||||
# define usual(COND) (COND)
|
||||
#endif
|
||||
|
107
src/xaposix/realtime.h
Normal file
107
src/xaposix/realtime.h
Normal file
|
@ -0,0 +1,107 @@
|
|||
/** @file realtime.h
|
||||
* @brief Functions for handling a time or time interval in a double.
|
||||
*/
|
||||
/* Copyright (C) 2010,2013 Olly Betts
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef XAPIAN_INCLUDED_REALTIME_H
|
||||
#define XAPIAN_INCLUDED_REALTIME_H
|
||||
|
||||
#include <cmath>
|
||||
#include <ctime>
|
||||
#include "safeerrno.h"
|
||||
#include "safeunistd.h"
|
||||
|
||||
#ifndef __WIN32__
|
||||
# ifdef HAVE_FTIME
|
||||
# include <sys/timeb.h>
|
||||
# endif
|
||||
# ifdef HAVE_GETTIMEOFDAY
|
||||
# include <sys/time.h>
|
||||
# endif
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# include <sys/timeb.h>
|
||||
extern void xapian_sleep_milliseconds(unsigned int millisecs);
|
||||
#endif
|
||||
|
||||
namespace RealTime {
|
||||
|
||||
/// Return the current time.
|
||||
inline double now() {
|
||||
#ifndef __WIN32__
|
||||
// POSIX.1-2008 stopped specifying ftime(), so prefer gettimeofday().
|
||||
# ifdef HAVE_GETTIMEOFDAY
|
||||
struct timeval tv;
|
||||
if (usual(gettimeofday(&tv, NULL) == 0))
|
||||
return tv.tv_sec + (tv.tv_usec * 1e-6);
|
||||
return double(std::time(NULL));
|
||||
# elif defined HAVE_FTIME
|
||||
struct timeb tp;
|
||||
# ifdef FTIME_RETURNS_VOID
|
||||
ftime(&tp);
|
||||
# else
|
||||
if (rare(ftime(&tp) != 0))
|
||||
return double(std::time(NULL));
|
||||
# endif
|
||||
return tp.time + (tp.millitm * 1e-3);
|
||||
# else
|
||||
return double(std::time(NULL));
|
||||
# endif
|
||||
#else
|
||||
struct __timeb64 tp;
|
||||
_ftime64(&tp);
|
||||
return tp.time + tp.millitm * 1e-3;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Return the end time for a timeout in @a timeout seconds.
|
||||
*
|
||||
* If @a timeout is 0, that means "no timeout", so 0 is returned. Otherwise
|
||||
* the current time plus @a timeout seconds is returned.
|
||||
*/
|
||||
inline double end_time(double timeout) {
|
||||
return (timeout == 0.0 ? timeout : timeout + now());
|
||||
}
|
||||
|
||||
/// Sleep until the time represented by this object.
|
||||
inline void sleep(double t) {
|
||||
#ifndef __WIN32__
|
||||
double delta;
|
||||
struct timeval tv;
|
||||
do {
|
||||
delta = t - RealTime::now();
|
||||
if (delta <= 0.0)
|
||||
return;
|
||||
tv.tv_sec = long(delta);
|
||||
tv.tv_usec = long(std::fmod(delta, 1.0) * 1e6);
|
||||
} while (select(0, NULL, NULL, NULL, &tv) < 0 && errno == EINTR);
|
||||
#else
|
||||
double delta = t - RealTime::now();
|
||||
if (delta <= 0.0)
|
||||
return;
|
||||
while (rare(delta > 4294967.0)) {
|
||||
xapian_sleep_milliseconds(4294967000u);
|
||||
delta -= 4294967.0;
|
||||
}
|
||||
xapian_sleep_milliseconds(unsigned(delta * 1000.0));
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // XAPIAN_INCLUDED_REALTIME_H
|
31
src/xaposix/safe.cc
Normal file
31
src/xaposix/safe.cc
Normal file
|
@ -0,0 +1,31 @@
|
|||
/** @file safe.cc
|
||||
* @brief Helper functions for safe*.h
|
||||
*/
|
||||
/* Copyright (C) 2007 Olly Betts
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "safewindows.h"
|
||||
|
||||
// Used by safeunistd.h:
|
||||
void
|
||||
xapian_sleep_milliseconds(unsigned int millisecs)
|
||||
{
|
||||
Sleep(millisecs);
|
||||
}
|
||||
|
||||
|
36
src/xaposix/safeerrno.h
Normal file
36
src/xaposix/safeerrno.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* safeerrno.h: #include <errno.h>, but working around broken platforms.
|
||||
*
|
||||
* Copyright (C) 2006,2007 Olly Betts
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
|
||||
* USA
|
||||
*/
|
||||
|
||||
#ifndef XAPIAN_INCLUDED_SAFEERRNO_H
|
||||
#define XAPIAN_INCLUDED_SAFEERRNO_H
|
||||
|
||||
//#ifndef PACKAGE
|
||||
//# error You must #include <config.h> before #include "safeerrno.h"
|
||||
//#endif
|
||||
|
||||
// Compaq's C++ compiler requires sys/errno.h to be included, followed by
|
||||
// errno.h, otherwise you don't get EINTR or most of the other EXXX codes
|
||||
// defined.
|
||||
#if defined __DECCXX && defined HAVE_SYS_ERRNO_H
|
||||
# include <sys/errno.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
|
||||
#endif // XAPIAN_INCLUDED_SAFEERRNO_H
|
|
@ -34,7 +34,9 @@
|
|||
#ifdef _MSC_VER
|
||||
// MSVC #define-s open but also defines a function called open, so just undef
|
||||
// the macro.
|
||||
# undef open
|
||||
// Jf/recoll: don't do this, open() seems to be finally deprecated in vs 2015, we need _open(). Hopefully recoll has
|
||||
// no open() methods..
|
||||
//# undef open
|
||||
#else
|
||||
|
||||
inline int fcntl_open_(const char *filename, int flags, mode_t mode) {
|
||||
|
|
45
src/xaposix/safewindows.h
Normal file
45
src/xaposix/safewindows.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/* safewindows.h: #include <windows.h> without all the bloat and damage.
|
||||
*
|
||||
* Copyright (C) 2005,2007 Olly Betts
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef XAPIAN_INCLUDED_SAFEWINDOWS_H
|
||||
#define XAPIAN_INCLUDED_SAFEWINDOWS_H
|
||||
|
||||
#if !defined __CYGWIN__ && !defined __WIN32__
|
||||
# error Including safewindows.h, but neither __CYGWIN__ nor __WIN32__ defined!
|
||||
#endif
|
||||
|
||||
// Prevent windows.h from defining min and max macros.
|
||||
#ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
#endif
|
||||
|
||||
// Prevent windows.h from including lots of obscure win32 api headers
|
||||
// which we don't care about and will just slow down compilation and
|
||||
// increase the risk of symbol collisions.
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <windows.h>
|
||||
|
||||
// FOF_NOERRORUI isn't defined by older versions of the mingw headers.
|
||||
#ifndef FOF_NOERRORUI
|
||||
# define FOF_NOERRORUI 1024
|
||||
#endif
|
||||
|
||||
#endif // XAPIAN_INCLUDED_SAFEWINDOWS_H
|
Loading…
Add table
Add a link
Reference in a new issue