ROL(3L)

NAME
rol, ror - rotate bits

SYNOPSIS
int rol (x, n)

int ror (x, n)

int x, n;

DESCRIPTION
The rol function returns x logically bit-rotated left by n.

The ror function returns x logically bit-rotated right by n.

EXAMPLE
The following subroutine can be used to determine whether a Point p in a Bitmap b is on or off (returning 1 or 0, respectively).

    #include <dmd.h>
    pixel (b, p)
    Bitmap *b;
    Point	p;
    {
    	Word *w;
    	w = addr (b, p);
    	return ( (rol (*w, p.x%WORDSIZE)
    		& FIRSTBIT)==FIRSTBIT);
    }

This routine is implemented differently in addr(3R).

SEE ALSO
addr(3R).