/[cvs]/stack/stack.c
ViewVC logotype

Diff of /stack/stack.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by masse, Sat Feb 2 15:26:10 2002 UTC revision 1.22 by masse, Sat Feb 2 18:11:54 2002 UTC
# Line 254  extern void printstack(stackitem** stack Line 254  extern void printstack(stackitem** stack
254  extern void eval(stackitem** stack_head)  extern void eval(stackitem** stack_head)
255  {  {
256    funcp in_func;    funcp in_func;
257      stackitem* temp= *stack_head;
258    
259    if((*stack_head)==NULL || (*stack_head)->type!=ref) {    if(temp==NULL) {
260      printerr("Stack empty or not a reference");      printerr("Stack empty");
261      return;      return;
262    }    }
263    
264    if(((stackitem*)(*stack_head)->content.ptr)->type==func) {    while(temp->type==ref)
265      in_func= (funcp)((stackitem*)(*stack_head)->content.ptr)->content.ptr;      temp= temp->content.ptr;
266    
267      if(temp->type==func) {
268        in_func= (funcp)(temp->content.ptr);
269      toss(stack_head);      toss(stack_head);
270      (*in_func)(stack_head);      (*in_func)(stack_head);
271      return;      return;
272    } else    }
273      printerr("Not a function");      
274      printerr("Couldn't evaluate");
275  }  }
276    
277  /* Make a list. */  /* Make a list. */

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26