static char *SccsId = "@(#)single_s.c 4.1 (TU-Delft) 05/24/90";
/**********************************************************

Name/Version      : libfunc/4.1

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : GOULD

Author(s)         : O. Hol
Creation date     : 18-Feb-1988
Modified by       : 
Modification date : 


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1988 , All rights reserved
**********************************************************/
#include <stdio.h>

extern int stopsim;

/* single_step()      : can be called in the behavior part of a        */
/*                    : function description when curses is used       */
/*                    : single step is performed when a character      */
/*                    : is typed; 'q' stops the simulation             */
/*                    : immediately, 'x' stops the simulation after    */
/*                    : the current simulation step, 'c' continues     */
/*                    : until the end of simulation.                   */

single_step()
{
    int tmpc;
    static int no_stop = 0;

    if (no_stop == 0) {
	tmpc = getchar();
	if (tmpc == 'q')
	    die  (0);
	else if (tmpc == 'x')
	    stopsim = 1;
	else if (tmpc == 'c')
	    no_stop = 1;
    }
}
