view dmbstr.h @ 510:43ea59887c69

Start work on making C64 formats encoding possible by changing DMDecodeOps to DMEncDecOps and adding fields and op enums for custom encode functions, renaming, etc. Split generic op sanity checking into a separate function in preparation for its use in generic encoding function.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 15:06:01 +0200
parents a7ab6bf5b012
children c63e24f9aa9a
line wrap: on
line source

/*
 * 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