switch.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* $Header$ */
  2. /* S W I T C H - T A B L E - S T R U C T U R E */
  3. struct switch_hdr {
  4. struct switch_hdr *next;
  5. label sh_break;
  6. label sh_default;
  7. label sh_table;
  8. int sh_nrofentries;
  9. struct type *sh_type;
  10. arith sh_lowerbd;
  11. arith sh_upperbd;
  12. struct case_entry *sh_entries;
  13. };
  14. /* allocation definitions of struct switch_hdr */
  15. /* ALLOCDEF "switch_hdr" */
  16. extern char *st_alloc();
  17. extern struct switch_hdr *h_switch_hdr;
  18. #define new_switch_hdr() ((struct switch_hdr *) \
  19. st_alloc((char **)&h_switch_hdr, sizeof(struct switch_hdr)))
  20. #define free_switch_hdr(p) st_free(p, h_switch_hdr, sizeof(struct switch_hdr))
  21. struct case_entry {
  22. struct case_entry *next;
  23. label ce_label;
  24. arith ce_value;
  25. };
  26. /* allocation definitions of struct case_entry */
  27. /* ALLOCDEF "case_entry" */
  28. extern char *st_alloc();
  29. extern struct case_entry *h_case_entry;
  30. #define new_case_entry() ((struct case_entry *) \
  31. st_alloc((char **)&h_case_entry, sizeof(struct case_entry)))
  32. #define free_case_entry(p) st_free(p, h_case_entry, sizeof(struct case_entry))