support intptr_t and uintptr_t in swi api

This commit is contained in:
vscosta 2014-11-09 11:18:03 +00:00
parent 6958f4ce6d
commit d8c4ea4364
2 changed files with 16 additions and 0 deletions

View File

@ -525,6 +525,8 @@ extern X_API int PL_unify_atom_nchars(term_t, size_t len, const char *);
extern X_API int PL_unify_float(term_t, double);
extern X_API int PL_unify_functor(term_t, functor_t);
extern X_API int PL_unify_int64(term_t, int64_t);
extern X_API int PL_unify_intptr(term_t, intptr_t);
extern X_API int PL_unify_uintptr(term_t, uintptr_t);
extern X_API int PL_unify_integer(term_t, long);
extern X_API int PL_unify_list(term_t, term_t, term_t);
extern X_API int PL_unify_list_chars(term_t, const char *);

View File

@ -1210,6 +1210,20 @@ X_API int PL_unify_integer(term_t t, long n)
return Yap_unify(Yap_GetFromSlot(t PASS_REGS),iterm);
}
X_API int PL_unify_intptr(term_t t, intptr_t n)
{
CACHE_REGS
Term iterm = MkIntegerTerm(n);
return Yap_unify(Yap_GetFromSlot(t PASS_REGS),iterm);
}
X_API int PL_unify_uintptr(term_t t, uintptr_t n)
{
CACHE_REGS
Term iterm = MkIntegerTerm(n);
return Yap_unify(Yap_GetFromSlot(t PASS_REGS),iterm);
}
/* SWI: int PL_unify_integer(term_t ?t, long n)
YAP long int unify(YAP_Term* a, Term* b) */
X_API int PL_unify_functor(term_t t, functor_t f)