home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !FALCON / NOCREW / MP2_0997.ZIP / mp2_0997 / src / libshoe.h < prev    next >
C/C++ Source or Header  |  1998-11-08  |  1KB  |  47 lines

  1. /* libshoe.h
  2.  *
  3.  * COPYRIGHT (c) 1998 by Fredrik Noring.
  4.  */
  5.  
  6. #include "types.h"
  7.  
  8. #ifndef _LIBSHOE_H_
  9. #define _LIBSHOE_H_
  10.  
  11. #define ONE_K   1024L
  12. #define ONE_MEG (ONE_K*ONE_K)
  13.  
  14. #define HEAP_SIZE   (100*ONE_K)
  15. #define GC_MINIMUM  (4*ONE_K)
  16. #define MAX_SYMBOLS (9999)
  17.  
  18. #define T                memdup("#t")
  19. #define F                memdup("#f")
  20. /*#define ERR              (trace?panic("#ERR."):memdup("#ERR.")) */
  21. #define ERR              memdup("#ERR.")
  22. #define FP(x)            MATCH((x), F)
  23. #define TP(x)            (!FP(x))
  24. #define NILP(x)          MATCH((x), "()")
  25. #define LISTP(x)         ((x)[0] == '(')
  26. #define MATCH(a, b)      (strcmp((a), (b)) == 0)
  27. #define DIGITP(c)        ((c) >= '0' && (c) <= '9')
  28. #define EVAL(x)          eval(car(x))
  29. #define EVALARG(x)       EVAL(cdr(x))
  30. #define DUAL_EVAL(s, op) \
  31.   Byte *a, *b; \
  32.   s = push_stack(s); a = push_stack(EVAL(s)); \
  33.   b = push_stack(EVALARG(s)); op; pop_n_elems(3); return s;
  34.  
  35. extern Byte *eval(Byte *s);
  36. extern Int inquire_balance(void);
  37. extern Byte *parse_eval(Byte *input);
  38. extern void bootstrap();
  39. extern void bif(Byte *symbol, void *f);
  40. extern Byte *mem(Int amount);
  41. extern Byte *memdup(Byte *s);
  42. extern Byte *car(Byte *s);
  43. extern Byte *cdr(Byte *s);
  44.  
  45. extern Byte *push_stack(Byte *s);extern Byte *pop_n_elems(Int n);
  46. #endif /* _LIBSHOE_H_ */
  47.