47 lines
705 B
C
47 lines
705 B
C
/**
|
|
* @file generator.c
|
|
* @date 2018-05-21
|
|
*
|
|
* @brief Client program which generates solutions and submits them.
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
static const char *pname;
|
|
|
|
struct sigaction sa;
|
|
|
|
static volatile sig_atomic_t quit = 0;
|
|
|
|
static void sig_handler(int signum)
|
|
{
|
|
quit = 1;
|
|
}
|
|
|
|
void usage(void)
|
|
{
|
|
fprintf(stderr, "SYNOPSIS\n"
|
|
"\tgenerator EDGE1...\n"
|
|
"EXAMPLE\n"
|
|
"\tgenerator 0-1 1-2 1-3 1-4 2-4 3-6 4-3 4-5 6-0\n");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
if (argc == 1)
|
|
usage();
|
|
|
|
struct sigaction sa;
|
|
memset(&sa, 0, sizeof(sa));
|
|
sa.sa_handler = &sig_handler;
|
|
sigaction(SIGINT, &sa, NULL);
|
|
sigaction(SIGTERM, &sa, NULL);
|
|
|
|
while (quit == 0) {
|
|
|
|
}
|
|
|
|
return 0;
|
|
}
|