home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / lbl / src / list.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.0 KB  |  55 lines

  1. /* (C) C.D.F. Miller, Heriot-Watt University, March 1984
  2.  *
  3.  *    Permission is hereby given to reproduce or modify this
  4.  *    software freely, provided that this notice be retained,
  5.  *    and that no use be made of the software for commercial
  6.  *    purposes without the express written permission of the
  7.  *    author.
  8.  */
  9.  
  10. /* list.c:
  11.  *    list definitions in verbose mode
  12.  */
  13.  
  14. #include    <lbl.h>
  15.  
  16. extern char    *def_format;
  17. extern type    *typetable;
  18.  
  19. listdefs()
  20. {
  21.     type    *tp;
  22.  
  23.     if (typetable == NULL)
  24.     {
  25.         fprintf(stderr, "No labels defined\n");
  26.         return;
  27.     }
  28.     for (tp = typetable; tp != NULL; tp = tp->t_next)
  29.         listtype(tp);
  30. }
  31.  
  32. listtype(tp)
  33.     type    *tp;
  34. {
  35.     label    *lp;
  36.  
  37.     fprintf(stderr, "*** Type %s: format %s\n", tp->t_name,
  38.         tp->t_format==def_format ? "default" : tp->t_format);
  39.     if (tp->t_labels == NULL)
  40.     {
  41.         fprintf(stderr, "(No labels defined\n)");
  42.         return;
  43.     }
  44.     for (lp = tp->t_labels; lp != NULL; lp = lp->l_next)
  45.     {
  46.         fprintf(stderr, "%-16.16s %-14.14s %-6D ",
  47.                 lp->l_name,
  48.                 lp->l_file,
  49.                 lp->l_line);
  50.         printl(lp, stderr);
  51.         putc('\n', stderr);
  52.     }
  53.     putc('\n', stderr);
  54. }
  55.