home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / sphsrc / sph_bits.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  523 b   |  27 lines

  1. #include "HEADERS.h"
  2. #include "sphigslocal.h"
  3.  
  4.  
  5. void ClearBitstring (substruct_bitstring *B)
  6. {
  7.    if (*B == NULL)
  8.       *B = (unsigned char*) malloc(BYTES_PER_BITSTRING);
  9.    bzero (*B,BYTES_PER_BITSTRING);
  10. }
  11.  
  12.  
  13. /** BitstringIsClear
  14. I wish I could have made this a macro, but it wasn't possible.  Checks
  15. each byte in a bitstring to verify all bits are off.
  16. **/
  17.  
  18. boolean BitstringIsClear (substruct_bitstring B)
  19. {
  20.    register int i; 
  21.  
  22.    for (i=0; i<BYTES_PER_BITSTRING; i++)
  23.       if (B[i])
  24.      return FALSE;
  25.    return TRUE;
  26. }
  27.