il_bits.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2002 by Denton Woods
  5. // Last modified: 05/25/2001 <--Y2K Compliant! =]
  6. //
  7. // Filename: src-IL/include/il_bits.h
  8. //
  9. // Description: Implements a file class that reads/writes bits directly.
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef BITS_H
  13. #define BITS_H
  14. #include "il_internal.h"
  15. // Struct for dealing with reading bits from a file
  16. typedef struct BITFILE
  17. {
  18. ILHANDLE File;
  19. ILuint BitPos;
  20. ILint ByteBitOff;
  21. ILubyte Buff;
  22. } BITFILE;
  23. // Functions for reading bits from a file
  24. //BITFILE* bopen(const char *FileName, const char *Mode);
  25. ILint bclose(BITFILE *BitFile);
  26. BITFILE* bfile(ILHANDLE File);
  27. ILint btell(BITFILE *BitFile);
  28. ILint bseek(BITFILE *BitFile, ILuint Offset, ILuint Mode);
  29. ILint bread(void *Buffer, ILuint Size, ILuint Number, BITFILE *BitFile);
  30. //ILint bwrite(void *Buffer, ILuint Size, ILuint Number, BITFILE *BitFile);
  31. // Useful macros for manipulating bits
  32. #define SetBits(var, bits) (var |= bits)
  33. #define ClearBits(var, bits) (var &= ~(bits))
  34. #endif//BITS_H