]> git.lyx.org Git - lyx.git/blobdiff - src/lyxserver.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / lyxserver.C
index 6bfed35380753279c8485c01f01465899171b69e..719412757e8930080993a5691f35a3dabbed1ee7 100644 (file)
@@ -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 (i<serv->numclients) {
                                        serv->numclients--;
-                                       serv->clients[i].erase();
+                                       serv->clients[i].clear();
                                        lyxerr[Debug::LYXSERVER]
                                                << "LyXServer: Client "
                                                << client << " said goodbye"