Exemplo n.º 1
0
int main(int argc, char *argv[])
{
	if (argc == 1)
		printf("Use -h for help\n");
	int c;
	while ((c = getopt(argc, argv, "hgs")) != -1) {
		switch (c) {
		case 'h':
			print_help();
		break;
		case 'g':
			if (!generate_new())
				printf("Done\n");
			else
				printf("Generating fail\n");
		break;
		case 's': {
			int pipe_gamma_fd = open(PIPE_GAMMA, O_WRONLY);
			if (pipe_gamma_fd == -1) {
				perror("Error opening gamma fifo");
				exit(EXIT_FAILURE);
			}
			while (1)
				from_file_to_pipe(pipe_gamma_fd);
		}
		break;
		default:
			printf("Option -h can help you\n");
		}
	}
}
Exemplo n.º 2
0
BOOL CSolverDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	generate_new(20, 65, 124);
//	newField(20, 20);

	return TRUE;
}