1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-02-16 12:39:47 +00:00
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
* \file systemcall.h
|
2002-09-25 10:03:41 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-02-16 12:39:47 +00:00
|
|
|
*
|
|
|
|
* \author Asger Alstrup
|
|
|
|
*
|
|
|
|
* Interface cleaned up by
|
2002-09-25 10:03:41 +00:00
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-02-16 12:39:47 +00:00
|
|
|
*/
|
|
|
|
|
2002-02-18 19:13:48 +00:00
|
|
|
#ifndef SYSTEMCALL_H
|
|
|
|
#define SYSTEMCALL_H
|
1999-10-12 21:37:10 +00:00
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
#include "support/std_string.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2003-06-30 23:56:22 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace support {
|
|
|
|
|
2002-09-25 10:03:41 +00:00
|
|
|
/**
|
2002-05-30 02:24:33 +00:00
|
|
|
* An instance of Class Systemcall represents a single child process.
|
|
|
|
*
|
|
|
|
* Class Systemcall uses system() to launch the child process.
|
|
|
|
* The user can choose to wait or not wait for the process to complete, but no
|
|
|
|
* callback is invoked upon completion of the child.
|
|
|
|
*
|
|
|
|
* The child process is not killed when the Systemcall instance goes out of
|
|
|
|
* scope.
|
|
|
|
*/
|
2002-02-18 19:13:48 +00:00
|
|
|
class Systemcall {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2002-05-30 02:24:33 +00:00
|
|
|
/// whether to wait for completion
|
1999-09-27 18:44:28 +00:00
|
|
|
enum Starttype {
|
2002-05-30 02:24:33 +00:00
|
|
|
Wait, //< wait for completion before returning from startscript()
|
|
|
|
DontWait //< don't wait for completion
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
2002-09-25 10:03:41 +00:00
|
|
|
|
2002-02-16 12:39:47 +00:00
|
|
|
/** Start child process.
|
2002-03-21 17:09:55 +00:00
|
|
|
* The string "what" contains a commandline with arguments separated
|
2002-02-18 19:13:48 +00:00
|
|
|
* by spaces.
|
2002-02-16 12:39:47 +00:00
|
|
|
*/
|
|
|
|
int startscript(Starttype how, string const & what);
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
2002-02-16 12:39:47 +00:00
|
|
|
|
2003-06-30 23:56:22 +00:00
|
|
|
} // namespace support
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-02-18 19:13:48 +00:00
|
|
|
#endif // SYSTEMCALL_H
|