home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
328_02
/
whide.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-17
|
1KB
|
75 lines
/* whide.c
* contains whide() and wshow()
*
* These routines cover up the current window with the prior screen
* and then restore it, without releasing the window
*
* They must be called in pairs, whide() first, then wshow()
* without an intermediate call to wopen() or similar functions
*
* PARAMETERS: whide()-- none.
* wshow()-- takes the pointer returned by whide.
*
* RETURNS: whide()-- a void far *, to pass to wshow later.
* wshow()-- none.
*/
#include "wsys.h"
WHEAP *whide (void)
{
WHEAP *oldimage;
WHEAP *newimage;
/* can't hide if no old save area
*/
if ( NULL == (oldimage = w0->winsave) )
{
return (NULL);
}
w0->winsave = NULL;
wsave (); /* get current image */
newimage = w0->winsave;
w0->winsave = oldimage;
wrestore ();
return (newimage); /* whide */
}
void wshow ( WHEAP *newimage )
{
WHEAP *oldimage;
if ( NULL == (oldimage = w0->winsave) )
{
return;
}
w0->winsave = newimage;
wrestore ();
w0->winsave = oldimage;
if ( newimage )
{
wheap_free ( newimage );
}
return; /* wshow */
}