From 077b044d629319cd721afa87329f6dd93f6570e2 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 58eda916bb..63d4d786ae 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -343,6 +343,31 @@ bfd_cache_close (bfd *abfd) return bfd_cache_delete (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.2.1