night mission

This commit is contained in:
2019-10-30 05:31:38 +01:00
parent 7ac2bc53e9
commit d721ea674c
8 changed files with 182 additions and 0 deletions

View File

@@ -4,7 +4,14 @@
CC = gcc
CCOPT = -Wall -g -DDEBUG_LEVEL=1
ncfuncs.o: ncfuncs.c ncfuncs.h Makefile
$(CC) ${CCOPT} -c $<
OBJS = ncfuncs.o
LIBS = -lcurses
t: t.c ${OBJS} Makefile
$(CC) ${CCOPT} $< ${OBJS} ${LIBS} -o $@

29
ui/ncfuncs.c Normal file
View File

@@ -0,0 +1,29 @@
/*
* NcLooper--- interface curses, fonctions de base
*/
#include <curses.h>
/* --------------------------------------------------------------------- */
int init_ecran(char *txt)
{
initscr();
standout();
border('o', 'o', 'o', 'o', 'X', 'X', 'X', 'X');
standend();
mvaddstr(1, 5, txt);
refresh();
return -1;
}
/* --------------------------------------------------------------------- */
int fin_ecran(void)
{
endwin();
return 0;
}
/* --------------------------------------------------------------------- */

8
ui/ncfuncs.h Normal file
View File

@@ -0,0 +1,8 @@
/*
* NcLooper--- interface curses, fonctions de base
*/
int init_ecran(char *txt);
int fin_ecran(void);

8
ui/t.c
View File

@@ -6,6 +6,8 @@
#include <stdlib.h>
#include <unistd.h>
#include "ncfuncs.h"
/* --------------------------------------------------------------------- */
int verbosity;
@@ -34,6 +36,12 @@ while ((opt = getopt(argc, argv, "hv")) != -1) {
fprintf(stderr, "argc = %d, optind = %d\n", argc, optind);
#endif
foo = init_ecran("* NcLooper *");
sleep(2);
fin_ecran();
return 0;
}