]> git.lyx.org Git - features.git/blob - src/support/syscall.C
Small fixes for docbook.
[features.git] / src / support / syscall.C
1 /**
2  *  \file syscall.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 Systemcalls 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 <cstdlib> //for ::system
26
27 #include "syscall.h"
28 #include "os.h"
29
30 #if 0
31 Systemcalls::Systemcalls(Starttype how, string const & what)
32 {
33         startscript(how, what);
34 }
35 #endif
36
37
38 // Reuse of instance
39 int Systemcalls::startscript(Starttype how, string const & what)
40 {
41         string command = what;
42
43         if (how == DontWait) {
44                 if (os::shell() == os::UNIX) {
45                         command += " &";
46                 } else {
47                         command = "start /min/n " + command;
48                 }
49         }
50
51         return ::system(command.c_str());
52 }