// mrDiff.h

#include <string>
#include <vector>

#define MRDIFF_VERSION    "1.2"

#ifdef _DEBUG
#define MRDIFF_perror(x)  fputs(x "\n", stderr)
#else
#define MRDIFF_perror(x)
#endif

//#define MRDIFF_USE_NAIVE_PATH
#define MRDIFF_ENABLE_PREDIFF_OPTIMISATIONS

// Types

struct diff_t {
	int type;
	std::string literal;
	int src_len;
};

typedef std::vector<diff_t> patch_t;

// Primary diff operations

patch_t     mrdiff  (std::string sl, std::string sr);
std::string mrpatch (std::string orig, patch_t& d);
patch_t     mrmerge (patch_t& dl, patch_t& dr);

// Helper functions

int         mrpos         (int pos, patch_t& patch);
std::string mrserialise   (patch_t& d);
patch_t     mrunserialise (std::string d);