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

Diff of /stack/stack.c

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

revision 1.1 by masse, Mon Jan 7 23:09:01 2002 UTC revision 1.3 by teddy, Mon Jan 7 23:31:34 2002 UTC
# Line 4  Line 4 
4  #include <stdlib.h>  #include <stdlib.h>
5  /* NULL */  /* NULL */
6  #include <stddef.h>  #include <stddef.h>
7    /* dlopen, dlsym, dlerror */
8  #include <dlfcn.h>  #include <dlfcn.h>
9    
10  #define HASHTBLSIZE 65536  #define HASHTBLSIZE 65536
# Line 147  void print_st(stackitem* stack_head, lon Line 148  void print_st(stackitem* stack_head, lon
148    if(stack_head->next != NULL)    if(stack_head->next != NULL)
149      print_st(stack_head->next, counter+1);      print_st(stack_head->next, counter+1);
150    
151    if(stack_head->type==value)    switch(stack_head->type){
152      case value:
153      printf("%ld: %d\n", counter, (int)stack_head->content.val);      printf("%ld: %d\n", counter, (int)stack_head->content.val);
154    else if(stack_head->type==string)      break;
155      case string:
156      printf("%ld: \"%s\"\n", counter, (char*)stack_head->content.ptr);      printf("%ld: \"%s\"\n", counter, (char*)stack_head->content.ptr);
157    else      break;
158      case ref:
159      case func:
160      printf("%ld: %p\n", counter, stack_head->content.ptr);      printf("%ld: %p\n", counter, stack_head->content.ptr);
161        break;
162      }
163  }  }
164    
165  extern void printstack(stackitem** stack_head)  extern void printstack(stackitem** stack_head)
# Line 250  int main() Line 257  int main()
257    
258    return EXIT_SUCCESS;    return EXIT_SUCCESS;
259  }  }
260    
261    /* Local Variables: */
262    /* compile-command:"make CFLAGS=\"-Wall -g -rdynamic -ldl\" stack" */
263    /* End: */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26