diff options
author | Steve Chamberlain <sac@cygnus> | 1992-04-15 22:12:06 +0000 |
---|---|---|
committer | Steve Chamberlain <sac@cygnus> | 1992-04-15 22:12:06 +0000 |
commit | b7311408af78f016a0a1d440c11f79bb60c9402e (patch) | |
tree | 1dc639e992a50349da67f6593ebe825b3f987a09 /binutils | |
parent | c0cc691258938d3c280b06531b951936b93dc921 (diff) | |
download | gdb-b7311408af78f016a0a1d440c11f79bb60c9402e.zip gdb-b7311408af78f016a0a1d440c11f79bb60c9402e.tar.gz gdb-b7311408af78f016a0a1d440c11f79bb60c9402e.tar.bz2 |
Added EXTRACT command
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/arsup.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/binutils/arsup.c b/binutils/arsup.c index ee7e4e9..59f6435 100644 --- a/binutils/arsup.c +++ b/binutils/arsup.c @@ -380,3 +380,41 @@ DEFUN_VOID(ar_list) } } } + + +void +DEFUN(ar_extract,(list), + struct list *list) +{ + if (!obfd) + { + + fprintf(stderr, "%s: no open archive\n", program_name); + maybequit(); + } + else + { + while (list) { + /* Find this name in the archive */ + bfd *member = obfd->archive_head; + int found = 0; + while (member && !found) + { + if (strcmp(member->filename, list->name) == 0) + { + extract_file(member); + found = 1; + } + + member = member->next; + } + if (!found) { + bfd *abfd = bfd_openr(list->name, 0); + fprintf(stderr,"%s: can't find module file %s\n", program_name, + list->name); + + } + list = list->next; + } + } +} |