File: fbits.h

package info (click to toggle)
xdmf 2.1.dfsg.1-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 29,484 kB
  • sloc: ansic: 260,210; cpp: 95,960; python: 6,378; yacc: 687; fortran: 291; xml: 200; f90: 131; lex: 125; makefile: 17; sh: 1
file content (26 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 *   Copyright 1995, University Corporation for Atmospheric Research
 *   See top level COPYRIGHT file for copying and redistribution conditions.
 */
/* $Id: fbits.h,v 1.1 2010-01-06 16:34:05 kwleiter Exp $ */

#ifndef _FBITS_H_
#define _FBITS_H_

/*
 * Macros for dealing with flag bits.
 */
#define fSet(t, f)       ((t) |= (f))
#define fClr(t, f)       ((t) &= ~(f))
#define fIsSet(t, f)     ((t) & (f))
#define fMask(t, f)     ((t) & ~(f))

/*
 * Propositions
 */
/* a implies b */
#define pIf(a,b) (!(a) || (b))
/* a if and only if b, use == when it makes sense */
#define pIff(a,b) (((a) && (b)) || (!(a) && !(b)))

#endif /*!FBITS_H_*/