This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
2005-11-18 18:52:41 +00:00
|
|
|
#ifdef CUT_C
|
|
|
|
|
|
|
|
#include "Yap.h"
|
|
|
|
#include "cut_c.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void cut_c_initialize(void){
|
2006-03-09 15:52:06 +00:00
|
|
|
Yap_REGS.CUT_C_TOP=(cut_c_str_ptr)Yap_LocalBase;
|
2005-11-18 18:52:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*Removes a choice_point from the stack*/
|
|
|
|
void cut_c_pop(void){
|
|
|
|
cut_c_str_ptr to_delete = NULL;
|
2006-03-09 15:52:06 +00:00
|
|
|
if (((CELL *)Yap_REGS.CUT_C_TOP) == ((CELL *)Yap_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){
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /*CUT_C*/
|