⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseenvinit.c

📁 linux环境下结合ncurse库
💻 C
字号:
/*
	环境初始化实现
*/
#include"BaseEnvInit.h"

void BaseEnvInit()
{
	initscr();
	if(!has_colors())
	{
		endwin();
		fprintf(stderr,"Error - no color support on this terminal \n");
		exit(1);
	}

	if(start_color()!= OK)
	{
		endwin();
		fprintf(stderr,"Error - could not initiallize colors\n");
		exit(2);
	}

	init_pair(1,COLOR_RED,COLOR_CYAN);
	init_pair(2,COLOR_BLACK,COLOR_BLACK);
	init_pair(3,COLOR_BLACK,COLOR_RED);
	init_pair(4,COLOR_BLACK,COLOR_CYAN);
	init_pair(5,COLOR_BLACK,COLOR_WHITE);
	init_pair(6,COLOR_WHITE,COLOR_RED);
	init_pair(7,COLOR_WHITE,COLOR_BLUE);
	init_pair(8,COLOR_WHITE,COLOR_WHITE);
	refresh();
}

void ExitEnvInit()
{
	endwin();
	exit(1);
}

⌨️ 快捷键说明

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