home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / ace_gpl_release / src_ansi / ace / c / acedef.h next >
Encoding:
C/C++ Source or Header  |  1999-01-05  |  18.7 KB  |  867 lines

  1. /* << ACE >> 
  2.  
  3.    -- Amiga BASIC Compiler --
  4.  
  5.    ** #includes, #defines and function prototypes ** 
  6.    ** Copyright (C) 1998 David Benn
  7.    ** 
  8.    ** This program is free software; you can redistribute it and/or
  9.    ** modify it under the terms of the GNU General Public License
  10.    ** as published by the Free Software Foundation; either version 2
  11.    ** of the License, or (at your option) any later version.
  12.    **
  13.    ** This program is distributed in the hope that it will be useful,
  14.    ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.    ** GNU General Public License for more details.
  17.    **
  18.    ** You should have received a copy of the GNU General Public License
  19.    ** along with this program; if not, write to the Free Software
  20.    ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  21.  
  22.    Author: David J Benn
  23.    Date: 19th October-30th November, 3rd-12th December 1991,
  24.    14th,27th January 1992, 5th,7th-17th, 
  25.    23rd-24th February 1992,
  26.    14th,22nd March 1992,
  27.    21st April 1992,
  28.    2nd,11th,15th May 1992,
  29.    7th,8th,9th,11th,13th,14th,28th June 1992,
  30.    2nd-6th,8th,14th-19th,26th,28th,29th July 1992,
  31.    1st,9th August 1992,
  32.    6th,28th December 1992,
  33.    7th January 1993,
  34.    11th,13th February 1993,
  35.    1st,6th March 1993,
  36.    12th April 1993,
  37.    17th May 1993,
  38.    12th,14th June 1993,
  39.    1st July 1993,
  40.    5th,25th September 1993,
  41.    26th October 1993,
  42.    6th,15th November 1993,
  43.    17th,18th,24th December 1993,
  44.    2nd,3rd,7th,9th January 1994,
  45.    6th,15th,16th,27th February 1994,
  46.    10th,14th July 1994,
  47.    11th September 1994,
  48.    13th May 1996,
  49.    4th,22nd June 1996,
  50.    4th September 1996
  51.  */
  52.  
  53. #include <exec/types.h>
  54. #include <assert.h>
  55. #include <exec/memory.h>
  56. #include <libraries/mathffp.h>
  57. #include <libraries/mathlibrary.h>
  58. #include <libraries/dos.h>
  59. #include <stdio.h>
  60.  
  61. #ifdef __GNUC__
  62.     /* Force compiling with builtin math for gcc */
  63. #define SPFloor( a )      ( floor( a ) )
  64. #define SPCmp( a, b )     ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 )
  65. #define SPFix( a )        ( (int) a )
  66. #define SPCeil( a )       ( ceil( a ) )
  67. #define SPFlt( a )        ( (float) a )
  68. #define SPSub( a, b )     ( (float)(a) - (float)(b) )
  69. #define SPAdd( a, b )     ( (float)(a) + (float)(b) )
  70. #define SPMul( a, b )     ( (float)(a) * (float)(b) )
  71. #define SPDiv( a, b )     ( (float)(a) / (float)(b) )
  72. #define SPPow( a, b )     ( pow( (float)(a) , (float)(b) ) )
  73. #endif
  74.  
  75. /* AmigaBASIC reserved words */
  76. enum
  77.   {
  78.     abssym = 0,
  79.     allsym,
  80.     andsym,
  81.     appendsym,
  82.     areasym,
  83.     areafillsym,
  84.     assym,
  85.     ascsym,
  86.     atnsym,
  87.     basesym,
  88.     beepsym,
  89.     breaksym,
  90.     callsym,
  91.     cdblsym,
  92.     chainsym,
  93.     chdirsym,
  94.     chrstrsym,
  95.     cintsym,
  96.     circlesym,
  97.     clearsym,
  98.     clngsym,
  99.     closesym,
  100.     clssym,
  101.     collisionsym,
  102.     colorsym,
  103.     commonsym,
  104.     contsym,
  105.     cossym,
  106.     csngsym,
  107.     csrlinsym,
  108.     cvdsym,
  109.     cvisym,
  110.     cvlsym,
  111.     cvssym,
  112.     datasym,
  113.     datestrsym,
  114.     declaresym,
  115.     defsym,
  116.     defdblsym,
  117.     defintsym,
  118.     deflngsym,
  119.     defsngsym,
  120.     defstrsym,
  121.     deletesym,
  122.     dimsym,
  123.     elsesym,
  124.     elseifsym,
  125.     endsym,
  126.     eofsym,
  127.     eqvsym,
  128.     erasesym,
  129.     erlsym,
  130.     errsym,
  131.     errorsym,
  132.     exitsym,
  133.     expsym,
  134.     fieldsym,
  135.     filessym,
  136.     fixsym,
  137.     fnsym,
  138.     forsym,
  139.     fresym,
  140.     functionsym,
  141.     getsym,
  142.     gosubsym,
  143.     gotosym,
  144.     hexsym,
  145.     ifsym,
  146.     impsym,
  147.     inkeysym,
  148.     inputsym,
  149.     inputstrsym,
  150.     instrsym,
  151.     intsym,
  152.     killsym,
  153.     lboundsym,
  154.     leftstrsym,
  155.     lensym,
  156.     letsym,
  157.     librarysym,
  158.     linesym,
  159.     listsym,
  160.     llistsym,
  161.     loadsym,
  162.     locsym,
  163.     locatesym,
  164.     lofsym,
  165.     logsym,
  166.     lpossym,
  167.     lprintsym,
  168.     lsetsym,
  169.     menusym,
  170.     mergesym,
  171.     midstrsym,
  172.     mkdstrsym,
  173.     mkistrsym,
  174.     mklstrsym,
  175.     mksstrsym,
  176.     modsym,
  177.     mousesym,
  178.     namesym,
  179.     newsym,
  180.     nextsym,
  181.     notsym,
  182.     objaxsym,
  183.     objaysym,
  184.     objclipsym,
  185.     objclosesym,
  186.     objhitsym,
  187.     objoffsym,
  188.     objonsym,
  189.     objplanessym,
  190.     objprioritysym,
  191.     objshapesym,
  192.     objstartsym,
  193.     objstopsym,
  194.     objvxsym,
  195.     objvysym,
  196.     objxsym,
  197.     objysym,
  198.     octstrsym,
  199.     offsym,
  200.     onsym,
  201.     opensym,
  202.     optionsym,
  203.     orsym,
  204.     outputsym,
  205.     paintsym,
  206.     palettesym,
  207.     patternsym,
  208.     peeksym,
  209.     peeklsym,
  210.     peekwsym,
  211.     pointsym,
  212.     pokesym,
  213.     pokelsym,
  214.     pokewsym,
  215.     possym,
  216.     presetsym,
  217.     printsym,
  218.     psetsym,
  219.     ptabsym,
  220.     putsym,
  221.     randomizesym,
  222.     readsym,
  223.     remsym,
  224.     restoresym,
  225.     resumesym,
  226.     returnsym,
  227.     rightstrsym,
  228.     rndsym,
  229.     rsetsym,
  230.     runsym,
  231.     saddsym,
  232.     savesym,
  233.     saysym,
  234.     screensym,
  235.     scrollsym,
  236.     sgnsym,
  237.     sharedsym,
  238.     sinsym,
  239.     sleepsym,
  240.     soundsym,
  241.     spacestrsym,
  242.     spcsym,
  243.     sqrsym,
  244.     staticsym,
  245.     stepsym,
  246.     sticksym,
  247.     stopsym,
  248.     strstrsym,
  249.     strigsym,
  250.     stringstrsym,
  251.     subsym,
  252.     swapsym,
  253.     systemsym,
  254.     tabsym,
  255.     tansym,
  256.     thensym,
  257.     timestrsym,
  258.     timersym,
  259.     tosym,
  260.     translatestrsym,
  261.     troff,
  262.     tron,
  263.     uboundsym,
  264.     ucasestrsym,
  265.     usingsym,
  266.     valsym,
  267.     varptrsym,
  268.     waitsym,
  269.     wavesym,
  270.     wendsym,
  271.     whilesym,
  272.     widthsym,
  273.     windowsym,
  274.     writesym,
  275.     xorsym,
  276.  
  277. /* ACE-specific reserved words */
  278.     addresssym,
  279.     allocsym,
  280.     argstrsym,
  281.     argcountsym,
  282.     assemsym,
  283.     backsym,
  284.     bevelboxsym,
  285.     binstrsym,
  286.     blocksym,
  287.     buttonsym,
  288.     bytesym,
  289.     casesym,
  290.     constsym,
  291.     cstrsym,
  292.     daysym,
  293.     externalsym,
  294.     fileboxstrsym,
  295.     fontsym,
  296.     forwardsym,
  297.     gadgetsym,
  298.     globalsym,
  299.     handlesym,
  300.     headingsym,
  301.     homesym,
  302.     iffsym,
  303.     inputboxsym,
  304.     inputboxstrsym,
  305.     longintsym,
  306.     messagesym,
  307.     msgboxsym,
  308.     pendownsym,
  309.     penupsym,
  310.     potxsym,
  311.     potysym,
  312.     printssym,
  313.     repeatsym,
  314.     serialsym,
  315.     setheadingsym,
  316.     setxysym,
  317.     shlsym,
  318.     shortintsym,
  319.     shrsym,
  320.     singlesym,
  321.     sizesym,
  322.     sizeofsym,
  323.     stringsym,
  324.     structsym,
  325.     stylesym,
  326.     turnsym,
  327.     turnleftsym,
  328.     turnrightsym,
  329.     turtlesym,
  330.     untilsym,
  331.     xcorsym,
  332.     ycorsym,
  333.  
  334.     RWSENTINEL
  335.   };
  336.  
  337. /* special symbols */
  338. enum
  339.   {
  340.     increment = 500,
  341.     decrement,
  342.     shortpointer,
  343.     longpointer,
  344.     singlepointer,
  345.     memberpointer,
  346.     plus,
  347.     minus,
  348.     multiply,
  349.     fdiv,
  350.     idiv,
  351.     raiseto,
  352.     lparen,
  353.     rparen,
  354.     comma,
  355.     apostrophe,
  356.     semicolon,
  357.     becomes,
  358.     colon,
  359.     question,
  360.     notequal,
  361.     ltorequal,
  362.     gtorequal,
  363.     equal,
  364.     lessthan,
  365.     gtrthan,
  366.     hash,
  367.     octalprefix,
  368.     hexprefix,
  369.     atsymbol,
  370.     endofline,
  371.  
  372.     RSSENTINEL
  373.   };
  374.  
  375. /* symbols */
  376. enum
  377.   {
  378.     shortconst = 1000,
  379.     longconst,
  380.     singleconst,
  381.     doubleconst,
  382.     stringconst,
  383.     ident
  384.   };
  385.  
  386. /* types */
  387. enum
  388.   {
  389.     bytetype = 2000,
  390.     shorttype,
  391.     longtype,
  392.     singletype,
  393.     doubletype,
  394.     stringtype,
  395.     notype
  396.   };
  397.  
  398. /* objects */
  399. enum
  400.   {
  401.     variable = 3000,
  402.     array,
  403.     subprogram,
  404.     definedfunc,
  405.     function,
  406.     extfunc,
  407.     extvar,
  408.     label,
  409.     constant,
  410.     structdef,
  411.     structure,
  412.     rsvd_word,
  413.  
  414.     undefined = 9999
  415.   };
  416. #define NDEBUG            /* to strip asserts code without removing asserts */
  417. #define    MAXLINELEN   1024    /* max length of a BASIC line */
  418. #define    MAXIDSIZE     42    /* max length of identifier (+ qualifier) */
  419. #define    MAXSTRLEN   1024    /* max length of string */
  420. #define    MAXSHORT   32767    /* max +ve short value */
  421. #define    MINSHORT  -32768    /* min -ve short value */
  422. #define    MAXLONG    2147483647    /* max +ve long value */
  423. #define    MINLONG   -2147483648    /* min -ve long value */
  424. #define    MAXPARAMS     40    /* max # of subprogram parameters */
  425. #define    NEGATIVE      -1    /* a negative result from ACE lib check */
  426. #define    MAXCASES     1000    /* max # of cases in a CASE statement */
  427. #define    NUMACELIBS     7    /* # of shared libraries used by ACE */
  428. #define    NUMLIBS          40    /* max # of "other" shared libraries */
  429. #define    LF_CODE           0    /* line feed code for PRINTS */
  430. #define    TAB_CODE       1    /* tab code for PRINTS */
  431. #define    SPACE_CODE     2    /* single space code for PRINTS */
  432.  
  433. /* --symbol table-- */
  434. #define    ZERO        0
  435. #define    ONE         1
  436. #define    fwdref      0
  437. #define    subdecl     1
  438. #define    undeclared  2        /* undeclared string variable (eg: x$="A") */
  439. #define    declared    3        /* string variable declared with STRING */
  440. #define    MAXDIMS   255
  441.  
  442. /* --symbol table-- */
  443. typedef union conststruct
  444.   {
  445.     SHORT shortnum;
  446.     LONG longnum;
  447.     float singlenum;
  448.   }
  449. CONST;
  450.  
  451. typedef struct structmem
  452.   {
  453.     char name[MAXIDSIZE];
  454.     int type;
  455.     ULONG offset;
  456.     ULONG strsize;
  457.     struct structmem *next;
  458.   }
  459. STRUCM;
  460.  
  461. typedef struct symstruct
  462.   {
  463.     char *name;            /* name of identifier */
  464.     int type;            /* type (short,long...) */
  465.     int object;            /* variable,sub... */
  466.     int dims;            /* # of array elements */
  467.     BOOL shared;        /* is object shared? */
  468.     BOOL new_string_var;    /* new string variable? */
  469.     SHORT *index;        /* array indices */
  470.     SHORT no_of_params;        /* # of SUB parameters */
  471.     int p_type[MAXPARAMS];    /* SUB parameter types */
  472.     UBYTE decl;            /* forward reference? */
  473.     UBYTE *reg;            /* lib function regs */
  474.     char *libname;        /* library name */
  475.     CONST numconst;        /* a numeric constant */
  476.     STRUCM *structmem;        /* structdef list ptr */
  477.     long address;        /* frame/library offset */
  478.     ULONG size;            /* # of bytes in object */
  479.     int level;            /* main or sub program */
  480.     struct symstruct *other;    /* for cross-reference */
  481.     struct symstruct *next;    /* next table entry */
  482.   }
  483. SYM;
  484.  
  485. /* --code generator-- */
  486.  
  487. /* --code list-- */
  488. typedef struct codelist
  489.   {
  490.     char *opcode;        /* 68000 opcode */
  491.     char *srcopr;        /* source operand */
  492.     char *destopr;        /* destination operand */
  493.     struct codelist *next;
  494.   }
  495. CODE;
  496.  
  497. /* --data list-- */
  498. typedef struct datalist
  499.   {
  500.     char *name;            /* name of storage */
  501.     char *literal;        /* data */
  502.     struct datalist *next;
  503.   }
  504. DATA;
  505.  
  506. /* --bss list-- */
  507. typedef struct bsslist
  508.   {
  509.     char *name;            /* name of storage */
  510.     char *store;        /* storage type & size */
  511.     struct bsslist *next;
  512.   }
  513. BSS;
  514.  
  515. /* --XREF list-- */
  516. typedef struct xreflist
  517.   {
  518.     char *name;            /* name of external reference */
  519.     struct xreflist *next;
  520.   }
  521. XREF;
  522.  
  523. /* --BASIC DATA list-- */
  524. typedef struct basicdatalist
  525.   {
  526.     char *literal;        /* string or float constant */
  527.     struct basicdatalist *next;
  528.   }
  529. BASDATA;
  530.  
  531. /* --ACE library usage information--  */
  532. typedef struct aceliblist
  533.   {
  534.     char name[MAXIDSIZE];    /* library name */
  535.     char base[MAXIDSIZE + 5];    /* library base: _NAMEBase */
  536.   } ACELIBS;
  537.  
  538. /*
  539. struct aceliblist
  540.   {
  541.     char name[MAXIDSIZE];    /* library name 
  542.     char base[MAXIDSIZE + 5];    /* library base: _NAMEBase 
  543.   };
  544.  
  545. this is the new way.
  546. #define ACELIBS struct aceliblist */
  547.  
  548. /* --function protos-- */
  549.  
  550. /* opt.c */
  551. BOOL is_a_move (char *opcode);
  552. SHORT peephole (void);
  553. void optimise (void);
  554.  
  555. /* lex.c */
  556. void open_shared_libs (void);
  557. void close_shared_libs (void);
  558. void setup (void);
  559. void cleanup (void);
  560. void _warn (int n);
  561. void _error (int n);
  562. void _abort (int n);
  563. void open_files (char *source);
  564. void nextch (void);
  565. BOOL letter (void);
  566. BOOL digit (void);
  567. int hex_digit (void);
  568. int octal_digit (void);
  569. void convert_special_ident (void);
  570. BOOL qualifier (void);
  571. BOOL ssymbol (void);
  572. int rsvd_wd (char *id);
  573. int rsvd_sym (char *id);
  574. void reclassify_number (void);
  575. void classify_integer (LONG n);
  576. void insymbol (void);
  577. void showsym (int sym);
  578. void showobj (int typ);
  579. void showtyp (int typ);
  580. void tab (void);
  581. void lf (void);
  582.  
  583. /* alloc.c */
  584. void *alloc (unsigned int bytes, unsigned long  flags);
  585. void *sym_alloc (unsigned int  bytes, unsigned long flags);
  586. void free_alloc (void);
  587. void free_sym_alloc (void);
  588. CODE *alloc_code (char *opcode, char *srcopr, char *destopr);
  589. void free_code (CODE * cnode);
  590. BOOL alloc_code_members (CODE * cnode, char *opcode, char *srcopr, char *destopr);
  591. void free_code_members (CODE * cnode);
  592.  
  593. /* sym.c */
  594. void new_symtab (void);
  595. void kill_symtab (void);
  596. void find_tab_tail (void);
  597. BOOL exist (char *name, int obj);
  598. void enter (char *name, int typ, int obj, int dims);
  599. void create_lists (void);
  600. BOOL is_a_label (char *opc);
  601. void write_code (CODE * line);
  602. BOOL label_undef (CODE * node);
  603. void undef_label_check (void);
  604. void kill_code (void);
  605. void gen (char *opcode, char *srcopr, char *destopr);
  606. void change (CODE * cx, char *opcode, char *srcopr, char *destopr);
  607. BOOL exist_DATA (char *name);
  608. void enter_DATA (char *name, char *literal);
  609. void write_data (void);
  610. BOOL exist_BSS (char *name);
  611. void enter_BSS (char *name, char *store);
  612. void write_bss (void);
  613. BOOL exist_XREF (char *name);
  614. void enter_XREF (char *name);
  615. void write_xrefs (void);
  616. void enter_BASDATA (char *literal);
  617. void write_basdata (void);
  618. void find_structmem_tail (SYM * symtabitem);
  619. BOOL structmem_exist (SYM * symtabitem, char *name);
  620. void add_struct_member (SYM * symtabitem, char *name, int mtype, SYM * structtype);
  621. void kill_all_lists (void);
  622.  
  623. /* basfun.c */
  624. BOOL strfunc (void);
  625. int stringfunction (void);
  626. int gen_single_func (char *funcname, int nftype);
  627. BOOL numfunc (void);
  628. int numericfunction (void);
  629. int address_of_object (void);
  630. int find_object_size (void);
  631.  
  632. /* functions in main ace modules */
  633. /* misc.c */
  634. void make_temp_long (void);
  635. void make_temp_short (void);
  636. void make_temp_string (void);
  637. void make_string_const (char *string);
  638. void make_label_from_linenum (int intconst, char *buf);
  639. LONG max_array_ndx (SYM * curr);
  640. void push_indices (SYM * curr);
  641. void get_abs_ndx (SYM * curr);
  642. void push_num_constant (int typ, SYM * item);
  643. int push_struct (SYM * item);
  644. void change_id_type (int newtype);
  645. void gen_branch (char *branch, char *labname);
  646. void assem (void);
  647. void parse_option_list (void);
  648. void MsgBox (void);
  649.  
  650. /* factor.c */
  651. BOOL factorfunc (void);
  652. int factor (void);
  653.  
  654. /* expr.c */
  655. BOOL coerce (int *typ1, int *typ2, CODE * cx[]);
  656. void make_short (void);
  657. void make_long (void);
  658. int ptr_term (void);
  659. int expterm (void);
  660. int negterm (void);
  661. int prodterm (void);
  662. int idivterm (void);
  663. int modterm (void);
  664. int simple_expr (void);
  665. BOOL relop (int op);
  666. char *cond_branch_op (int op);
  667. void make_label (char *name, char *lab);
  668. int relexpr (void);
  669. int notexpr (void);
  670. int andexpr (void);
  671. int orexpr (void);
  672. int eqvexpr (void);
  673. int expr (void);
  674. void pop_operands (int typ);
  675. void push_result (int typ);
  676. void gen_round (int type);
  677. void gen_Flt (int typ);
  678. void change_Flt (int exptyp, CODE * cx[]);
  679. int make_integer (int oldtyp);
  680. void make_sure_short (int type);
  681. void make_sure_long (int type);
  682.  
  683. /* assign.c */
  684. int assign_coerce (int storetype, int exptype);
  685. void make_string_store (void);
  686. void create_string_variable (SYM * string_item, long string_size);
  687. void assign_to_string_variable (SYM * string_item, long string_size);
  688. void assign_to_string_array (char *addrbuf);
  689. void assign_to_struct (SYM * item);
  690. void assign (void);
  691. void make_array_name (char *name, char *lab);
  692. void dim (void);
  693. void input (void);
  694. void point_to_array (SYM * storage, char *addrbuf);
  695. void make_data_const (char *string);
  696. void get_data (void);
  697. void read_data (void);
  698.  
  699. /* print.c */
  700. void gen_printcode (int code);
  701. void print_statement (void);
  702. void gen_printscode (int code);
  703. void prints_statement (void);
  704.  
  705. /* control.c */
  706. void block_if (CODE * cx1);
  707. void if_statement (void);
  708. void while_statement (void);
  709. void repeat_statement (void);
  710. void case_statement (void);
  711. int for_assign (char *addr);
  712. void for_statement (void);
  713. void on_branch (void);
  714. void block_statement (void);
  715.  
  716. /* gfx.c */
  717. void pset (void);
  718. void paint (void);
  719. void circle (void);
  720. void draw_line (void);
  721. void color (void);
  722. void area (void);
  723. void areafill (void);
  724. void pattern (void);
  725. void scroll (void);
  726. void text_style (void);
  727. void text_font (void);
  728. void gfx_get (void);
  729. void gfx_put (void);
  730.  
  731. /* screen.c */
  732. void screen (void);
  733.  
  734. /* window.c */
  735. void window (void);
  736. void wdwclose (void);
  737. void wdwoutput (void);
  738.  
  739. /* gadget.c */
  740. void gadget_rectangle(void);
  741. void close_gadget(void);
  742. void gadget_output(void);
  743. void wait_gadget(void);
  744. void modify_gadget(void);
  745. void gadget(void);
  746. void bevel_box(void);
  747. void gadget(void);
  748.  
  749. /* menu.c */
  750. void clear_menu (void);
  751. void wait_menu (void);
  752. void menu (void);
  753.  
  754. /* file.c */
  755. void open_a_file (void);
  756. void close_a_file (void);
  757. void line_input (void);
  758. void write_to_file (void);
  759. void gen_writecode (int code);
  760. void print_to_file (void);
  761. void input_from_file (void);
  762. void kill (void);
  763. void ace_rename (void);
  764. void ace_chdir (void);
  765. void files (void);
  766. void random_file_get (void);
  767. void random_file_put (void);
  768.  
  769. /* serial.c */
  770. void serial_command (void);
  771. void open_serial (void);
  772. void close_serial (void);
  773. void read_serial (void);
  774. void write_serial (void);
  775.  
  776. /* message.c */
  777. void message_open (void);
  778. void message_read (void);
  779. void message_write (void);
  780. void message_wait (void);
  781. void message_clear (void);
  782. void message_close (void);
  783. void message (void);
  784.  
  785. /* iff.c */
  786. void iff_open (void);
  787. void iff_read (void);
  788. void iff_close (void);
  789. void iff (void);
  790.  
  791. /* libfunc.c */
  792. BYTE check_for_ace_lib (char *libname);
  793. void enter_new_library (char *libname);
  794. void make_library_base (char *libname);
  795. void make_library_name (char *libname);
  796. void make_bmap_name (char *libname);
  797. void get_libname (char *libname, char *ut_libname);
  798. void library (void);
  799. void closelibrary (void);
  800. void remove_qualifier (char *funcname);
  801. BOOL search_func (char *bmap, char *func, SYM * declared_func);
  802. BOOL found_func (char *libname, char *ut_funcname, SYM * declared_func);
  803. void declare (void);
  804. void load_func_params (SYM * func_item);
  805. void load_mc_params (SYM * sub_ptr);
  806.  
  807. /* statement.c */
  808. void sound (void);
  809. void handle_label (char *label_name);
  810. void statement (void);
  811.  
  812. /* event.c */
  813. void get_event_trap_label (void);
  814. void change_event_trapping_status (int event);
  815. void turn_event_off (char *eventHandler);
  816. void check_for_event (void);
  817. void ctrl_c_test (void);
  818. void break_event_test (void);
  819. void menu_event_test (void);
  820. void mouse_event_test (void);
  821. void timer_event_test (void);
  822. void error_event_test (void);
  823. void wdw_close_test (void);
  824. void wdw_event_test (void);
  825. void gad_event_test (void);
  826.  
  827. /* declare.c */
  828. void define_structure (void);
  829. void declare_structure (void);
  830. void define_constant (void);
  831. void declare_variable (int vartype);
  832. void define_external_object (void);
  833. void define_external_variable (void);
  834. void define_external_function (void);
  835. void call_external_function (char *extfuncid, BOOL * need_symbol);
  836. void define_common_or_global_variable (int varsym);
  837.  
  838. /* memory.c */
  839. void poke (void);
  840. void pokew (void);
  841. void pokel (void);
  842. void get_obj_info (char *objname, int *object, int *objtype);
  843. void swap (void);
  844.  
  845. /* sub.c */
  846. void forward_ref (void);
  847. void load_params (SYM * sub_ptr);
  848. void sub_params (SYM * sub_ptr);
  849. void parse_shared_vars (void);
  850.  
  851. /* parse.c */
  852. void block (void);
  853. void parse (void);
  854. void compile (char *source, char *dest_name);
  855. void show_title (void);
  856. void usage (void);
  857. BOOL check_options (char *opt);
  858. void dump_reserved_words (void);
  859. int main(int argc, char *argv[]);
  860.  
  861. /* extras.c */
  862. char *ultoa (unsigned long n, char *buffer, int radix);
  863. long fsize (char *name);
  864. char *itoa (long n, char *buffer, int radix);
  865. char *ltoa (long n, char *buffer, int radix);
  866. char *strupr (char *string);
  867.