Programming Guide



sm_*resetcrt

Resets the terminal to the operating system's default state

void sm_resetcrt(void);
void sm_jresetcrt(void);
void sm_jxresetcrt(void);

Environment

C only

Description

sm_resetcrt resets terminal characteristics to the operating system's normal state. Use this function only with your own executive. Call sm_resetcrt when leaving the screen manager environment before program exit.

All the memory associated with the display and open screens is freed. However, the buffers that hold the message file, key translation file, and so on, are not released. A subsequent call to sm_initcrt finds them in place. In character-mode, sm_resetcrt then clears the screen and turns on the cursor, transmits the RESET sequence defined in the video file, and resets the operating system channel.

Panther automatically calls sm_resetcrt through sm_jresetcrt or—in the case of the screen editor—sm_jxresetcrt as part of its exit processing. These two functions should not be called by application programs except in case of abnormal termination.

Example

/* If an effort to read the first form results in
* failure, clean up the screen and leave. */

if (sm_r_form("first") < 0)
{
sm_resetcrt();
exit(1);
}

See Also

sm_cancel, sm_leave