#include "support/Package.h"
#include "support/unicode.h"
-#include <boost/current_function.hpp>
-
#include <cerrno>
namespace lyx {
-using lyx::support::package;
+using support::package;
+
using std::endl;
using std::string;
#if 0
--#include <locale>
+#include <locale>
// This version of the Pimpl utilizes the message capability of
// libstdc++ that is distributed with GNU G++.
char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
int e = errno;
if (e) {
- LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
+ LYXERR(Debug::DEBUG, "Messages::get()" << '\n'
<< "Error code: " << errno << '\n'
<< "Lang, mess: " << lang_ << " " << m << '\n'
<< "Directory : " << package().locale_dir().absFilename() << '\n'
}
if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
- LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
+ LYXERR(Debug::DEBUG, "Messages::get()" << '\n'
<< "Error code: " << errno << '\n'
<< "Codeset : " << ucs4_codeset << '\n');
}
#include "support/lstrings.h"
#include <boost/filesystem/operations.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/scoped_ptr.hpp>
// getpid(), getppid()
string itoa(unsigned int i)
{
- return ::boost::lexical_cast<string>(i);
+ char buf[20];
+ sprintf(buf, "%d", i);
+ return buf;
}
-// Class IOWatch ------------------------------------------------------------
+/////////////////////////////////////////////////////////////////////
+//
+// IOWatch
+//
+/////////////////////////////////////////////////////////////////////
+
class IOWatch {
public:
IOWatch();
}
-bool IOWatch::isset(int fd) {
+bool IOWatch::isset(int fd)
+{
return FD_ISSET(fd, &act);
}
-// ~Class IOWatch ------------------------------------------------------------
-// Class LyXDataSocket -------------------------------------------------------
+
+/////////////////////////////////////////////////////////////////////
+//
+// LyXDataSocket
+//
+/////////////////////////////////////////////////////////////////////
+
// Modified LyXDataSocket class for use with the client
class LyXDataSocket {
public:
connected_ = false;
}
}
-// ~Class LyXDataSocket -------------------------------------------------------
-// Class CmdLineParser -------------------------------------------------------
+/////////////////////////////////////////////////////////////////////
+//
+// CmdLineParser
+//
+/////////////////////////////////////////////////////////////////////
+
class CmdLineParser {
public:
typedef int (*optfunc)(vector<docstring> const & args);
void usage()
{
- cerr << "Usage: lyxclient [options]" << endl
- << "Options are:" << endl
- << " -a address set address of the lyx socket" << endl
- << " -t directory set system temporary directory" << endl
- << " -p pid select a running lyx by pid" << endl
- << " -c command send a single command and quit" << endl
- << " -g file row send a command to go to file and row" << endl
- << " -n name set client name" << endl
- << " -h name display this help end exit" << endl
- << "If -a is not used, lyxclient will use the arguments of -t and -p to look for" << endl
- << "a running lyx. If -t is not set, 'directory' defaults to /tmp. If -p is set," << endl
- << "lyxclient will connect only to a lyx with the specified pid. Options -c and -g" << endl
- << "cannot be set simultaneoulsly. If no -c or -g options are given, lyxclient" << endl
- << "will read commands from standard input and disconnect when command read is BYE:"
- << endl;
+ cerr <<
+ "Usage: lyxclient [options]\n"
+ "Options are:\n"
+ " -a address set address of the lyx socket\n"
+ " -t directory set system temporary directory\n"
+ " -p pid select a running lyx by pidi\n"
+ " -c command send a single command and quit\n"
+ " -g file row send a command to go to file and row\n"
+ " -n name set client name\n"
+ " -h name display this help end exit\n"
+ "If -a is not used, lyxclient will use the arguments of -t and -p to look for\n"
+ "a running lyx. If -t is not set, 'directory' defaults to /tmp. If -p is set,\n"
+ "lyxclient will connect only to a lyx with the specified pid. Options -c and -g\n"
+ "cannot be set simultaneoulsly. If no -c or -g options are given, lyxclient\n"
+ "will read commands from standard input and disconnect when command read is BYE:"
+ << endl;
}
}
-docstring clientName(from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid())));
+docstring clientName =
+ from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid()));
int n(vector<docstring> const & arg)
{
} // namespace cmdline
-
} // namespace lyx