#include #include #include #include #include #include #include #include "ecran.h" int verbosity; /* ---------------------------------------------------------------- */ void demo_vumetres(int nbl, int notused) { int loop, idx; int hpos; char ligne[100]; float value; for (loop=0; loop 1023.0) { rvals[foo] = (float)(rand() % 25); } } plot_waterfall(water, 1, rvals); /* if (rand()%10 < 1) sleep(1); */ foo = nanosleep(&ts, NULL); if (foo) { /* got a signal ? */ message("err on nanosleep"); } } close_waterfall(water, 0); } /* ---------------------------------------------------------------- */ static void finish(int signal) { endwin(); exit(0); } /* ---------------------------------------------------------------- */ int main (int argc, char *argv[]) { int opt; int demonum = 0; /* set some default values */ verbosity = 0; while ((opt = getopt(argc, argv, "vy:")) != -1) { switch (opt) { case 'v': verbosity++; break; case 'y': demonum = atoi(optarg); break; default: fprintf(stderr, "%s : uh ?", argv[0]); exit(1); break; } } initscr(); nonl(); cbreak(); noecho(); keypad(stdscr, TRUE); /* acces aux touches 'curseur' */ fond_ecran(" Demonstrator "); switch (demonum) { case 0: demo_vumetres(666, 0); break; case 1: demo_waterfall(666, 0); break; } /* * plop, on a fini, restaurer la console */ finish(0); return 0; } /* ---------------------------------------------------------------- */