static char rcsid[] = "@(#)$Id: cur_process.c,v 1.6 2006/04/09 07:37:37 hurtta Exp $";

/******************************************************************************
 *  The Elm (ME+) Mail System  -  $Revision: 1.6 $   $State: Exp $
 *
 *  Author: Kari Hurtta <hurtta+elm@posti.FMI.FI> (was hurtta+elm@ozone.FMI.FI)
 *****************************************************************************/

#include "def_screen.h"
#include "s_elm.h"


static void print_status_1 P_((struct run_state *rs,int sig,int exit_code,
			       struct menu_context *page));
static void print_status_1(rs,sig,exit_code,page) 
     struct run_state *rs;
     int sig, exit_code;
     struct menu_context *page;
{
  int LINES, COLUMNS;

 redraw:
    menu_get_sizes( page, &LINES, &COLUMNS);

    if (sig) 
	PutLineX(LINES-1,0,
		 CATGETS(elm_msg_cat, ElmSet, 
			 ElmTerminatedWithSignal,
			 "Terminated with signal %d. Press any key to continue: "),
		 sig);
    else if (exit_code)
	PutLineX(LINES-1,0,
		 CATGETS(elm_msg_cat, ElmSet, 
			 ElmExitedWithStatus,
			 "Exited with status %d. Press any key to continue: "),
		 exit_code);
    else
	PutLineX(LINES-1,0,
		 CATGETS(elm_msg_cat, ElmSet, 
			 ElmDoneCont,
			 "Done. Press any key to continue: "));
    if (menu_ReadCh(page,REDRAW_MARK) == REDRAW_MARK) 
	goto redraw;
}


void print_status_cooked(rs,sig,exit_code) 
     struct run_state *rs;
     int sig, exit_code;
{
    struct menu_context *cpage;

    cpage = Raw(ON | NO_TITE);

    print_status_1(rs,sig,exit_code, cpage);

    Raw(OFF | NO_TITE);
    printf("\n\r");
}


void print_status(rs,sig,exit_code) 
     struct run_state *rs;
     int sig, exit_code;
{
    if (rs->raw == ON && ( SY_CLRWAIT & rs->options )) {
	
	print_status_1(rs,sig,exit_code, default_context);
    }
}


void start_run_tty_init()
{
    int LINES, COLUMNS;

    menu_get_sizes( default_context, &LINES, &COLUMNS);
    

    MoveCursor(LINES-1,0);
    CleartoEOLN();
    FlushBuffer();
}

/*
 * Local Variables:
 *  mode:c
 *  c-basic-offset:4
 *  buffer-file-coding-system: iso-8859-1
 * End:
 */


syntax highlighted by Code2HTML, v. 0.9.1