/*************************
 * prolog_exit
 *************************/
PROLOG_API void
prolog_exit(void)
{
    if (!initialized)
        return;
    
    if (PL_is_initialised(NULL, NULL))
        PL_cleanup(0);
    
    libprolog_free_predicates();

    libprolog_trace_exit();
    initialized = FALSE;
}
Пример #2
0
void check_prolog(pTHX_ pMY_CXT) {
    if (!c_prolog_ok) {
	if(!PL_is_initialised(NULL, NULL)) {
	    args2argv();
	    if(!PL_initialise(PL_argc, PL_argv)) {
		die ("unable to start prolog engine");
	    }
	    push_frame(aTHX_ aMY_CXT);
	    c_prolog_init=1;
	}
#ifdef MULTIPLICITY
	if(PL_thread_self()==-1) {
	    if(PL_thread_attach_engine(NULL)==-1) {
		die ("unable to create prolog thread engine");
	    }
	    push_frame(aTHX_ aMY_CXT);
	    c_prolog_init=1;
	}
#endif
	c_prolog_ok=1;
    }
}