Skip to content

r10nw7fd3/libcircles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libcircles

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

Building

Install easylzma and run

make

Usage

Include

#include <libcircles/replay.h>

Reading from file

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);

Reading from wherever

Callback

int read_callback(char* buf, size_t* size, void* ctx) {
	FILE* fp = (FILE*) ctx;

	return fread(buf, *size, 1, fp) != 1;
}

Parsing

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);

About

osu! Replay parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published