Back to index

texmacs  1.0.7.15
Functions | Variables
texmacs_server.cpp File Reference
#include "tm_link.hpp"
#include "client_server.hpp"
#include "socket_server.hpp"
#include "scheme.hpp"

Go to the source code of this file.

Functions

void server_start ()
void server_stop ()
string server_read (int fd)
void server_write (int fd, string s)

Variables

static socket_server_repthe_server = NULL

Function Documentation

string server_read ( int  fd)

Definition at line 42 of file texmacs_server.cpp.

                     {
  tm_link ln= find_socket_link (fd);
  if (is_nil (ln)) return "";
  if (!ln->complete_packet (LINK_OUT)) return "";
  bool success;
  string back= ln->read_packet (LINK_OUT, 0, success);
  //cout << "Server read " << back << "\n";
  return back;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void server_start ( )

Definition at line 24 of file texmacs_server.cpp.

                {
  if (the_server == NULL) {
    (void) eval ("(use-modules (remote texmacs-server))");
    the_server= tm_new<socket_server_rep> (6561);
  }
  if (!the_server->alive)
    cout << "TeXmacs] Starting server... " << the_server->start () << "\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

void server_stop ( )

Definition at line 34 of file texmacs_server.cpp.

               {
  if (the_server != NULL) {
    tm_delete (the_server);
    the_server= NULL;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void server_write ( int  fd,
string  s 
)

Definition at line 53 of file texmacs_server.cpp.

                                {
  tm_link ln= find_socket_link (fd);
  if (is_nil (ln)) return;
  //cout << "Server write " << s << "\n";
  ln->write_packet (s, LINK_IN);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

socket_server_rep* the_server = NULL [static]

Definition at line 17 of file texmacs_server.cpp.