[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bfd_openr_iovec
bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open) (struct bfd *nbfd, void *open_closure), void *open_closure, file_ptr (*pread) (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset), int (*close) (struct bfd *nbfd, void *stream)); |
Calls bfd_find_target
, so target is interpreted as by
that function.
Calls open (which can call bfd_zalloc
and
bfd_get_filename
) to obtain the read-only stream backing
the BFD. open either succeeds returning the
non-NULL
stream, or fails returning NULL
(setting bfd_error
).
Calls pread to request nbytes of data from
stream starting at offset (e.g., via a call to
bfd_read
). pread either succeeds returning the
number of bytes read (which can be less than nbytes when
end-of-file), or fails returning -1 (setting bfd_error
).
Calls close when the BFD is later closed using
bfd_close
. close either succeeds returning 0, or
fails returning -1 (setting bfd_error
).
If bfd_openr_iovec
returns NULL
then an error has
occurred. Possible errors are bfd_error_no_memory
,
bfd_error_invalid_target
and bfd_error_system_call
.