Generated from the b-test.def file:
/* -*- buffer-read-only: t -*- vi: set ro:
*
* DO NOT EDIT THIS FILE (b-test.h)
*
* It has been AutoGen-ed Saturday May 24, 2008 at 11:49:29 AM PDT
* From the definitions /home/bkorb/ag/addon/bits/b-test.def
* and the template file bits.tpl
*/
#ifndef BIT_MASK_B_TEST_H_GUARD
#define BIT_MASK_B_TEST_H_GUARD 1
#include <stdint.h>
typedef uint64_t status_bits_t;
typedef enum {
STS_ALPHA_ID = 0, /* the beginning */
STS_BETA_ID = 1, /* second */
STS_GAMMA_ID = 2, /* thirds */
STS_DELTA_ID = 3, /* fourth */
STS_EPSILON_ID = 4, /* fifth */
STS_ZETA_ID = 5, /* sixth */
STS_ETA_ID = 6, /* seventh */
STS_THETA_ID = 7, /* eighth */
STS_IOTA_ID = 8, /* ninth */
STS_KAPPA_ID = 9, /* tenth */
STS_LAMBDA_ID = 10, /* eleventh */
STS_MU_ID = 11, /* twelfth */
STS_NU_ID = 12, /* thirteenth */
STS_XI_ID = 13, /* fourteenth */
STS_OMICRON_ID = 14, /* fifteenth */
STS_PI_ID = 15, /* sixteenth */
STS_RHO_ID = 16, /* seventeenth */
STS_SIGMA_ID = 32, /* eighteenth */
STS_TAU_ID = 33, /* nineteenth */
STS_UPSILON_ID = 34, /* twentieth */
STS_PHI_ID = 35, /* twenty-first */
STS_CHI_ID = 36, /* twenty-second */
STS_PSI_ID = 37, /* twenty-third */
STS_OMEGA_ID = 38 /* the end */
} status_enum_t;
#define STS_NO_BITS 0ULL
#define STS_ALPHA_BIT (1ULL << STS_ALPHA_ID)
#define STS_BETA_BIT (1ULL << STS_BETA_ID)
#define STS_GAMMA_BIT (1ULL << STS_GAMMA_ID)
#define STS_DELTA_BIT (1ULL << STS_DELTA_ID)
#define STS_EPSILON_BIT (1ULL << STS_EPSILON_ID)
#define STS_ZETA_BIT (1ULL << STS_ZETA_ID)
#define STS_ETA_BIT (1ULL << STS_ETA_ID)
#define STS_THETA_BIT (1ULL << STS_THETA_ID)
#define STS_IOTA_BIT (1ULL << STS_IOTA_ID)
#define STS_KAPPA_BIT (1ULL << STS_KAPPA_ID)
#define STS_LAMBDA_BIT (1ULL << STS_LAMBDA_ID)
#define STS_MU_BIT (1ULL << STS_MU_ID)
#define STS_NU_BIT (1ULL << STS_NU_ID)
#define STS_XI_BIT (1ULL << STS_XI_ID)
#define STS_OMICRON_BIT (1ULL << STS_OMICRON_ID)
#define STS_PI_BIT (1ULL << STS_PI_ID)
#define STS_RHO_BIT (1ULL << STS_RHO_ID)
#define STS_SIGMA_BIT (1ULL << STS_SIGMA_ID)
#define STS_TAU_BIT (1ULL << STS_TAU_ID)
#define STS_UPSILON_BIT (1ULL << STS_UPSILON_ID)
#define STS_PHI_BIT (1ULL << STS_PHI_ID)
#define STS_CHI_BIT (1ULL << STS_CHI_ID)
#define STS_PSI_BIT (1ULL << STS_PSI_ID)
#define STS_OMEGA_BIT (1ULL << STS_OMEGA_ID)
#define STATUS_MASK 0x0000007F0001FFFFULL
#define STS_FIRST_FOUR_MASK ( \
STS_ALPHA_BIT | STS_BETA_BIT | STS_DELTA_BIT | STS_GAMMA_BIT \
/* 0x000000000000000F */ )
#define STS_SMORE_MASK ( \
STS_BETA_BIT | STS_KAPPA_BIT | STS_PHI_BIT \
/* 0x0000000800000202 */ )
#define STS_AFTER_FOUR_MASK ( STATUS_MASK & ~( \
STS_ALPHA_BIT | STS_BETA_BIT | STS_DELTA_BIT | STS_GAMMA_BIT \
/* 0x000000000000000F */ ))
#define SET_STATUS(_m, _b) \
do { (_m) |= 1ULL << _b; } while (0)
#define CLEAR_STATUS(_m, _b) \
do { (_m) &= ~(1ULL << _b); } while (0)
#define TEST_STATUS(_m, _b) (((_m) & (1ULL << _b)) != 0)
#define AND_STATUS(_d, _s1, _s2) \
do { (_d) = (_s1) & (_s2); } while (0)
#define OR_STATUS(_d, _s1, _s2) \
do { (_d) = (_s1) | (_s2); } while (0)
#define XOR_STATUS(_d, _s1, _s2) \
do { (_d) = (_s1) ^ (_s2); } while (0)
#define NOT_STATUS(_d, _s) \
do { (_d) = ~(_s); } while (0)
/*
* Return a string containing the names of the bits set.
*/
extern char *
status_names(status_bits_t bits);
#define INV_STATUS -1
#define DUP_STATUS -2
/*
* Set the bits in "bits" as specified by the input string "str".
* If any names are untranslatable (not in the name list or are
* ambiguous in that they match the initial portion of more than
* one entry), it will return -1 or -2, respectively.
* Otherwise, it returns the number of bits set in "bits".
*/
extern int
status_bits(
status_bits_t * const bits,
char const * str);
#endif /* BIT_MASK_B_TEST_H_GUARD */
/* end of b-test.h */