📄 bitio.h
字号:
#ifndef __BITIO_H_
#define __BITIO_H_
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* The codes are from the book "The Data Compression Book" by Mark Nelson
* and Jean-Loup Gailly, M&T Books 1996.
*
* I did some changes to the end of file issue, but not really successful.
*
* Mow-Song, Ng 2/9/2002
* msng@mmu.edu.my
* http://www.pesona.mmu.edu.my/~msng
*
* I do not claim copyright to the code, but if you use them or modify them,
* please drop me a mail.
*
*/
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
* $LOG
* ----
* Last modified 28/10/2001
*
*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "memchk.h"
typedef struct bit_file {
FILE *file;
unsigned char mask;
int rack;
} 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, int *EOFflag );
unsigned long InputBits( BIT_FILE *bit_file, int bit_count, int *EOFflag);
void CloseInputBitFile( BIT_FILE *bit_file );
void CloseOutputBitFile( BIT_FILE *bit_file );
void FilePrintBinary( FILE *file, unsigned int code, int bits );
void BitioError(char *fmt, ...);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -