2019-11-17 15:25:40 +00:00
|
|
|
#include <stdio.h>
|
2019-11-19 14:10:28 +00:00
|
|
|
#include <unistd.h>
|
2019-11-17 10:04:41 +00:00
|
|
|
#include <stdlib.h>
|
2019-11-17 14:53:59 +00:00
|
|
|
#include <notcurses.h>
|
2019-11-17 10:04:41 +00:00
|
|
|
|
|
|
|
int main(void){
|
2019-11-17 15:25:40 +00:00
|
|
|
struct notcurses* nc;
|
2019-11-19 14:54:14 +00:00
|
|
|
notcurses_options nopts = {
|
|
|
|
.inhibit_alternate_screen = false,
|
|
|
|
.outfd = STDOUT_FILENO,
|
|
|
|
.termtype = NULL,
|
|
|
|
};
|
|
|
|
if((nc = notcurses_init(&nopts)) == NULL){
|
2019-11-19 11:26:44 +00:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2019-11-19 14:10:28 +00:00
|
|
|
if(notcurses_fg_rgb8(nc, 200, 0, 200)){
|
2019-11-19 11:44:28 +00:00
|
|
|
goto err;
|
2019-11-17 14:53:59 +00:00
|
|
|
}
|
2019-11-19 10:33:38 +00:00
|
|
|
if(notcurses_render(nc)){
|
2019-11-19 11:44:28 +00:00
|
|
|
goto err;
|
2019-11-17 15:25:40 +00:00
|
|
|
}
|
2019-11-19 14:10:28 +00:00
|
|
|
if(notcurses_move(nc, 1, 1)){
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
if(notcurses_render(nc)){
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
sleep(5);
|
2019-11-17 15:25:40 +00:00
|
|
|
if(notcurses_stop(nc)){
|
2019-11-17 14:53:59 +00:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2019-11-17 10:04:41 +00:00
|
|
|
return EXIT_SUCCESS;
|
2019-11-19 11:44:28 +00:00
|
|
|
|
|
|
|
err:
|
|
|
|
notcurses_stop(nc);
|
|
|
|
return EXIT_FAILURE;
|
2019-11-17 10:04:41 +00:00
|
|
|
}
|