From 8b9cf7dc2a7e4e1327f7c84c7b9ac013df7ed57d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 30 Aug 2010 22:25:56 -0500 Subject: [PATCH] YAP_SetYAP_Flag --- C/c_interface.c | 25 +++++++++++++++++++++++++ changes-6.0.html | 1 + docs/yap.tex | 21 +++++++++++++++++++-- include/YapInterface.h | 3 +++ include/yap_structs.h | 8 ++++++++ 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index a48707cf2..b6565a6fc 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -519,6 +519,7 @@ X_API int STD_PROTO(YAP_Erase,(void *)); X_API int STD_PROTO(YAP_Variant,(Term, Term)); X_API int STD_PROTO(YAP_ExactlyEqual,(Term, Term)); X_API Int STD_PROTO(YAP_TermHash,(Term, Int, Int, int)); +X_API int STD_PROTO(YAP_SetYAPFlag,(yap_flag_t, int)); static int (*do_getf)(void); @@ -3100,4 +3101,28 @@ YAP_SlotsToArgs(int n, Int slot) } +X_API int +YAP_SetYAPFlag(yap_flag_t flag, int val) +{ + switch (flag) { + case YAPC_ENABLE_GC: + if (val) { + Yap_PutValue(AtomGc, MkAtomTerm(AtomTrue)); + } else { + Yap_PutValue(AtomGc, TermNil); + } + return TRUE; + case YAPC_ENABLE_AGC: + if (val) { + AGcThreshold = 10000; + } else { + AGcThreshold = 0; + } + return TRUE; + default: + return FALSE; + } +} + + diff --git a/changes-6.0.html b/changes-6.0.html index a15408ad8..be67a39b7 100644 --- a/changes-6.0.html +++ b/changes-6.0.html @@ -17,6 +17,7 @@

Yap-6.0.7: