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

2.14.1.5 bfd_openr_iovec

Synopsis
 
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));
Description
Create and return a BFD backed by a read-only stream. The stream is created using open, accessed using pread and destroyed using close.

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.



This document was generated by system on July, 22 2007 using texi2html