#include <config.h>
+#include "LyXRC.h"
+
#include "support/ConsoleApplication.h"
#include "support/debug.h"
#include "support/FileName.h"
#include "support/lstrings.h"
#include "support/Messages.h"
#include "support/unicode.h"
-
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
// getpid(), getppid()
#ifdef HAVE_SYS_TYPES_H
#include <map>
#include <iostream>
+
using namespace std;
using namespace lyx::support;
-using ::boost::scoped_ptr;
-
namespace lyx {
-// Dummy LyXRC support
-struct LyXRC {
- string icon_set;
-} lyxrc;
+// Required global variables
+bool verbose = false;
+LyXRC lyxrc;
// Keep the linker happy on Windows
void lyx_exit(int)
namespace support {
-string itoa(unsigned int i)
-{
- char buf[20];
- sprintf(buf, "%d", i);
- return buf;
-}
-
-
/// Returns the absolute pathnames of all lyx local sockets in
/// file system encoding.
/// Parts stolen from lyx::support::DirList().
string linen(line + '\n');
int size = linen.size();
int 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
+ // that must be caught
cerr << "lyxclient: connection closed while writing."
<< endl;
} else {
docstring clientName =
- from_ascii(itoa(::getppid()) + ">" + itoa(::getpid()));
+ from_ascii(to_string(::getppid()) + ">" + to_string(::getpid()));
int n(vector<docstring> const & arg)
{
<< endl;
return -1;
}
- singleCommand = "LYXCMD:server-goto-file-row "
- + arg[0] + ' '
- + arg[1];
+ singleCommand = "LYXCMD:command-sequence "
+ "server-goto-file-row "
+ + arg[0] + ' '
+ + arg[1] + "; " +
+ "lyx-activate";
return 2;
}
<< endl;
return -1;
}
- // -a supercedes LYXSOCKET environment variable
+ // -a supersedes LYXSOCKET environment variable
serverAddress = arg[0];
return 1;
}
return EXIT_FAILURE;
}
- scoped_ptr<LyXDataSocket> server;
+ unique_ptr<LyXDataSocket> server;
if (!cmdline::serverAddress.empty()) {
server.reset(new LyXDataSocket(FileName(to_utf8(cmdline::serverAddress))));
return app.exec();
}
-
-namespace boost {
-
-void assertion_failed(char const* a, char const* b, char const* c, long d)
-{
- lyx::lyxerr << "Assertion failed: " << a << ' ' << b << ' ' << c << ' '
- << d << '\n';
-}
-
-} // namespace boost