/[gcl]/gcl/gcl-tk/comm.c
ViewVC logotype

Diff of /gcl/gcl-tk/comm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by camm, Sat Jul 20 07:10:55 2002 UTC revision 1.3 by camm, Sat Feb 15 00:38:27 2003 UTC
# Line 19  Line 19 
19  #endif  #endif
20    
21    
22  DEFUN("CHECK-FD-FOR-INPUT",object,fScheck_fd_for_input,  DEFUN_NEW("CHECK-FD-FOR-INPUT",object,fScheck_fd_for_input,
23        SI,2,2,NONE,OI,IO,OO,OO,        SI,2,2,NONE,OI,IO,OO,OO,(int fd,int timeout),
24    
25  "Check FD a file descriptor for data to read, waiting TIMEOUT clicks \  "Check FD a file descriptor for data to read, waiting TIMEOUT clicks \
26  for data to become available.  Here there are \  for data to become available.  Here there are \
27  INTERNAL-TIME-UNITS-PER-SECOND in one second.  Return is 1 if data \  INTERNAL-TIME-UNITS-PER-SECOND in one second.  Return is 1 if data \
28  available on FD, 0 if timeout reached and -1 if failed.")  available on FD, 0 if timeout reached and -1 if failed.")
   
      (fd,timeout)  
 int fd;  
 int timeout;  
29  {  {
30    fd_set inp;    fd_set inp;
31    int n;    int n;
# Line 79  setup_connection_state(fd) Line 75  setup_connection_state(fd)
75  }  }
76    
77  /* P is supposed to start with a hdr  and run N bytes. */  /* P is supposed to start with a hdr  and run N bytes. */
78  void  static void
79  scan_headers(sfd)  scan_headers(sfd)
80       struct connection_state *sfd;       struct connection_state *sfd;
81  { struct our_header *hdr;  { struct our_header *hdr;
# Line 118  send_confirmation(struct connection_stat Line 114  send_confirmation(struct connection_stat
114    
115  */    */  
116    
117  int  static int
118  read1(sfd,p,m,timeout)  read1(sfd,p,m,timeout)
119  struct connection_state* sfd;      struct connection_state* sfd;    
120  char *p;  char *p;
# Line 208  int m; Line 204  int m;
204  /* send BYTES chars from buffer P to CONNECTION.  /* send BYTES chars from buffer P to CONNECTION.
205     They are packaged up with a hdr */     They are packaged up with a hdr */
206    
207    static void
208    write_timeout_error(char *);
209    
210    static void
211    connection_failure(char *);
212    
213  int  int
214  write1(sfd,p,bytes)  write1(sfd,p,bytes)
215       struct connection_state *sfd;       struct connection_state *sfd;
# Line 255  write1(sfd,p,bytes) Line 257  write1(sfd,p,bytes)
257                
258  }          }        
259    
260  DEFUN("CLEAR-CONNECTION",object,fSclear_connection,SI,1,1,NONE,OI,OO,OO,OO,  DEFUN_NEW("CLEAR-CONNECTION",object,fSclear_connection,SI,1,1,NONE,OI,OO,OO,OO,(int fd),
261        "Read on FD until nothing left to read.  Return number of bytes read")        "Read on FD until nothing left to read.  Return number of bytes read")
      (fd)  
      int fd;  
262  {char buffer[0x1000];  {char buffer[0x1000];
263   int n=0;   int n=0;
264   while (fix(fScheck_fd_for_input(fd,0)))   while (fix(fScheck_fd_for_input(fd,0)))

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26