home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 357_01 / cstar1.exe / TMP.H < prev    next >
C/C++ Source or Header  |  1991-06-18  |  9KB  |  286 lines

  1. /*
  2.     Global function declarations.
  3.  
  4.     source: tmp.h
  5.     version: March 7, 1989
  6.  
  7.     PUBLIC DOMAIN SOFTWARE
  8.  
  9.     The CSTAR program was placed in    the public domain on June 15, 1991,
  10.     by its author and sole owner,
  11.  
  12.         Edward K. Ream
  13.         1617 Monroe Street
  14.         Madison, WI 53711
  15.         (608) 257-0802
  16.  
  17.     CSTAR may be used for any commercial or non-commercial purpose.
  18.  
  19.     See cstar.h or cstar.c for a DISCLAIMER OF WARRANTIES.
  20. */
  21.  
  22. /* cstar.c */
  23. void        begin_line();
  24. void        do_nl();
  25. void        get_token();
  26.  
  27. /* dcl.c */
  28. void    pd_tcopy    (struct type_node *s,  struct type_node *d);
  29. bool    pd_teq        (struct type_node *t1, struct type_node *t2);
  30. bool    pd_t1eq        (struct type_node *t1, struct type_node *t2);
  31. bool    pd_taeq        (struct type_node *t1, struct type_node *t2);
  32. void    reg_check    (struct type_node *type, int regtype, char *symbol);
  33. unsigned long    m_size    (int m);
  34. bool    pd_is1func    (struct type_node *t);
  35. void    pd_orphan    (struct type_node *t);
  36. struct type_node *
  37.     pd_cast        (void);
  38. struct type_node *
  39.     pd_stmt    (int kind, int plural, struct type_node **head_x);
  40. unsigned long
  41.     m_size        (int m);
  42.  
  43. /* def.c */
  44. void    pp_def        (void);
  45. void    pp_expand    (int nargs, unsigned char * rtext);
  46.  
  47. /* dir.c */
  48. void    do_pp(void);
  49.  
  50. /* exp.c */
  51. struct node *    pe_list        (register int type);
  52. struct node *    pe_expr        (void);
  53. struct node *    pe_expr1    (bool comma_ok);
  54. bool        pe_check    (struct node * p, int type);
  55. void        pe_massage    (register struct type_node *t1,
  56.                 register struct node *p2, int op);
  57. void        pe_retype    (int mclass, register struct node * p2,
  58.                 int op);
  59. int        pe_oversize    (int mclass, long value);
  60. int        pe_number    (struct node * p);
  61.  
  62. /* g1.c */
  63. void        gen_init(void);
  64. void        gen_function(struct fbody *p);
  65.  
  66. /* g2.c */
  67. void        gen_bool    (struct node *p,
  68.                 struct node *true_lab, struct node *false_lab);
  69. void        gen_expr    (struct node *p);
  70. void        gen_a0exp    (struct node *p);
  71. void        gen_d0exp    (struct node *p);
  72. struct node *    gen_dexpr    (struct node *p);
  73. void        gen_bpost    (struct node *p);
  74.  
  75. /* g3.c */
  76. void    g_init    (void);
  77. void    g_line    (int i);
  78. void    g_lit    (char *s);
  79. void    g_1lab    (int opcode, struct node *p);
  80. void    g_2lab    (int opcode, struct node  *p1, struct node *p2);
  81. void    g_0    (int opcode);
  82. void    g_1    (int opcode, struct node *p);
  83. void    g_1l    (int opcode, struct node *p);
  84. void    g_1l2    (int opcode, struct node *p);
  85. void    g_2    (int opcode, struct node *p1, struct node *p2);
  86. void    g_2l1    (int opcode, struct node *p1, struct node *p2);
  87. void    g_qmove    (struct node *loc1, struct node *loc2);
  88. void    g_2l2    (int opcode, struct node *p1, struct node *p2);
  89. void    g_label    (struct node * p);
  90. int    mlen    (struct node *p);
  91.  
  92. /* in.c */
  93. bool        is_reserved    (char * name, int length);
  94. struct x_ex *    x_exists    (struct node *q);
  95.  
  96. /* mem.c */
  97. struct node *    new_pnode    (int size);
  98. void *        node_dupl    (byte *s, int size);
  99. struct type_node *
  100.         new_tnode    (void);
  101. struct node *    new_cnode    (void);
  102. struct node *    new_rloc    (int regfield);
  103. struct node *    new_grloc    (int regfield);
  104. struct node *    new_cloc    (long constant);
  105. struct node *    new_clabel    (void);
  106. struct node *    new_culabel    (char * symbol);
  107. struct iblock *    new_iblock    (unsigned long size);
  108. void *        mg_alloc    (int n);
  109. void        mg_free        (char *p);
  110. void *        ml_alloc    (int n);
  111. void        ml_release    (void);
  112. void        mm_init        (void);
  113. void        mm_stat        (void);
  114.  
  115. /* mst.c */
  116. void        mst_delete    (char * symbol);
  117. struct mst_node *
  118.         mst_enter    (char * symbol, char * txt, int nargs);
  119. void        mst_init    (void);
  120. void        mst2_init    (void);
  121. struct mst_node *
  122.         mst_lookup    (char * symbol);
  123.  
  124. /* out.c */
  125. void    out_arg        (struct node * p);
  126. void    out_decl    (struct type_node *t);
  127. void    out_function    (struct fbody *p, unsigned long link_size,
  128.                 int r_push, int do_addq);
  129. void    out_list    (register struct node *p);
  130. void    out_tree    (struct node * p);
  131.  
  132. /* par.c */
  133. void    mark_noneed    (struct node * p);
  134. void    need        (int token);
  135. bool    needend        (int token);
  136. void    pn_init        (void);
  137. void    program        (void);
  138.  
  139. /* ph.c */
  140. void    peep_hole    (void);
  141.  
  142. /* pr.c */
  143. void    pr_arg        (struct node *p);
  144. void    pr_expr        (struct node *p);
  145. void    pr_iblock    (struct iblock *p);
  146. void    pr_list        (struct node *p);
  147. void    pr_loc        (struct node *p);
  148. void    pr_sclass    (int sclass);
  149. void    pr_type        (struct type_node *t);
  150. char *    ps_tok        (int token);
  151.  
  152. /* reg.c */
  153. void        regs_clear    (void);
  154. unsigned long    pd_alloc    (struct type_node *t, int mode);
  155. struct node *    locn_xconst    (long value);
  156. struct node *    locn_dupl    (struct node *s);
  157. struct node *    locn_xdupl    (struct node *s);
  158. struct node *    locn_chmod    (struct node *loc, int mode);
  159. struct node *    locn_reg    (int reg);
  160. static int    get_free    (int sx_free[]);
  161. struct node *    get_temp    (struct node * loc);
  162. struct node *    get_dtemp    (void);
  163. struct node *    get_atemp    (void);
  164. void        free_temp    (struct node *loc);
  165. void        free_xtemp    (struct node *loc1, struct node *loc2);
  166. void        force_free    (int reg);
  167. void        push_scratch    (void);
  168. void        free_reg    (int reg);
  169. bool        alloc_reg    (int reg);
  170. void        regs_init    (void);
  171. void        free_all    (void);
  172. bool        is_equiv    (struct node *loc1, struct node *loc2);
  173. bool        is_cloc        (struct node * loc);
  174. struct node *    fix_cloc    (register struct node * loc);
  175. bool        is_zloc        (struct node * loc);
  176. bool        is_xloc        (struct node * loc);
  177. bool        is_xtloc    (struct node * loc);
  178. bool        is_aloc        (struct node * loc);
  179. bool        is_atloc    (struct node * loc);
  180. bool        is_atreg    (int reg);
  181. bool        is_dtreg    (int reg);
  182. bool        is_dloc        (struct node * loc);
  183. bool        is_dtloc    (struct node * loc);
  184. bool        has_dtreg    (struct node * loc);
  185. bool        has_atreg    (struct node * loc);
  186. bool        is_storloc    (struct node *p);
  187. void        ss_push        (struct node * loc);
  188. struct node *    ss_pop        (void);
  189. struct node *    ss_restore    (void);
  190.  
  191. /* st.c */
  192. struct st_node * ast_lookup    (char * symbol);
  193.  
  194. struct st_node * gst_enter     (char * symbol,
  195.                 struct type_node * type, int class);
  196. static int     gst_hash     (char * symbol);
  197. struct st_node * gst_lookup     (char * symbol);
  198. struct st_node * lst_enter     (char * symbol,
  199.                 struct type_node * type, int class);
  200. static int     lst_hash     (char * symbol);
  201. void         lst_init    (void);
  202. struct st_node * lst_lookup     (char * symbol);
  203. struct st_node * rst_lookup    (char * symbol);
  204. struct st_node * rst_enter     (char * symbol,
  205.                 struct type_node * type, int class);
  206. void         st_init    (void);
  207. struct st_node * st_lookup    (char * symbol);
  208.  
  209. /* str.c */
  210. void    str_cat        (register char *s1, register char *s2);
  211. int    str_cmp        (register char *s1, register char *s2);
  212. void    str_cpy        (register char *s1, register char *s2);
  213. bool    str_eq        (register char *s1, register char *s2);
  214. char *    str_galloc    (register char *s);
  215. char *    str_gcat    (register char *s1, register char *s2);
  216. char *    str_lalloc    (register char *s);
  217. char *    str_lcat    (register char *s1, register char *s2);
  218. int    str_len        (register char *s);
  219. char *    str_name    (void);
  220. char *    str_salloc    (register char *s);
  221. char *    chr_salloc    (register char *s, int n);
  222.  
  223. /* sys.c */
  224. void    sysabort    (void);
  225. void    sysnext        (void);
  226. void    syspush        (int c);
  227. void    sysspush    (char *s);
  228. void    sysiclose    (void);
  229. bool    sysopen        (char * name);
  230. bool    syscreat    (char * name);
  231. void    sysoclose    (void);
  232. void    sysnlput    (void);
  233. void    syscput        (char c);
  234. void    syssput        (char * s);
  235. void    sysend        (void);
  236. void    sysinit        (void);
  237. int    syscsts        (void);
  238.  
  239. /* tok.c */
  240. int    t_number    (void);
  241. void    t_string    (char * symbol);
  242. void    t_comment    (void);
  243. void    t_id        (char * symbol);
  244.  
  245. /* utl.c */
  246. int    char_val    (register char *s);
  247. void    conv2s        (int a, char *s);
  248. void    convl2s     (long a, char *s);
  249. void    conul2sc    (unsigned long n, char *s, int c);
  250. void    conl2h        (unsigned long n, char *s, int c);
  251. void    fatal        (char * message);
  252. void    revcpy        (char *s1, char *s2);
  253. void    scan_number    (int base);
  254. void    skip_bl        (void);
  255. bool    skip_crlf    (void);
  256. void    skip_1line    (void);
  257. void    skip_past    (void);
  258. void    skip_pp        (void);
  259. void    skip_ws        (void);
  260. void    t_error        (char * message);
  261. void    t_2error    (char * mess1, char *mess2);
  262. void    t_3serr        (struct node *p, char * mess1, char *mess2,
  263.             char *mess3);
  264. void    t_warning    (char * message);
  265. void    t_2warning    (char * mess1, char *mess2);
  266. void    t_help        (char * message);
  267. void    t_2help        (char * mess1, char *mess2);
  268. void    g_error        (struct node * p, char * message);
  269. void    g_help        (struct node *p, char * message);
  270. unsigned int str_val    (unsigned char *d);
  271.  
  272. /* x2.c */
  273. struct node *    x_addpsi(register struct node *locp,
  274.                 register struct node *loci,
  275.                 register int x_op);
  276. int        x_shift    (register unsigned long scale);
  277. struct node *    x_scale    (register struct node * loc1, unsigned long scale);
  278. struct node *    x_subp    (register struct node *loc1, struct node *loci,
  279.             unsigned long scale);
  280. struct node *    x_cast    (register struct node *loc1,
  281.             int len1, int imod1, int len3, bool dloc_ok);
  282. struct node *    resolve    (register struct node *loc1);
  283. void        x_lookat(register struct node *loc1);
  284. struct node *    x_sspush(register struct node *loc1);
  285. void        gen_pp    (struct node *p);
  286.