support for SWIG.
This commit is contained in:
29
packages/swig/yap.c
Normal file
29
packages/swig/yap.c
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user