3 * (c) Copyright 1988-1998 by the Massachusetts Institute of Technology.
4 * For copying and distribution information, please see the file
8 #include <mit-copyright.h>
16 void empty_list_check(int id, void *list, void *hint);
17 void unref_string_check(int id, void *string, void *hint);
18 void noclu_mach_check(int id, void *machine, void *hint);
20 void empty_list_check(int id, void *list, void *hint)
22 struct list *l = list;
23 if (l->members == 0 && l->list_id != 0)
24 printf("Warning: List %s is empty\n", l->name);
28 /* Used by other parts of the program to check that a string_id is good.
29 * This returns the stringif it is, or NULL if it is not, and as a side effect
30 * increments the string reference count.
33 struct string *string_check(int id)
37 s = (struct string *) hash_lookup(strings, id);
45 void unref_string_check(int id, void *string, void *hint)
47 struct string *s = string;
51 printf("Unreferenced string %s id %d\n", s->name, id);
52 if (single_fix("Delete", 1))
53 single_delete("strings", "string_id", id);
57 /* This test was disabled because the MIT Moira server, which
58 * initially only managed host information for workstations and
59 * servers in the Athena Computing Environment, has been extended to
60 * manage all hosts in the MIT.EDU domain (but not subdomains).
62 void noclu_mach_check(int id, void *machine, void *hint)
64 struct machine *m = machine;
66 if (m->clucount == 0 && m->mach_id != 0)
67 printf("Warning: machine %s is not in any clusters\n", m->name);
72 printf("Phase 3 - Finding unused objects\n");
77 dprintf("Checking machines...\n");
78 hash_step(machines, noclu_mach_check, NULL);
80 dprintf("Checking lists...\n");
81 hash_step(lists, empty_list_check, NULL);
84 dprintf("Checking strings...\n");
85 hash_step(strings, unref_string_check, NULL);