
   /*
    * These functions are used in bit-I/O routines
    */

   /*
    * if you define this, we will call "bwrite_number", which works
    * one bit at a time.  If SLOW is not defined, we call the
    * routine "new_bwrite_number", which ought to work much
    * faster.
    *
    * If not defined, we have to call "init_arrays" upon initialization,
    * too.
    */
#undef SLOW

   /* routines to init/free a special bit-buffer */

void
init_buf(int noise_bits);

void
free_buf(void);


   /* routines to write bits */

int 
finish_buf(FILE *fp);

int 
bwrite_zeroes(FILE *fp, int n);

int 
bwrite_ones(FILE *fp, int n);

int 
bwrite_zeroes_and_a_one(FILE *fp, int n);

int 
bwrite_number(FILE *fp, int n, unsigned short int uval);

   /* this _should_ be a faster version of bwrite_number */
int 
new_bwrite_number(FILE *fp, int n, unsigned short int uval);


   /* routines to read bits */

int 
fill_buf(FILE *fp);

int
bread_zeroes(FILE *fp);

int
bread_single_one(FILE *fp);

int
bread_zeroes_and_a_one(FILE *fp);

int 
bread_number(FILE *fp, int nbits, unsigned short int *uval);



