cabi.c
static void putbit(int val)
{
	if (val) cs.byte |= cs.bit;
	cs.bit <<= 1;
	if (cs.bit == 0x100)
	{
		//output byte
		if (cs.out_pos != 0) printf(",");
		if (cs.out_pos % 16 == 0) printf("\n");
		printf("0x%02x", cs.byte);
		
		cs.out_pos ++;
		cs.bit = 0x1;
		cs.byte = 0;
		
	}
}
// write a bit to the stream. non-zero val means 1, otherwise 0.
write a bit to the stream. non-zero val means 1, otherwise 0.
write a bit to the stream . non - zero val means 1 otherwise 0 .
static void putbit(int val)
{
	if (val) cs.byte |= cs.bit;
	cs.bit <<= 1;
	if (cs.bit == 0x100)
	{
		if (cs.out_pos != 0) printf(",");
		if (cs.out_pos % 16 == 0) printf("\n");
		printf("0x%02x", cs.byte);
		cs.out_pos ++;
		cs.bit = 0x1;
		cs.byte = 0;
	}
}
static void putbit ( int val ) { if ( val ) cs . byte |= cs . bit ; cs . bit <<= 1 ; if ( cs . bit == 0x100 ) { if ( cs . out_pos != 0 ) printf ( " " ) ; if ( cs . out_pos % 16 == 0 ) printf ( " \n " ) ; printf ( " " , cs . byte ) ; cs . out_pos ++ ; cs . bit = 0x1 ; cs . byte = 0 ; } }
write a bit to the stream.
write a bit to the stream .
//output byte