signal.c

来自「一个MIPS模拟器的源码」· C语言 代码 · 共 46 行

C
46
字号
/* * Copyright (c) 2008 Martin Decky * All rights reserved. * * Distributed under the terms of GPL. * */#include "../signal.h"#ifdef __WIN32__#include <windows.h>#include <stdlib.h>#include "../../device/machine.h"#include "../../io/output.h"static BOOL machine_user_break(DWORD fdwCtrlType){	switch (fdwCtrlType) {	case CTRL_C_EVENT:		if ((tobreak) || (interactive)) {			mprintf("Quit\n");			input_back();			return false;		}				tobreak = true;		if (!interactive)			reenter = true;		interactive = true;		return true;	}		return false;}void register_sigint(void){	SetConsoleCtrlHandler((PHANDLER_ROUTINE) machine_user_break, true);} #endif /* __WIN32__ */

⌨️ 快捷键说明

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