2005-11-18 18:52:41 +00:00
|
|
|
#include "Yap.h"
|
|
|
|
#include "cut_c.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2012-12-13 18:12:50 +00:00
|
|
|
void cut_c_initialize(int wid){
|
2011-03-07 16:02:55 +00:00
|
|
|
CACHE_REGS
|
2012-12-13 18:12:50 +00:00
|
|
|
Yap_REGS.CUT_C_TOP=(cut_c_str_ptr)REMOTE_LocalBase(wid);
|
2005-11-18 18:52:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*Removes a choice_point from the stack*/
|
|
|
|
void cut_c_pop(void){
|
2011-03-07 16:02:55 +00:00
|
|
|
CACHE_REGS
|
2005-11-18 18:52:41 +00:00
|
|
|
cut_c_str_ptr to_delete = NULL;
|
2011-05-23 16:19:47 +01:00
|
|
|
if (((CELL *)Yap_REGS.CUT_C_TOP) == ((CELL *)LOCAL_LocalBase))
|
2005-11-18 18:52:41 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ /* removes the top element
|
|
|
|
from the stack */
|
2006-03-09 15:52:06 +00:00
|
|
|
to_delete = Yap_REGS.CUT_C_TOP;
|
|
|
|
Yap_REGS.CUT_C_TOP = to_delete->before;
|
2005-11-18 18:52:41 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Insert a choice_point in the stack*/
|
|
|
|
void cut_c_push(cut_c_str_ptr new_top){
|
2011-03-07 16:02:55 +00:00
|
|
|
CACHE_REGS
|
2006-03-09 15:52:06 +00:00
|
|
|
new_top->before = Yap_REGS.CUT_C_TOP;
|
|
|
|
Yap_REGS.CUT_C_TOP=new_top;
|
2005-11-18 18:52:41 +00:00
|
|
|
return;
|
|
|
|
}
|