]> ncurses.scripts.mit.edu Git - ncurses.git/blob - progs/clear.c
ncurses 4.1
[ncurses.git] / progs / clear.c
1
2 /***************************************************************************
3 *                            COPYRIGHT NOTICE                              *
4 ****************************************************************************
5 *                ncurses is copyright (C) 1992-1995                        *
6 *                          Zeyd M. Ben-Halim                               *
7 *                          zmbenhal@netcom.com                             *
8 *                          Eric S. Raymond                                 *
9 *                          esr@snark.thyrsus.com                           *
10 *                                                                          *
11 *        Permission is hereby granted to reproduce and distribute ncurses  *
12 *        by any means and for any fee, whether alone or as part of a       *
13 *        larger distribution, in source or in binary form, PROVIDED        *
14 *        this notice is included with any such distribution, and is not    *
15 *        removed from any of its header files. Mention of ncurses in any   *
16 *        applications linked with it is highly appreciated.                *
17 *                                                                          *
18 *        ncurses comes AS IS with no warranty, implied or expressed.       *
19 *                                                                          *
20 ***************************************************************************/
21
22
23 /*
24  * clear.c --  clears the terminal's screen
25  */
26
27 #include <progs.priv.h>
28
29 #include <curses.h>
30
31 MODULE_ID("$Id: clear.c,v 1.6 1996/12/21 17:35:11 tom Exp $")
32
33 static int putch(int c)
34 {
35         return putchar(c);
36 }
37
38 int main(
39         int argc GCC_UNUSED,
40         char *argv[] GCC_UNUSED)
41 {
42         setupterm((char *) 0, STDOUT_FILENO, (int *) 0);
43         if (clear_screen == (char *) 0)
44                 return EXIT_FAILURE;
45         tputs(clear_screen, lines > 0 ? lines : 1, putch);
46         return EXIT_SUCCESS;
47 }