/* $Header$ * * (c) Copyright 1988 by the Massachusetts Institute of Technology. * For copying and distribution information, please see the file * . */ #include #include "dbck.h" static char phase3_qc_rcsid[] = "$Header$"; empty_list_check(id, l, hint) int id, hint; struct list *l; { if (l->members == 0 && l->list_id != 0) printf("Warning: List %s is empty\n", l->name); } /* Used by other parts of the program to check that a string_id is good. * This returns TRUE if it is, or FALSE if it is not, and as a side effect * increments the string reference count. */ struct string *string_check(id) int id; { register struct string *s; s = (struct string *) hash_lookup(strings, id); if (s == NULL) return(s); s->refc++; return(s); } unref_string_check(id, s, hint) int id, hint; struct string *s; { if (s->refc == 0) { printf("Unreferenced string %s id %d\n", s->name, id); if (single_fix("Delete", 1)) single_delete("strings", "string_id", id); } } /* This test was disabled because the MIT Moira server, which * initially only managed host information for workstations and * servers in the Athena Computing Environment, has been extended to * manage all hosts in the MIT.EDU domain (but not subdomains). */ /* noclu_mach_check(id, m, hint) int id, hint; struct machine *m; { if (m->clucount == 0 && m->mach_id != 0) printf("Warning: machine %s is not in any clusters\n", m->name); } */ phase3() { printf("Phase 3 - Finding unused objects\n"); if (warn) { /* dprintf("Checking machines...\n"); * hash_step(machines, noclu_mach_check, NULL); */ dprintf("Checking lists...\n"); hash_step(lists, empty_list_check, NULL); } dprintf("Checking strings...\n"); hash_step(strings, unref_string_check, NULL); }