DD2-monitor/Beep/display.c

44 lines
942 B
C
Raw Normal View History

2021-04-15 22:36:00 +02:00
/*
* un module 'curses' de AlguaBeep
*/
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);
2021-04-15 22:36:00 +02:00
sprintf(chaine, " AlguaBeep (%s %s) pid=%d \n", __DATE__, __TIME__,
2021-04-12 20:10:15 +02:00
getpid());
standout(); mvaddstr(0, 0, chaine); standend();
refresh();
2021-04-13 19:14:08 +02:00
fprintf(stderr, "%s: COLS=%d LINES=%d\n", __func__, COLS, LINES);
2021-04-12 20:10:15 +02:00
return 0;
}
/* ---------------------------------------------------------------- */
void finish(void)
{
endwin();
fprintf(stderr, "end of pid %d\n", getpid());
exit(0);
}
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */