From: André Pönitz Date: Tue, 27 Nov 2007 19:30:59 +0000 (+0000) Subject: cosmetics X-Git-Tag: 1.6.10~7172 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f5d02d7dc650bb62d83342156638891de199442e;p=features.git cosmetics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21821 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/client/Messages.cpp b/src/client/Messages.cpp index ca98849789..f19c154d8d 100644 --- a/src/client/Messages.cpp +++ b/src/client/Messages.cpp @@ -15,14 +15,13 @@ #include "support/Package.h" #include "support/unicode.h" -#include - #include namespace lyx { -using lyx::support::package; +using support::package; + using std::endl; using std::string; @@ -32,7 +31,7 @@ using std::string; #if 0 --#include +#include // This version of the Pimpl utilizes the message capability of // libstdc++ that is distributed with GNU G++. @@ -116,7 +115,7 @@ public: 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' @@ -124,7 +123,7 @@ public: } 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'); } diff --git a/src/client/client.cpp b/src/client/client.cpp index ec375f0539..9742dd10e0 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -18,7 +18,6 @@ #include "support/lstrings.h" #include -#include #include // getpid(), getppid() @@ -76,7 +75,9 @@ namespace support { string itoa(unsigned int i) { - return ::boost::lexical_cast(i); + char buf[20]; + sprintf(buf, "%d", i); + return buf; } @@ -161,7 +162,12 @@ int connect(FileName const & name) -// Class IOWatch ------------------------------------------------------------ +///////////////////////////////////////////////////////////////////// +// +// IOWatch +// +///////////////////////////////////////////////////////////////////// + class IOWatch { public: IOWatch(); @@ -213,13 +219,19 @@ bool IOWatch::wait() } -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: @@ -327,10 +339,14 @@ void LyXDataSocket::writeln(string const & line) connected_ = false; } } -// ~Class LyXDataSocket ------------------------------------------------------- -// Class CmdLineParser ------------------------------------------------------- +///////////////////////////////////////////////////////////////////// +// +// CmdLineParser +// +///////////////////////////////////////////////////////////////////// + class CmdLineParser { public: typedef int (*optfunc)(vector const & args); @@ -387,21 +403,22 @@ namespace cmdline { 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; } @@ -412,7 +429,8 @@ int h(vector const &) } -docstring clientName(from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid()))); +docstring clientName = + from_ascii(support::itoa(::getppid()) + ">" + support::itoa(::getpid())); int n(vector const & arg) { @@ -503,7 +521,6 @@ int p(vector const & arg) } // namespace cmdline - } // namespace lyx