diff options
-rw-r--r-- | usr.bin/make/dir.c | 16 | ||||
-rw-r--r-- | usr.bin/make/memory.c | 16 | ||||
-rw-r--r-- | usr.bin/make/memory.h | 6 |
3 files changed, 21 insertions, 17 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 45171f2e395..12758db668c 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: dir.c,v 1.47 2007/09/16 10:14:26 espie Exp $ */ +/* $OpenBSD: dir.c,v 1.48 2007/09/16 10:43:53 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* @@ -219,9 +219,6 @@ static struct file_stamp *find_stampi(const char *, const char *); * cache. */ static void record_stamp(const char *, TIMESTAMP); -/* free_hash(o): free a ohash structure, where each element can be free'd. */ -static void free_hash(struct ohash *); - /* p = DirReaddiri(name, end): read an actual directory, caching results * as we go. */ static Path *DirReaddiri(const char *, const char *); @@ -276,17 +273,6 @@ find_file_hashi(Path *p, const char *file, const char *efile, uint32_t hv) return ohash_find(h, ohash_lookup_interval(h, file, efile, hv)); } -static void -free_hash(struct ohash *h) -{ - void *e; - unsigned int i; - - for (e = ohash_first(h, &i); e != NULL; e = ohash_next(h, &i)) - free(e); - ohash_delete(h); -} - /* Side Effects: cache the current directory */ void diff --git a/usr.bin/make/memory.c b/usr.bin/make/memory.c index 64833e006cf..2fea8517078 100644 --- a/usr.bin/make/memory.c +++ b/usr.bin/make/memory.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: memory.c,v 1.3 2004/04/07 13:11:36 espie Exp $ */ +/* $OpenBSD: memory.c,v 1.4 2007/09/16 10:43:53 espie Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -42,6 +42,9 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <stddef.h> +#include <stdint.h> +#include <ohash.h> #include "defines.h" #include "memory.h" @@ -166,3 +169,14 @@ eunlink(const char *file) return unlink(file); } +void +free_hash(struct ohash *h) +{ + void *e; + unsigned int i; + + for (e = ohash_first(h, &i); e != NULL; e = ohash_next(h, &i)) + free(e); + ohash_delete(h); +} + diff --git a/usr.bin/make/memory.h b/usr.bin/make/memory.h index e2787a11044..40d75649b14 100644 --- a/usr.bin/make/memory.h +++ b/usr.bin/make/memory.h @@ -2,7 +2,7 @@ #define MEMORY_H /* $OpenPackages$ */ -/* $OpenBSD: memory.h,v 1.2 2003/06/03 02:56:12 millert Exp $ */ +/* $OpenBSD: memory.h,v 1.3 2007/09/16 10:43:53 espie Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -54,4 +54,8 @@ extern void *hash_alloc(size_t, void *); extern void hash_free(void *, size_t, void *); extern void *element_alloc(size_t, void *); +struct ohash; +/* free_hash(o): free a ohash structure, where each element can be free'd. */ +extern void free_hash(struct ohash *); + #endif /* MEMORY_H */ |