night mission
This commit is contained in:
@@ -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
29
ui/ncfuncs.c
Normal 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
8
ui/ncfuncs.h
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* NcLooper--- interface curses, fonctions de base
|
||||
*/
|
||||
|
||||
|
||||
int init_ecran(char *txt);
|
||||
int fin_ecran(void);
|
||||
|
||||
8
ui/t.c
8
ui/t.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user