📄 main.c
字号:
#include <stdio.h>
#include <time.h>
#include <curses.h>
#include <signal.h>
#include <unistd.h>
#include "flasher.h"
#include <string.h>
#include <stdlib.h>
typedef void (*sighandler_t)(int);
void handler(void);
void Ctrl_C();
static int flashtime=0;
int main( int argc, char *argv[] )
{
char message[20];
if (argc == 3)
{
sscanf(argv[1],"%d",&flashtime);
strcpy(message,argv[2]);
initscr();
clear();
while(1)
{
while(!alarm(flashtime))
{
move(RULES_ROW+3, RULES_COL+8);
showrules(message);
signal(SIGALRM,(sighandler_t)handler);
refresh();
}
scanw("%d",&flashtime);
(void)signal(SIGINT,(void*)Ctrl_C);
}
endwin();
exit(0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -