support for executing c code when a cut occurs
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1463 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
34
C/cut_c.c
Executable file
34
C/cut_c.c
Executable file
@@ -0,0 +1,34 @@
|
||||
#ifdef CUT_C
|
||||
|
||||
#include "Yap.h"
|
||||
#include "cut_c.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void cut_c_initialize(void){
|
||||
Yap_regp->CUT_C_TOP=(cut_c_str_ptr)Yap_LocalBase;
|
||||
}
|
||||
|
||||
/*Removes a choice_point from the stack*/
|
||||
void cut_c_pop(void){
|
||||
cut_c_str_ptr to_delete = NULL;
|
||||
if (((int)Yap_regp->CUT_C_TOP) == ((int)Yap_LocalBase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{ /* removes the top element
|
||||
from the stack */
|
||||
to_delete = Yap_regp->CUT_C_TOP;
|
||||
Yap_regp->CUT_C_TOP = to_delete->before;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*Insert a choice_point in the stack*/
|
||||
void cut_c_push(cut_c_str_ptr new_top){
|
||||
new_top->before = Yap_regp->CUT_C_TOP;
|
||||
Yap_regp->CUT_C_TOP=new_top;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /*CUT_C*/
|
Reference in New Issue
Block a user