daily update
[deliverable/binutils-gdb.git] / bfd / opncls.c
index cdf08df05dd4c1500f31655988781aea83f88709..32d223ebb74aeb2cc4a9cfeb09c8caf7a2e550e4 100644 (file)
@@ -63,7 +63,9 @@ _bfd_new_bfd ()
   nbfd->direction = no_direction;
   nbfd->iostream = NULL;
   nbfd->where = 0;
-  if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc))
+  if (!bfd_hash_table_init_n (&nbfd->section_htab,
+                             bfd_section_hash_newfunc,
+                             251))
     {
       free (nbfd);
       return NULL;
@@ -73,13 +75,13 @@ _bfd_new_bfd ()
   nbfd->format = bfd_unknown;
   nbfd->my_archive = (bfd *) NULL;
   nbfd->origin = 0;
-  nbfd->opened_once = false;
-  nbfd->output_has_begun = false;
+  nbfd->opened_once = FALSE;
+  nbfd->output_has_begun = FALSE;
   nbfd->section_count = 0;
   nbfd->usrdata = (PTR) NULL;
-  nbfd->cacheable = false;
+  nbfd->cacheable = FALSE;
   nbfd->flags = BFD_NO_FLAGS;
-  nbfd->mtime_set = false;
+  nbfd->mtime_set = FALSE;
 
   return nbfd;
 }
@@ -124,7 +126,7 @@ FUNCTION
        bfd_openr
 
 SYNOPSIS
-        bfd *bfd_openr(const char *filename, const char *target);
+       bfd *bfd_openr(const char *filename, const char *target);
 
 DESCRIPTION
        Open the file @var{filename} (using <<fopen>>) with the target
@@ -134,7 +136,8 @@ DESCRIPTION
        that function.
 
        If <<NULL>> is returned then an error has occured.   Possible errors
-       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or <<system_call>> error.
+       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
+       <<system_call>> error.
 */
 
 bfd *
@@ -179,28 +182,28 @@ bfd_openr (filename, target)
        the file descriptor too, even though we didn't open it.  */
 /*
 FUNCTION
-         bfd_fdopenr
+       bfd_fdopenr
 
 SYNOPSIS
-         bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
+       bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
 
 DESCRIPTION
-         <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to <<fopen>>.
-        It opens a BFD on a file already described by the @var{fd}
-        supplied.
-
-        When the file is later <<bfd_close>>d, the file descriptor will be closed.
-
-        If the caller desires that this file descriptor be cached by BFD
-        (opened as needed, closed as needed to free descriptors for
-        other opens), with the supplied @var{fd} used as an initial
-        file descriptor (but subject to closure at any time), call
-        bfd_set_cacheable(bfd, 1) on the returned BFD.  The default is to
-        assume no cacheing; the file descriptor will remain open until
-        <<bfd_close>>, and will not be affected by BFD operations on other
-        files.
-
-         Possible errors are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+       <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to
+       <<fopen>>.  It opens a BFD on a file already described by the
+       @var{fd} supplied.
+
+       When the file is later <<bfd_close>>d, the file descriptor will
+       be closed.  If the caller desires that this file descriptor be
+       cached by BFD (opened as needed, closed as needed to free
+       descriptors for other opens), with the supplied @var{fd} used as
+       an initial file descriptor (but subject to closure at any time),
+       call bfd_set_cacheable(bfd, 1) on the returned BFD.  The default
+       is to assume no cacheing; the file descriptor will remain open
+       until <<bfd_close>>, and will not be affected by BFD operations
+       on other files.
+
+       Possible errors are <<bfd_error_no_memory>>,
+       <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
 */
 
 bfd *
@@ -272,7 +275,7 @@ bfd_fdopenr (filename, target, fd)
       _bfd_delete_bfd (nbfd);
       return NULL;
     }
-  nbfd->opened_once = true;
+  nbfd->opened_once = TRUE;
 
   return nbfd;
 }
@@ -385,14 +388,14 @@ FUNCTION
        bfd_close
 
 SYNOPSIS
-       boolean bfd_close(bfd *abfd);
+       bfd_boolean bfd_close (bfd *abfd);
 
 DESCRIPTION
 
-       Close a BFD. If the BFD was open for writing,
-       then pending operations are completed and the file written out
-       and closed. If the created file is executable, then
-       <<chmod>> is called to mark it as such.
+       Close a BFD. If the BFD was open for writing, then pending
+       operations are completed and the file written out and closed.
+       If the created file is executable, then <<chmod>> is called
+       to mark it as such.
 
        All memory attached to the BFD is released.
 
@@ -400,24 +403,24 @@ DESCRIPTION
        if it was passed in to BFD by <<bfd_fdopenr>>).
 
 RETURNS
-       <<true>> is returned if all is ok, otherwise <<false>>.
+       <<TRUE>> is returned if all is ok, otherwise <<FALSE>>.
 */
 
 
-boolean
+bfd_boolean
 bfd_close (abfd)
      bfd *abfd;
 {
-  boolean ret;
+  bfd_boolean ret;
 
   if (bfd_write_p (abfd))
     {
       if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd)))
-       return false;
+       return FALSE;
     }
 
   if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
-    return false;
+    return FALSE;
 
   ret = bfd_cache_close (abfd);
 
