From 02d5a37b2d1262e7f7d877ba134350cadae67973 Mon Sep 17 00:00:00 2001 From: Jerome Guitton Date: Thu, 17 Jun 2004 11:47:51 +0000 Subject: * bfd-in.h (bfd_cache_close_all): New function declaration. * bfd-in2.h: Regenerate. * cache.c (bfd_cache_close_all): New function definition. --- bfd/cache.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'bfd/cache.c') diff --git a/bfd/cache.c b/bfd/cache.c index 58eda91..63d4d78 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -344,6 +344,31 @@ bfd_cache_close (bfd *abfd) } /* +FUNCTION + bfd_cache_close_all + +SYNOPSIS + bfd_boolean bfd_cache_close_all (void); + +DESCRIPTION + Remove all BFDs from the cache. If the attached file is open, + then close it too. + +RETURNS + <> is returned if closing one of the file fails, <> is + returned if all is well. +*/ + +bfd_boolean +bfd_cache_close_all () +{ + bfd_boolean ret = TRUE; + + while (bfd_last_cache != NULL) + ret &= bfd_cache_close (bfd_last_cache); +} + +/* INTERNAL_FUNCTION bfd_open_file -- cgit v1.1