From ba761e7a47636df97a678d8a548d7755a70ea24d Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 2 Aug 2007 17:22:00 +0000 Subject: [PATCH] iallow checking for readline and gmp git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1917 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/bignum.c | 13 ++++++++++++- C/iopreds.c | 11 +++++++++++ changes-5.1.html | 2 ++ docs/yap.tex | 4 ++-- pl/directives.yap | 4 ++++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/C/bignum.c b/C/bignum.c index adcb5031f..66bf3672c 100644 --- a/C/bignum.c +++ b/C/bignum.c @@ -100,12 +100,23 @@ p_is_bignum(void) Term t = Deref(ARG1); return(IsNonVarTerm(t) && IsApplTerm(t) && FunctorOfTerm(t) == FunctorBigInt); #else - return(FALSE); + return FALSE; +#endif +} + +static Int +p_has_bignums(void) +{ +#ifdef USE_GMP + return TRUE; +#else + return FALSE; #endif } void Yap_InitBigNums(void) { + Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag|HiddenPredFlag); Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag|HiddenPredFlag); } diff --git a/C/iopreds.c b/C/iopreds.c index 2a15c70fc..35487d529 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -1080,6 +1080,16 @@ ReadlineGetc(int sno) #endif /* HAVE_LIBREADLINE */ +static Int +p_has_readline(void) +{ +#if HAVE_LIBREADLINE + return TRUE; +#else + return FALSE; +#endif +} + int Yap_GetCharForSIGINT(void) @@ -5937,6 +5947,7 @@ Yap_InitIOPreds(void) #endif Yap_InitCPred ("$same_file", 2, p_same_file, SafePredFlag|SyncPredFlag|HiddenPredFlag); Yap_InitCPred ("$float_format", 1, p_float_format, SafePredFlag|SyncPredFlag|HiddenPredFlag); + Yap_InitCPred ("$has_readline", 0, p_has_readline, SafePredFlag|HiddenPredFlag); Yap_InitReadUtil (); #if USE_SOCKET diff --git a/changes-5.1.html b/changes-5.1.html index 31cd83802..61fdb2ec2 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,6 +16,8 @@

Yap-5.1.3: