]> git.lyx.org Git - lyx.git/blob - src/support/Systemcall.cpp
abdel likes short code
[lyx.git] / src / support / Systemcall.cpp
1 /**
2  * \file Systemcall.cpp
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 namespace std;
22
23 namespace lyx {
24 namespace support {
25
26 // Reuse of instance
27 int Systemcall::startscript(Starttype how, string const & what)
28 {
29         string command = what;
30
31         if (how == DontWait) {
32                 switch (os::shell()) {
33                 case os::UNIX:
34                         command += " &";
35                         break;
36                 case os::CMD_EXE:
37                         command = "start /min " + command;
38                         break;
39                 }
40         }
41
42         return ::system(command.c_str());
43 }
44
45 } // namespace support
46 } // namespace lyx