DD2-monitor/Beep/display.c

39 lines
833 B
C
Raw Normal View History

2021-04-12 20:10:15 +02:00
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <curses.h>
#include "funcs.h"
/* ---------------------------------------------------------------- */
int initialise_ecran(int type)
{
char chaine[100];
initscr();
nonl(); cbreak(); noecho();
keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
atexit(finish);
sprintf(chaine, " alguabeep (%s %s) pid=%d \n", __DATE__, __TIME__,
getpid());
standout(); mvaddstr(0, 0, chaine); standend();
refresh();
return 0;
}
/* ---------------------------------------------------------------- */
void finish(void)
{
endwin();
fprintf(stderr, "end of pid %d\n", getpid());
exit(0);
}
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */