1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /* (C) C.D.F. Miller, Heriot-Watt University, March 1984
- *
- * Permission is hereby given to reproduce or modify this
- * software freely, provided that this notice be retained,
- * and that no use be made of the software for commercial
- * purposes without the express written permission of the
- * author.
- */
- #include <lbl.h>
- #include "list.h"
- #include "printl.h"
- void listtype(Type *);
- extern char *def_format;
- extern LIST_HEAD(, Type) typehead;
- void
- listdefs()
- {
- Type *tp;
- if (LIST_EMPTY(&typehead)) {
- fprintf(stderr, "No labels defined\n");
- return;
- }
- LIST_FOREACH(tp, &typehead, link)
- listtype(tp);
- }
- void
- listtype(Type *tp)
- {
- Label *lp;
- fprintf(stderr, "*** Type %s: format %s\n", tp->t_name,
- tp->t_format == def_format ? "default" : tp->t_format);
- if (LIST_EMPTY(&(tp->labelhead))) {
- fprintf(stderr, "(No labels defined\n)");
- return;
- }
- LIST_FOREACH(lp, &(tp->labelhead), link) {
- fprintf(stderr, "%-16.16s %-14.14s %-6ld ",
- lp->l_name,
- lp->l_file,
- lp->l_line);
- labelPrint(lp, stderr);
- putc('\n', stderr);
- }
- putc('\n', stderr);
- }
|