=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/targ.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- src/usr.bin/make/targ.c 2000/11/24 14:36:35 1.29 +++ src/usr.bin/make/targ.c 2001/03/02 16:57:26 1.30 @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.29 2000/11/24 14:36:35 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.30 2001/03/02 16:57:26 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -87,15 +87,15 @@ static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else UNUSED -static char *rcsid = "$OpenBSD: targ.c,v 1.29 2000/11/24 14:36:35 espie Exp $"; +static char *rcsid = "$OpenBSD: targ.c,v 1.30 2001/03/02 16:57:26 espie Exp $"; #endif #endif /* not lint */ #ifdef CLEANUP static LIST allGNs; /* List of all the GNodes */ #endif -static struct hash targets; /* a hash table of same */ -static struct hash_info gnode_info = { +static struct ohash targets; /* a hash table of same */ +static struct ohash_info gnode_info = { offsetof(GNode, name), NULL, hash_alloc, hash_free, element_alloc }; @@ -122,7 +122,7 @@ Lst_Init(&allGNs); #endif /* A small make file already creates 200 targets. */ - hash_init(&targets, 10, &gnode_info); + ohash_init(&targets, 10, &gnode_info); } /*- @@ -139,7 +139,7 @@ { #ifdef CLEANUP Lst_Destroy(&allGNs, TargFreeGN); - hash_delete(&targets); + ohash_delete(&targets); #endif } @@ -163,7 +163,7 @@ { GNode *gn; - gn = hash_create_entry(&gnode_info, name, &end); + gn = ohash_create_entry(&gnode_info, name, &end); gn->path = NULL; if (name[0] == '-' && name[1] == 'l') { gn->type = OP_LIB; @@ -253,13 +253,13 @@ GNode *gn; /* node in that element */ unsigned int slot; - slot = hash_qlookupi(&targets, name, &end); + slot = ohash_qlookupi(&targets, name, &end); - gn = hash_find(&targets, slot); + gn = ohash_find(&targets, slot); if (gn == NULL && (flags & TARG_CREATE)) { gn = Targ_NewGN(name, end); - hash_insert(&targets, slot, gn); + ohash_insert(&targets, slot, gn); } return gn; @@ -563,13 +563,13 @@ unsigned int i; printf("#*** Input graph:\n"); - for (gn = hash_first(&targets, &i); gn != NULL; - gn = hash_next(&targets, &i)) + for (gn = ohash_first(&targets, &i); gn != NULL; + gn = ohash_next(&targets, &i)) TargPrintNode(gn, pass); printf("\n\n"); printf("#\n# Files that are only sources:\n"); - for (gn = hash_first(&targets, &i); gn != NULL; - gn = hash_next(&targets, &i)) + for (gn = ohash_first(&targets, &i); gn != NULL; + gn = ohash_next(&targets, &i)) TargPrintOnlySrc(gn); printf("#*** Global Variables:\n"); Var_Dump(VAR_GLOBAL);