#
#define  SINGLE  7
#define  REBOOT  ~7
#define  SHUP  1
#define  SINT  2
#define  SBUS  10
#define  SSEG  11
#define EGOOD	0
#define EBAD	1
main(argc,argv)
char  **argv;
{
	register i,pid;
	++argv;
	pid = 1;
	if((*argv)[1] != 0){
		printf("Illegal argument\n");
		exit(EBAD);
	}
	switch(**argv){
		case 'Q':	/*Query lines file*/
			kill(pid,SHUP);
			exit(EGOOD);
		case 'R':	/*Reboot signal*/
			if(getcsw() == REBOOT)
				kill(pid,SBUS);
			else{
				printf("Illegal switch settings\n");
				exit(EBAD);
			}
			exit(EGOOD);
		case 'S':	/*Single signal*/
			if(getcsw() == SINGLE)
				kill(pid,SBUS);
			else{
				printf("Illegal switch settings\n");
				exit(EBAD);
			}
			exit(EGOOD);
		case 'a':	/*Asynchronous stimuli*/
		case 'b':
		case 'c':
			kill(pid,(**argv - 'a' + SSEG));
			exit(EGOOD);
		default :
			i = **argv - '0';
			if(i>=0 && i<= 6)
				kill(pid,i+SINT);
			else{
				printf("Illegal argument\n");
				exit(EBAD);
			}
	}
	exit(EGOOD);
}
