DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦2b216f6f6⟧ TextFile

    Length: 497 (0x1f1)
    Types: TextFile
    Notes: UNIX file
    Names: »bits.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »cmd/egrep/bits.c« 

TextFile



/*
 * 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);
}