File: clrscr.c

package info (click to toggle)
gramofile 1.6-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 840 kB
  • ctags: 538
  • sloc: ansic: 10,238; makefile: 55
file content (39 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Clear Screen + Header

 * Copyright (C) 1998 J.A. Bezemer
 *
 * Licensed under the terms of the GNU General Public License.
 * ABSOLUTELY NO WARRANTY.
 * See the file `COPYING' in this directory.
 */

#include "clrscr.h"
#ifndef OLD_CURSES
#include <ncurses.h>
#else
#include <curses.h>
#endif


void
header (char *headertext)
{
  int i;
  mvaddstr (0, 1, PROGRAM_NAME);

  mvaddstr (0, (80 - strlen (headertext) + 1) / 2,
	    headertext);

  move (1, 0);
  for (i = 0; i < 80; i++)
    addch (ACS_S1);
}

void
clearscreen (char *headertext)
{
  clear ();
  refresh ();

  header (headertext);
}