]> git.lyx.org Git - lyx.git/blob - src/support/systemcall.C
the convert patch
[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 "support/systemcall.h"
17 #include "support/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                 switch (os::shell()) {
37                 case os::UNIX:
38                         command += " &";
39                         break;
40                 case os::CMD_EXE:
41                         command = "start /min " + command;
42                         break;
43                 }
44         }
45
46         return ::system(command.c_str());
47 }
48
49 } // namespace support
50 } // namespace lyx