]> git.lyx.org Git - lyx.git/blob - src/support/systemcall.C
parselog fixes, i18n fix, menu separator fix
[lyx.git] / src / support / systemcall.C
1 /**
2  *  \file systemcall.C
3  *  Copyright 2002 the LyX Team
4  *  Read the file COPYING
5  *
6  * \author Asger Alstrup
7  *
8  * Interface cleaned up by
9  * \author Angus Leeming <a.leeming@ic.ac.uk>
10  *
11  * Class Systemcall uses "system" to launch the child process.
12  * The user can choose to wait or not wait for the process to complete, but no
13  * callback is invoked upon completion of the child.
14  *
15  * The child process is not killed when the Systemcall instance goes out of
16  * scope.
17  */
18
19 #include <config.h>
20
21 #ifdef __GNUG__
22 #pragma implementation
23 #endif
24
25 #include "systemcall.h"
26 #include "os.h"
27
28 #include <cstdlib> //for ::system
29
30
31 #if 0
32 Systemcall::Systemcall(Starttype how, string const & what)
33 {
34         startscript(how, what);
35 }
36 #endif
37
38
39 // Reuse of instance
40 int Systemcall::startscript(Starttype how, string const & what)
41 {
42         string command = what;
43
44         if (how == DontWait) {
45                 if (os::shell() == os::UNIX) {
46                         command += " &";
47                 } else {
48                         command = "start /min/n " + command;
49                 }
50         }
51
52         return ::system(command.c_str());
53 }