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 / rproto.h < prev    next >
C/C++ Source or Header  |  2002-01-18  |  24KB  |  615 lines

  1. /*
  2.  * Prototypes for run-time functions.
  3.  */
  4.  
  5. /*
  6.  * Prototypes common to the compiler and interpreter.
  7.  */
  8. void        EVInit        (void);
  9. int        activate    (dptr val, struct b_coexpr *ncp, dptr result);
  10. word        add        (word a,word b);
  11. void        addmem (struct b_set *ps, struct b_selem *pe, union block **pl);
  12. struct astkblk    *alcactiv    (void);
  13. struct b_cset    *alccset    (void);
  14. struct b_file    *alcfile    (FILE *fd,int status,dptr name);
  15. union block    *alchash    (int tcode);
  16. struct b_list    *alclist    (uword size);
  17. struct b_lelem    *alclstb    (uword nslots,uword first,uword nused);
  18. struct b_real    *alcreal    (double val);
  19. struct b_slots    *alcsegment    (word nslots);
  20. struct b_selem    *alcselem    (dptr mbr,uword hn);
  21. char        *alcstr        (char    *s,word slen);
  22. struct b_telem    *alctelem    (void);
  23. struct b_tvtbl    *alctvtbl    (dptr tbl,dptr ref,uword hashnum);
  24. int        anycmp        (dptr dp1,dptr dp2);
  25. int        bfunc        (void);
  26. struct b_proc    *bi_strprc    (dptr s, C_integer arity);
  27. void        c_exit        (int i);
  28. int        c_get        (struct b_list *hp, struct descrip *res);
  29. void        c_put        (struct descrip *l, struct descrip *val);
  30. int        cnv_c_dbl    (dptr s, double *d);
  31. int        cnv_c_int    (dptr s, C_integer *d);
  32. int        cnv_c_str    (dptr s, dptr d);
  33. int        cnv_cset    (dptr s, dptr d);
  34. int        cnv_ec_int    (dptr s, C_integer *d);
  35. int        cnv_eint    (dptr s, dptr d);
  36. int        cnv_int        (dptr s, dptr d);
  37. int        cnv_real    (dptr s, dptr d);
  38. int        cnv_str        (dptr s, dptr d);
  39. int        cnv_tcset    (struct b_cset *cbuf, dptr s, dptr d);
  40. int        cnv_tstr    (char *sbuf, dptr s, dptr d);
  41. int        co_chng        (struct b_coexpr *ncp, struct descrip *valloc,
  42.                    struct descrip *rsltloc,
  43.                    int swtch_typ, int first);
  44. void        co_init        (struct b_coexpr *sblkp);
  45. void        coclean        (word *old);
  46. void        coacttrace    (struct b_coexpr *ccp,struct b_coexpr *ncp);
  47. void        cofailtrace    (struct b_coexpr *ccp,struct b_coexpr *ncp);
  48. void        corettrace    (struct b_coexpr *ccp,struct b_coexpr *ncp);
  49. int        coswitch    (word *old, word *new, int first);
  50. int        cplist        (dptr dp1,dptr dp2,word i,word j);
  51. int        cpset        (dptr dp1,dptr dp2,word size);
  52. void        cpslots        (dptr dp1,dptr slotptr,word i, word j);
  53. int        csetcmp        (unsigned int *cs1,unsigned int *cs2);
  54. int        cssize        (dptr dp);
  55. word        cvpos        (long pos,long len);
  56. void        datainit    (void);
  57. void        deallocate    (union block *bp);
  58. int        def_c_dbl    (dptr s, double df, double * d);
  59. int        def_c_int    (dptr s, C_integer df, C_integer * d);
  60. int        def_c_str    (dptr s, char * df, dptr d);
  61. int        def_cset    (dptr s, struct b_cset * df, dptr d);
  62. int        def_ec_int    (dptr s, C_integer df, C_integer * d);
  63. int        def_eint    (dptr s, C_integer df, dptr d);
  64. int        def_int        (dptr s, C_integer df, dptr d);
  65. int        def_real    (dptr s, double df, dptr d);
  66. int        def_str        (dptr s, dptr df, dptr d);
  67. int        def_tcset (struct b_cset *cbuf,dptr s,struct b_cset *df,dptr d);
  68. int        def_tstr    (char *sbuf, dptr s, dptr df, dptr d);
  69. word        div3        (word a,word b);
  70. int        doasgn        (dptr dp1,dptr dp2);
  71. int        doimage        (int c,int q);
  72. int        dp_pnmcmp    (struct pstrnm *pne,dptr dp);
  73. void        drunerr        (int n, double v);
  74. void        dumpact        (struct b_coexpr *ce);
  75. void        env_int    (char *name,word *variable,int non_neg, uword limit);
  76. int        equiv        (dptr dp1,dptr dp2);
  77. int        err        (void);
  78. void        err_msg        (int n, dptr v);
  79. void        error        (char *s1, char *s2);
  80. void        fatalerr    (int n,dptr v);
  81. int        findcol        (word *ipc);
  82. char        *findfile    (word *ipc);
  83. int        findipc        (int line);
  84. int        findline    (word *ipc);
  85. int        findloc        (word *ipc);
  86. void        fpetrap        (int);
  87. int        getvar        (char *s,dptr vp);
  88. uword        hash        (dptr dp);
  89. union block    **hchain    (union block *pb,uword hn);
  90. union block    *hgfirst    (union block *bp, struct hgstate *state);
  91. union block    *hgnext        (union block*b,struct hgstate*s,union block *e);
  92. union block    *hmake        (int tcode,word nslots,word nelem);
  93. void        icon_init    (char *name, int *argcp, char *argv[]);
  94. void        iconhost    (char *hostname);
  95. int        idelay        (int n);
  96. int        interp        (int fsig,dptr cargp);
  97. void        irunerr        (int n, C_integer v);
  98. int        lexcmp        (dptr dp1,dptr dp2);
  99. word        longread    (char *s,int width,long len,FILE *fname);
  100. union block    **memb        (union block *pb,dptr x,uword hn, int *res);
  101. void        mksubs        (dptr var,dptr val,word i,word j, dptr result);
  102. word        mod3        (word a,word b);
  103. word        mul        (word a,word b);
  104. word        neg        (word a);
  105. void        new_context    (int fsig, dptr cargp); /* w/o Coexpr: a stub */
  106. int        numcmp        (dptr dp1,dptr dp2,dptr dp3);
  107. void        outimage    (FILE *f,dptr dp,int noimage);
  108. struct b_coexpr    *popact        (struct b_coexpr *ce);
  109. word        prescan        (dptr d);
  110. int        pstrnmcmp    (struct pstrnm *a,struct pstrnm *b);
  111. int        pushact        (struct b_coexpr *ce, struct b_coexpr *actvtr);
  112. int        putstr        (FILE *f,dptr d);
  113. char        *qsearch    (char *key, char *base, int nel, int width,
  114.                    int (*cmp)());
  115. int        qtos        (dptr dp,char *sbuf);
  116. int         radix        (int sign, register int r, register char *s,
  117.                    register char *end_s, union numeric *result);
  118. char        *reserve    (int region, word nbytes);
  119. void        retderef        (dptr valp, word *low, word *high);
  120. void        segvtrap    (int);
  121. void        stkdump        (int);
  122. word        sub        (word a,word b);
  123. void        syserr        (char *s);
  124. struct b_coexpr    *topact        (struct b_coexpr *ce);
  125. void        xmfree        (void);
  126.  
  127. #ifdef MultiThread
  128.    void    resolve            (struct progstate *pstate);
  129.    struct b_coexpr *loadicode (char *name, struct b_file *theInput,
  130.       struct b_file *theOutput, struct b_file *theError,
  131.       C_integer bs, C_integer ss, C_integer stk);
  132.    void actparent (int eventcode);
  133.    int mt_activate   (dptr tvalp, dptr rslt, struct b_coexpr *ncp);
  134. #else                    /* MultiThread */
  135.    void    resolve            (void);
  136. #endif                    /* MultiThread */
  137.  
  138. #ifdef EventMon
  139.    void EVAsgn    (dptr dx);
  140. #endif                    /* EventMon */
  141.  
  142. #ifdef ExternalFunctions
  143.    dptr    extcall            (dptr x, int nargs, int *signal);
  144. #endif                    /* ExternalFunctions */
  145.  
  146. #ifdef LargeInts
  147.    struct b_bignum *alcbignum    (word n);
  148.    word        bigradix    (int sign, int r, char *s, char *x,
  149.                            union numeric *result);
  150.    double    bigtoreal    (dptr da);
  151.    int        realtobig    (dptr da, dptr dx);
  152.    int        bigtos        (dptr da, dptr dx);
  153.    void        bigprint    (FILE *f, dptr da);
  154.    int        cpbignum    (dptr da, dptr db);
  155.    int        bigadd        (dptr da, dptr db, dptr dx);
  156.    int        bigsub        (dptr da, dptr db, dptr dx);
  157.    int        bigmul        (dptr da, dptr db, dptr dx);
  158.    int        bigdiv        (dptr da, dptr db, dptr dx);
  159.    int        bigmod        (dptr da, dptr db, dptr dx);
  160.    int        bigneg        (dptr da, dptr dx);
  161.    int        bigpow        (dptr da, dptr db, dptr dx);
  162.    int        bigpowri        (double a, dptr db, dptr drslt);
  163.    int        bigand        (dptr da, dptr db, dptr dx);
  164.    int        bigor        (dptr da, dptr db, dptr dx);
  165.    int        bigxor        (dptr da, dptr db, dptr dx);
  166.    int        bigshift    (dptr da, dptr db, dptr dx);
  167.    word        bigcmp        (dptr da, dptr db);
  168.    int        bigrand        (dptr da, dptr dx);
  169. #endif                    /* LargeInts */
  170.  
  171. #if !HIGHC_386
  172.    int dup2(int h1, int h2);
  173. #endif                    /* !HIGHC_386 */
  174.  
  175. #if HIGHC_386
  176.    int    brk(char *p);
  177. #endif                    /* HIGHC_386 */
  178.  
  179. #if MACINTOSH
  180.    #if MPW
  181.       char *brk(char *addr);
  182.       char *sbrk(int incr);
  183.    #endif                /* MPW */
  184. #endif                    /* MACINTOSH */
  185.  
  186. #ifdef MSWindows
  187.    #ifdef FAttrib
  188.       #if MSDOS
  189.          char *make_mode(unsigned short st_mode);
  190.          int strcasecmp(char *s1, char *s2);
  191.          int strncasecmp(char *s1, char *s2, int n);
  192.       #endif                /* MSDOS */
  193.    #endif                /* FAttrib */
  194. #endif                    /* MSWindows */
  195.  
  196. #ifdef Graphics
  197.    /*
  198.     * portable graphics routines in rwindow.r and rwinrsc.r
  199.     */
  200.    wcp    alc_context    (wbp w);
  201.    wbp    alc_wbinding    (void);
  202.    wsp    alc_winstate    (void);
  203.    int    atobool        (char *s);
  204.    void    c_push        (dptr l,dptr val);  /* in fstruct.r */
  205.    int    docircles    (wbp w, int argc, dptr argv, int fill);
  206.    void    drawCurve    (wbp w, XPoint *p, int n);
  207.    char    *evquesub    (wbp w, int i);
  208.    void    genCurve    (wbp w, XPoint *p, int n, void (*h)());
  209.    wsp    getactivewindow    (void);
  210.    int    getpattern    (wbp w, char *answer);
  211.    struct palentry *palsetup(int p);
  212.    int    palnum        (dptr d);
  213.    int    parsecolor    (wbp w, char *s, long *r, long *g, long *b);
  214.    int    parsefont    (char *s, char *fam, int *sty, int *sz);
  215.    int    parsegeometry    (char *buf, SHORT *x, SHORT *y, SHORT *w, SHORT *h);
  216.    int    parsepattern    (char *s, int len, int *w, int *nbits, C_integer *bits);
  217.    void    qevent        (wsp ws, dptr e, int x, int y, uword t, long f);
  218.    int    readGIF        (char *fname, int p, struct imgdata *d);
  219.    int    rectargs    (wbp w, int argc, dptr argv, int i,
  220.                word *px, word *py, word *pw, word *ph);
  221.    char    *rgbkey        (int p, double r, double g, double b);
  222.    int    setsize        (wbp w, char *s);
  223.    char    *si_i2s        (siptr sip, int i);
  224.    int    si_s2i        (siptr sip, char *s);
  225.    int    ulcmp        (pointer p1, pointer p2);
  226.    int    wattrib        (wbp w, char *s, long len, dptr answer, char *abuf);
  227.    int    wgetche        (wbp w, dptr res);
  228.    int    wgetchne    (wbp w, dptr res);
  229.    int    wgetevent    (wbp w, dptr res);
  230.    int    wgetstrg    (char *s, long maxlen, FILE *f);
  231.    void    wgoto        (wbp w, int row, int col);
  232.    int    wlongread    (char *s, int elsize, int nelem, FILE *f);
  233.    void    wputstr        (wbp w, char *s, int len);
  234.    int    writeGIF    (wbp w, char *filename,
  235.               int x, int y, int width, int height);
  236.    int    xyrowcol    (dptr dx);
  237.  
  238.    /*
  239.     * graphics implementation routines supplied for each platform
  240.     * (excluding those defined as macros for X-windows)
  241.     */
  242.    int    SetPattern    (wbp w, char *name, int len);
  243.    int    SetPatternBits    (wbp w, int width, C_integer *bits, int nbits);
  244.    int    allowresize    (wbp w, int on);
  245.    int    blimage        (wbp w, int x, int y, int wd, int h,
  246.               int ch, unsigned char *s, word len);
  247.    wcp    clone_context    (wbp w);
  248.    int    copyArea    (wbp w,wbp w2,int x,int y,int wd,int h,int x2,int y2);
  249.    int    do_config    (wbp w, int status);
  250.    int    dumpimage    (wbp w, char *filename, unsigned int x, unsigned int y,
  251.                unsigned int width, unsigned int height);
  252.    void    eraseArea    (wbp w, int x, int y, int width, int height);
  253.    void    fillrectangles    (wbp w, XRectangle *recs, int nrecs);
  254.    void    free_binding    (wbp w);
  255.    void    free_context    (wcp wc);
  256.    void    free_mutable    (wbp w, int mute_index);
  257.    int    free_window    (wsp ws);
  258.    void    freecolor    (wbp w, char *s);
  259.    char    *get_mutable_name (wbp w, int mute_index);
  260.    void    getbg        (wbp w, char *answer);
  261.    void    getcanvas    (wbp w, char *s);
  262.    int    getdefault    (wbp w, char *prog, char *opt, char *answer);
  263.    void    getdisplay    (wbp w, char *answer);
  264.    void    getdrawop    (wbp w, char *answer);
  265.    void    getfg        (wbp w, char *answer);
  266.    void    getfntnam    (wbp w, char *answer);
  267.    void    geticonic    (wbp w, char *answer);
  268.    int    geticonpos    (wbp w, char *s);
  269.    int    getimstr    (wbp w, int x, int y, int width, int hgt,
  270.               struct palentry *ptbl, unsigned char *data);
  271.    void    getlinestyle    (wbp w, char *answer);
  272.    int    getpixel_init    (wbp w, struct imgmem *imem);
  273.    int    getpixel_term    (wbp w, struct imgmem *imem);
  274.    int    getpixel    (wbp w,int x,int y,long *rv,char *s,struct imgmem *im);
  275.    void    getpointername    (wbp w, char *answer);
  276.    int    getpos        (wbp w);
  277.    int    getvisual    (wbp w, char *answer);
  278.    int    isetbg        (wbp w, int bg);
  279.    int    isetfg        (wbp w, int fg);
  280.    int    lowerWindow    (wbp w);
  281.    int    mutable_color    (wbp w, dptr argv, int ac, int *retval);
  282.    int    nativecolor    (wbp w, char *s, long *r, long *g, long *b);
  283.  
  284.    #ifndef PresentationManager
  285.       /* Exclude those functions defined as macros */
  286.       int pollevent    (void);
  287.       void wflush    (wbp w);
  288.    #endif                /* PresentationManager */
  289.  
  290.    int    query_pointer    (wbp w, XPoint *pp);
  291.    int    query_rootpointer (XPoint *pp);
  292.    int    raiseWindow    (wbp w);
  293.    int    readimage    (wbp w, char *filename, int x, int y, int *status);
  294.    int    rebind        (wbp w, wbp w2);
  295.    int    set_mutable    (wbp w, int i, char *s);
  296.    int    setbg        (wbp w, char *s);
  297.    int    setcanvas    (wbp w, char *s);
  298.    void    setclip        (wbp w);
  299.    int    setcursor    (wbp w, int on);
  300.    int    setdisplay    (wbp w, char *s);
  301.    int    setdrawop    (wbp w, char *val);
  302.    int    setfg        (wbp w, char *s);
  303.    int    setfillstyle    (wbp w, char *s);
  304.    int    setfont        (wbp w, char **s);
  305.    int    setgamma    (wbp w, double gamma);
  306.    int    setgeometry    (wbp w, char *geo);
  307.    int    setheight    (wbp w, SHORT new_height);
  308.    int    seticonicstate    (wbp w, char *s);
  309.    int    seticonlabel    (wbp w, char *val);
  310.    int    seticonpos    (wbp w, char *s);
  311.    int    setimage    (wbp w, char *val);
  312.    int    setleading    (wbp w, int i);
  313.    int    setlinestyle    (wbp w, char *s);
  314.    int    setlinewidth    (wbp w, LONG linewid);
  315.    int    setpointer    (wbp w, char *val);
  316.    int    setwidth    (wbp w, SHORT new_width);
  317.    int    setwindowlabel    (wbp w, char *val);
  318.    int    strimage    (wbp w, int x, int y, int width, int height,
  319.                struct palentry *e, unsigned char *s,
  320.                word len, int on_icon);
  321.    void    toggle_fgbg    (wbp w);
  322.    int    walert        (wbp w, int volume);
  323.    void    warpPointer    (wbp w, int x, int y);
  324.    int    wclose        (wbp w);
  325.    void    wflush        (wbp w);
  326.    int    wgetq        (wbp w, dptr res);
  327.    FILE    *wopen        (char *nm, struct b_list *hp, dptr attr, int n, int *e);
  328.    int    wputc        (int ci, wbp w);
  329.    void    wsync        (wbp w);
  330.    void    xdis        (wbp w, char *s, int n);
  331.  
  332.    #ifdef ConsoleWindow
  333.       FILE* OpenConsole        (void);
  334.       int   Consolefprintf    (FILE *file, char *format, ...);
  335.       int   Consoleputc        (int c, FILE *file);
  336.       int   Consolefflush    (FILE *file);
  337.    #endif                /* ConsoleWindow */
  338.  
  339.    #ifdef MacGraph
  340.       /*
  341.        * Implementation routines specific to Macintosh
  342.        */
  343.       void hidecrsr (wsp ws);
  344.       void showcrsr (wsp ws);
  345.       void UpdateCursorPos(wsp ws, wcp wc);
  346.       void GetEvents (void);
  347.       void DoEvent (EventRecord *eventPtr);
  348.       void DoMouseUp (EventRecord *eventPtr);
  349.       void DoMouseDown (EventRecord *eventPtr);
  350.       void DoGrowWindow (EventRecord *eventPtr, WindowPtr whichWindow);
  351.       void GetLocUpdateRgn (WindowPtr whichWindow, RgnHandle localRgn);
  352.       void DoKey (EventRecord *eventPtr, WindowPtr whichWindow);
  353.       void EventLoop(void);
  354.       void HandleMenuChoice (long menuChoice);
  355.       void HandleAppleChoice (short item);
  356.       void HandleFileChoice (short item);
  357.       void HandleOptionsChoice (short item);
  358.       void DoUpdate (EventRecord *eventPtr);
  359.       void DoActivate (WindowPtr whichWindow, Boolean becomingActive);
  360.       void RedrawWindow (WindowPtr whichWindow);
  361.       const int ParseCmdLineStr (char *s, char *t, char **argv);
  362.       pascal OSErr SetDialogDefaultItem (DialogPtr theDialog, short newItem) =
  363.          { 0x303C, 0x0304, 0xAA68 };
  364.       pascal OSErr SetDialogCancelItem (DialogPtr theDialog, short newItem) =
  365.          { 0x303C, 0x0305, 0xAA68 };
  366.       pascal OSErr SetDialogTracksCursor (DialogPtr theDialog, Boolean tracks) =
  367.          { 0x303C, 0x0306, 0xAA68 };
  368.  
  369.       void drawarcs(wbinding *wb, XArc *arcs, int narcs);
  370.       void drawlines(wbinding *wb, XPoint *points, int npoints);
  371.       void drawpoints(wbinding *wb, XPoint *points, int npoints);
  372.       void drawrectangles(wbp wb, XRectangle *recs, int nrecs);
  373.       void drawsegments(wbinding *wb, XSegment *segs, int nsegs);
  374.       void fillarcs(wbp wb, XArc *arcs, int narcs);
  375.       void fillpolygon(wbp wb, XPoint *pts, int npts);
  376.    #endif                /* MacGraph */
  377.  
  378.    #ifdef XWindows
  379.       /*
  380.        * Implementation routines specific to X-Windows
  381.        */
  382.       void    unsetclip        (wbp w);
  383.       void    moveWindow        (wbp w, int x, int y);
  384.       int    moveResizeWindow    (wbp w, int x, int y, int wd, int h);
  385.       int    resetfg            (wbp w);
  386.       int    setfgrgb        (wbp w, int r, int g, int b);
  387.       int    setbgrgb        (wbp w, int r, int g, int b);
  388.  
  389.       XColor    xcolor            (wbp w, LinearColor clr);
  390.       LinearColor    lcolor        (wbp w, XColor color);
  391.       int    pixmap_open        (wbp w, dptr attribs, int argc);
  392.       int    pixmap_init        (wbp w);
  393.       int    remap            (wbp w, int x, int y);
  394.       int    seticonimage        (wbp w, dptr dp);
  395.       void    makeIcon        (wbp w, int x, int y);
  396.       int    translate_key_event    (XKeyEvent *k1, char *s, KeySym *k2);
  397.       int    handle_misc        (wdp display, wbp w);
  398.       wdp    alc_display        (char *s);
  399.       void    free_display        (wdp wd);
  400.       wfp    alc_font        (wbp w, char **s);
  401.       wfp    tryfont            (wbp w, char *s);
  402.       wclrp    alc_rgb            (wbp w, char *s, unsigned int r,
  403.                        unsigned int g, unsigned int b,
  404.                        int is_iconcolor);
  405.       int    alc_centry        (wdp wd);
  406.       wclrp    alc_color        (wbp w, char *s);
  407.       void    copy_colors        (wbp w1, wbp w2);
  408.       void    free_xcolor        (wbp w, unsigned long c);
  409.       void    free_xcolors        (wbp w, int extent);
  410.       int    go_virtual        (wbp w);
  411.       int    resizePixmap        (wbp w, int width, int height);
  412.       void    wflushall        (void);
  413.    #endif                /* XWindows */
  414.  
  415.    #ifdef MSWindows
  416.       /*
  417.        * Implementation routines specific to MS Windows
  418.        */
  419.       int playmedia        (wbp w, char *s);
  420.       char *nativecolordialog    (wbp w,long r,long g, long b,char *s);
  421.       int nativefontdialog    (wbp w, char *buf, int flags, int fheight);
  422.       char *nativeopendialog    (wbp w,char *s1,char *s2,char *s3,int i,int j);
  423.       char *nativeselectdialog    (wbp w,struct b_list *,char *s);
  424.       char *nativesavedialog    (wbp w,char *s1,char *s2,char *s3,int i,int j);
  425.       HFONT mkfont        (char *s);
  426.       int sysTextWidth        (wbp w, char *s, int n);
  427.       int sysFontHeight        (wbp w);
  428.       int mswinsystem        (char *s);
  429.       void UpdateCursorPos    (wsp ws, wcp wc);
  430.       LRESULT_CALLBACK WndProc    (HWND, UINT, WPARAM, LPARAM);
  431.       HDC CreateWinDC        (wbp);
  432.       HDC CreatePixDC        (wbp, HDC);
  433.       HBITMAP loadimage    (wbp wb, char *filename, unsigned int *width,
  434.             unsigned int *height, int atorigin, int *status);
  435.       void wfreersc();
  436.       int getdepth(wbp w);
  437.       HBITMAP CreateBitmapFromData(char *data);
  438.       int resizePixmap(wbp w, int width, int height);
  439.       int textWidth(wbp w, char *s, int n);
  440.       int    seticonimage        (wbp w, dptr dp);
  441.       int devicecaps(wbp w, int i);
  442.       void fillarcs(wbp wb, XArc *arcs, int narcs);
  443.       void drawarcs(wbp wb, XArc *arcs, int narcs);
  444.       void drawlines(wbinding *wb, XPoint *points, int npoints);
  445.       void drawpoints(wbinding *wb, XPoint *points, int npoints);
  446.       void drawrectangles(wbp wb, XRectangle *recs, int nrecs);
  447.       void fillpolygon(wbp w, XPoint *pts, int npts);
  448.       void drawsegments(wbinding *wb, XSegment *segs, int nsegs);
  449.       void drawstrng(wbinding *wb, int x, int y, char *s, int slen);
  450.       void unsetclip(wbp w);
  451.  
  452.    #endif                /* MSWindows */
  453.  
  454.    #ifdef PresentationManager
  455.       /*
  456.        * Implementation routines specific to OS/2 Presentation Manager
  457.        */
  458.       wsp ObtainEvents(wsp ws, SHORT blockflag, ULONG messg, QMSG *msg);
  459.       void InterpThreadStartup(void *args);
  460.       void InterpThreadShutdown(void);
  461.       void DestroyWindow(wsp ws);
  462.       void LoadDefAttrs(wbinding *wb, wsp ws, wcp wc);
  463.       void ResizeBackingBitmap(wsp ws, SHORT x, SHORT y);
  464.       int  moveResizeWindow(wbp w,int x, int y, int width, int height);
  465.       void moveWindow(wbp w, int x, int y);
  466.       int  resizeWindow(wbp w,int width,int height);
  467.       int SetNewBitPattern(wcp wc, PBYTE bits);
  468.       int LoadFont(wbp wb, char *family, LONG attr, ULONG fontsize);
  469.       void FreeIdTable(void);
  470.       void FreeLocalID(LONG id);
  471.  
  472.       /* -- not needed because of macro definitions
  473.       void SetCharContext(wbp wb, wsp ws, wcp wc);
  474.       void SetAreaContext(wbp wb, wsp ws, wcp wc);
  475.       void SetLineContext(wbp wb, wsp ws, wcp wc);
  476.       void SetImageContext(wbp wb, wsp ws, wcp wc);
  477.          -- */
  478.  
  479.       void SetClipContext(wbp wb, wsp ws, wcp wc);
  480.       void UnsetContext(wcp wc, void (*f)(wcp, wsp));
  481.       void UCharContext(wcp wc, wsp ws);
  482.       void ULineContext(wcp wc, wsp ws);
  483.       void UAreaContext(wcp wc, wsp ws);
  484.       void UImageContext(wcp wc, wsp ws);
  485.       void UClipContext(wcp wc, wsp ws);
  486.       void UAllContext(wcp wc, wsp ws);
  487.       void drawpoints(wbp wb, XPoint *pts, int npts);
  488.       void drawsegments(wbp wb, XSegment *segs, int nsegs);
  489.       void drawstrng(wbp wb, int x, int y, char *str, int slen);
  490.       void drawarcs(wbp w, XArc *arcs, int narcs);
  491.       void drawlines(wbp wb, XPoint *pts, int npts);
  492.       void drawrectangles(wbp wb, XRectangle *recs, int nrecs);
  493.       int dumpimage(wbp wb, char *filename, int x, int y, int width, int height);
  494.       void fillpolygon(wbp wb, XPoint *pts, int npts);
  495.       HBITMAP loadimage(wbp wb, char *filename, int *width, int *height);
  496.       void InitializeIdTable(void);
  497.       void InitializeColorTable(void);
  498.       void FreeColorTable(void);
  499.       LONG GetColorIndex(char *buf, double gamma);
  500.       void AddLocalIdToWindow(wsp ws, LONG id);
  501.       void ReleaseLocalId(LONG id);
  502.       void ReleaseColor(LONG indx);
  503.       void ColorInitPS(wbp wb);
  504.       void GetColorName(LONG indx, char *buf, int len);
  505.       void EnsureColorAvailable(LONG indx);
  506.       int GetTextWidth(wbp wb, char *text, int len);
  507.       int AddWindowDep(wsp ws, wcp wc);
  508.       int AddContextDep(wsp ws, wcp wc);
  509.       FILE *PMOpenConsole(void);
  510.       void UpdateCursorConfig(wsp ws, wcp wc);
  511.       void UpdateCursorPos(wsp ws, wcp wc);
  512.  
  513.    #endif                /* PresentationManager */
  514.  
  515. #endif                    /* Graphics */
  516.  
  517. /*
  518.  * Prototypes for the run-time system.
  519.  */
  520.  
  521. struct b_external *alcextrnl    (int n);
  522. struct b_record *alcrecd    (int nflds,union block *recptr);
  523. struct b_tvsubs *alcsubs    (word len,word pos,dptr var);
  524. int    bfunc        (void);
  525. long    ckadd        (long i, long j);
  526. long    ckmul        (long i, long j);
  527. long    cksub        (long i, long j);
  528. void    cmd_line    (int argc, char **argv, dptr rslt);
  529. struct b_coexpr *create    (continuation fnc,struct b_proc *p,int ntmp,int wksz);
  530. int    collect        (int region);
  531. void    cotrace        (struct b_coexpr *ccp, struct b_coexpr *ncp,
  532.                int swtch_typ, dptr valloc);
  533. int    cvcset        (dptr dp,int * *cs,int *csbuf);
  534. int    cvnum        (dptr dp,union numeric *result);
  535. int    cvreal        (dptr dp,double *r);
  536. void    deref        (dptr dp1, dptr dp2);
  537. void    envset        (void);
  538. int    eq        (dptr dp1,dptr dp2);
  539. int    get_name    (dptr dp1, dptr dp2);
  540. int    getch        (void);
  541. int    getche        (void);
  542. double    getdbl        (dptr dp);
  543. int    getimage    (dptr dp1, dptr dp2);
  544. int    getstrg        (char *buf, int maxi, struct b_file *fbp);
  545. void    hgrow        (union block *bp);
  546. void    hshrink        (union block *bp);
  547. C_integer iipow        (C_integer n1, C_integer n2);
  548. void    init        (char *name, int *argcp, char *argv[], int trc_init);
  549. int    kbhit        (void);
  550. int    mkreal        (double r,dptr dp);
  551. int    nthcmp        (dptr d1,dptr d2);
  552. void    nxttab        (C_integer *col, dptr *tablst, dptr endlst,
  553.                C_integer *last, C_integer *interval);
  554. int    order        (dptr dp);
  555. int    printable    (int c);
  556. int    ripow        (double r, C_integer n, dptr rslt);
  557. void    rtos        (double n,dptr dp,char *s);
  558. int    sig_rsm        (void);
  559. struct b_proc *strprc    (dptr s, C_integer arity);
  560. int    subs_asgn    (dptr dest, const dptr src);
  561. int    trcmp3        (struct dpair *dp1,struct dpair *dp2);
  562. int    trefcmp        (dptr d1,dptr d2);
  563. int    tvalcmp        (dptr d1,dptr d2);
  564. int    tvcmp4        (struct dpair *dp1,struct dpair *dp2);
  565. int    tvtbl_asgn    (dptr dest, const dptr src);
  566. void    varargs        (dptr argp, int nargs, dptr rslt);
  567.  
  568. #ifdef MultiThread
  569.    struct b_coexpr *alccoexp (long icodesize, long stacksize);
  570. #else                    /* MultiThread */
  571.    struct b_coexpr *alccoexp (void);
  572. #endif                    /* MultiThread */
  573.  
  574. #if COMPILER
  575.  
  576.    struct b_refresh *alcrefresh    (int na, int nl, int nt, int wk_sz);
  577.    void    atrace            (void);
  578.    void    ctrace            (void);
  579.    void    failtrace        (void);
  580.    void    initalloc        (void);
  581.    int    invoke            (int n, dptr args, dptr rslt, continuation c);
  582.    void    rtrace            (void);
  583.    void    strace            (void);
  584.    void    tracebk            (struct p_frame *lcl_pfp, dptr argp);
  585.    int    xdisp            (struct p_frame *fp, dptr dp, int n, FILE *f);
  586.  
  587. #else                    /* COMPILER */
  588.  
  589.    struct b_refresh *alcrefresh    (word *e, int nl, int nt);
  590.    void    atrace            (dptr dp);
  591.    void    ctrace            (dptr dp, int nargs, dptr arg);
  592.    void    failtrace        (dptr dp);
  593.    int    invoke            (int nargs, dptr *cargs, int *n);
  594.    void    rtrace            (dptr dp, dptr rval);
  595.    void    strace            (dptr dp, dptr rval);
  596.    void    tracebk            (struct pf_marker *lcl_pfp, dptr argp);
  597.    int    xdisp            (struct pf_marker *fp, dptr dp, int n, FILE *f);
  598.  
  599.    #define Fargs dptr cargp
  600.    int    Obscan            (int nargs, Fargs);
  601.    int    Ocreate            (word *entryp, Fargs);
  602.    int    Oescan            (int nargs, Fargs);
  603.    int    Ofield            (int nargs, Fargs);
  604.    int    Olimit            (int nargs, Fargs);
  605.    int    Ollist            (int nargs, Fargs);
  606.    int    Omkrec            (int nargs, Fargs);
  607.  
  608.    #ifdef MultiThread
  609.       void    initalloc    (word codesize, struct progstate *p);
  610.    #else                /* MultiThread */
  611.       void    initalloc    (word codesize);
  612.    #endif                /* MultiThread */
  613.  
  614. #endif                    /* COMPILER */
  615.