improve C-interface to cope with prism.

This commit is contained in:
Vítor Santos Costa 2011-11-10 12:26:23 +00:00
parent e865248dce
commit 3ac8e3914f
7 changed files with 501 additions and 454 deletions

View File

@ -15,6 +15,7 @@
/********* abstract machine registers **********************************/ /********* abstract machine registers **********************************/
#ifdef YAP_H
#ifdef CUT_C #ifdef CUT_C
#include "cut_c.h" #include "cut_c.h"
#endif #endif
@ -22,6 +23,7 @@
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL #if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
#include "myddas.h" #include "myddas.h"
#endif #endif
#endif
#define MaxTemps 512 #define MaxTemps 512
#define MaxArithms 32 #define MaxArithms 32

View File

@ -64,7 +64,7 @@ inline EXTERN int IsAttVar (CELL *pt);
inline EXTERN int inline EXTERN int
IsAttVar (CELL *pt) IsAttVar (CELL *pt)
{ {
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
CACHE_REGS CACHE_REGS
return (pt)[-1] == (CELL)attvar_e return (pt)[-1] == (CELL)attvar_e
&& pt < H; && pt < H;
@ -148,7 +148,7 @@ exts;
#endif #endif
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
/* make sure that these data structures are the first thing to be allocated /* make sure that these data structures are the first thing to be allocated
in the heap when we start the system */ in the heap when we start the system */
@ -294,7 +294,7 @@ IsFloatTerm (Term t)
/* extern Functor FunctorLongInt; */ /* extern Functor FunctorLongInt; */
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
inline EXTERN Term MkLongIntTerm (Int); inline EXTERN Term MkLongIntTerm (Int);
inline EXTERN Term inline EXTERN Term
@ -604,7 +604,7 @@ IsAttachedTerm (Term t)
#endif #endif
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
inline EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)); inline EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL));

View File

@ -184,7 +184,7 @@ IsUnboundVar (Term * t)
#else #else
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
inline EXTERN Term MkVarTerm__ ( USES_REGS1 ); inline EXTERN Term MkVarTerm__ ( USES_REGS1 );
@ -316,7 +316,7 @@ IsIntTerm (Term t)
} }
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
EXTERN inline Term STD_PROTO (MkPairTerm__, (Term, Term CACHE_TYPE) ); EXTERN inline Term STD_PROTO (MkPairTerm__, (Term, Term CACHE_TYPE) );
EXTERN inline Term EXTERN inline Term
@ -367,7 +367,7 @@ MkPairTerm__ (Term head, Term tail USES_REGS)
#define IsAccessFunc(func) ((func) == FunctorAccess) #define IsAccessFunc(func) ((func) == FunctorAccess)
#ifdef _YAP_NOT_INSTALLED_ #ifdef YAP_H
inline EXTERN Term MkIntegerTerm (Int); inline EXTERN Term MkIntegerTerm (Int);
inline EXTERN Term inline EXTERN Term

View File

@ -13,12 +13,11 @@
* version: $Id: Yap.h,v 1.38 2008-06-18 10:02:27 vsc Exp $ * * version: $Id: Yap.h,v 1.38 2008-06-18 10:02:27 vsc Exp $ *
*************************************************************************/ *************************************************************************/
#ifndef _YAP_NOT_INSTALLED_ #ifndef YAP_H
#include "YapTermConfig.h" #include "YapTermConfig.h"
typedef void *Functor; typedef void *Functor;
typedef void *Atom; typedef void *Atom;
#endif #endif
#ifndef EXTERN #ifndef EXTERN

913
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -796,6 +796,13 @@ else
fi fi
AC_SUBST(ENABLE_GECODE) AC_SUBST(ENABLE_GECODE)
if test "$use_prism" = no; then
ENABLE_PRISM="@# "
else
ENABLE_PRISM=""
fi
AC_SUBST(ENABLE_PRISM)
if test "$use_chr" = no; then if test "$use_chr" = no; then
ENABLE_CHR="@# " ENABLE_CHR="@# "
elif test -e "$srcdir"/packages/chr/Makefile.in; then elif test -e "$srcdir"/packages/chr/Makefile.in; then
@ -2163,6 +2170,13 @@ mkdir -p packages/PLStream
mkdir -p packages/PLStream/libtai mkdir -p packages/PLStream/libtai
mkdir -p packages/pldoc mkdir -p packages/pldoc
mkdir -p packages/plunit mkdir -p packages/plunit
mkdir -p packages/prism
mkdir -p packages/prism/src
mkdir -p packages/prism/src/c
mkdir -p packages/prism/src/c/core
mkdir -p packages/prism/src/c/mp
mkdir -p packages/prism/src/c/up
mkdir -p packages/prism/src/prolog
mkdir -p packages/ProbLog mkdir -p packages/ProbLog
mkdir -p packages/ProbLog/simplecudd mkdir -p packages/ProbLog/simplecudd
mkdir -p packages/ProbLog/simplecudd_lfi mkdir -p packages/ProbLog/simplecudd_lfi
@ -2270,5 +2284,10 @@ if test "$ENABLE_GECODE" = ""; then
AC_CONFIG_FILES([library/gecode/Makefile]) AC_CONFIG_FILES([library/gecode/Makefile])
fi fi
if test "$ENABLE_PRISM" = ""; then
AC_CONFIG_FILES([packages/prism/src/c/Makefile])
AC_CONFIG_FILES([packages/prism/src/prolog/Makefile])
fi
AC_OUTPUT() AC_OUTPUT()

View File

@ -23,6 +23,10 @@ typedef char *ADDR;
#define RESET_VARIABLE(X) (*(X) = (CELL)(X)) #define RESET_VARIABLE(X) (*(X) = (CELL)(X))
#ifdef _YAP_NOT_INSTALLED_
#include "Regs.h"
#else
#include "src/Regs.h" #include "src/Regs.h"
#endif
#endif #endif