2004-04-29 H.J. Lu * section.c (bfd_sections_find_if): New. * bfd-in2.h: Regenerated. --- bfd/section.c.short 2003-12-04 10:43:20.000000000 -0800 +++ bfd/section.c 2004-04-29 18:30:25.000000000 -0700 @@ -1090,6 +1090,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