+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * Chktex.C:
+ * LaTeX.C:
+ * LyXSendto.C:
+ * converter.C:
+ * lyx_cb.C:
+ * vc-backend.C: Changes due to the renaming of support/syscall.[Ch] as
+ support/systemcall.[Ch] and of class Systemcalls as class SystemCall.
+
+ * lyxfunc.C:
+ * vc-backend.h: remove #include "support/syscall.h"
+
+ * LaTeX.C:
+ * LyXSendto.C:
+ * converter.C: rearrange #includes in Lars' approved fashion.
+
+ * LyXView.[Ch]: make autosave_timeout a pointer to Timeout. Can thus
+ forward declare class Timeout in the header file.
+
+ * XFormsView.C: changes due to the above.
+
+ * minibuffer.[Ch]: make timer and stored_timer pointers to Timeout,
+ similar to LyXView.
+
+ * commandtags.h: add LFUN_FORKS_SHOW and LFUN_FORKS_KILL to the enum.
+ * LyXAction.C (init): add LFUN_FORKS_SHOW and LFUN_FORKS_KILL to items[]
+
2002-02-18 José Matos <jamatos@fep.up.pt>
* buffer.C (simpleDocBookOnePar): if paragraph style is CDATA escapes
* Chktex.C:
* buffer.C:
- remove #include "support/syscall.h" as it's redundant. Always has been.
+ remove #include "support/syscontr.h" as it's redundant. Always has been.
* Chktex.C:
* LaTeX.C:
#include "support/FileInfo.h"
#include "support/filetools.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "support/path.h"
#include "support/lstrings.h"
// run bibtex
string log = OnlyFilename(ChangeExtension(file, ".log"));
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
- Systemcalls one;
- int result= one.startscript(Systemcalls::Wait, tmp);
+ Systemcall one;
+ int result= one.startscript(Systemcall::Wait, tmp);
if (result == 0) {
result = scanLogFile(terr);
} else {
#include <fstream>
#include "LaTeX.h"
+#include "bufferlist.h"
+#include "gettext.h"
+#include "lyx_gui_misc.h"
+#include "lyxfunc.h"
+#include "debug.h"
#include "support/filetools.h"
-#include "support/os.h"
#include "support/FileInfo.h"
-#include "debug.h"
-#include "support/lyxlib.h"
-#include "support/syscall.h"
-#include "support/path.h"
#include "support/LRegex.h"
#include "support/LSubstring.h"
#include "support/lstrings.h"
-#include "bufferlist.h"
-#include "gettext.h"
-#include "lyx_gui_misc.h"
-#include "lyxfunc.h"
+#include "support/lyxlib.h"
+#include "support/systemcall.h"
+#include "support/os.h"
+#include "support/path.h"
using std::ifstream;
using std::getline;
#else // cmd.exe (OS/2) causes SYS0003 error at "/dev/null"
string tmp = cmd + ' ' + file + " > nul";
#endif
- Systemcalls one;
- return one.startscript(Systemcalls::Wait, tmp);
+ Systemcall one;
+ return one.startscript(Systemcall::Wait, tmp);
}
// to come for a later time. (0.13 perhaps?)
string tmp = "makeindex -c -q ";
tmp += f;
- Systemcalls one;
- one.startscript(Systemcalls::Wait, tmp);
+ Systemcall one;
+ one.startscript(Systemcall::Wait, tmp);
return true;
}
string tmp = "bibtex ";
tmp += OnlyFilename(ChangeExtension(it->aux_file, string()));
- Systemcalls one;
- one.startscript(Systemcalls::Wait, tmp);
+ Systemcall one;
+ one.startscript(Systemcall::Wait, tmp);
}
// Return whether bibtex was run
return result;
N_("Display information about LyX"), NoBuffer },
{ LFUN_HELP_TEXINFO, "help-Texinfo",
N_("Display information about the TeX installation"), NoBuffer },
+ { LFUN_FORKS_SHOW, "show-forks",
+ N_("Show the processes forked by LyX"), NoBuffer },
+ { LFUN_FORKS_KILL, "kill-forks",
+ N_("Kill the forked process with this PID"), NoBuffer },
{ LFUN_NOACTION, "", "", Noop }
};
#include "lyx_main.h"
#include "lyxrc.h"
#include "LString.h"
-#include "support/filetools.h"
-#include "support/path.h"
#include "buffer.h"
#include "lyx_gui_misc.h"
-#include "support/syscall.h"
-#include "support/lstrings.h"
#include "gettext.h"
#include "bufferview_funcs.h"
#include "exporter.h"
#include "BufferView.h"
+#include "support/filetools.h"
+#include "support/lstrings.h"
+#include "support/path.h"
+#include "support/systemcall.h"
+
extern FD_form_sendto * fd_form_sendto;
extern BufferView * current_view;
extern int MakeLaTeXOutput(Buffer * buffer);
// create the .txt file in tmp_dir if this filetype is requested
if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
buffer->writeFileAscii(fname, lyxrc.ascii_linelen);
- Systemcalls one;
- one.startscript(Systemcalls::Wait, command);
+ Systemcall one;
+ one.startscript(Systemcall::Wait, command);
}
#include "frontends/Dialogs.h"
#include "frontends/Toolbar.h"
+#include "frontends/Timeout.h"
#include "frontends/Menubar.h"
#include "support/filetools.h" // OnlyFilename()
intl = new Intl;
+ // Give the timeout some default sensible value.
+ autosave_timeout = new Timeout(5000);
+
dialogs_ = new Dialogs(this);
// temporary until all dialogs moved into Dialogs.
dialogs_->updateBufferDependent
delete minibuffer;
delete lyxfunc;
delete intl;
+ delete autosave_timeout;
delete dialogs_;
}
void LyXView::resetAutosaveTimer()
{
if (lyxrc.autosave)
- autosave_timeout.restart();
+ autosave_timeout->restart();
}
#include <sigc++/signal_system.h>
#include "LString.h"
-#include "frontends/Timeout.h"
#include "support/types.h"
class Buffer;
class BufferView;
class Dialogs;
class LyXFunc;
+class Timeout;
///
class LyXView : public SigC::Object, boost::noncopyable {
///
Intl * intl;
///
- Timeout autosave_timeout;
+ Timeout * autosave_timeout;
/// A callback
void AutoSave();
///
#include "support/filetools.h" // OnlyFilename()
#include "frontends/Toolbar.h"
#include "frontends/Menubar.h"
+#include "frontends/Timeout.h"
#include "MenuBackend.h"
#include "ToolbarDefaults.h"
#include "lyxfunc.h"
// TIMERS
//
- autosave_timeout.timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
+ autosave_timeout->timeout.connect(SigC::slot(this, &XFormsView::AutoSave));
//
// Misc
// Start autosave timer
if (lyxrc.autosave) {
- autosave_timeout.setTimeout(lyxrc.autosave * 1000);
- autosave_timeout.start();
+ autosave_timeout->setTimeout(lyxrc.autosave * 1000);
+ autosave_timeout->start();
}
intl->InitKeyMapper(lyxrc.use_kbmap);
LFUN_HELP_ABOUTLYX, // Edwin 20010712
LFUN_THESAURUS_ENTRY, // Levon 20010720
LFUN_HELP_TEXINFO, // Herbert 20011001
+ LFUN_FORKS_SHOW, // Angus 16 Feb 2002
+ LFUN_FORKS_KILL, // Angus 16 Feb 2002
LFUN_LASTACTION /* this marks the end of the table */
};
#include "converter.h"
#include "lyxrc.h"
-#include "support/syscall.h"
-#include "support/path.h"
-#include "support/filetools.h"
#include "buffer.h"
#include "bufferview_funcs.h"
#include "LaTeX.h"
#include "LyXView.h"
#include "lyx_gui_misc.h"
#include "lyx_cb.h" // ShowMessage()
-#include "support/lyxfunctional.h"
-#include "frontends/Alert.h"
#include "gettext.h"
#include "BufferView.h"
#include "debug.h"
+#include "frontends/Alert.h"
+
+#include "support/filetools.h"
+#include "support/lyxfunctional.h"
+#include "support/path.h"
+#include "support/systemcall.h"
+
using std::vector;
using std::queue;
using std::endl;
ShowMessage(buffer, _("Executing command:"), command);
Path p(OnlyPath(filename));
- Systemcalls one;
- int const res = one.startscript(Systemcalls::DontWait, command);
+ Systemcall one;
+ int const res = one.startscript(Systemcall::DontWait, command);
if (res) {
Alert::alert(_("Cannot view file"),
if (buffer)
ShowMessage(buffer, _("Executing command:"), command);
- Systemcalls::Starttype type = (dummy)
- ? Systemcalls::DontWait : Systemcalls::Wait;
- Systemcalls one;
+ Systemcall::Starttype type = (dummy)
+ ? Systemcall::DontWait : Systemcall::Wait;
+ Systemcall one;
int res;
if (conv.original_dir && buffer) {
Path p(buffer->filePath());
string const command2 = conv.parselog +
" < " + QuoteName(infile2 + ".out") +
" > " + QuoteName(logfile);
- one.startscript(Systemcalls::Wait, command2);
+ one.startscript(Systemcall::Wait, command2);
if (!scanLog(buffer, command, logfile))
return false;
}
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * Liason.C: Changes due to the renaming of support/syscall.[Ch] as
+ support/systemcall.[Ch] and of class Systemcalls as class SystemCall.
+ Rearrange #includes in Lars' approved fashion.
+
+ * Timeout.[Ch] (running): new method.
+ (default c-tor): removed.
+
+ * Dialogs.h: added a new signal, showForks.
+
2002-02-16 Angus Leeming <a.leeming@ic.ac.uk>
* Liason.C:
SigC::Signal1<void, InsetExternal *> showExternal;
/// show the contents of a file.
SigC::Signal1<void, string const &> showFile;
+ /// show all forked child processes
+ SigC::Signal0<void> showForks;
///
SigC::Signal1<void, InsetGraphics *> showGraphics;
/// show the details of a LyX file include inset
#endif
#include "Liason.h"
+#include "lyxrc.h"
+#include "PrinterParams.h"
+
#include "LyXView.h"
#include "BufferView.h"
#include "buffer.h"
-#include "lyxrc.h"
-#include "PrinterParams.h"
+#include "exporter.h"
+#include "converter.h"
#include "lyx_gui_misc.h"
+
#include "support/LAssert.h"
#include "support/lstrings.h"
#include "support/filetools.h"
#include "support/path.h"
-#include "exporter.h"
-#include "converter.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
using std::endl;
// 1. we print to a file
// 2. we print direct to a printer
// 3. we print using a spool command (print to file first)
- Systemcalls one;
+ Systemcall one;
int res = 0;
string dviname = ChangeExtension(buffer->getLatexName(true), "dvi");
switch (pp.target) {
command2 += QuoteName(psname);
// First run dvips.
// If successful, then spool command
- res = one.startscript(Systemcalls::Wait, command);
+ res = one.startscript(Systemcall::Wait, command);
if (res == 0)
- res = one.startscript(Systemcalls::DontWait,
+ res = one.startscript(Systemcall::DontWait,
command2);
} else
// case 2
- res = one.startscript(Systemcalls::DontWait,
+ res = one.startscript(Systemcall::DontWait,
command + QuoteName(dviname));
break;
command += lyxrc.print_to_file
+ QuoteName(MakeAbsPath(pp.file_name, path));
command += ' ' + QuoteName(dviname);
- res = one.startscript(Systemcalls::DontWait, command);
+ res = one.startscript(Systemcall::DontWait, command);
break;
}
return res == 0;
#include "Timeout_pimpl.h"
-Timeout::Timeout()
- : type(ONETIME), timeout_ms(0)
-{
- pimpl_ = new Pimpl(this);
-}
-
Timeout::Timeout(unsigned int msec, Type t)
: type(t), timeout_ms(msec)
}
+bool Timeout::running() const
+{
+ return pimpl_->running();
+}
+
+
void Timeout::start()
{
pimpl_->start();
CONTINUOUS
};
///
- Timeout();
- ///
Timeout(unsigned int msec, Type = ONETIME);
///
~Timeout();
+ /// Is the timer running?
+ bool running() const;
/// start the timer
void start();
/// stop the timer
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * helper_funcs.h: wrap the structs firster and seconder up in a
+ namespace to avoid clashes with those in lyxalgo,h.
+
+ * ControlTexinfo.C Changes due to the renaming of support/syscall.[Ch]
+ as support/systemcall.[Ch] and of class Systemcalls as class SystemCall.
+
2002-02-16 Angus Leeming <a.leeming@ic.ac.uk>
* ControlGraphics.C: remove #include "support/syscall.h" as it's not
#include "BufferView.h"
#include "gettext.h"
#include "support/filetools.h" // FileSearch
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "support/path.h"
#include "helper_funcs.h"
#include "support/lstrings.h"
{
// Run rescan in user lyx directory
Path p(user_lyxdir);
- Systemcalls one;
- one.startscript(Systemcalls::Wait,
+ Systemcall one;
+ one.startscript(Systemcall::Wait,
LibFileSearch("scripts", "TeXFiles.sh"));
p.pop();
}
Path p(user_lyxdir);
//path to texhash through system
- Systemcalls one;
- one.startscript(Systemcalls::Wait, "texhash");
+ Systemcall one;
+ one.startscript(Systemcall::Wait, "texhash");
p.pop();
// Alert::alert(_("texhash run!"),
vector<pair<A,B> >
*/
+namespace hide {
+
template<class Pair>
struct firster {
typedef typename Pair::first_type first_type;
typedef typename Pair::second_type second_type;
second_type const & operator()(Pair const & p) { return p.second; }
};
+
+}
///
template<class Pair>
getFirst(std::vector<Pair> const & pr)
{
std::vector<typename Pair::first_type> tmp(pr.size());
- std::transform(pr.begin(), pr.end(), tmp.begin(), firster<Pair>());
+ std::transform(pr.begin(), pr.end(), tmp.begin(),
+ hide::firster<Pair>());
return tmp;
}
getSecond(std::vector<Pair> const & pr)
{
std::vector<typename Pair::second_type> tmp(pr.size());
- std::transform(pr.begin(), pr.end(), tmp.begin(), seconder<Pair>());
+ std::transform(pr.begin(), pr.end(), tmp.begin(),
+ hide::seconder<Pair>());
return tmp;
}
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * Timeout_pimpl.[Ch] (running): new method.
+
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* FormParagraph.C:
}
+bool Timeout::Pimpl::running() const
+{
+ return timeout_id != -1;
+}
+
+
void Timeout::Pimpl::start()
{
if (timeout_id != -1)
public:
///
Pimpl(Timeout * owner_);
+ /// Is the timer running?
+ bool running() const;
/// start the timer
void start();
/// stop the timer
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * insetexternal.C Changes due to the renaming of support/syscall.[Ch]
+ as support/systemcall.[Ch] and of class Systemcalls as class SystemCall.
+
2002-02-18 José Matos <jamatos@fep.up.pt>
* insetinclude.C (validate): some code only applies to latex buffers,
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/path.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "support/FileInfo.h"
#include <cstdio>
Buffer const * buffer) const
{
Path p(buffer->filePath());
- Systemcalls one;
+ Systemcall one;
if (lyxerr.debugging()) {
lyxerr << "Executing '" << s << "' in '"
<< buffer->filePath() << "'" << endl;
}
- one.startscript(Systemcalls::Wait, s);
+ one.startscript(Systemcall::Wait, s);
}
#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/path.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "support/lstrings.h"
#include <fstream>
// Run configure in user lyx directory
Path p(user_lyxdir);
- Systemcalls one;
- one.startscript(Systemcalls::Wait,
+ Systemcall one;
+ one.startscript(Systemcall::Wait,
AddName(system_lyxdir, "configure"));
p.pop();
bv->owner()->message(_("Reloading configuration..."));
#include "support/LAssert.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
-#include "support/syscall.h"
#include "support/lstrings.h"
#include "support/path.h"
#include "support/lyxfunctional.h"
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * formula.C Changes due to the renaming of support/syscall.[Ch]
+ as support/systemcall.[Ch] and of class Systemcalls as class SystemCall.
+
2002-02-16 Angus Leeming <a.leeming@ic.ac.uk>
* formula.C: change Systemcalls::System to Systemcalls::Wait and
#include "support/LOstream.h"
#include "support/LAssert.h"
#include "support/lyxlib.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "support/lstrings.h"
#include "support/filetools.h" // LibFileSearch
#include "LyXView.h"
string outfile = lyx::tempName(string(), "mathextern");
string full = "echo '" + data + "' | (" + cmd + ") > " + outfile;
lyxerr << "calling: " << full << "\n";
- Systemcalls dummy;
- dummy.startscript(Systemcalls::Wait, full);
+ Systemcall dummy;
+ dummy.startscript(Systemcall::Wait, full);
string out = GetFileContents(outfile);
lyx::unlink(outfile);
lyxerr << "result: '" << out << "'\n";
#include "gettext.h"
#include "LyXAction.h"
#include "BufferView.h"
+#include "frontends/Timeout.h"
#include <cctype>
: stored_(false), owner_(o), state_(spaces)
{
add(FL_NORMAL_INPUT, x, y, h, w);
- timer.setTimeout(6000);
- timer.timeout.connect(slot(this, &MiniBuffer::init));
- stored_timer.setTimeout(1500);
- stored_timer.timeout.connect(slot(this, &MiniBuffer::stored_slot));
+
+ timer = new Timeout(600);
+ timer->timeout.connect(slot(this, &MiniBuffer::init));
+
+ stored_timer = new Timeout(1500);
+ stored_timer->timeout.connect(slot(this, &MiniBuffer::stored_slot));
deactivate();
}
MiniBuffer::~MiniBuffer()
{
+ delete timer;
+ delete stored_timer;
delete dropdown_;
}
{
stored_input = str;
stored_ = true;
- stored_timer.start();
+ stored_timer->start();
}
char const * tmp = fl_get_input(ob);
string input = tmp ? tmp : "";
if (stored_) {
- stored_timer.stop();
+ stored_timer->stop();
input = stored_input;
set_input(input);
stored_ = false;
void MiniBuffer::message(string const & str)
{
- timer.restart();
+ timer->restart();
string const ntext = strip(str);
if (!the_buffer->focus) {
set_input(ntext);
return;
timeout.emit();
- timer.stop();
+ timer->stop();
}
#include FORMS_H_LOCATION
#include "LString.h"
-#include "frontends/Timeout.h"
#ifdef __GNUG__
#pragma interface
class LyXView;
class DropDown;
+class Timeout;
///
class MiniBuffer : public SigC::Object {
///
FL_OBJECT * add(int, FL_Coord, FL_Coord, FL_Coord, FL_Coord);
///
- Timeout timer;
+ Timeout * timer;
///
- Timeout stored_timer;
+ Timeout * stored_timer;
/// the dropdown menu
DropDown * dropdown_;
///
+2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * syscall.[Ch]: renamed as systemcall.[Ch]. class Systemcalls renamed
+ as class SystemCall because one Systemcall instance represents a
+ single child process.
+
+ * filetools.C:
+ * Makefile.am: associated changes.
+
2002-02-18 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* syscall.C (Systemcalls): include <cstdlib>
snprintf.h \
snprintf.c \
sstream.h \
- $(REGEX) syscall.C \
- syscall.h \
+ $(REGEX) systemcall.C \
+ systemcall.h \
tempname.C \
textutils.h \
translator.h \
#include <cerrno>
#include "debug.h"
#include "support/lstrings.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include "filetools.h"
#include "LSubstring.h"
string const tempfile = lyx::tempName(string(), file);
// Run gunzip
string const command = "gunzip -c " + zipped_file + " > " + tempfile;
- Systemcalls one;
- one.startscript(Systemcalls::Wait, command);
+ Systemcall one;
+ one.startscript(Systemcall::Wait, command);
// test that command was executed successfully (anon)
// yes, please do. (Lgb)
return tempfile;
+++ /dev/null
-/**
- * \file syscall.C
- * Copyright 2002 the LyX Team
- * Read the file COPYING
- *
- * \author Asger Alstrup
- *
- * Interface cleaned up by
- * \author Angus Leeming <a.leeming@ic.ac.uk>
- *
- * Class Systemcalls 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.
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include <cstdlib> //for ::system
-
-#include "syscall.h"
-#include "os.h"
-
-#if 0
-Systemcalls::Systemcalls(Starttype how, string const & what)
-{
- startscript(how, what);
-}
-#endif
-
-
-// Reuse of instance
-int Systemcalls::startscript(Starttype how, string const & what)
-{
- string command = what;
-
- if (how == DontWait) {
- if (os::shell() == os::UNIX) {
- command += " &";
- } else {
- command = "start /min/n " + command;
- }
- }
-
- return ::system(command.c_str());
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file syscall.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
- *
- * \author Asger Alstrup
- *
- * Interface cleaned up by
- * \author Angus Leeming <a.leeming@ic.ac.uk>
- *
- * Class Systemcalls 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.
- */
-
-#ifndef SYSCALL_H
-#define SYSCALL_H
-
-#include "LString.h"
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-class Systemcalls {
-public:
- ///
- enum Starttype {
- ///
- Wait,
- ///
- DontWait
- };
-
- ///
- Systemcalls() {}
-
-#if 0
- /** Generate instance and start child process.
- * The string "what" contains a commandline with arguments separated
- * by spaces.
- */
- Systemcalls(Starttype how, string const & what);
-#endif
-
- /** Start child process.
- * This is for reuse of the Systemcalls instance.
- */
- int startscript(Starttype how, string const & what);
-};
-
-#endif // SYSCALL_H
--- /dev/null
+/**
+ * \file systemcall.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger Alstrup
+ *
+ * Interface cleaned up by
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ *
+ * 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.
+ */
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "systemcall.h"
+#include "os.h"
+
+#include <cstdlib> //for ::system
+
+
+#if 0
+Systemcall::Systemcall(Starttype how, string const & what)
+{
+ startscript(how, what);
+}
+#endif
+
+
+// Reuse of instance
+int Systemcall::startscript(Starttype how, string const & what)
+{
+ string command = what;
+
+ if (how == DontWait) {
+ if (os::shell() == os::UNIX) {
+ command += " &";
+ } else {
+ command = "start /min/n " + command;
+ }
+ }
+
+ return ::system(command.c_str());
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file systemcall.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Asger Alstrup
+ *
+ * Interface cleaned up by
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
+ *
+ * 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.
+ */
+
+#ifndef SYSTEMCALL_H
+#define SYSTEMCALL_H
+
+#include "LString.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class Systemcall {
+public:
+ ///
+ enum Starttype {
+ ///
+ Wait,
+ ///
+ DontWait
+ };
+
+#if 0
+ ///
+ Systemcall() {}
+
+ /** Generate instance and start child process.
+ * The string "what" contains a commandline with arguments separated
+ * by spaces.
+ */
+ Systemcall(Starttype how, string const & what);
+#endif
+
+ /** Start child process.
+ * The string "what" contains a commandline with arguments separated
+ * by spaces.
+ */
+ int startscript(Starttype how, string const & what);
+};
+
+#endif // SYSTEMCALL_H
#include "support/path.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/syscall.h"
+#include "support/systemcall.h"
#include <fstream>
int VCS::doVCCommand(string const & cmd, string const & path)
{
lyxerr[Debug::LYXVC] << "doVCCommand: " << cmd << endl;
- Systemcalls one;
+ Systemcall one;
Path p(path);
- int const ret = one.startscript(Systemcalls::Wait, cmd);
+ int const ret = one.startscript(Systemcall::Wait, cmd);
return ret;
}
#endif
#include "LString.h"
-#include "support/syscall.h"
class Buffer;