Terminal goodies
C C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Release 0.0.2 Jan 26, 2013
.gitignore Initial commit Jul 4, 2012
History.md Release 0.0.2 Jan 26, 2013
Makefile add real example Jul 4, 2012
Readme.md docs Oct 10, 2013
example.c refactor example Jul 4, 2012
package.json docs Oct 10, 2013
test.c add background to example Jul 4, 2012

Readme.md

term.c

Terminal goodies.

Example

Check out ./example.c:

Installation

Install with clib:

$ clib install clibs/term

API

// aliases

#define term_bold term_bright
#define term_clear term_erase

// display

#define term_reset() term_write("0m")
#define term_bright() term_write("1m")
#define term_dim() term_write("2m")
#define term_underline() term_write("4m")
#define term_blink() term_write("5m")
#define term_reverse() term_write("7m")
#define term_hidden() term_write("8m")

// cursor

#define term_hide_cursor() term_write("?25l")
#define term_show_cursor() term_write("?25h")

// size

int
term_size(int *width, int *height);

// movement

void
term_move_by(int x, int y);

void
term_move_to(int x, int y);

// erasing

const char *
term_erase_from_name(const char *name);

int
term_erase(const char *name);

// colors

int
term_color_from_name(const char *name);

int
term_color(const char *name);

int
term_background(const char *name);