}
if (!ready_) {
- lyxerr << "LyXComm: Already disconnected" << endl;
+ LYXERR0("LyXComm: Already disconnected");
return;
}
return;
}
if (errno != 0) {
- lyxerr << "LyXComm: " << strerror(errno) << endl;
+ LYXERR0("LyXComm: " << strerror(errno));
if (!read_buffer_.empty()) {
- lyxerr << "LyXComm: truncated command: "
- << read_buffer_ << endl;
+ LYXERR0("LyXComm: truncated command: " << read_buffer_);
read_buffer_.erase();
}
break; // reset connection
void LyXComm::send(string const & msg)
{
if (msg.empty()) {
- lyxerr << "LyXComm: Request to send empty string. Ignoring."
- << endl;
+ LYXERR0("LyXComm: Request to send empty string. Ignoring.");
return;
}
if (pipename_.empty()) return;
if (!ready_) {
- lyxerr << "LyXComm: Pipes are closed. Could not send "
- << msg << endl;
+ LYXERR0("LyXComm: Pipes are closed. Could not send " << msg);
} else if (::write(outfd_, msg.c_str(), msg.length()) < 0) {
lyxerr << "LyXComm: Error sending message: " << msg
<< '\n' << strerror(errno)
}
+int compare(char const * a, char const * b, unsigned int len)
+{
+ using namespace std;
+ return strncmp(a, b, len);
+}
+
+
// Handle data gotten from communication, called by LyXComm
void Server::callback(string const & msg)
{
"Server: ignoring bye messge from unregistered client" << client);
}
} else {
- lyxerr <<"Server: Undefined server command "
- << cmd << '.' << endl;
+ LYXERR0("Server: Undefined server command " << cmd << '.');
}
return;
}
#endif
}
-///
-inline
-int compare(char const * a, char const * b, unsigned int len)
-{
-#ifndef CXX_GLOBAL_CSTD
- return std::strncmp(a, b, len);
-#else
- return strncmp(a, b, len);
-#endif
-}
-
///
bool isStrInt(std::string const & str);