home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / src / h / rexterns.h < prev    next >
C/C++ Source or Header  |  2002-01-18  |  10KB  |  274 lines

  1. /*
  2.  * External declarations for the run-time system.
  3.  */
  4.  
  5. /*
  6.  * External declarations common to the compiler and interpreter.
  7.  */
  8.  
  9. extern struct b_proc *op_tbl;   /* operators available for string invocation */
  10. extern int op_tbl_sz;           /* number of operators in op_tbl */
  11. extern int debug_info;        /* flag: debugging information is available */
  12. extern int err_conv;        /* flag: error conversion is supported */
  13. extern int dodump;        /* termination dump */
  14. extern int line_info;        /* flag: line information is available */
  15. extern char *file_name;        /* source file for current execution point */
  16. extern int line_num;        /* line number for current execution point */
  17.  
  18. extern unsigned char allchars[];/* array for making one-character strings */
  19. extern char *blkname[];        /* print names for block types. */
  20. extern char *currend;        /* current end of memory region */
  21. extern dptr *quallist;        /* start of qualifier list */
  22. extern int bsizes[];        /* sizes of blocks */
  23. extern int firstd[];        /* offset (words) of first descrip. */
  24. extern uword segsize[];        /* size of hash bucket segment */
  25. extern int k_level;        /* value of &level */
  26.  
  27. extern struct b_coexpr *stklist;/* base of co-expression stack list */
  28. extern struct b_cset blankcs;   /* ' ' */
  29. extern struct b_cset lparcs;    /* '(' */
  30. extern struct b_cset rparcs;    /* ')' */
  31. extern struct b_cset fullcs;    /* cset containing all characters */
  32. extern struct descrip blank;    /* blank */
  33. extern struct descrip emptystr;    /* empty string */
  34.  
  35. extern struct descrip kywd_dmp; /* descriptor for &dump */
  36. extern struct descrip nullptr;    /* descriptor with null block pointer */
  37. extern struct descrip lcase;    /* lowercase string */
  38. extern struct descrip letr;    /* letter "r" */
  39. extern struct descrip maps2;    /* second argument to map() */
  40. extern struct descrip maps3;    /* third argument to map() */
  41. extern struct descrip nulldesc;    /* null value */
  42. extern struct descrip onedesc;    /* one */
  43. extern struct descrip ucase;    /* uppercase string */
  44. extern struct descrip zerodesc;    /* zero */
  45.  
  46. extern word mstksize;        /* size of main stack in words */
  47. extern word stksize;        /* size of co-expression stacks in words */
  48. extern word qualsize;        /* size of string qualifier list */
  49. extern word memcushion;        /* memory region cushion factor */
  50. extern word memgrowth;        /* memory region growth factor */
  51. extern uword stattotal;        /* cumulative total of all static allocations */
  52.                 /* N.B. not currently set */
  53.  
  54. extern struct tend_desc *tend;  /* chain of tended descriptors */
  55.  
  56. /*
  57.  * Externals that are conditional on features.
  58.  */
  59. #ifdef FncTrace
  60.    extern struct descrip kywd_ftrc;    /* descriptor for &ftrace */
  61. #endif                    /* FncTrace */
  62.  
  63. #ifdef Polling
  64.    extern int pollctr;
  65. #endif                    /* Polling */
  66.  
  67. #ifdef EventMon
  68.    extern char typech[];
  69.    extern word oldsum;
  70.    extern struct descrip csetdesc;    /* cset descriptor */
  71.    extern struct descrip eventdesc;    /* event descriptor */
  72.    extern struct b_iproc mt_llist;
  73.    extern struct descrip rzerodesc;    /* real descriptor */
  74.    extern struct b_real realzero;    /* real zero block */
  75. #endif                    /* EventMon */
  76.  
  77. #ifdef DosFncs
  78.    extern char *zptr;
  79. #endif                    /* DosFncs */
  80.  
  81. /*
  82.  * Externals conditional on multithreading.
  83.  */
  84. #ifndef MultiThread
  85.    extern dptr glbl_argp;        /* argument pointer */
  86.    extern struct region *curstring;
  87.    extern struct region *curblock;
  88. #endif                    /* MultiThread */
  89.    extern struct region rootstring;
  90.    extern struct region rootblock;
  91. #ifndef MultiThread
  92.    extern struct descrip k_current;    /* ¤t */
  93.    extern char *k_errortext;        /* value of &errortext */
  94.    extern int have_errval;        /* &errorvalue has a legal value */
  95.    extern int k_errornumber;        /* value of &errornumber */
  96.    extern int t_errornumber;        /* tentative k_errornumber value */
  97.    extern int t_have_val;        /* tentative have_errval flag */
  98.    extern struct b_file k_errout;    /* value of &errout */
  99.    extern struct b_file k_input;    /* value of &input */
  100.    extern struct b_file k_output;    /* value of &output */
  101.    extern struct descrip k_errorvalue;    /* value of &errorvalue */
  102.    extern struct descrip kywd_err;    /* &error */
  103.    extern struct descrip kywd_pos;    /* descriptor for &pos */
  104.    extern struct descrip kywd_prog;    /* descriptor for &prog */
  105.    extern struct descrip kywd_ran;    /* descriptor for &random */
  106.    extern struct descrip k_subject;    /* &subject */
  107.    extern struct descrip kywd_trc;    /* descriptor for &trace */
  108.    extern struct descrip k_eventcode;    /* &eventcode */
  109.    extern struct descrip k_eventsource;    /* &eventsource */
  110.    extern struct descrip k_eventvalue;    /* &eventvalue */
  111.    extern struct descrip k_main;    /* value of &main */
  112. #endif                    /* MultiThread */
  113.  
  114. #ifndef MultiThread
  115.    extern struct descrip t_errorvalue;    /* tentative k_errorvalue value */
  116. #endif                    /* MultiThread */
  117.  
  118. #ifndef MultiThread
  119.    extern uword blktotal;        /* cumul total of all block allocs */
  120.    extern uword strtotal;        /* cumul total of all string allocs */
  121. #endif                    /* MultiThread */
  122.  
  123. #ifndef MultiThread
  124.    extern word coll_tot;        /* total number of collections */
  125.    extern word coll_stat;        /* collections from static reqests */
  126.    extern word coll_str;        /* collections from string requests */
  127.    extern word coll_blk;        /* collections from block requests */
  128.    extern dptr globals;            /* start of global variables */
  129.    extern dptr eglobals;        /* end of global variables */
  130.    extern dptr gnames;            /* start of global variable names */
  131.    extern dptr egnames;            /* end of global variable names */
  132.    extern dptr estatics;        /* end of static variables */
  133. #endif                    /* MultiThread */
  134.  
  135. #ifndef MultiThread
  136.    extern int n_globals;        /* number of global variables */
  137.    extern int n_statics;        /* number of static variables */
  138.    extern struct b_coexpr *mainhead;    /* &main */
  139. #endif                    /* MultiThread */
  140.  
  141. /*
  142.  * Externals that differ between compiler and interpreter.
  143.  */
  144. #if !COMPILER
  145.    /*
  146.     * External declarations for the interpreter.
  147.     */
  148.  
  149.    extern inst ipc;            /* interpreter program counter */
  150.    extern int ilevel;            /* interpreter level */
  151.    extern int ntended;            /* number of active tended descriptors*/
  152.    extern struct b_cset k_ascii;    /* value of &ascii */
  153.    extern struct b_cset k_cset;        /* value of &cset */
  154.    extern struct b_cset k_digits;    /* value of &lcase */
  155.    extern struct b_cset k_lcase;    /* value of &lcase */
  156.    extern struct b_cset k_letters;    /* value of &letters */
  157.    extern struct b_cset k_ucase;    /* value of &ucase */
  158.    extern struct descrip tended[];    /* tended descriptors */
  159.    extern struct ef_marker *efp;    /* expression frame pointer */
  160.    extern struct gf_marker *gfp;    /* generator frame pointer */
  161.    extern struct pf_marker *pfp;    /* procedure frame pointer */
  162.    extern word *sp;            /* interpreter stack pointer */
  163.    extern word *stack;            /* interpreter stack base */
  164.    extern word *stackend;        /* end of evaluation stack */
  165.  
  166.    extern struct pstrnm pntab[];
  167.    extern int pnsize;
  168.  
  169.    #ifdef ExecImages
  170.       extern int dumped;        /* the interpreter has been dumped */
  171.    #endif                /* ExecImages */
  172.  
  173.    #ifdef MultiThread
  174.       extern struct progstate *curpstate;
  175.       extern struct progstate rootpstate;
  176.       extern int noMTevents;        /* no MT events during GC */
  177.    #else                /* MultiThread */
  178.       extern char *code;        /* start of icode */
  179.       extern char *ecode;        /* end of icode */
  180.       extern dptr statics;        /* start of static variables */
  181.       extern char *strcons;        /* start of the string constants */
  182.       extern dptr fnames;        /* field names */
  183.       extern dptr efnames;        /* end of field names */
  184.       extern word *records;
  185.       extern int *ftabp;        /* field table pointer */
  186.       #ifdef FieldTableCompression
  187.          extern word ftabwidth, foffwidth;
  188.          extern unsigned char *ftabcp;
  189.          extern short *ftabsp;
  190.       #endif                /* FieldTableCompression */
  191.       extern dptr xargp;
  192.       extern word xnargs;
  193.  
  194.       extern word lastop;
  195.    #endif                /* MultiThread */
  196.  
  197. #else                    /* COMPILER */
  198.  
  199.    extern struct descrip statics[];    /* array of static variables */
  200.    extern struct b_proc *builtins[];    /* pointers to builtin functions */
  201.    extern int noerrbuf;            /* error buffering */
  202.    extern struct p_frame *pfp;        /* procedure frame pointer */
  203.    extern struct descrip trashcan;    /* dummy descriptor, never read */
  204.    extern int largeints;        /* flag: large integers supported */
  205.  
  206. #endif                    /* COMPILER */
  207.  
  208. /*
  209.  * graphics
  210.  */
  211. #ifdef Graphics
  212.  
  213.    extern stringint attribs[], drawops[];
  214.    extern wbp wbndngs;
  215.    extern wcp wcntxts;
  216.    extern wsp wstates;
  217.    extern int GraphicsLeft, GraphicsUp, GraphicsRight, GraphicsDown;
  218.    extern int GraphicsHome, GraphicsPrior, GraphicsNext, GraphicsEnd;
  219.    extern int win_highwater, canvas_serial, context_serial;
  220.    extern clock_t starttime;        /* start time in milliseconds */
  221.  
  222.    #ifndef MultiThread
  223.       extern struct descrip kywd_xwin[];
  224.       extern struct descrip lastEventWin;
  225.       extern int lastEvFWidth, lastEvLeading, lastEvAscent;
  226.       extern struct descrip amperCol;
  227.       extern struct descrip amperRow;
  228.       extern struct descrip amperX;
  229.       extern struct descrip amperY;
  230.       extern struct descrip amperInterval;
  231.       extern uword xmod_control, xmod_shift, xmod_meta;
  232.    #endif                /* MultiThread */
  233.  
  234.    #ifdef XWindows
  235.       extern struct _wdisplay * wdsplys;
  236.       extern stringint cursorsyms[];
  237.    #endif                /* XWindows */
  238.  
  239.    #ifdef MSWindows
  240.       extern HINSTANCE mswinInstance;
  241.       extern int ncmdShow;
  242.    #endif                /* MSWindows */
  243.  
  244.    #ifdef PresentationManager
  245.       /* this is the handle to the interpreter thread's anchor block */
  246.       extern HAB HInterpAnchorBlock;
  247.       extern HAB HMainAnchorBlock;
  248.       extern HMQ HInterpMessageQueue;
  249.       extern HMQ HMainMessageQueue;
  250.       extern lclIdentifier *LocalIds;
  251.       extern stringint siMixModes[];
  252.       extern stringint siLineTypes[];
  253.       extern stringint siColorNames[];
  254.       extern stringint siCursorSyms[];
  255.       extern LONG ScreenWidth;
  256.       extern LONG ScreenHeight;
  257.       extern LONG NumWindows;
  258.       extern LONG MaxPSColors;
  259.       extern colorEntry *ColorTable;
  260.       extern ULONG areaAttrs;
  261.       extern ULONG lineAttrs;
  262.       extern ULONG charAttrs;
  263.       extern ULONG imageAttrs;
  264.    #endif                /* PresentationManager */
  265.  
  266.    #ifdef ConsoleWindow
  267.       extern FILE *ConsoleBinding, *flog;
  268.       extern unsigned long ConsoleFlags;
  269.       extern char ConsoleStringBuf[];
  270.       extern char *ConsoleStringBufPtr;
  271.    #endif                /* ConsoleWindow */
  272.  
  273. #endif                    /* Graphics */
  274.