diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-05-20 14:27:19 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-05-21 09:13:19 -0400 |
commit | cca98fd6aa111f622be09ffdb5c59684c5e160af (patch) | |
tree | b6390d453a085825c1d260dbe69a2433d6f86b77 /common/env_attr.c | |
parent | 032ea185d644cfe420822dd3dc84734623ffac91 (diff) |
env: Allow env_attr_walk to pass a priv * to callback
In some cases it can be helpful to have context in the callback about
the calling situation. This is needed for following patches.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/env_attr.c')
-rw-r--r-- | common/env_attr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/env_attr.c b/common/env_attr.c index 6e13184d7e8..b9de16f73e7 100644 --- a/common/env_attr.c +++ b/common/env_attr.c @@ -26,7 +26,8 @@ * list = entry[,list] */ int env_attr_walk(const char *attr_list, - int (*callback)(const char *name, const char *attributes)) + int (*callback)(const char *name, const char *attributes, void *priv), + void *priv) { const char *entry, *entry_end; char *name, *attributes; @@ -93,7 +94,7 @@ int env_attr_walk(const char *attr_list, if (strlen(name) != 0) { int retval = 0; - retval = callback(name, attributes); + retval = callback(name, attributes, priv); if (retval) { free(entry_cpy); return retval; |