1st successful use of mh_exec (direct antiword exec)
--HG-- branch : WINDOWSPORT
This commit is contained in:
parent
b626d80a83
commit
06f43c573e
@ -47,6 +47,7 @@
|
|||||||
#include "readfile.h"
|
#include "readfile.h"
|
||||||
#include "fstreewalk.h"
|
#include "fstreewalk.h"
|
||||||
#include "cpuconf.h"
|
#include "cpuconf.h"
|
||||||
|
#include "execmd.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -1305,47 +1306,45 @@ vector<string> RclConfig::getDaemSkippedPaths() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Look up an executable filter. We look in $RECOLL_FILTERSDIR,
|
// Look up an executable filter. We add $RECOLL_FILTERSDIR,
|
||||||
// filtersdir in config file, then let the system use the PATH
|
// and filtersdir from the config file to the PATH, then use execmd::which()
|
||||||
string RclConfig::findFilter(const string &icmd) const
|
string RclConfig::findFilter(const string &icmd) const
|
||||||
{
|
{
|
||||||
// If the path is absolute, this is it
|
// If the path is absolute, this is it
|
||||||
if (path_isabsolute(icmd))
|
if (path_isabsolute(icmd))
|
||||||
return icmd;
|
return icmd;
|
||||||
|
|
||||||
string cmd;
|
const char *cp = getenv("PATH");
|
||||||
const char *cp;
|
if (!cp) //??
|
||||||
|
cp = "";
|
||||||
|
string PATH(cp);
|
||||||
|
|
||||||
// Filters dir from environment ?
|
// For historical reasons: check in personal config directory
|
||||||
|
PATH = getConfDir() + path_PATHsep() + PATH;
|
||||||
|
|
||||||
|
string temp;
|
||||||
|
// Prepend $datadir/filters
|
||||||
|
temp = path_cat(m_datadir, "filters");
|
||||||
|
PATH = temp + path_PATHsep() + PATH;
|
||||||
|
|
||||||
|
// Prepend possible configuration parameter?
|
||||||
|
if (getConfParam(string("filtersdir"), temp)) {
|
||||||
|
temp = path_tildexpand(temp);
|
||||||
|
PATH = temp + path_PATHsep() + PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepend possible environment variable
|
||||||
if ((cp = getenv("RECOLL_FILTERSDIR"))) {
|
if ((cp = getenv("RECOLL_FILTERSDIR"))) {
|
||||||
cmd = path_cat(cp, icmd);
|
PATH = string(cp) + path_PATHsep() + PATH;
|
||||||
if (access(cmd.c_str(), X_OK) == 0)
|
|
||||||
return cmd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filters dir as configuration parameter?
|
string cmd;
|
||||||
if (getConfParam(string("filtersdir"), cmd)) {
|
if (ExecCmd::which(icmd, cmd, PATH.c_str())) {
|
||||||
cmd = path_cat(cmd, icmd);
|
return cmd;
|
||||||
cmd = path_tildexpand(cmd);
|
} else {
|
||||||
if (access(cmd.c_str(), X_OK) == 0)
|
// Let the shell try to find it...
|
||||||
return cmd;
|
return icmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filters dir as datadir subdir. Actually the standard case, but
|
|
||||||
// this is normally the same value found in config file (previous step)
|
|
||||||
cmd = path_cat(m_datadir, "filters");
|
|
||||||
cmd = path_cat(cmd, icmd);
|
|
||||||
if (access(cmd.c_str(), X_OK) == 0)
|
|
||||||
return cmd;
|
|
||||||
|
|
||||||
// Last resort for historical reasons: check in personal config
|
|
||||||
// directory
|
|
||||||
cmd = path_cat(getConfDir(), icmd);
|
|
||||||
if (access(cmd.c_str(), X_OK) == 0)
|
|
||||||
return cmd;
|
|
||||||
|
|
||||||
// Let the shell try to find it...
|
|
||||||
return icmd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -27,9 +27,7 @@ using namespace std;
|
|||||||
|
|
||||||
#include "mimetype.h"
|
#include "mimetype.h"
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
#ifndef _WIN32
|
|
||||||
#include "execmd.h"
|
#include "execmd.h"
|
||||||
#endif
|
|
||||||
#include "rclconfig.h"
|
#include "rclconfig.h"
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "idfile.h"
|
#include "idfile.h"
|
||||||
|
|||||||
@ -17,10 +17,10 @@
|
|||||||
#ifndef _MIMETYPE_H_INCLUDED_
|
#ifndef _MIMETYPE_H_INCLUDED_
|
||||||
#define _MIMETYPE_H_INCLUDED_
|
#define _MIMETYPE_H_INCLUDED_
|
||||||
|
|
||||||
|
#include "safesysstat.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class RclConfig;
|
class RclConfig;
|
||||||
struct stat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to determine a mime type for file.
|
* Try to determine a mime type for file.
|
||||||
|
|||||||
@ -17,10 +17,10 @@
|
|||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <time.h>
|
||||||
|
#include "safesyswait.h"
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "cstr.h"
|
#include "cstr.h"
|
||||||
#include "execmd.h"
|
#include "execmd.h"
|
||||||
@ -32,6 +32,8 @@ using namespace std;
|
|||||||
#include "md5ut.h"
|
#include "md5ut.h"
|
||||||
#include "rclconfig.h"
|
#include "rclconfig.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
// This is called periodically by ExeCmd when it is waiting for data,
|
// This is called periodically by ExeCmd when it is waiting for data,
|
||||||
// or when it does receive some. We may choose to interrupt the
|
// or when it does receive some. We may choose to interrupt the
|
||||||
// command.
|
// command.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2005 J.F.Dockes
|
/* Copyright (C) 2005 J.F.Dockes
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@ -32,7 +32,7 @@ using namespace std;
|
|||||||
#include "idfile.h"
|
#include "idfile.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include "safesyswait.h"
|
||||||
|
|
||||||
bool MimeHandlerExecMultiple::startCmd()
|
bool MimeHandlerExecMultiple::startCmd()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -98,9 +98,7 @@ text/plainData: 10
|
|||||||
class MimeHandlerExecMultiple : public MimeHandlerExec {
|
class MimeHandlerExecMultiple : public MimeHandlerExec {
|
||||||
/////////
|
/////////
|
||||||
// Things not reset by "clear()", additionally to those in MimeHandlerExec
|
// Things not reset by "clear()", additionally to those in MimeHandlerExec
|
||||||
#ifndef _WIN32
|
|
||||||
ExecCmd m_cmd;
|
ExecCmd m_cmd;
|
||||||
#endif
|
|
||||||
/////// End un-cleared stuff.
|
/////// End un-cleared stuff.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -195,9 +195,6 @@ static const string cstr_mh_charset("charset");
|
|||||||
MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
|
MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
|
||||||
bool multiple, const string& id)
|
bool multiple, const string& id)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
ConfSimple attrs;
|
ConfSimple attrs;
|
||||||
string cmdstr;
|
string cmdstr;
|
||||||
|
|
||||||
@ -241,7 +238,6 @@ MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get handler/filter object for given mime type: */
|
/* Get handler/filter object for given mime type: */
|
||||||
|
|||||||
@ -239,6 +239,17 @@ const string& path_sharedatadir()
|
|||||||
return datadir;
|
return datadir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string path_PATHsep()
|
||||||
|
{
|
||||||
|
static const string w(";");
|
||||||
|
static const string u(":");
|
||||||
|
#ifdef _WIN32
|
||||||
|
return w;
|
||||||
|
#else
|
||||||
|
return u;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool maketmpdir(string& tdir, string& reason)
|
bool maketmpdir(string& tdir, string& reason)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|||||||
@ -78,6 +78,9 @@ extern long long path_filesize(const std::string& path);
|
|||||||
/// the file/dir does not exist or that an error occurred.
|
/// the file/dir does not exist or that an error occurred.
|
||||||
extern bool path_exists(const std::string& path);
|
extern bool path_exists(const std::string& path);
|
||||||
|
|
||||||
|
/// Return separator for PATH environment variable
|
||||||
|
extern std::string path_PATHsep();
|
||||||
|
|
||||||
/// Dump directory
|
/// Dump directory
|
||||||
extern bool readdir(const std::string& dir, std::string& reason,
|
extern bool readdir(const std::string& dir, std::string& reason,
|
||||||
std::set<std::string>& entries);
|
std::set<std::string>& entries);
|
||||||
|
|||||||
@ -151,6 +151,8 @@
|
|||||||
<ClInclude Include="..\index\indexer.h" />
|
<ClInclude Include="..\index\indexer.h" />
|
||||||
<ClInclude Include="..\index\mimetype.h" />
|
<ClInclude Include="..\index\mimetype.h" />
|
||||||
<ClInclude Include="..\internfile\internfile.h" />
|
<ClInclude Include="..\internfile\internfile.h" />
|
||||||
|
<ClInclude Include="..\internfile\mh_exec.h" />
|
||||||
|
<ClInclude Include="..\internfile\mh_execm.h" />
|
||||||
<ClInclude Include="..\internfile\mh_symlink.h" />
|
<ClInclude Include="..\internfile\mh_symlink.h" />
|
||||||
<ClInclude Include="..\utils\cancelcheck.h" />
|
<ClInclude Include="..\utils\cancelcheck.h" />
|
||||||
<ClInclude Include="..\utils\cpuconf.h" />
|
<ClInclude Include="..\utils\cpuconf.h" />
|
||||||
@ -193,6 +195,8 @@
|
|||||||
<ClCompile Include="..\internfile\extrameta.cpp" />
|
<ClCompile Include="..\internfile\extrameta.cpp" />
|
||||||
<ClCompile Include="..\internfile\htmlparse.cpp" />
|
<ClCompile Include="..\internfile\htmlparse.cpp" />
|
||||||
<ClCompile Include="..\internfile\internfile.cpp" />
|
<ClCompile Include="..\internfile\internfile.cpp" />
|
||||||
|
<ClCompile Include="..\internfile\mh_exec.cpp" />
|
||||||
|
<ClCompile Include="..\internfile\mh_execm.cpp" />
|
||||||
<ClCompile Include="..\internfile\mh_html.cpp" />
|
<ClCompile Include="..\internfile\mh_html.cpp" />
|
||||||
<ClCompile Include="..\internfile\mh_mail.cpp" />
|
<ClCompile Include="..\internfile\mh_mail.cpp" />
|
||||||
<ClCompile Include="..\internfile\mh_mbox.cpp" />
|
<ClCompile Include="..\internfile\mh_mbox.cpp" />
|
||||||
|
|||||||
@ -96,6 +96,12 @@
|
|||||||
<ClInclude Include="..\utils\cancelcheck.h">
|
<ClInclude Include="..\utils\cancelcheck.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\internfile\mh_exec.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\internfile\mh_execm.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\utils\smallut.cpp">
|
<ClCompile Include="..\utils\smallut.cpp">
|
||||||
@ -299,6 +305,12 @@
|
|||||||
<ClCompile Include="execmd_w.cpp">
|
<ClCompile Include="execmd_w.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\internfile\mh_exec.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\internfile\mh_execm.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="ClassDiagram.cd" />
|
<None Include="ClassDiagram.cd" />
|
||||||
|
|||||||
@ -190,6 +190,26 @@ static void make_path_vec(const char *ep, vector<string>& vec)
|
|||||||
vec.insert(vec.begin(), ".\\");
|
vec.insert(vec.begin(), ".\\");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string pipeUniqueName(std::string nClass, std::string prefix)
|
||||||
|
{
|
||||||
|
std::stringstream uName;
|
||||||
|
|
||||||
|
long currCnt;
|
||||||
|
// PID + multi-thread-protected static counter to be unique
|
||||||
|
{
|
||||||
|
static long cnt = 0;
|
||||||
|
currCnt = InterlockedIncrement(&cnt);
|
||||||
|
}
|
||||||
|
DWORD pid = GetCurrentProcessId();
|
||||||
|
|
||||||
|
// naming convention
|
||||||
|
uName << "\\\\.\\" << nClass << "\\";
|
||||||
|
uName << "pid-" << pid << "-cnt-" << currCnt << "-";
|
||||||
|
uName << prefix;
|
||||||
|
|
||||||
|
return uName.str();
|
||||||
|
}
|
||||||
|
|
||||||
enum WaitResult {
|
enum WaitResult {
|
||||||
Ok, Quit, Timeout
|
Ok, Quit, Timeout
|
||||||
};
|
};
|
||||||
@ -420,24 +440,9 @@ void ExecCmd::putenv(const string &name, const string& value)
|
|||||||
m->m_env[name] = value;
|
m->m_env[name] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string pipeUniqueName(std::string nClass, std::string prefix)
|
void ExecCmd::setrlimit_as(int mbytes)
|
||||||
{
|
{
|
||||||
std::stringstream uName;
|
// Later maybe
|
||||||
|
|
||||||
long currCnt;
|
|
||||||
// PID + multi-thread-protected static counter to be unique
|
|
||||||
{
|
|
||||||
static long cnt = 0;
|
|
||||||
currCnt = InterlockedIncrement(&cnt);
|
|
||||||
}
|
|
||||||
DWORD pid = GetCurrentProcessId();
|
|
||||||
|
|
||||||
// naming convention
|
|
||||||
uName << "\\\\.\\" << nClass << "\\";
|
|
||||||
uName << "pid-" << pid << "-cnt-" << currCnt << "-";
|
|
||||||
uName << prefix;
|
|
||||||
|
|
||||||
return uName.str();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ExecCmd::Internal::preparePipes(bool has_input,HANDLE *hChildInput,
|
bool ExecCmd::Internal::preparePipes(bool has_input,HANDLE *hChildInput,
|
||||||
|
|||||||
28
src/windows/trexe/trexecmd/trexecmd.sln
Normal file
28
src/windows/trexe/trexecmd/trexecmd.sln
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
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}") = "trexecmd", "trexecmd.vcxproj", "{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}"
|
||||||
|
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
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Release|x64.Build.0 = Release|x64
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
168
src/windows/trexe/trexecmd/trexecmd.vcxproj
Normal file
168
src/windows/trexe/trexecmd/trexecmd.vcxproj
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<?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>{AA325A63-79BC-41A5-BEDD-A64879D2A0A0}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>trexecmd</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" />
|
||||||
|
<Import Project="..\..\SolutionSettings\SolutionSettings.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\SolutionSettings\SolutionSettings.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\SolutionSettings\SolutionSettings.props" />
|
||||||
|
</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" />
|
||||||
|
<Import Project="..\..\SolutionSettings\SolutionSettings.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
</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;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(Solutiondir)..\..\..\xaposix;$(Solutiondir)..\..\;$(Solutiondir)..\..\..\common;$(Solutiondir)..\..\..\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(Solutiondir)..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>librecoll.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>__WIN32__;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(Solutiondir)..\..\..\xaposix;$(Solutiondir)..\..\;$(Solutiondir)..\..\..\common;$(Solutiondir)..\..\..\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(libiconv)\libiconv\$(Platform)\$(Configuration);$(zlib)\$(PLatform)\$(Configuration)\;$(xapian)\win32\$(PLatform)\$(Configuration)\;$(solutiondir)..\..\$(PLatform)\$(Configuration)\;$(pthreads)\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>Win32ProjectRecoll.lib;zlib.lib;xapian-core.lib;libiconv.lib;Ws2_32.lib;Rpcrt4.lib;pthreadVC2.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>
|
||||||
|
<AdditionalIncludeDirectories>$(Solutiondir)..\..\..\xaposix;$(Solutiondir)..\..\;$(Solutiondir)..\..\..\common;$(Solutiondir)..\..\..\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(Solutiondir)..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>librecoll.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</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>
|
||||||
|
<AdditionalIncludeDirectories>$(Solutiondir)..\..\..\xaposix;$(Solutiondir)..\..\;$(Solutiondir)..\..\..\common;$(Solutiondir)..\..\..\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(Solutiondir)..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>librecoll.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\trexecmd.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
src/windows/trexe/trexecmd/trexecmd.vcxproj.filters
Normal file
22
src/windows/trexe/trexecmd/trexecmd.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="..\..\trexecmd.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
39
src/xaposix/safesyswait.h
Normal file
39
src/xaposix/safesyswait.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/** @file safesyswait.h
|
||||||
|
* @brief #include <sys/wait.h>, with portability stuff.
|
||||||
|
*/
|
||||||
|
/* Copyright (C) 2010 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_SAFESYSWAIT_H
|
||||||
|
#define XAPIAN_INCLUDED_SAFESYSWAIT_H
|
||||||
|
|
||||||
|
#ifndef __WIN32__
|
||||||
|
# include <sys/wait.h>
|
||||||
|
#else
|
||||||
|
// We don't try to replace waitpid(), etc - they're only useful for us when
|
||||||
|
// we can fork(). But it's handy to be able to use WIFEXITED() and
|
||||||
|
// WEXITSTATUS().
|
||||||
|
# ifndef WIFEXITED
|
||||||
|
# define WIFEXITED(STATUS) (STATUS != -1)
|
||||||
|
# endif
|
||||||
|
# ifndef WEXITSTATUS
|
||||||
|
# define WEXITSTATUS(STATUS) (STATUS)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* XAPIAN_INCLUDED_SAFESYSWAIT_H */
|
||||||
Loading…
x
Reference in New Issue
Block a user