simple c terminal spinners
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
spin.gif
spin.h
spintest.c

README.md

spin

Simple UTF-8 console spinners for C.

spinner gif

usage

Drop spin.h into your project directory.

#include "spin.h"
int func() {
    spinner *s = spin_new(utf8_pat1, "Working...", UTF8_CHAR_WIDTH);
    while(working) {
        // ... do work ...
        spin_drw(s);
        if(progress == .5)
            spin_upd_msg(s, "Half way through...") // update the message
    }
    spin_del(s);
    return 0;
}

expanding

It's possible to add new spinner patterns, but for now, they have to be UTF8 (since there are hard coded 3 byte jumps in the code).