~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to src/System/Link/socket_link.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : socket_link.cpp
 
4
* DESCRIPTION: TeXmacs links by sockets
 
5
* COPYRIGHT  : (C) 2000  Joris van der Hoeven
 
6
*******************************************************************************
 
7
* This software falls under the GNU general public license and comes WITHOUT
 
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
 
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
 
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
11
******************************************************************************/
 
12
 
 
13
#ifndef SOCKET_LINK_H
 
14
#define SOCKET_LINK_H
 
15
#include "tm_link.hpp"
 
16
 
 
17
/******************************************************************************
 
18
* The socket_link class
 
19
******************************************************************************/
 
20
 
 
21
struct socket_link_rep: tm_link_rep {
 
22
  string host;          // host for the socket
 
23
  int    port;          // port for the socket
 
24
  int    io;            // file descriptor for data going to the child
 
25
  string outbuf;        // pending output from plugin
 
26
 
 
27
public:
 
28
  socket_link_rep (string host, int port);
 
29
  ~socket_link_rep ();
 
30
 
 
31
  string start ();
 
32
  void   write (string s, int channel);
 
33
  string read (int channel);
 
34
  void   listen (int msecs);
 
35
  void   interrupt ();
 
36
  void   stop ();
 
37
 
 
38
  void   feed (int channel);
 
39
};
 
40
 
 
41
void listen_to_sockets ();
 
42
void close_all_sockets ();
 
43
 
 
44
#endif // SOCKET_LINK_H