[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 Opening and Closing BFDs



[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.1 bfd_openr

Synopsis

bfd *bfd_openr(CONST char *filename, CONST char*target);

Description
This function opens the file supplied (using fopen) with the target supplied, it returns a pointer to the created BFD. If NULL is returned then an error has occured. Possible errors are no_memory, invalid_target or system_call error.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.2 bfd_fdopenr

Synopsis

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 fd supplied. Possible errors are no_memory, invalid_target and system_call error.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.3 bfd_openw

Synopsis

bfd *bfd_openw(CONST char *filename, CONST char *target);

Description
Creates a BFD, associated with file filename, using the file format target, and returns a pointer to it. Possible errors are system_call_error, no_memory, invalid_target.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.4 bfd_close

Synopsis

boolean bfd_close(bfd *);

Description
This function closes 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’s obstacks is released.
Returns
true is returned if all is ok, otherwise false.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.5 bfd_close_all_done

Synopsis

boolean bfd_close_all_done(bfd *);

Description
This function closes a BFD. It 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. All memory attached to the BFD’s obstacks is released.
Returns
true is returned if all is ok, otherwise false.
Synopsis

bfd_size_type bfd_alloc_size(bfd *abfd);

Description
Return the number of bytes in the obstacks connected to the supplied BFD.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.6 bfd_create

Synopsis

bfd *bfd_create(CONST char *filename, bfd *template);

Description
This routine creates 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 template. The format is always set to bfd_object.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.7 bfd_alloc_by_size_t

Synopsis

PTR bfd_alloc_by_size_t(bfd *abfd, size_t wanted);

Description
This function allocates a block of memory in the obstack attatched to abfd and returns a pointer to it.


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on December 11, 2024 using texi2html 5.0.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated on December 11, 2024 using texi2html 5.0.