2002-02-16 12:39:47 +00:00
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
* \file systemcall.C
|
2002-09-25 10:03:41 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-02-16 12:39:47 +00:00
|
|
|
*
|
|
|
|
* \author Asger Alstrup
|
|
|
|
*
|
|
|
|
* Interface cleaned up by
|
2002-09-25 10:03:41 +00:00
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-02-16 12:39:47 +00:00
|
|
|
*/
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2004-11-07 13:22:51 +00:00
|
|
|
#include "support/systemcall.h"
|
|
|
|
#include "support/os.h"
|
2002-02-18 19:13:48 +00:00
|
|
|
|
2002-05-30 02:24:33 +00:00
|
|
|
#include <cstdlib>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
using std::string;
|
|
|
|
|
2002-06-10 07:57:39 +00:00
|
|
|
#ifndef CXX_GLOBAL_CSTD
|
|
|
|
using std::system;
|
|
|
|
#endif
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-06-30 23:56:22 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace support {
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
// Reuse of instance
|
2002-02-18 19:13:48 +00:00
|
|
|
int Systemcall::startscript(Starttype how, string const & what)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2002-02-16 12:39:47 +00:00
|
|
|
string command = what;
|
2000-09-05 13:16:19 +00:00
|
|
|
|
2002-02-16 12:39:47 +00:00
|
|
|
if (how == DontWait) {
|
2001-06-27 14:10:35 +00:00
|
|
|
if (os::shell() == os::UNIX) {
|
|
|
|
command += " &";
|
|
|
|
} else {
|
|
|
|
command = "start /min/n " + command;
|
|
|
|
}
|
2000-09-05 13:16:19 +00:00
|
|
|
}
|
|
|
|
|
2002-02-16 12:39:47 +00:00
|
|
|
return ::system(command.c_str());
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
2003-06-30 23:56:22 +00:00
|
|
|
|
|
|
|
} // namespace support
|
|
|
|
} // namespace lyx
|