Back to index

radiance  4R0+20100331
selcall.h
Go to the documentation of this file.
00001 /* RCSid $Id: selcall.h,v 3.10 2003/07/14 22:23:59 schorsch Exp $ */
00002 /*
00003  * header file for select call compatibility
00004  */
00005 #ifndef _RAD_SELCALL_H_
00006 #define _RAD_SELCALL_H_
00007 
00008 #include <string.h>
00009 #include <sys/types.h>
00010 #ifdef _WIN32
00011   /*#include <winsock2.h>*/
00012 #else
00013   #include <sys/time.h>
00014 #endif
00015 #ifdef INCL_SEL_H
00016 #include <sys/select.h>
00017 #endif
00018 
00019 #ifndef FD_SETSIZE
00020 #ifdef _WIN32
00021 #else
00022   #include <sys/param.h>
00023 #endif
00024 #define FD_SETSIZE   NOFILE        /* maximum # select file descriptors */
00025 #endif
00026 #ifndef FD_SET
00027 #ifndef NFDBITS
00028 #define NFDBITS             (8*sizeof(int))      /* number of bits per fd_mask */
00029 #endif
00030 #define       FD_SET(n, p)  ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
00031 #define       FD_CLR(n, p)  ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
00032 #define       FD_ISSET(n, p)       ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
00033 #define FD_ZERO(p)   memset((char *)(p), 0, sizeof(*(p)))
00034 #endif
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 /* nothing yet */
00041 
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045 #endif /* _RAD_SELCALL_H_ */