* bfd-in.h (bfd_cache_close_all): New function declaration.
authorJerome Guitton <guitton@adacore.com>
Thu, 17 Jun 2004 11:47:51 +0000 (11:47 +0000)
committerJerome Guitton <guitton@adacore.com>
Thu, 17 Jun 2004 11:47:51 +0000 (11:47 +0000)
* bfd-in2.h: Regenerate.
* cache.c (bfd_cache_close_all): New function definition.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/cache.c

index abaaf7a32ec2d5b12ad1302ddbde30057e5bfc5d..d475a27c63f0e5450be2f5684511c383a4cc9a8d 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-17  Jerome Guitton  <guitton@gnat.com>
+
+       * bfd-in.h (bfd_cache_close_all): New function declaration.
+       * bfd-in2.h: Regenerate.
+       * cache.c (bfd_cache_close_all): New function definition.
+
 2004-06-16  Mark Kettenis  <kettenis@gnu.org>
 
        * configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
index cbf7e931ed29945dafe68fc24f1d16fe851d9298..5f98164cba2c2e14729099c58e43ccadaf5db53f 100644 (file)
@@ -511,6 +511,8 @@ extern bfd_boolean bfd_cache_close
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
index 851fe4738ed0ec48034d3766899b8566805c74b2..87dd250d670c791e7af7b3b3b8cab961540fa8fa 100644 (file)
@@ -518,6 +518,8 @@ extern bfd_boolean bfd_cache_close
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
index 58eda916bbc9052263f6e40527d0d0c5dab5502c..63d4d786aeab20104e57e7b59d13a9d2f8846ead 100644 (file)
@@ -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
+       <<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);
+}
+
 /*
 INTERNAL_FUNCTION
        bfd_open_file
This page took 0.03001 seconds and 4 git commands to generate.