|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 660 (0x294) Types: TextFile Names: »twiddle.h«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─⟦526ad3590⟧ »EUUGD11/gnu-31mar87/X.V10.R4.tar.Z« └─⟦2109abc41⟧ └─⟦this⟧ »./X.V10R4/hacks/bitrot/twiddle.h«
/* * $Source: /u1/X/hacks/bitrot/RCS/twiddle.h,v $ * $Author: tony $ * $Locker: $ * $Header: twiddle.h,v 10.1 86/02/01 15:43:23 tony Rel $ */ #include <sys/types.h> /* WARNING! ASSUMES 8-BIT CHARACTERS! */ /* Each of these operates on the xth bit from map */ /* Map must be a pointer, not necessarily a u_char pointer */ #define fetch(map, x) (1 & (((u_char *) map)[x >> 3] >> (x & 7))) #define set(map, x) ((((u_char *) map)[x>>3] |= 1 << (x & 7))) #define reset(map, x) ((((u_char *) map)[x>>3] &= ~(1 << (x & 7)))) #define flip(map,x) ((((u_char *) map)[x>>3] ^= 1 << (x & 7))) #define place(map, x, bit) ((bit ? set(map,x),0 : reset(map,x), 0))