YAP 7.1.0
cut_c.c
1#include "Yap.h"
2#include "cut_c.h"
3#include <stdio.h>
4
5void cut_c_initialize(int wid){
6 CACHE_REGS
7 Yap_REGS.CUT_C_TOP=(cut_c_str_ptr)REMOTE_LocalBase(wid);
8}
9
10/*Removes a choice_point from the stack*/
11void cut_c_pop(void){
12 CACHE_REGS
13 cut_c_str_ptr to_delete = NULL;
14 if (((CELL *)Yap_REGS.CUT_C_TOP) == ((CELL *)LOCAL_LocalBase))
15 {
16 return;
17 }
18 else
19 { /* removes the top element
20 from the stack */
21 to_delete = Yap_REGS.CUT_C_TOP;
22 Yap_REGS.CUT_C_TOP = to_delete->before;
23 return;
24 }
25}
26
27/*Insert a choice_point in the stack*/
28void cut_c_push(cut_c_str_ptr new_top){
29 CACHE_REGS
30 new_top->before = Yap_REGS.CUT_C_TOP;
31 Yap_REGS.CUT_C_TOP=new_top;
32 return;
33}
Main definitions.