From 9397c9336d45756d92f379039b480c2875394658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 3 Nov 2011 07:55:42 +0900 Subject: [PATCH] make this callable from foeign code. --- H/TermExt.h | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/H/TermExt.h b/H/TermExt.h index 625094c59..779f37f74 100644 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -58,13 +58,19 @@ blob_type; #define FunctorDouble ((Functor)(double_e)) #define EndSpecials (double_e+sizeof(Functor *)) + inline EXTERN int IsAttVar (CELL *pt); inline EXTERN int IsAttVar (CELL *pt) { +#ifdef _YAP_NOT_INSTALLED_ CACHE_REGS - return (pt)[-1] == (CELL)attvar_e && pt < H; + return (pt)[-1] == (CELL)attvar_e + && pt < H; +#else + return (pt)[-1] == (CELL)attvar_e; +#endif } inline EXTERN int GlobalIsAttVar (CELL *pt); @@ -142,6 +148,8 @@ exts; #endif +#ifdef _YAP_NOT_INSTALLED_ + /* make sure that these data structures are the first thing to be allocated in the heap when we start the system */ #ifdef THREADS @@ -171,6 +179,7 @@ inline EXTERN Float STD_PROTO (CpFloatUnaligned, (CELL *)); #if SIZEOF_DOUBLE == SIZEOF_LONG_INT + inline EXTERN Term MkFloatTerm (Float); inline EXTERN Term @@ -246,7 +255,6 @@ MkFloatTerm (Float dbl) } - inline EXTERN Float FloatOfTerm (Term t); inline EXTERN Float @@ -264,6 +272,14 @@ FloatOfTerm (Term t) #endif #endif +Term STD_PROTO (Yap_MkBlobStringTerm, (const char *, size_t len)); +Term STD_PROTO (Yap_MkBlobWideStringTerm, (const wchar_t *, size_t len)); +char *STD_PROTO (Yap_BlobStringOfTerm, (Term)); +wchar_t *STD_PROTO (Yap_BlobWideStringOfTerm, (Term)); +char *STD_PROTO (Yap_BlobStringOfTermAndLength, (Term, size_t *)); + +#endif /* YAP_NOT_INSTALLED */ + inline EXTERN int IsFloatTerm (Term); @@ -278,6 +294,7 @@ IsFloatTerm (Term t) /* extern Functor FunctorLongInt; */ +#ifdef _YAP_NOT_INSTALLED_ inline EXTERN Term MkLongIntTerm (Int); inline EXTERN Term @@ -291,6 +308,8 @@ MkLongIntTerm (Int i) return AbsAppl(H - 3); } +#endif + inline EXTERN Int LongIntOfTerm (Term t); inline EXTERN Int @@ -402,12 +421,6 @@ typedef struct string_struct { UInt len; } blob_string_t; -Term STD_PROTO (Yap_MkBlobStringTerm, (const char *, size_t len)); -Term STD_PROTO (Yap_MkBlobWideStringTerm, (const wchar_t *, size_t len)); -char *STD_PROTO (Yap_BlobStringOfTerm, (Term)); -wchar_t *STD_PROTO (Yap_BlobWideStringOfTerm, (Term)); -char *STD_PROTO (Yap_BlobStringOfTermAndLength, (Term, size_t *)); - inline EXTERN int IsBlobStringTerm (Term); inline EXTERN int @@ -591,6 +604,8 @@ IsAttachedTerm (Term t) #endif +#ifdef _YAP_NOT_INSTALLED_ + inline EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)); EXTERN int STD_PROTO (unify_extension, (Functor, CELL, CELL *, CELL)); @@ -664,3 +679,4 @@ CELL Yap_Double_key(Term t) return Yap_DoubleP_key(RepAppl(t)+1); } +#endif