halt.c

来自「Minix比较全的源码」· C语言 代码 · 共 38 行

C
38
字号
/*  (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.  See the copyright notice in the ACK home directory, in the file "Copyright".*//*  Module:	program termination routines  Author:	Ceriel J.H. Jacobs  Version:	$Header$*/#define MAXPROCS 32static int callindex = 0;static int (*proclist[MAXPROCS])();_cleanup(){	while (--callindex >= 0)		(*proclist[callindex])();	callindex = 0;}CallAtEnd(p)	int (*p)();{	if (callindex >= MAXPROCS) {		return 0;	}	proclist[callindex++] = p;	return 1;}halt(){	_cleanup();	_exit(0);}

⌨️ 快捷键说明

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