/* ECP: FILEname=fig2_13.c */ /* 1*/ /* Faculty Profile Fields */ /* 2*/ #define Sex 0x0001 /* On If Female */ /* 3*/ #define Minority 0x0002 /* On If In A Minority Group */ /* 4*/ #define Veteran 0x0004 /* On If Veteran */ /* 5*/ #define Disabled 0x0008 /* On If Disabled */ /* 6*/ #define UScitizen 0x0010 /* On If Citizen */ /* 7*/ #define Doctorate 0x0020 /* On If Holds A Doctorate */ /* 8*/ #define Tenured 0x0040 /* On If Tenured */ /* 9*/ #define TwelveMonth 0x0080 /* On If On 12 Month Contract */ /*10*/ #define Visitor 0x0100 /* On If Not Permanent Faculty */ /*11*/ #define Campus 0x0200 /* On If Work Is At Main Campus */ /*12*/ #define Rank 0x0c00 /* Two Bits To Represent Rank */ /*13*/ #define Assistant 0x0400 /* Assistant Professor */ /*14*/ #define Associate 0x0800 /* Associate Professor */ /*15*/ #define Full 0x0c00 /* Full Professor */ /*16*/ #define College 0xf000 /* Represents 16 Colleges */ /*17*/ ... /*18*/ #define ArtsScience 0x3000 /* Arts And Science = College #3 */ /*19*/ ... /*20*/ /* Initialize Appropriate Fields */ /*21*/ Tim = ArtsScience | Associate | Campus | Tenured | /*22*/ Doctorate | UScitizen; /*23*/ /* Promote Tim To Full Professor */ /*24*/ Tim &= ~Rank; /* Turn All Rank Fields Off */ /*25*/ Tim |= Full; /* Turn Rank Fields On */ /*26*/ /* Find Bob's Tenure And College */ /*27*/ BobsTenured = Bob & Tenured; /* Zero If Untenured */ /*28*/ BobsCollege = ( Bob >> 12 ) & 0x000f;