1997-11-27 18:06:33 +00:00
|
|
|
|
/* classes: h_files */
|
|
|
|
|
|
|
2001-08-31 10:42:19 +00:00
|
|
|
|
#ifndef SCM_ISELECT_H
|
|
|
|
|
|
#define SCM_ISELECT_H
|
1997-11-27 18:06:33 +00:00
|
|
|
|
|
2006-04-17 00:05:42 +00:00
|
|
|
|
/* Copyright (C) 1997,1998,2000,2001, 2002, 2006 Free Software Foundation, Inc.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
|
|
|
|
* as published by the Free Software Foundation; either version 3 of
|
|
|
|
|
|
* the License, or (at your option) any later version.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* This library is distributed in the hope that it will be useful, but
|
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
|
* Lesser General Public License for more details.
|
2001-08-31 10:42:19 +00:00
|
|
|
|
*
|
2003-04-05 19:15:35 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2009-06-17 00:22:09 +01:00
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
|
* 02110-1301 USA
|
2003-04-05 19:15:35 +00:00
|
|
|
|
*/
|
2001-08-31 10:42:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
1997-11-27 18:06:33 +00:00
|
|
|
|
|
|
|
|
|
|
#include "libguile/__scm.h"
|
|
|
|
|
|
|
1998-01-04 00:31:05 +00:00
|
|
|
|
/* Needed for FD_SET on some systems. */
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
2003-03-27 20:08:35 +00:00
|
|
|
|
#if SCM_HAVE_SYS_SELECT_H
|
|
|
|
|
|
# include <sys/select.h>
|
1997-11-27 18:06:33 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
2003-03-27 20:08:35 +00:00
|
|
|
|
#if SCM_HAVE_WINSOCK2_H
|
2003-03-25 23:57:11 +00:00
|
|
|
|
# include <winsock2.h>
|
2001-06-26 17:53:09 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
1997-11-27 18:06:33 +00:00
|
|
|
|
#ifdef FD_SET
|
|
|
|
|
|
|
|
|
|
|
|
#define SELECT_TYPE fd_set
|
|
|
|
|
|
#define SELECT_SET_SIZE FD_SETSIZE
|
|
|
|
|
|
|
|
|
|
|
|
#else /* no FD_SET */
|
|
|
|
|
|
|
|
|
|
|
|
/* Define the macros to access a single-int bitmap of descriptors. */
|
|
|
|
|
|
#define SELECT_SET_SIZE 32
|
|
|
|
|
|
#define SELECT_TYPE int
|
|
|
|
|
|
#define FD_SET(n, p) (*(p) |= (1 << (n)))
|
|
|
|
|
|
#define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
|
|
|
|
|
|
#define FD_ISSET(n, p) (*(p) & (1 << (n)))
|
|
|
|
|
|
#define FD_ZERO(p) (*(p) = 0)
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* no FD_SET */
|
|
|
|
|
|
|
2005-03-02 20:42:01 +00:00
|
|
|
|
SCM_API int scm_std_select (int fds,
|
|
|
|
|
|
SELECT_TYPE *rfds,
|
|
|
|
|
|
SELECT_TYPE *wfds,
|
|
|
|
|
|
SELECT_TYPE *efds,
|
|
|
|
|
|
struct timeval *timeout);
|
1998-04-20 00:39:45 +00:00
|
|
|
|
|
2001-08-31 10:42:19 +00:00
|
|
|
|
#endif /* SCM_ISELECT_H */
|
2000-03-19 19:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
|
c-file-style: "gnu"
|
|
|
|
|
|
End:
|
|
|
|
|
|
*/
|