mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-05 03:56:46 +00:00
add r_io_desc_list (possibly useful for bughunting)
This commit is contained in:
parent
c20e2c70db
commit
051de62f9e
@ -425,6 +425,7 @@ R_API RIODesc *r_io_desc_get(RIO *io, int fd);
|
||||
R_API ut64 r_io_desc_size(RIO *io, RIODesc *desc);
|
||||
R_API ut64 r_io_fd_size(RIO *io, int fd);
|
||||
R_API ut64 r_io_desc_seek (RIO *io, RIODesc *desc, ut64 offset);
|
||||
R_API void r_io_desc_list (RIO *io);
|
||||
//R_API int r_io_desc_generate(RIO *io);
|
||||
|
||||
/* buffer.c */
|
||||
|
@ -114,6 +114,23 @@ R_API ut64 r_io_desc_seek (RIO *io, RIODesc *desc, ut64 offset) {
|
||||
return desc->plugin->lseek (io, desc, offset, SEEK_SET);
|
||||
}
|
||||
|
||||
R_API void r_io_desc_list (RIO *io) {
|
||||
RIODesc *desc = NULL;
|
||||
RListIter *iter;
|
||||
if (io && io->files) {
|
||||
r_list_foreach (io->files, iter, desc) {
|
||||
if (desc) {
|
||||
io->printf ("- %i", desc->fd);
|
||||
if (desc->uri)
|
||||
io->printf ("\t%s", desc->uri);
|
||||
if (desc->name)
|
||||
io->printf ("\t%s", desc->name);
|
||||
io->printf ("\tstate: %i\tflags: %i\n", desc->state, desc->flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// XXX: This must be deprecated in order to promote the cast of dataptr to ut32
|
||||
R_API int r_io_desc_generate(struct r_io_t *io) {
|
||||
|
Loading…
Reference in New Issue
Block a user