view src/dmbstr.h @ 1269:4b22da2a309f

Comments, cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 03 Jun 2015 16:17:04 +0300
parents e0fb6fa1c689
children
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"


#ifdef __cplusplus
extern "C" {
#endif


typedef struct _DMBitStreamContext
{
    void *fp;

    BOOL (*putByte)(struct _DMBitStreamContext *ctx, Uint8 val);

    int outBuf, outBitCount, outByteCount;
} DMBitStreamContext;


void  dmInitBitStreamContext(DMBitStreamContext *ctx);
int   dmFlushBitStream(DMBitStreamContext *ctx);

BOOL  dmPutBits(DMBitStreamContext *ctx, const int val, const int n);


int   dmInitBitStreamFILE(DMBitStreamContext *ctx, FILE *fp);


#ifdef __cplusplus
}
#endif
#endif // DMBSTR_H