aboutsummaryrefslogtreecommitdiff
path: root/bfd/targets.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-07-16 13:29:35 +0930
committerAlan Modra <amodra@gmail.com>2016-07-16 13:29:35 +0930
commit4212b42d795628dcc36bcffc7cf16175f7698305 (patch)
treeccc4026c32f6e7b701444b1309a0fa126d04e1bf /bfd/targets.c
parent16412c3bc4b00ecbf87251bfd2c92584615412bb (diff)
downloadgdb-4212b42d795628dcc36bcffc7cf16175f7698305.zip
gdb-4212b42d795628dcc36bcffc7cf16175f7698305.tar.gz
gdb-4212b42d795628dcc36bcffc7cf16175f7698305.tar.bz2
Don't include libbfd.h outside of bfd, part 4
Not much to see here, just renaming a function. bfd/ * targets.c (bfd_seach_for_target): Rename to.. (bfd_iterate_over_targets): ..this. Rewrite doc. * bfd-in2.h: Regenerate. ld/ * ldlang.c (open_output): Replace bfd_search_for_target with bfd_iterate_over_targets. Localize vars.
Diffstat (limited to 'bfd/targets.c')
-rw-r--r--bfd/targets.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/bfd/targets.c b/bfd/targets.c
index a9edd4c..19d442a 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -1815,29 +1815,28 @@ bfd_target_list (void)
/*
FUNCTION
- bfd_seach_for_target
+ bfd_iterate_over_targets
SYNOPSIS
- const bfd_target *bfd_search_for_target
- (int (*search_func) (const bfd_target *, void *),
- void *);
+ const bfd_target *bfd_iterate_over_targets
+ (int (*func) (const bfd_target *, void *),
+ void *data);
DESCRIPTION
- Return a pointer to the first transfer vector in the list of
- transfer vectors maintained by BFD that produces a non-zero
- result when passed to the function @var{search_func}. The
- parameter @var{data} is passed, unexamined, to the search
- function.
+ Call @var{func} for each target in the list of BFD target
+ vectors, passing @var{data} to @var{func}. Stop iterating if
+ @var{func} returns a non-zero result, and return that target
+ vector. Return NULL if @var{func} always returns zero.
*/
const bfd_target *
-bfd_search_for_target (int (*search_func) (const bfd_target *, void *),
- void *data)
+bfd_iterate_over_targets (int (*func) (const bfd_target *, void *),
+ void *data)
{
- const bfd_target * const *target;
+ const bfd_target *const *target;
- for (target = bfd_target_vector; *target != NULL; target ++)
- if (search_func (*target, data))
+ for (target = bfd_target_vector; *target != NULL; ++target)
+ if (func (*target, data))
return *target;
return NULL;