home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / gcl-1.000 / gcl-1 / gcl-1.0 / h / vs.h < prev   
Encoding:
C/C++ Source or Header  |  1994-05-07  |  1.7 KB  |  71 lines

  1. /*
  2.  Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
  3.  
  4. This file is part of GNU Common Lisp, herein referred to as GCL
  5.  
  6. GCL is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GCL is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public 
  14. License for more details.
  15.  
  16. You should have received a copy of the GNU Library General Public License 
  17. along with GCL; see the file COPYING.  If not, write to the Free Software
  18. Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. */
  21.  
  22. /*
  23.     vs.h
  24.  
  25.     value stack
  26. */
  27.  
  28. /*
  29. #define    VSSIZE        2048
  30. */
  31.                     /*  value stack size  */
  32. #define    VSGETA        128        /*  value stack geta  */
  33.  
  34.  
  35. object value_stack[VSSIZE + 2*VSGETA];
  36.  
  37.  
  38. object *vs_org;
  39. object *vs_limit;    /*  value stack limit  */
  40.  
  41. object *vs_base;    /*  value stack base  */
  42. object *vs_top;        /*  value stack top  */
  43.  
  44. #define    vs_push(obje)    (*vs_top++ = (obje))
  45.  
  46. #define    vs_pop        (*--vs_top)
  47. #define    vs_head        vs_top[-1]
  48.  
  49. #define    vs_mark        object *old_vs_top = vs_top
  50. #define    vs_reset    vs_top = old_vs_top
  51.  
  52. #define    vs_check    if (vs_top >= vs_limit)  \
  53.                 vs_overflow()
  54.  
  55. #define    vs_check_push(obje)  \
  56.             (vs_top >= vs_limit ?  \
  57.              (object)vs_overflow() : (*vs_top++ = (obje)))
  58.  
  59. #define    check_arg(n)  \
  60.             if (vs_top - vs_base != (n))  \
  61.                 check_arg_failed(n)
  62.  
  63. #define    MMcheck_arg(n)  \
  64.             if (vs_top - vs_base < (n))  \
  65.                 too_few_arguments();  \
  66.             else if (vs_top - vs_base > (n))  \
  67.                 too_many_arguments()
  68.  
  69. #define vs_reserve(x)    if(vs_base+(x) >= vs_limit)  \
  70.                 vs_overflow();
  71.