/*
 * DMLib
 * -- Simple bitstream I/O functions
 * Programmed and designed by Matti 'ccr' Hamalainen
 * (C) Copyright 2012 Tecnic Software productions (TNSP)
 */
#ifndef DMBSTR_H
#define DMBSTR_H

#include "dmlib.h"

typedef struct
{
  FILE *fp;
  int buf, bitcnt, bytecnt;
} DMBitStream;


int   dmInitBitStream(DMBitStream *ctx, FILE *fp);
BOOL  dmPutBits(DMBitStream *ctx, const int val, const int n);
int   dmFlushBitStream(DMBitStream *ctx);


#ifdef __cplusplus
}
#endif
#endif // DMBSTR_H
