This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/swig/yap.c
Vítor Santos Costa 23561d086b support for SWIG.
2014-04-28 11:57:09 +01:00

30 lines
443 B
C

#include <stdio.h>
#include <stdlib.h>
#include "YAPInterface.h"
static void init_yap( void );
int yap_prove_string(char *s);
static int yap_on;
int
prove_string(char *s) {
if (!yap_on)
init_yap();
if (YAP_RunGoal(YAP_MkAtomTerm(YAP_LookupAtom(s)))) {
YAP_ShutdownGoal( TRUE );
return TRUE;
}
return FALSE;
}
static void
init_yap( void )
{
if (YAP_FastInit(NULL) == YAP_BOOT_ERROR)
exit(1);
yap_on = TRUE;
}