home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / condor40.zip / CONDOR / src / h / condor_types.h < prev    next >
C/C++ Source or Header  |  1989-05-15  |  2KB  |  64 lines

  1. /* 
  2. ** Copyright 1986, 1987, 1988, 1989 University of Wisconsin
  3. ** 
  4. ** Permission to use, copy, modify, and distribute this software and its
  5. ** documentation for any purpose and without fee is hereby granted,
  6. ** provided that the above copyright notice appear in all copies and that
  7. ** both that copyright notice and this permission notice appear in
  8. ** supporting documentation, and that the name of the University of
  9. ** Wisconsin not be used in advertising or publicity pertaining to
  10. ** distribution of the software without specific, written prior
  11. ** permission.  The University of Wisconsin makes no representations about
  12. ** the suitability of this software for any purpose.  It is provided "as
  13. ** is" without express or implied warranty.
  14. ** 
  15. ** THE UNIVERSITY OF WISCONSIN DISCLAIMS ALL WARRANTIES WITH REGARD TO
  16. ** THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17. ** FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF WISCONSIN  BE LIABLE FOR
  18. ** ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19. ** WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  20. ** ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  21. ** OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22. ** 
  23. ** Authors:  Allan Bricker and Michael J. Litzkow,
  24. **              University of Wisconsin, Computer Sciences Dept.
  25. ** 
  26. */ 
  27.  
  28.  
  29. #if defined(sun) && defined(SUNOS32)
  30.  
  31. /*
  32. **    Sun seems to have defined an fd_set incorrectly (or
  33. **    at least in a strange way) for SunOS 3.2...
  34. */
  35. #ifndef    FD_SETSIZE
  36. #define    FD_SETSIZE    30
  37. #endif
  38.  
  39. typedef    long    fd_mask;
  40. #define    NFDBITS    (sizeof(fd_mask) * 8)        /* bits per mask */
  41. #ifndef    howmany
  42. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  43. #endif
  44.  
  45. /*
  46. **    typedef    struct fd_set {
  47. **        fd_mask    fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  48. **    } fd_set;
  49. */
  50.  
  51. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  52. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  53. #define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  54. #define FD_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  55. #define    FD_SET_SZ(n)    (howmany((n), NFDBITS) * sizeof(fd_mask))
  56.  
  57. #endif defined(sun) && defined(SUNOS32)
  58.  
  59. struct qelem {
  60.     struct qelem *q_forw;
  61.     struct qelem *q_back;
  62.     char    q_data[1];
  63. };
  64.