fbits.h 643 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright 1995, University Corporation for Atmospheric Research
  3. * See top level COPYRIGHT file for copying and redistribution conditions.
  4. */
  5. /* $Id: fbits.h,v 1.2 1995/05/26 20:46:46 davis Exp $ */
  6. #ifndef _FBITS_H_
  7. #define _FBITS_H_
  8. /*
  9. * Macros for dealing with flag bits.
  10. */
  11. #define fSet(t, f) ((t) |= (f))
  12. #define fClr(t, f) ((t) &= ~(f))
  13. #define fIsSet(t, f) ((t) & (f))
  14. #define fMask(t, f) ((t) & ~(f))
  15. /*
  16. * Propositions
  17. */
  18. /* a implies b */
  19. #define pIf(a,b) (!(a) || (b))
  20. /* a if and only if b, use == when it makes sense */
  21. #define pIff(a,b) (((a) && (b)) || (!(a) && !(b)))
  22. #endif /*!FBITS_H_*/