get.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* I N P U T R O U T I N E S */
  7. extern FILE *curinp; /* current input file */
  8. block_id lastbid; /* block identifying number */
  9. lab_id lastlabid; /* last label identifier */
  10. #define getbyte() getc(curinp)
  11. short getshort(); /*
  12. * Read a short from curinp
  13. */
  14. offset getoff(); /*
  15. * Read an offset from curinp
  16. */
  17. line_p read_line(proc_p *p_out);
  18. /* Read a line of EM code (i.e. one
  19. * instruction) and its arguments
  20. * (if any). If the instruction is a
  21. * 'pro' pseudo, set p_out.
  22. */
  23. line_p getlines(FILE *lf, int n, proc_p *p_out, bool collect_mes);
  24. /* bool collect_mes)
  25. * Read n lines of EM text and doubly
  26. * link them. Also process messages
  27. * if required.
  28. */
  29. bblock_p freshblock();
  30. /* Allocate a bblock struct and assign
  31. * it a brand new block_id.
  32. */
  33. lab_id freshlabel();
  34. /* Get a brand new lab_id.
  35. */
  36. dblock_p getdtable(char *dname);
  37. /* Read the data block table from
  38. * the file with the given name.
  39. */
  40. proc_p getptable(char *pname);
  41. /* Read the proc table from
  42. * the file with the given name.
  43. */
  44. bool getunit(FILE *gf, FILE *lf, short *kind_out, bblock_p *g_out, line_p *l_out, proc_p *p_out, bool collect_mes);
  45. /* Read the control flow graph
  46. * (from file gf) and the EM text
  47. * (from lf). If collect_mes is TRUE,
  48. * all register messages will be
  49. * collected and put in the global
  50. * variable 'mesregs'. The proc read
  51. * is returned in p_out.
  52. */
  53. void message(line_p lnp);
  54. /* See if lnp is some useful message.
  55. * (e.g. a message telling that a
  56. * certain local variable will never be
  57. * referenced indirectly, so it may be
  58. * put in a register.
  59. * If so, add it to the mesregs set.)
  60. */