home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v92.tgz / v92.tar / v92 / src / h / typedefs.h < prev    next >
Text File  |  1996-03-22  |  2KB  |  95 lines

  1. /*
  2.  * typdefs for the run-time system.
  3.  */
  4.  
  5. typedef AllocType msize;
  6. typedef int ALIGN;        /* pick most stringent type for alignment */
  7. typedef unsigned int DIGIT;
  8.  
  9. /*
  10.  * Default sizing and such.
  11.  */
  12.  
  13. /*
  14.  * Set up typedefs and related definitions depending on whether or not
  15.  * ints and pointers are the same size.
  16.  */
  17.  
  18. #if IntBits != WordBits
  19. typedef long int word;
  20. typedef unsigned long int uword;
  21. #else                    /* IntBits != WordBits */
  22. typedef int word;
  23. #ifdef CDC_VXVE
  24. typedef uword;
  25. #else                    /* CDC_VXVE */
  26. typedef unsigned int uword;
  27. #endif                    /* CDC_VXVE */
  28. #endif                    /* IntBits != WordBits */
  29.  
  30. #ifdef StandardC
  31. #ifndef PointerDef
  32. typedef void *pointer;
  33. #endif                    /* PointerDef */
  34. #else                    /* StandardC */
  35. #ifndef PointerDef
  36. typedef char *pointer;
  37. #endif                    /* PointerDef */
  38. #endif                    /* StandardC */
  39.  
  40. /*
  41.  * Typedefs to make some things easier.
  42.  */
  43.  
  44. typedef int (*fptr)();
  45. typedef struct descrip *dptr;
  46.  
  47. typedef word C_integer;
  48.  
  49. /*
  50.  * A success continuation is referenced by a pointer to an integer function
  51.  *  that takes no arguments.
  52.  */
  53. typedef int (*continuation) Params((noargs));
  54.  
  55. #if !COMPILER
  56.  
  57. /*
  58.  * Typedefs for the interpreter.
  59.  */
  60.  
  61. /*
  62.  * Icode consists of operators and arguments.  Operators are small integers,
  63.  *  while arguments may be pointers.  To conserve space in icode files on
  64.  *  computers with 16-bit ints, icode is written by the linker as a mixture
  65.  *  of ints and words (longs).  When an icode file is read in and processed
  66.  *  by the interpreter, it looks like a C array of mixed ints and words.
  67.  *  Accessing this "nonstandard" structure is handled by a union of int and
  68.  *  word pointers and incrementing is done by incrementing the appropriate
  69.  *  member of the union (see the interpreter).  This is a rather dubious
  70.  *  method and certainly not portable.  A better way might be to address
  71.  *  icode with a char *, but the incrementing code might be inefficient
  72.  *  (at a place that experiences a lot of execution activity).
  73.  *
  74.  * For the moment, the dubious coding is isolated under control of the
  75.  *  size of integers.
  76.  */
  77.  
  78. #if IntBits != WordBits
  79.  
  80. typedef union {
  81.    int *op;
  82.    word *opnd;
  83.    } inst;
  84.  
  85. #else                    /* IntBits != WordBits */
  86.  
  87. typedef union {
  88.    word *op;
  89.    word *opnd;
  90.    } inst;
  91.  
  92. #endif                    /* IntBits != WordBits */
  93.  
  94. #endif                    /* COMPILER */
  95.