Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
tm_link.hpp File Reference
#include "tree.hpp"
#include "command.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tm_link_rep
class  tm_link

Defines

#define CONNECTION_DEAD   0
#define CONNECTION_DYING   1
#define WAITING_FOR_INPUT   2
#define WAITING_FOR_OUTPUT   3
#define DATA_BEGIN   ((char) 2)
#define DATA_END   ((char) 5)
#define DATA_COMMAND   ((char) 16)
#define DATA_ESCAPE   ((char) 27)
#define LINK_IN   0
#define LINK_OUT   0
#define LINK_ERR   1
#define SOCKET_DEFAULT   0
#define SOCKET_CLIENT   1
#define SOCKET_SERVER   2

Functions

 ABSTRACT_NULL_CODE (tm_link)
tm_link make_pipe_link (string cmd)
tm_link make_dynamic_link (string lib, string symb, string init, string ses)
tm_link make_socket_link (string h, int p, int t=SOCKET_DEFAULT, int fd=-1)
tm_link make_socket_server (int port)
tm_link find_socket_link (int fd)
void close_all_pipes ()
void process_all_pipes ()
void close_all_sockets ()
void close_all_servers ()
int number_of_servers ()

Define Documentation

#define CONNECTION_DEAD   0

Definition at line 17 of file tm_link.hpp.

#define CONNECTION_DYING   1

Definition at line 18 of file tm_link.hpp.

#define DATA_BEGIN   ((char) 2)

Definition at line 22 of file tm_link.hpp.

#define DATA_COMMAND   ((char) 16)

Definition at line 24 of file tm_link.hpp.

#define DATA_END   ((char) 5)

Definition at line 23 of file tm_link.hpp.

#define DATA_ESCAPE   ((char) 27)

Definition at line 25 of file tm_link.hpp.

#define LINK_ERR   1

Definition at line 29 of file tm_link.hpp.

#define LINK_IN   0

Definition at line 27 of file tm_link.hpp.

#define LINK_OUT   0

Definition at line 28 of file tm_link.hpp.

#define SOCKET_CLIENT   1

Definition at line 32 of file tm_link.hpp.

#define SOCKET_DEFAULT   0

Definition at line 31 of file tm_link.hpp.

#define SOCKET_SERVER   2

Definition at line 33 of file tm_link.hpp.

#define WAITING_FOR_INPUT   2

Definition at line 19 of file tm_link.hpp.

#define WAITING_FOR_OUTPUT   3

Definition at line 20 of file tm_link.hpp.


Function Documentation

void close_all_pipes ( )

Definition at line 103 of file pipe_link.cpp.

                   {
#ifndef __MINGW32__
  iterator<pointer> it= iterate (pipe_link_set);
  while (it->busy()) {
    pipe_link_rep* con= (pipe_link_rep*) it->next();
    if (con->alive) {
      if (-1 != killpg(con->pid,SIGTERM)) {
       sleep(2);
       killpg(con->pid,SIGKILL);
      }
      con->alive= false;
    }
  }
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 57 of file socket_server.cpp.

                     {
#ifndef __MINGW32__
  iterator<pointer> it= iterate (socket_server_set);
  while (it->busy()) {
    socket_server_rep* ss= (socket_server_rep*) it->next();
    if (ss->alive) {
      // FIXME: cleanly close the connection to the socket here
      ss->alive= false;
    }
  }
#endif
}

Here is the call graph for this function:

Definition at line 71 of file socket_link.cpp.

                     {
#ifndef __MINGW32__
  iterator<pointer> it= iterate (socket_link_set);
  while (it->busy()) {
    socket_link_rep* con= (socket_link_rep*) it->next();
    if (con->alive) {
      // FIXME: cleanly close the connection to the socket here
      con->alive= false;
    }
  }
#endif
}

Here is the call graph for this function:

Definition at line 61 of file socket_link.cpp.

                          {
  iterator<pointer> it= iterate (socket_link_set);
  while (it->busy()) {
    socket_link_rep* con= (socket_link_rep*) it->next();
    if (con->io == fd && con->alive) return tm_link (con);
  }
  return tm_link ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

tm_link make_dynamic_link ( string  lib,
string  symb,
string  init,
string  ses 
)

Definition at line 101 of file dyn_link.cpp.

                                                                         {
  return tm_new<dyn_link_rep> (lib, symb, init, session);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file pipe_link.cpp.

                            {
  return tm_new<pipe_link_rep> (cmd);
}

Here is the caller graph for this function:

tm_link make_socket_link ( string  h,
int  p,
int  t = SOCKET_DEFAULT,
int  fd = -1 
)

Definition at line 56 of file socket_link.cpp.

                                                           {
  return tm_new<socket_link_rep> (host, port, type, fd);
}

Here is the caller graph for this function:

tm_link make_socket_server ( int  port)

Definition at line 47 of file socket_server.cpp.

                              {
  return tm_new<socket_server_rep> (port);
}

Definition at line 52 of file socket_server.cpp.

                     {
  return N (socket_server_set);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 120 of file pipe_link.cpp.

                     {
  iterator<pointer> it= iterate (pipe_link_set);
  while (it->busy()) {
    pipe_link_rep* con= (pipe_link_rep*) it->next();
    if (con->alive) con->apply_command ();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: