main.c.svn-base

来自「a screen handling program to provide a f」· SVN-BASE 代码 · 共 43 行

SVN-BASE
43
字号
#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 + =
减小字号Ctrl + -
显示快捷键?