11 Instance starts and represents childprocesses.
12 You should use this class if you need to start an external program in LyX.
13 You can start a child in the background and have a callback function
14 executed when the child finishes by using the DontWait starttype.
25 /// Callback function gets commandline and returnvalue from child
26 typedef void (*Callbackfct)(string cmd, int retval);
31 /** Geberate instance and start childprocess
32 The string "what" contains a commandline with arguments separated
34 When the requested program finishes, the callback-function is
35 called with the commandline and the returnvalue from the program.
36 The instance is automatically added to a timercheck if starttype is
37 DontWait (i.e. background execution). When a background child
38 finishes, the timercheck will automatically call the callback
41 Systemcalls(Starttype how, string what, Callbackfct call = 0);
47 /** Start childprocess. what contains a command on systemlevel.
49 int Startscript(Starttype how, string what, Callbackfct call = 0); // for reuse
51 /** gets PID of childprocess. Used by timer */
52 inline pid_t Getpid() { return pid; }
55 inline void Callback() { if (cbk) cbk(command, retval); }
57 /** Set return value. Used by timer */
58 inline void setRetValue(int r) { retval = r; }
60 /// Type of execution: system, wait for child or background
66 /// Process ID of child
68 /// Return value from child
77 /// Wait for child process to finish. Updates returncode from child.