Example #1
0
int
main(int argc, char **argv)
{
#if O_CTRLC
    main_thread_id = GetCurrentThreadId();
    SetConsoleCtrlHandler((PHANDLER_ROUTINE)consoleHandlerRoutine, TRUE);
#endif

#if O_ANSI_COLORS
    PL_w32_wrap_ansi_console();	/* decode ANSI color sequences (ESC[...m) */
#endif
#ifdef READLINE
    PL_initialise_hook(install_readline);
#endif

    if ( !PL_initialise(argc, argv) )
        PL_halt(1);

    for(;;)
    {   int status = PL_toplevel() ? 0 : 1;

        PL_halt(status);
    }

    return 0;
}
	OntoEmPl(bool flag) :
			ple(NULL),
			alive(flag) {
#ifdef READLINE
		PL_initialise_hook(install_readline);
#endif
		char *av[10];
		int ac = 0;
		av[ac++] = "-q";
		av[ac] = NULL;
		if (ple == NULL) {
			ple = new PlEngine(ac, av);
		} else {
			std::cout << "Prolog engine start failed\n";
			exit(1);
		}
	}