]> git.lyx.org Git - lyx.git/blob - src/support/systemcall.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / systemcall.C
1 /**
2  * \file systemcall.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Asger Alstrup
7  *
8  * Interface cleaned up by
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #include <config.h>
15
16 #include "systemcall.h"
17 #include "os.h"
18
19 #include <cstdlib>
20
21 using std::string;
22
23 #ifndef CXX_GLOBAL_CSTD
24 using std::system;
25 #endif
26
27 namespace lyx {
28 namespace support {
29
30 // Reuse of instance
31 int Systemcall::startscript(Starttype how, string const & what)
32 {
33         string command = what;
34
35         if (how == DontWait) {
36                 if (os::shell() == os::UNIX) {
37                         command += " &";
38                 } else {
39                         command = "start /min/n " + command;
40                 }
41         }
42
43         return ::system(command.c_str());
44 }
45
46 } // namespace support
47 } // namespace lyx