|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 497 (0x1f1)
Types: TextFile
Notes: UNIX file
Names: »bits.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »cmd/egrep/bits.c«
/*
* support for bitmaps
*/
#include "egrep.h"
char bitmask[] = {
0001, 0002, 0004, 0010, 0020, 0040, 0100, 0200
};
/*
* allocate bitmap for character class
* If `setbits'==TRUE then the map is initialized to ones, else zeros.
*/
char *
newbits( setbits)
bool setbits;
{
register i,
c;
register char *p,
*q;
p = malloc( NCHARS/NBCHAR);
if (p == NULL)
nomem( );
c = 0;
if (setbits)
c = ~0;
q = p;
i = NCHARS / NBCHAR;
do {
*p++ = c;
} while (--i);
return (q);
}