Exiting to the Operating System on Errors

The function exit_err() prints error messages and exits to the operating system. The call is as follows:

void exit_err(stp1, stp2)
 
UCHAR *stp1;
/* First error message string
*/
UCHAR *stp2;
/* Second error message string
*/

exit_err() prints both strings at the bottom of the screen, one after the other, puts the cursor on the first column of the last line of the video display, calls vv_exit(), and finally calls the system function exit() with an argument value of one (1), the normal error exit code. You can use one string for a fixed message and the second as a variable argument. For example, to report an error opening a file with the name contained in string variable filename, call:

exit_err("Error opening file ", filename);


Home Contents Previous Next