This commit is contained in:
2024-04-14 22:18:05 +05:30
parent b89368be70
commit b55c5a4192
8 changed files with 436 additions and 1 deletions

29
clib/bitio.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef _BITIO_H
#define _BITIO_H
#include <stdio.h>
typedef struct bit_file {
FILE* file;
unsigned char mask;
int rack;
int pacifier_counter;
} BIT_FILE;
BIT_FILE* OpenInputBitFile(char* name);
BIT_FILE* OpenOutputBitFile(char* name);
void OutputBit(BIT_FILE* bit_file, int bit);
void OutputBits(BIT_FILE* bit_file, unsigned long code, int count);
int InputBit(BIT_FILE* bit_file);
unsigned long InputBits(BIT_FILE* bit_file, int bit_count);
void CloseInputBitFile(BIT_FILE* bit_file);
void CloseOutputBitFile(BIT_FILE* bit_file);
void FilePrintBinary(FILE* file, unsigned int code, int bits);
#endif /* _BITIO_H */