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>
This commit is contained in:
committed by
Tom Rini
parent
032ea185d6
commit
cca98fd6aa
@@ -16,13 +16,14 @@
|
||||
* attributes = [^,:\s]*
|
||||
* entry = name[:attributes]
|
||||
* list = entry[,list]
|
||||
* It will call the "callback" function with the "name" and attribute as "value"
|
||||
* It will call the "callback" function with the "name" and "attributes"
|
||||
* The callback may return a non-0 to abort the list walk.
|
||||
* This return value will be passed through to the caller.
|
||||
* 0 is returned on success.
|
||||
*/
|
||||
extern int env_attr_walk(const char *attr_list,
|
||||
int (*callback)(const char *name, const char *value));
|
||||
int env_attr_walk(const char *attr_list,
|
||||
int (*callback)(const char *name, const char *attributes, void *priv),
|
||||
void *priv);
|
||||
|
||||
/*
|
||||
* env_attr_lookup takes as input an "attr_list" with the same form as above.
|
||||
@@ -33,7 +34,6 @@ extern int env_attr_walk(const char *attr_list,
|
||||
* "attr_list" is NULL.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
extern int env_attr_lookup(const char *attr_list, const char *name,
|
||||
char *attributes);
|
||||
int env_attr_lookup(const char *attr_list, const char *name, char *attributes);
|
||||
|
||||
#endif /* __ENV_ATTR_H__ */
|
||||
|
||||
Reference in New Issue
Block a user