small adjustments for out-of-recoll builds
This commit is contained in:
parent
dade21bc3a
commit
e6428d04e2
@ -1134,13 +1134,15 @@ void ReExec::reexec()
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
#include "cancelcheck.h"
|
|
||||||
#include "execmd.h"
|
#include "execmd.h"
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
|
#include "cancelcheck.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
// Testing the rclexecm protocol outside of recoll. Here we use the
|
// Testing the rclexecm protocol outside of recoll. Here we use the
|
||||||
// rcldoc.py filter, you can try with rclaudio too, adjust the file arg
|
// rcldoc.py filter, you can try with rclaudio too, adjust the file arg
|
||||||
// accordingly
|
// accordingly
|
||||||
@ -1233,6 +1235,7 @@ bool exercise_mhexecm(const string& cmdstr, const string& mimetype,
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *thisprog;
|
static char *thisprog;
|
||||||
static char usage [] =
|
static char usage [] =
|
||||||
@ -1270,6 +1273,7 @@ class MEAdv : public ExecCmdAdvise {
|
|||||||
public:
|
public:
|
||||||
void newData(int cnt) {
|
void newData(int cnt) {
|
||||||
if (op_flags & OPT_c) {
|
if (op_flags & OPT_c) {
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
static int callcnt;
|
static int callcnt;
|
||||||
if (callcnt++ == 10) {
|
if (callcnt++ == 10) {
|
||||||
// Just sets the cancellation flag
|
// Just sets the cancellation flag
|
||||||
@ -1278,6 +1282,7 @@ public:
|
|||||||
// exception. We call it here for simplicity
|
// exception. We call it here for simplicity
|
||||||
CancelCheck::instance().checkCancel();
|
CancelCheck::instance().checkCancel();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
cerr << "newData(" << cnt << ")" << endl;
|
cerr << "newData(" << cnt << ")" << endl;
|
||||||
}
|
}
|
||||||
@ -1338,12 +1343,14 @@ int main(int argc, char *argv[])
|
|||||||
case 'c': op_flags |= OPT_c; break;
|
case 'c': op_flags |= OPT_c; break;
|
||||||
case 'r': op_flags |= OPT_r; break;
|
case 'r': op_flags |= OPT_r; break;
|
||||||
case 'w': op_flags |= OPT_w; break;
|
case 'w': op_flags |= OPT_w; break;
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
case 'm': op_flags |= OPT_m; break;
|
case 'm': op_flags |= OPT_m; break;
|
||||||
|
#endif
|
||||||
case 'i': op_flags |= OPT_i; break;
|
case 'i': op_flags |= OPT_i; break;
|
||||||
case 'o': op_flags |= OPT_o; break;
|
case 'o': op_flags |= OPT_o; break;
|
||||||
default: Usage(); break;
|
default: Usage(); break;
|
||||||
}
|
}
|
||||||
b1: argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
@ -1381,12 +1388,14 @@ int main(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
} else if (op_flags & OPT_m) {
|
} else if (op_flags & OPT_m) {
|
||||||
if (l.size() < 2)
|
if (l.size() < 2)
|
||||||
Usage();
|
Usage();
|
||||||
string mimetype = l[0];
|
string mimetype = l[0];
|
||||||
l.erase(l.begin());
|
l.erase(l.begin());
|
||||||
return exercise_mhexecm(arg1, mimetype, l) ? 0 : 1;
|
return exercise_mhexecm(arg1, mimetype, l) ? 0 : 1;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// Default: execute command line arguments
|
// Default: execute command line arguments
|
||||||
ExecCmd mexec;
|
ExecCmd mexec;
|
||||||
@ -1422,7 +1431,7 @@ int main(int argc, char *argv[])
|
|||||||
int status = -1;
|
int status = -1;
|
||||||
try {
|
try {
|
||||||
status = mexec.doexec(arg1, l, ip, op);
|
status = mexec.doexec(arg1, l, ip, op);
|
||||||
} catch (CancelExcept) {
|
} catch (...) {
|
||||||
cerr << "CANCELLED" << endl;
|
cerr << "CANCELLED" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef _EXECMD_H_INCLUDED_
|
#ifndef _EXECMD_H_INCLUDED_
|
||||||
#define _EXECMD_H_INCLUDED_
|
#define _EXECMD_H_INCLUDED_
|
||||||
#include "autoconfig.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -138,6 +137,17 @@ class ExecCmd {
|
|||||||
const std::string *input = 0,
|
const std::string *input = 0,
|
||||||
std::string *output = 0);
|
std::string *output = 0);
|
||||||
|
|
||||||
|
/** Same as doexec but cmd and args in one vector */
|
||||||
|
int doexec1(const std::vector<std::string>& args,
|
||||||
|
const std::string *input = 0,
|
||||||
|
std::string *output = 0) {
|
||||||
|
if (args.empty())
|
||||||
|
return -1;
|
||||||
|
return doexec(args[0],
|
||||||
|
std::vector<std::string>(args.begin() + 1, args.end()),
|
||||||
|
input, output);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next four methods can be used when a Q/A dialog needs to be
|
* The next four methods can be used when a Q/A dialog needs to be
|
||||||
* performed with the command
|
* performed with the command
|
||||||
|
|||||||
@ -19,7 +19,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef TEST_NETCON
|
#ifndef TEST_NETCON
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
#else
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -43,7 +47,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
|
||||||
#ifdef RECOLL_DATADIR
|
#ifdef BUILDING_RECOLL
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -16,7 +16,11 @@
|
|||||||
* Free Software Foundation, Inc.,
|
* Free Software Foundation, Inc.,
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
#ifdef BUILDING_RECOLL
|
||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
#else
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user