debug_switch.c

来自「在SCO UNIX制定界面程序 可根据文件配制菜单,而不必修改源程序,非常方便」· C语言 代码 · 共 53 行

C
53
字号
#include <stdio.h>
#include <curses.h>
#include <varargs.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/timeb.h>
#include <fcntl.h>
#include <errno.h>

#include "all.h"
#include "tool.h"
#include "macro_def.h"

int debug_switch()
{
	WINDOW *my_win;
	char screen[128];
	char	buffer[128], buf[64], filename[128];
	FILE	*fp;
	struct	termio stdin_term;
	struct	termio stdout_term;
	int 	ret;

	sprintf(screen, "/tmp/.debug_switch.%d", getpid());
	scr_dump(screen);

	disp_below("数据导入");
	clear_wline(stdscr, LINES-1);
	my_win = newwin(18, 80, 3, 0);
	mvwprintw(my_win, 0, 0, "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
	wrefresh(my_win);

	ioctl(0, TCGETA, &stdin_term);
	ioctl(1, TCGETA, &stdout_term);

	if ( yorn( my_win, 10, "是否打开系统日志跟踪开关?", "1.是", "2,否", 0, 0 ) )
		tConfig_SetConfValues( "DEBUG_CONFIG", 0, "DEBUG_SWITCH", "HEAD", "0" );
	else
		tConfig_SetConfValues( "DEBUG_CONFIG", 0, "DEBUG_SWITCH", "HEAD", "1" );
	
	ioctl(0, TCSETAW, &stdin_term);
	ioctl(1, TCSETAW, &stdout_term);

	scr_restore(screen);
	unlink(screen);
	touchwin(curscr);
	wrefresh(curscr);
	return(0);
}

⌨️ 快捷键说明

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