osu! Replay parser
This library implements callback api, which allows the user to parse replays directly from memory, without having to save them to disk.
Easylzma is the only dependency, needed for replay decompression
Install easylzma and run
make
#include <libcircles/replay.h>
Replay* replay;
circles_replay_parse_file(&replay, "test.osr"); // Returns 0 on success
// See include/circles/replay.h for available attributes
circles_replay_end(&replay);
int read_callback(char* buf, size_t* size, void* ctx) {
FILE* fp = (FILE*) ctx;
return fread(buf, *size, 1, fp) != 1;
}
FILE* fp = fopen("test.osr", "rb");
Replay* replay;
circles_replay_parse(&replay, &read_callback, (void*) fp); // Returns 0 on success
fclose(fp);
// See include/circles/replay.h for available attributes
circles_replay_end(&replay);