diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2004-04-30 15:01:15 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2004-04-30 15:01:15 +0000 |
commit | bc87dd2ec11aaeda576515604b008776612f2261 (patch) | |
tree | 8a9d2e6b33f1a35fd701322beaf635b80ebe1d8b /bfd/section.c | |
parent | f2da459f6549a10145a55a3618a6317ac0df9749 (diff) | |
download | gdb-bc87dd2ec11aaeda576515604b008776612f2261.zip gdb-bc87dd2ec11aaeda576515604b008776612f2261.tar.gz gdb-bc87dd2ec11aaeda576515604b008776612f2261.tar.bz2 |
2004-04-30 H.J. Lu <hongjiu.lu@intel.com>
* section.c (bfd_sections_find_if): New.
* bfd-in2.h: Regenerated.
Diffstat (limited to 'bfd/section.c')
-rw-r--r-- | bfd/section.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bfd/section.c b/bfd/section.c index 5ecb4a6..0236f08 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -1096,6 +1096,41 @@ bfd_map_over_sections (bfd *abfd, /* FUNCTION + bfd_sections_find_if + +SYNOPSIS + asection *bfd_sections_find_if + (bfd *abfd, + bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); + +DESCRIPTION + Call the provided function @var{func} for each section + attached to the BFD @var{abfd}, passing @var{obj} as an + argument. The function will be called as if by + +| func (abfd, the_section, obj); + + It returns the first section for which @var{func} returns true. + +*/ + +asection * +bfd_sections_find_if (bfd *abfd, + bfd_boolean (*operation) (bfd *, asection *, void *), + void *user_storage) +{ + asection *sect; + + for (sect = abfd->sections; sect != NULL; sect = sect->next) + if ((*operation) (abfd, sect, user_storage)) + break; + + return sect; +} + +/* +FUNCTION bfd_set_section_size SYNOPSIS |