DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦dadfdb0e3⟧ TextFile

    Length: 2479 (0x9af)
    Types: TextFile
    Names: »screenh.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Tools/mu/screenh.c« 

TextFile

/* screenh.c	screen handling routines */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Tools/mu/RCS/screenh.c,v 5.0 90/09/20 16:29:09 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Tools/mu/RCS/screenh.c,v 5.0 90/09/20 16:29:09 pp Exp Locker: pp $
 *
 * $Log:	screenh.c,v $
 * Revision 5.0  90/09/20  16:29:09  pp
 * rcsforce : 5.0 public release
 * 
 */



#include <curses.h>
#include <signal.h>

extern	int	use_termcap;		/* can switch off termcap usage :
					used in start_screen
						finish_screen and
						clean_quit */
#define LINES	24
#define COLS	80				

/* These used by termcap */
char	PC;
char	*BC;
char	*UP;
char	bp[1024];
short	ospeed;

void start_screen();
void finish_screen();
void set_strings ();
void posline ();
void insertline ();
void messline ();
void cleanquit ();

/* ----------------------------------------------------------------- */
void	start_screen()
{
	if(!use_termcap)
		return;
	initscr();	/* curses  - SHOULD test return code */
	crmode();	/* curses */
	noecho();	/* curses */
	set_strings();
	return;
}

/* ----------------------------------------------------------------- */
void	finish_screen()
{
	if(!use_termcap)
		return;
	endwin();	/* curses */
	return;
}

/* ----------------------------------------------------------------- */

void	set_strings()	/* set terminal-specific strings */
{
	tgetent(bp,"");	/* curses */
/*	printf("%2d  returned from  tgetent\n",tgetent(bp,"")); */
	return;
}
/* ----------------------------------------------------------------- */

void	posline(i)	/* position cursor at start of line i */
int	i;
{
	printf( (char *) tgoto(CM,0,i));	/* termcap */
	return;
}
/* ----------------------------------------------------------------- */

void	messline(i,mess)	/* write message mess at start of line i */
int	i;
char	*mess;
{
	posline(i);
	printf(CE);	/* CE from termcap */
	printf("%s",mess);
	return;
}
/* ----------------------------------------------------------------- */

void	insertline(i)	/* reverse scroll screen inserting blank at line i */
int	i;
{
	posline(i);
	printf(AL);	/* AL from termcap */
	posline(i);	/* always reposition */
	return;
}
/* ----------------------------------------------------------------- */
void	cleanquit()
{
	finish_screen();
	fflush(stdout);
	if(!use_termcap)
		exit(1);
	posline(LINES);
	printf(CE);	/* CE from termcap */
	exit(1);
}
/* ----------------------------------------------------------------- */