X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxserver.C;h=719412757e8930080993a5691f35a3dabbed1ee7;hb=a858be7332e331e0244e4dba7b0931b6072ffd3d;hp=6bfed35380753279c8485c01f01465899171b69e;hpb=35584afc1162dec2cf9fff79305e95cb3b75aefb;p=lyx.git diff --git a/src/lyxserver.C b/src/lyxserver.C index 6bfed35380..719412757e 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -79,6 +79,10 @@ int mkfifo( char *__path, mode_t __mode ) { extern LyXAction lyxaction; +// C wrapper +extern "C" void C_LyXComm_callback(int fd, void *v); + + // LyXComm class // Open pipes @@ -148,7 +152,7 @@ void LyXComm::openConnection() { << strerror(errno) << endl; return; } - fl_add_io_callback(infd, FL_READ, callback, (void*)this); + fl_add_io_callback(infd, FL_READ, C_LyXComm_callback, (void*)this); // --- prepare output pipe --------------------------------------- @@ -234,7 +238,7 @@ void LyXComm::closeConnection() { } if(infd > -1) { - fl_remove_io_callback(infd, FL_READ, callback); + fl_remove_io_callback(infd, FL_READ, C_LyXComm_callback); string tmp = pipename + ".in"; #ifdef __EMX__ // Notify the operating system. @@ -337,7 +341,7 @@ void LyXComm::callback(int fd, void *v) { lyxerr << "LyxComm: truncated command: " << lsbuf << endl; - lsbuf.erase(); + lsbuf.clear(); } break; // reset connection } @@ -346,6 +350,12 @@ void LyXComm::callback(int fd, void *v) c->openConnection(); errno=0; } + +extern "C" void C_LyXComm_callback(int fd, void *v) +{ + LyXComm::callback(fd, v); +} + void LyXComm::send(string const & msg) { if (msg.empty()) { @@ -485,7 +495,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg) } if (inumclients) { serv->numclients--; - serv->clients[i].erase(); + serv->clients[i].clear(); lyxerr[Debug::LYXSERVER] << "LyXServer: Client " << client << " said goodbye"