@@ -431,7 +434,7 @@ bfd_close (abfd)
 
       if (stat (abfd->filename, &buf) == 0)
        {
-         unsigned int mask = umask (0);
+         unsigned int mask = umask (0);
 
          umask (mask);
          chmod (abfd->filename,
@@ -450,13 +453,13 @@ FUNCTION
        bfd_close_all_done
 
 SYNOPSIS
-       boolean bfd_close_all_done(bfd *);
+       bfd_boolean bfd_close_all_done (bfd *);
 
 DESCRIPTION
-       Close a BFD.  Differs from <<bfd_close>>
-       since it does not complete any pending operations.  This
-       routine would be used if the application had just used BFD for
-       swapping and didn't want to use any of the writing code.
+       Close a BFD.  Differs from <<bfd_close>> since it does not
+       complete any pending operations.  This routine would be used
+       if the application had just used BFD for swapping and didn't
+       want to use any of the writing code.
 
        If the created file is executable, then <<chmod>> is called
        to mark it as such.
@@ -464,14 +467,14 @@ DESCRIPTION
        All memory attached to the BFD is released.
 
 RETURNS
-       <<true>> is returned if all is ok, otherwise <<false>>.
+       <<TRUE>> is returned if all is ok, otherwise <<FALSE>>.
 */
 
-boolean
+bfd_boolean
 bfd_close_all_done (abfd)
      bfd *abfd;
 {
-  boolean ret;
+  bfd_boolean ret;
 
   ret = bfd_cache_close (abfd);
 
@@ -507,10 +510,9 @@ SYNOPSIS
        bfd *bfd_create(const char *filename, bfd *templ);
 
 DESCRIPTION
-       Create a new BFD in the manner of
-       <<bfd_openw>>, but without opening a file. The new BFD
-       takes the target from the target used by @var{template}. The
-       format is always set to <<bfd_object>>.
+       Create a new BFD in the manner of <<bfd_openw>>, but without
+       opening a file. The new BFD takes the target from the target
+       used by @var{template}. The format is always set to <<bfd_object>>.
 */
 
 bfd *
@@ -537,7 +539,7 @@ FUNCTION
        bfd_make_writable
 
 SYNOPSIS
-       boolean bfd_make_writable(bfd *abfd);
+       bfd_boolean bfd_make_writable (bfd *abfd);
 
 DESCRIPTION
        Takes a BFD as created by <<bfd_create>> and converts it
@@ -546,10 +548,10 @@ DESCRIPTION
        you will call <<bfd_make_readable>> on this bfd later.
 
 RETURNS
-       <<true>> is returned if all is ok, otherwise <<false>>.
+       <<TRUE>> is returned if all is ok, otherwise <<FALSE>>.
 */
 
-boolean
+bfd_boolean
 bfd_make_writable(abfd)
      bfd *abfd;
 {
@@ -558,7 +560,7 @@ bfd_make_writable(abfd)
   if (abfd->direction != no_direction)
     {
       bfd_set_error (bfd_error_invalid_operation);
-      return false;
+      return FALSE;
     }
 
   bim = ((struct bfd_in_memory *)
@@ -572,7 +574,7 @@ bfd_make_writable(abfd)
   abfd->direction = write_direction;
   abfd->where = 0;
 
-  return true;
+  return TRUE;
 }
 
 /*
@@ -580,7 +582,7 @@ FUNCTION
        bfd_make_readable
 
 SYNOPSIS
-       boolean bfd_make_readable(bfd *abfd);
+       bfd_boolean bfd_make_readable (bfd *abfd);
 
 DESCRIPTION
        Takes a BFD as created by <<bfd_create>> and
@@ -590,23 +592,23 @@ DESCRIPTION
        direction.
 
 RETURNS
-       <<true>> is returned if all is ok, otherwise <<false>>.  */
+       <<TRUE>> is returned if all is ok, otherwise <<FALSE>>.  */
 
-boolean
+bfd_boolean
 bfd_make_readable(abfd)
      bfd *abfd;
 {
   if (abfd->direction != write_direction || !(abfd->flags & BFD_IN_MEMORY))
     {
       bfd_set_error (bfd_error_invalid_operation);
-      return false;
+      return FALSE;
     }
 
   if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd)))
-    return false;
+    return FALSE;
 
   if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
-    return false;
+    return FALSE;
 
 
   abfd->arch_info = &bfd_default_arch_struct;
@@ -615,15 +617,15 @@ bfd_make_readable(abfd)
   abfd->format = bfd_unknown;
   abfd->my_archive = (bfd *) NULL;
   abfd->origin = 0;
-  abfd->opened_once = false;
-  abfd->output_has_begun = false;
+  abfd->opened_once = FALSE;
+  abfd->output_has_begun = FALSE;
   abfd->section_count = 0;
   abfd->usrdata = (PTR) NULL;
-  abfd->cacheable = false;
+  abfd->cacheable = FALSE;
   abfd->flags = BFD_IN_MEMORY;
-  abfd->mtime_set = false;
+  abfd->mtime_set = FALSE;
 
-  abfd->target_defaulted = true;
+  abfd->target_defaulted = TRUE;
   abfd->direction = read_direction;
   abfd->sections = 0;
   abfd->symcount = 0;
@@ -633,7 +635,7 @@ bfd_make_readable(abfd)
   bfd_section_list_clear (abfd);
   bfd_check_format (abfd, bfd_object);
 
-  return true;
+  return TRUE;
 }
 
 /*
This page took 0.029613 seconds and 4 git commands to generate.