/[gcl]/gcl/o/sockets.c
ViewVC logotype

Diff of /gcl/o/sockets.c

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

revision 1.7 by camm, Wed Feb 26 22:21:37 2003 UTC revision 1.8 by camm, Sat Mar 1 22:37:37 2003 UTC
# Line 101  int w32_socket_exit(void) Line 101  int w32_socket_exit(void)
101  #define BIND_LAST_ADDRESS       65534  #define BIND_LAST_ADDRESS       65534
102  static unsigned int iLastAddressUsed = BIND_INITIAL_ADDRESS;  static unsigned int iLastAddressUsed = BIND_INITIAL_ADDRESS;
103    
104  DEFUN_NEW("OPEN-NAMED-SOCKET",object,fSopen_named_socket,SI,1,1,NONE,OI,OO,OO,OO,(int port),  DEFUN_NEW("OPEN-NAMED-SOCKET",object,fSopen_named_socket,SI,1,1,NONE,OI,OO,OO,OO,(fixnum port),
105  "Open a socket on PORT and return (cons fd portname) where file \  "Open a socket on PORT and return (cons fd portname) where file \
106  descriptor is a small fixnum which is the write file descriptor for \  descriptor is a small fixnum which is the write file descriptor for \
107  the socket.  If PORT is zero do automatic allocation of port")  the socket.  If PORT is zero do automatic allocation of port")
# Line 178  sockaddr_in addr; Line 178  sockaddr_in addr;
178    return make_cons(make_fixnum(s), small_fixnum(ntohs(addr.sin_port)));    return make_cons(make_fixnum(s), small_fixnum(ntohs(addr.sin_port)));
179  }  }
180    
181  DEFUN_NEW("CLOSE-FD",object,fSclose_fd,SI,1,1,NONE,OI,OO,OO,OO,(int fd),  DEFUN_NEW("CLOSE-FD",object,fSclose_fd,SI,1,1,NONE,OI,OO,OO,OO,(fixnum fd),
182        "Close the file descriptor FD")        "Close the file descriptor FD")
183    
184  {RETURN1(0==close(fd) ? Ct : Cnil);}  {RETURN1(0==close(fd) ? Ct : Cnil);}
# Line 308  DEFUN_NEW("CONNECTION-STATE-FD",object,f Line 308  DEFUN_NEW("CONNECTION-STATE-FD",object,f
308  { return make_fixnum(OBJ_TO_CONNECTION_STATE(sfd)->fd);  { return make_fixnum(OBJ_TO_CONNECTION_STATE(sfd)->fd);
309  }  }
310            
311  DEFUN_NEW("OUR-WRITE",object,fSour_write,SI,3,3,NONE,OO,OI,OO,OO,(object sfd,object buffer,int nbytes),"")  DEFUN_NEW("OUR-WRITE",object,fSour_write,SI,3,3,NONE,OO,OI,OO,OO,(object sfd,object buffer,fixnum nbytes),"")
312    
313  { return make_fixnum(write1(OBJ_TO_CONNECTION_STATE(sfd),buffer->ust.ust_self,nbytes));  { return make_fixnum(write1(OBJ_TO_CONNECTION_STATE(sfd),buffer->ust.ust_self,nbytes));
314  }  }
315    
316  DEFUN_NEW("OUR-READ-WITH-OFFSET",object,fSour_read_with_offset,SI,5,5,NONE,  DEFUN_NEW("OUR-READ-WITH-OFFSET",object,fSour_read_with_offset,SI,5,5,NONE,
317            OO,OI,II,OO,(object fd,object buffer,int offset,int nbytes,int timeout),            OO,OI,II,OO,(object fd,object buffer,fixnum offset,fixnum nbytes,fixnum timeout),
318        "Read from STATE-FD into string BUFFER putting data at OFFSET and reading NBYTES, waiting for TIMEOUT before failing")        "Read from STATE-FD into string BUFFER putting data at OFFSET and reading NBYTES, waiting for TIMEOUT before failing")
319    
320  { return make_fixnum(read1(OBJ_TO_CONNECTION_STATE(fd),&((buffer)->ust.ust_self[offset]),nbytes,timeout));  { return make_fixnum(read1(OBJ_TO_CONNECTION_STATE(fd),&((buffer)->ust.ust_self[offset]),nbytes,timeout));
# Line 473  not_defined_for_os() Line 473  not_defined_for_os()
473  { FEerror("Function not defined for this operating system",0);}  { FEerror("Function not defined for this operating system",0);}
474    
475    
476  DEFUN_NEW("SET-SIGIO-FOR-FD",object,fSset_sigio_for_fd,SI,1,1,NONE,OI,OO,OO,OO,(int fd),"")  DEFUN_NEW("SET-SIGIO-FOR-FD",object,fSset_sigio_for_fd,SI,1,1,NONE,OI,OO,OO,OO,(fixnum fd),"")
477    
478  {  {
479    /* for the moment we will use SIGUSR1 to notify, instead of depending on SIGIO,    /* for the moment we will use SIGUSR1 to notify, instead of depending on SIGIO,
# Line 502  DEFUN_NEW("SET-SIGIO-FOR-FD",object,fSse Line 502  DEFUN_NEW("SET-SIGIO-FOR-FD",object,fSse
502    
503  }  }
504            
505  DEFUN_NEW("RESET-STRING-INPUT-STREAM",object,fSreset_string_input_stream,SI,4,4,NONE,OO,OI,IO,OO,(object strm,object string,int start,int end),  DEFUN_NEW("RESET-STRING-INPUT-STREAM",object,fSreset_string_input_stream,SI,4,4,NONE,OO,OI,IO,OO,(object strm,object string,fixnum start,fixnum end),
506        "Reuse a string output STREAM by setting its output to STRING \        "Reuse a string output STREAM by setting its output to STRING \
507  and positioning the ouput/input to start at START and end at END")  and positioning the ouput/input to start at START and end at END")
508    
# Line 512  and positioning the ouput/input to start Line 512  and positioning the ouput/input to start
512    return strm;    return strm;
513  }  }
514    
515  DEFUN_NEW("CHECK-STATE-INPUT",object,fScheck_state_input,SI,2,2,NONE,OO,IO,OO,OO,(object osfd,int timeout),  DEFUN_NEW("CHECK-STATE-INPUT",object,fScheck_state_input,SI,2,2,NONE,OO,IO,OO,OO,(object osfd,fixnum timeout),
516        "")        "")
517  {  {
518    return fScheck_dsfd_for_input(OBJ_TO_CONNECTION_STATE(osfd),timeout);    return fScheck_dsfd_for_input(OBJ_TO_CONNECTION_STATE(osfd),timeout);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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