#ifndef _BPE_H_
#define _BPE_H_

#include <stdint.h>

enum BPE_RETURN_VALUE
{
	BPE_ALLOCATION_ERROR = -1,
	BPE_ERROR = 0,
	BPE_OK = 1
};

struct BPEPair
{
	uint8_t first;
	uint8_t second;
};

struct BPEData
{
	uint8_t *dictionary;
	int dictionaryLength;
	
	struct BPEPair *pairs;
	int pairCount;
	
	uint8_t *compressedString;
	int compressedStringLength;
};

int8_t bpeInit( struct BPEData* bpe, uint8_t *dictionary, int dictionaryLength );
void bpeClear( struct BPEData* bpe );

int8_t bpeEncode( const char* source, int sourceSize, uint8_t* ignore, int ignoreLength, struct BPEData* bpe );

#endif /* _BPE_H_ */
