aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in2.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-04-21 17:05:12 +0000
committerAndrew Cagney <cagney@redhat.com>2004-04-21 17:05:12 +0000
commit40838a725a2186ffdc9621694e72f340928a0b13 (patch)
tree188ce229fccc9465d5149968ddf2af50a1a6ebdc /bfd/bfd-in2.h
parent7f919c8471b407c6a8c698ee3b29cdf0e9c4eb3d (diff)
downloadgdb-40838a725a2186ffdc9621694e72f340928a0b13.zip
gdb-40838a725a2186ffdc9621694e72f340928a0b13.tar.gz
gdb-40838a725a2186ffdc9621694e72f340928a0b13.tar.bz2
2004-04-21 Andrew Cagney <cagney@redhat.com>
* opncls.c (_bfd_new_bfd_contained_in): Copy "iovec". (struct opncls, opncls_btell, opncls_bseek, opncls_bread) (opncls_bwrite, opncls_bclose, opncls_bflush) (opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a bfd iovec that uses function callbacks. (bfd_close): Use the iovec's bclose. * cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite) (cache_bclose, cache_bflush, cache_bstat) (cache_iovec): New functions and global variable, implement a cache "iovec", where applicable set bfd_error. (bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec. * bfdio.c (struct bfd_iovec): Define. (real_read): Delete function. (bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat) (bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec", assume that bread and bwrite set bfd_error. * bfd.c (struct bfd): Add "iovec", update comments. * bfd-in2.h, libbfd.h: Re-generate.
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r--bfd/bfd-in2.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 07af231..49e22b4 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -839,6 +839,18 @@ bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
bfd *bfd_openstreamr (const char *, const char *, void *);
+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));
+
bfd *bfd_openw (const char *filename, const char *target);
bfd_boolean bfd_close (bfd *abfd);
@@ -3708,14 +3720,10 @@ struct bfd
/* A pointer to the target jump table. */
const struct bfd_target *xvec;
- /* To avoid dragging too many header files into every file that
- includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
- and MTIME as a "long". Their correct types, to which they
- are cast when used, are "FILE *" and "time_t". The iostream
- is the result of an fopen on the filename. However, if the
- BFD_IN_MEMORY flag is set, then iostream is actually a pointer
- to a bfd_in_memory struct. */
+ /* The IOSTREAM, and corresponding IO vector that provide access
+ to the file backing the BFD. */
void *iostream;
+ const struct bfd_iovec *iovec;
/* Is the file descriptor being cached? That is, can it be closed as
needed, and re-opened when accessed later? */