* Full author contact details are available in file CREDITS.
*/
+#include <config.h>
+
#include "lyxsocket.h"
#include "debug.h"
#include "frontends/lyx_gui.h"
+#include "support/environment.h"
#include "support/lyxlib.h"
#include "support/socktools.h"
#include <cerrno>
+#if defined (_WIN32)
+# include <io.h>
+#endif
+
using boost::shared_ptr;
using std::auto_ptr;
// These env vars are used by DVI inverse search
// Needed by xdvi
- lyx::support::putenv("XEDITOR", "lyxclient -g %f %l");
+ lyx::support::setEnv("XEDITOR", "lyxclient -g %f %l");
// Needed by lyxclient
- lyx::support::putenv("LYXSOCKET", address_);
+ lyx::support::setEnv("LYXSOCKET", address_);
lyx_gui::register_socket_callback(
fd_,
- boost::bind(&LyXServerSocket::serverCallback, *this)
+ boost::bind(&LyXServerSocket::serverCallback, this)
);
lyxerr[Debug::LYXSERVER] << "lyx: New server socket "
lyx_gui::register_socket_callback(
client_fd,
boost::bind(&LyXServerSocket::dataCallback,
- *this, client_fd)
+ this, client_fd)
);
}
string const linen(line + '\n');
int const size = linen.size();
int const written = ::write(fd_, linen.c_str(), size);
- if (written < size) { // Allways mean end of connection.
+ if (written < size) { // Always mean end of connection.
if ((written == -1) && (errno == EPIPE)) {
// The program will also receive a SIGPIPE
// that must be caught
bool LyXDataSocket::readln(string & line)
{
int const charbuf_size = 100;
- char charbuf[charbuf_size]; // buffer for the ::read() system call
+ char charbuf[charbuf_size]; // buffer for the ::read() system call
int count;
// read and store characters in buffer
string const linen(line + '\n');
int const size = linen.size();
int const written = ::write(fd_, linen.c_str(), size);
- if (written < size) { // Allways mean end of connection.
+ if (written < size) { // Always mean end of connection.
if ((written == -1) && (errno == EPIPE)) {
// The program will also receive a SIGPIPE
// that must be catched