/*******************************************************************

            MPEG file I/O interface (very very very slow)

 *******************************************************************/

#ifndef MPEG_IO_H
#define MPEG_IO_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	FILE *stream;
	char path[FILENAME_MAX];

	unsigned int buffer;
	int rest;
} MPEG_IO;

#ifndef MPEG_IO_C
extern int open_mpeg_file(char *path, MPEG_IO *out);
extern int close_mpeg_file(MPEG_IO *p);
extern int get_bits(MPEG_IO *in, int num_of_bits);
extern int read_bits(MPEG_IO *in, int num_of_bits);
extern int erase_bits(MPEG_IO *in, int num_of_bits);
extern int next_marker(MPEG_IO *in);
#endif;

#ifdef __cplusplus
}
#endif

#endif	