home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume3
/
libc_term
/
center.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-11-30
|
1KB
|
83 lines
#include <strings.h>
#include <curses.h>
#include "c_term.h"
void center(line, string, mode)
int line;
char *string;
int mode;
/*
---------------------------------------------------------------------------
Last revision -
6 January 1985 - GWS
Change to use curses
2 April 1984 - GWS
NAME
center - center string in sceen
SYNOPSIS
void center(line, string, mode)
int line;
char *string;
int mode;
DESCRIPTION
This routine uses the curses(3x) routines to center and
optionally emphasize a string. 'Line' is the terminal line
number on which the string is to be placed, numbered starting
with 0. 'Mode' takes one of three values:
0 - no control characters sent
1 - stand-out mode turned on before and off after 'string'
2 - stand-out mode turned on before and off after 'string'
A call to init_term must be made before the first call to center.
SEE ALSO
curses(3x), init_term
DIAGNOSTICS
none
BUGS
does not check for string too long to fit on one line
AUTHOR
George W. Sherouse
31 March 1984
---------------------------------------------------------------------------
*/
{
int col;
int strlen();
col = (COLS - strlen(string)) / 2 - 1;
switch (mode)
{
case 0:
break;
case 1:
case 2:
standout();
break;
}
mvprintw(line, col, string);
switch (mode)
{
case 0:
break;
case 1:
case 2:
standend();
break;
}
refresh();
return;
}