2004-10-29 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / bfd / cache.c
index 58eda916bbc9052263f6e40527d0d0c5dab5502c..0d6529b209faef60df359535cae7646a39cc1710 100644 (file)
@@ -343,6 +343,33 @@ 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
+       <<FALSE>> is returned if closing one of the file fails, <<TRUE>> 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);
+
+  return ret;
+}
+
 /*
 INTERNAL_FUNCTION
        bfd_open_file
This page took 0.023114 seconds and 4 git commands to generate.