s_paus.c

来自「unix v7是最后一个广泛发布的研究型UNIX版本」· C语言 代码 · 共 45 行

C
45
字号
#include <stdio.h>#define PAUSESIG 15s_paus(s, n)char *s;long int n;{int i;int waitpause();fprintf(stderr, "PAUSE ");if(n > 0)	for(i = 0; i<n ; ++i)		putc(*s++, stderr);fprintf(stderr, " statement executed\n");if( isatty(fileno(stdin)) )	{	fprintf(stderr, "To resume execution, type go.  Any other input will terminate job.\n");	if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )		{		fprintf(stderr, "STOP\n");		f_exit();		exit(0);		}	}else	{	fprintf(stderr, "To resume execution, execute a   kill -%d %d   command\n",		PAUSESIG, getpid() );	signal(PAUSESIG, waitpause);	pause();	}fprintf(stderr, "Execution resumes after PAUSE.\n");}static waitpause(){return;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?